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,line2with 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,line2with 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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement