Unexpected result (closest_points)
-
hi all, I'm playing around with the method closest_points
and I'm getting unexpected results, this is the code:line1 = [Geom::Point3d.new(10,10,10),Geom::Point3d.new(1,0,0)] line2 = [Geom::Point3d.new(20,30,50),Geom::Vector3d.new(2,1,0)] r = Geom.closest_points line1,line2
with this I expected the two closest points between the two lines, in my case should be
(-20,10,10),(-20,10,50)
but I get
(43.7681, 47.5201, 47.5201),(46.0225, 43.0113, 50)
Am I missing something?
by the way, if any of the two lines coincide with the coordinate axes I get the expected result
(google translator) -
@dacastror said:
hi all, I'm playing around with the method closest_points
and I'm getting unexpected results, this is the code:line1 = [Geom::Point3d.new(10,10,10),Geom::Point3d.new(1,0,0)] line2 = [Geom::Point3d.new(20,30,50),Geom::Vector3d.new(2,1,0)] r = Geom.closest_points line1,line2
with this I expected the two closest points between the two lines, in my case should be
(-20,10,10),(-20,10,50)
but I get
(43.7681, 47.5201, 47.5201),(46.0225, 43.0113, 50)
Am I missing something?
by the way, if any of the two lines coincide with the coordinate axes I get the expected result
(google translator)in line1 you have [pt,pt], in line2 you have [pt,vec]. If you change line1 to [pt,vec] you will get your expected results.
-
sorry for my silly mistake, thanks Sdmitch
Advertisement