cubic curve intersections

6 views
Skip to first unread message

Andres Martinez Quijano

unread,
Aug 23, 2017, 8:29:41 AM8/23/17
to pl...@googlegroups.com
Hi

This is a question for pythagoras rather than PlayN.

I'm using pythagoras.f.GeometryUtil to calculate intersections between lines, quad curves and cubic curves.

Lines and quads works as expected, but cubic curves I cannot make it work right (neither with lines, quads or cubics)

For example this code

GeometryUtil.intersectLineAndCubic(350, 670, 500, 100, 300, 300, 380, 520, 340, 430, 600, 560, new float[6]);

which is for this line and cubic curve



returns 0 roots, when there's clearly an intersection.

Also with cubic-cubic, the newton raphson algorithm never finishes

I assume that the code expects some "pre processing" for the curves, like aligning them or reducing the terms, but I cannot find any documentation or figure it out by looking at the source code

Any hints?

Thanks
Reply all
Reply to author
Forward
0 new messages