Open travisweerts opened 9 years ago
Nevermind, I figured it out... it's probably a problem with the path I'm drawing... but I didn't go back and check... what I did do that fixed it was change this function (found at the top of FBBezierCurve.m)
The problem for me was the distance between the two points was zero, which produced some unwanted NaN values for the line. Checking for distance == 0 fixed it.
static FBNormalizedLine FBNormalizedLineMake(MWPoint point1, MWPoint point2)
{
FBNormalizedLine line = { point1.y - point2.y, point2.x - point1.x, point1.x * point2.y - point2.x * point1.y };
MWFloat distance = sqrt(line.b * line.b + line.a * line.a);
line.a = distance != 0 ? line.a/distance : 0;
line.b = distance != 0 ? line.b/distance : 0;
line.c = distance != 0 ? line.c/distance : 0;
return line;
}
Hey there, first off... what a great thing you (or yall) have made here... its one of the only ones I've found supporting all the features it has. Truly great.
I've run into a little snag though and I would really appreciate any help or guidance you might have...
In my app I'm drawing complex bezier curves, and they often overlap... here's one example, thats causing the bug:
I want to make a union of these paths.... but when I try, I get a fatal error from this method [FBBezierCurve convexHull]
It happens in the while loop at the bottom of the method... it tries to get an object at an index outside the range of the array...
I say in your code the comment there "// TODO: sometimes there is only one point left in results, which leads to a crash. This never happens on OS X!"
I'm guessing that's whats causing my bug... do u have any idea how to remedy this? Or could you point me in a direction? I'd be more than happy to write the code for that part... but I'm still a little new to bezier paths... so any insight would go a long way.
Thanks again for putting this out there! It's a life saver!