View Full Version : LineCurve intersection with Maxscript
sergo.pogosyan 03102009, 02:21 PM Is there any way to find point3 (or point2 for flat curves) at straight line and curved line intersection or curved linecurved line intersection with maxscript? How ‘Shape Check’ utility does this checking?
I’ve tried with trim command, but in maxscript it turns on interactive picking mode.
Thank you.


jman
03102009, 02:40 PM
Prettypixel has compiled a useful set of geometric calculations, a sticky at the top of this forum. Geometrical calculations : points, lines, planes : intersections, distances, angles.
http://forums.cgsociety.org/showthread.php?f=98&t=295257
There is a formula for line / line intersections in that topic.
(BTW not as easy as if may first seem!)
J.
sergo.pogosyan
03102009, 04:33 PM
Prettypixel has compiled a useful set of geometric calculations, a sticky at the top of this forum. Geometrical calculations : points, lines, planes : intersections, distances, angles.
http://forums.cgsociety.org/showthread.php?f=98&t=295257
There is a formula for line / line intersections in that topic.
(BTW not as easy as if may first seem!)
J.
Thank you, but unfortunately this function doesn't work with curved, nonstraight splines, e.g. bezier or smooth.
drdubosc
03102009, 05:32 PM
There's no simple formula for finding the intersection of a line and cubic Bezier, unfortunately. In 2D, It's often done by iterative subdivision and lineline intersection.
Roughly:
If the line does not intersect any of the lines between the (ordered) control points, it does not intersect the curve.
Split the curve (using deCasteljau's algorithm) , discarding all sections not intersected, creating new sets of control points for the remaining candidate sections.
Repeat, until the new control points approximate the curve closely enough. The lastfound lineline intersections are your approximate linecurve intersections.
CGTalk Moderation
03102009, 05:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©20002014, Jelsoft Enterprises Ltd.