Repository navigation
Add a bezier primitive - #333
SekoiaTree wants to merge 1 commit into
Conversation
|
I'm thinking, would it make sense to rename the method to And is there something speaking against actually just combining this with |
|
As for renaming, no problem, but Bezier is more explicit? And it'll pop up if you search for "curve" in the docs. |
|
I think it would make sense if a single curve/bezier call could produce a curve with multiple segments. Otherwise, filling won't work properly. A single stroked curve would just be a special case of that. |
|
Can I suggest using the Hobby algorithm? Here's a tex implementation: https://ctan.org/pkg/hobby?lang=en It's very aesthetically pleasing. |
Sure, but at that point I'd rather call it "path" (and probably open a different PR). Here's a quick syntax proposal:
Type-wise, I almost feel we should create a "Point" type that can be coerced from a 2 element array, for ease of writing. Opinions? |
Seems like that would fit under "one mirrored control point", correct? |
Seems sensible. The problem with the Path also makes sense although one could confuse it for a file path. |
I don't think so. The goal of Hobby's algorithm is to create nice looking interpolating splines through a list of points, with some degree of freedom. I'm not intimately familiar with the actual algorithm, but I think it's somewhat more complicated than that. It was originally published in this paper https://link.springer.com/article/10.1007/BF02187690 |
|
You're right, it's not the same. However it can be described using Beziers, so this would probably be an extension rather than a core thing. |
I'll look into it then. In the meantime I'll leave this open, but I'll probably open another PR once that's done. |
|
Superseded by #536 |
Remove unused Jenkinsfile and yarn.lock files
Related to #260. Adds a Bezier primitive, documented and tested with some basic tests.
Like
linethere's a start and an end. Although thelinedocs sayendis an offset relative to the start, from my testing they're not, so I did the same forbezier.Beziers also have a
start-control-pointandend-control-pointwhich are relative to their respective end point. Finally, just likeline, thestrokeis configurable.