PDA

View Full Version : 2 curves - how to get the intersection World space coordinates?



chopsuey
02-21-2008, 07:01 PM
Hi!

I'm trying to query the intersection point coordinates from 2 curves...


curve -d 1 -p -10 0 -10 -p 10 0 10;
duplicate curve1;
rotate -r 0 90 0 -p `rand 5` 0 0;

string $node = `curveIntersect -ch on curve1 curve2`;
float $p1[] = `getAttr ($node + ".parameter1")`; // or use ".p1"
float $p2[] = `getAttr ($node + ".parameter2")`; // or use ".p2"


....but I just get the relative position of the intersection point on the curves :(

I also tried to "filletCurve" a copy of the 2 lines with radius 0, so I can use "pointPosition" on the so shortened curves. But I just get a warning and it makes a zero length curve - "filletedCurve1" on the origin point.


Do you know a command/trick to query the intersection point world coordinates?

Thanks,
chopsuey