Re: [svgwg] Add circular arc path command 'R'. (#767)

Losing _a_ isn't possible since 'no breaking changes'. The proposal to make arcs easier to write can't actually modify _a_'s current logic. And hacking something into that is basically a non-starter. So you'd need an easier, less powerful PathSegment that's easier to write. And there's not that many folks using non-circular arcs. With _r_ you can do some rounded corners, but exact 90 degree circular arcs either require a really exact position or pick another position that's generally within the right area.

"M50,100 h50r5,0 20,20 v50r0,5 -20,20 h-50r-5,0 -20,-20v-50r0,-5 20,-20"

![r-example5](https://user-images.githubusercontent.com/3302478/70937829-e3f4a400-1ff9-11ea-9b03-340086f48475.png)

Though spitballing here. I think if you put two close but non-coincident points to give the initial directionality of the curve you'd end up with the typical 90° rounded corners.

"M50,100 h50r1e-5,0 20,20 v50r0,1e-5 -20,20 h-50r-1e-5,0 -20,-20v-50r0,-1e-5 20,-20"

![r-example6](https://user-images.githubusercontent.com/3302478/70938242-a9d7d200-1ffa-11ea-952c-c24116493468.png)

Which is pretty much on the money. The jsfiddle conversion code makes this to equal:
 `M50,100 h50a19.999995000000624 19.999995000000624 0 0 1 0.00001 0a19.999995000000624 19.999995000000624 0 0 1 19.99999 20 v50a19.999995000000624 19.999995000000624 0 0 1 0 0.00001a19.999995000000624 19.999995000000624 0 0 1 -20 19.99999 h-50a19.999995000000624 19.999995000000624 0 0 1 -0.00001 0a19.999995000000624 19.999995000000624 0 0 1 -19.99999 -20v-50a19.999995000000624 19.999995000000624 0 0 1 0 -0.00001a19.999995000000624 19.999995000000624 0 0 1 20 -19.99999
`

Applying this svg in the fiddle (http://jsfiddle.net/p6eLs4w1/):

```
<svg width="800" height="800">
  <path id="path" fill="#FF0000" d="M50,100 h50r1e-5,0 20,20 v50r0,1e-5 -20,20 h-50r-1e-5,0 -20,-20v-50r0,-1e-5 20,-20"/>
  <rect fill="#00F" opacity="0.5" x="30" y="100" rx="20" ry="20" width="90" height="90"/>
</svg>
```

Produces:

![r-example7](https://user-images.githubusercontent.com/3302478/70938816-d17b6a00-1ffb-11ea-875f-735ddc3032e3.png)

Note, that's the semi-opaque blue rounded rect that making the purple. It's overlapped perfectly.

Also, in the requirement notes and suggestions they very specifically referenced some method of giving a direction for the arc and a destination. "Propose a simpler arc path command, possibly angle relative like the turtle graphics commands." -- In this case, so long as you call a point another point really close to another, sort of giving an angle, this actually meets desire. And while they shot it down turtle graphics, it is actually a way of doing that. 

-- 
GitHub Notification of comment by tatarize
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/767#issuecomment-566222683 using your GitHub account

Received on Monday, 16 December 2019 20:10:37 UTC