Skip to content

Distorted path #10

@cdoublev

Description

@cdoublev

Hello,

I have created the following test case to illustrate the drift that occurs in my path definition, using svg-arc-to-cubic-bezier to transform arcs to cubic curves.

<script src="./svg-arc-to-cubic-bezier.js"></script>
<!-- <script src="./a2c.js"></script> -->

You can switch between this package and the one below, which is the function used in Snap.svg/SVGO. You will see that both paths are visually identical when using the latter. But it returns relative values and I needed absolute ones so I gave your function a shot.

I didn't change the functions signatures. I just added a utility to concat the returned cubic points into a string. I tested your function with a very simple arc and it works perfectly.

Are you aware of some corner cases/bugs/limitations with the maths involved in svg-arc-to-cubic-bezier? Would you be interested to get a feed back if I implement the function from Snap.svg/SVGO by returning absolute values?

EDIT: I implemented it here. But I'm still interested to check and learn about the maths involved here... someday.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions