new Bezier(a, b, a, c, d, e, f, g).outline(h) fails
- Construct a bezier using four points where the x values of the first and second points are identical
- Call
.outlinewith any number on the constructed bezier - Instead of the usual array of curves being returned, an error is thrown
TypeError: p1.split is not a function
Testable example
new Bezier(102,33, 102,33, 101,129, 132,173).outline(5)
bezier.js:1 Uncaught TypeError: t.split is not a function(…)(anonymous function) @ bezier.js:1p.reduce @ bezier.js:1p.outline @ bezier.js:1(anonymous function) @ VM675:2InjectedScript._evaluateOn @ VM90:878InjectedScript._evaluateAndWrap @ VM90:811InjectedScript.evaluate @ VM90:667
What's .curve? The library in this repo does not have that function as part of its API. Did you mean .get(t)? Because I can't reproduce that behaviour with get:
b = new Bezier(1,4,1,5,2,6,3,7);
b.get(0.5) // gives { x: 1.625, y: 5.5 }
any other value for t seems to work fine too, so if you have some code that's going wrong, please show the exact code you're using in addition to the general problem description.
closing due to inactivity, feel free to refile if this still happens, with runnable code that demonstrates this problem.
Sorry, this is meant to be .outline, not .curve. I've added a concrete example to demonstrate the bug.
I have run into this as well. seems like straight lines being outlined are a no go
@RyanElfman do you have some code that demonstrates the problem you ran into related to this, so it can be used to expand the tests?
@Pomax it's the same problem as @jacobp100 has for .outline and not .curve
var test = new Bezier(50, 50, 50, 50, 150, 50);
test.outline(); // error here
var test = new Bezier(50, 50, 60, 60, 150, 50);
test.outline(); // this works