GouMinghao / Geometry3D

Geometry3D: 3D Computational Geometrics Library
GNU General Public License v3.0
88 stars 23 forks source link

Issue with intersection #18

Open AndreaNegro953 opened 1 year ago

AndreaNegro953 commented 1 year ago

I'm having problems with evaluating the intersection of a line and a cylinder. I use the following code:

from Geometry3D import *
def intersection_v2(xp,yp,zp,px,py,pz,xt,yt,zt,rt,ht):
    part = Line(Point(xp,yp,zp),Vector(px,py,pz))
    tank = Cylinder(Point(xt,yt,zt),191.6,302.4*x_unit_vector(),40)
    inters = intersection(part,tank)
    print(inters)

intersection_v2(100000000,100000000,100000000,-1,-1,-1,0,0,0,191.6,302.4)

I get that intersection is only a point (0,0,0) which is absurd. For smaller initial points (1000,1000,1000) the code behaves as intended. I tried to look for eventual limits on intersection but could not find them