I’m using the Curve Side component to test whether a point is inside or outside the curve as takes roughty half the computation time of the Point in Curve component. Since all input curves are closed and flipped in the same direction, any point outside the curve should always be to the right of the curve. This holds true for the most part, but there’s apparently a malfunctioning zone in which the Curve Side component outputs a -1 meaning left instead of 1 meaning right.
I was suspecting that that might be the case, but thought it was odd, considering the deadzone is quite large. Well, here’s one fail-safe test, which is to retest the -1 points with Point in Curve, which ends up being faster still with the Curve Side preprocessing:
[Edit: Please disregard this post, which I am leaving in place only to demonstrate how easy it is to get carried away with a theory based on inadequate research.Mea culpa.]
I think there is a misunderstanding here. There is no malfunctioning zone. The side is simply being expressed in relation to the first segment of the curve only. If you move the seam point you get a different outcome because you are changing the first segment.
Left and right are not the same as inside and outside. I suspect that the first segment only is used because side varies by segment and it becomes meaningless to state a side when it is both left and right as it would be if all the segments were used.
If you divide space into nine sectors by extending the four line segments then all points within a sector will have the same set of left/right values for each of the four segments:
Note that points lying within tolerance on a sector boundary can ad hoc return left or right (it would make more sense to return ‘neither’ consistently).
The way I understood it is similar to the left and right bank of a river, where flow path of the water determines which side you call left or right. If you traverse the river (or curve) left and right is relative to the point on the curve. In a closed curve that runs in a predetermined direction (clockwise or counterclockise) left or right would then be the equivalent to inside and outside too. The way I see it, Curve Side algorithm looks at the position of a point relative to the closest curve segment and based on the curve direction, it determines whether a point is to the left or right.
You can see this is correct in the clip below:
I take it back - I was talking rubbish based on a woefully inadequate set of test data. Apologies for wasting everyone’s time with a distressing lack of rigor.