Detect and create <circle> elements from <path d="cubic spline of circle">
It would be really sweet if Scour could produce <circle cx="0.330689" cy="0.330689" r="0.330689"/> from input like <path d="M0.330689 0c-0.182634,0 -0.330689,0.148055 -0.330689,0.330689 0,0.182638 0.148055,0.330689 0.330689,0.330689 0.182634,0 0.330689,-0.148051 0.330689,-0.330689 0,-0.182634 -0.148055,-0.330689 -0.330689,
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Sorry if that got a bit unreadable. Attempting to add unsignificant whitespace for readability:
<path d="M 0.330689 0
c -0.182634, 0
z"/>
This example from https:/
Another related possible optimization: detecting consecutive cubic spline segments of a path that could be shortened to a single arc commands goes half way, while also arguably finding more things to optimize in general.
In the example, the relation between 0.182634 and 0.330689 is (Math.sqrt(
<path d="M r 0
c -r*X , 0
-r , r*(1-x)
-r , r
r , r
r*X , 0
r ,-r*(1-x)
r ,-r
-r ,-r
z"/>
...and optimize to
<circle cx="r" cy="r" r="r"/>