TheSwamp

Code Red => .NET => Topic started by: gswang on June 23, 2014, 05:00:13 AM

Title: how to use Cylinder.IntersectWith
Post by: gswang on June 23, 2014, 05:00:13 AM
I want to calculate the intersection of straight line and cylindrical surface, but always returns null。

LineSegment3d ls = new LineSegment3d(new Point3d(0, 0, 2.5), new Point3d(10, 0, 0));
Point3d p0 = new Point3d(0, 0, 0);
Point3d p1 = new Point3d(0, 0, 5);
Cylinder cyl = new Cylinder(0.25, p0, Vector3d.ZAxis, Vector3d.XAxis, new Interval(0.0, 5.0, 0.1), 0, 6.0);

Point3d[] pts = cyl.IntersectWith(ls);  // :-(return null