Author Topic: how to use Cylinder.IntersectWith  (Read 1204 times)

0 Members and 1 Guest are viewing this topic.

gswang

  • Newt
  • Posts: 117
how to use Cylinder.IntersectWith
« 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