sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Unexpected result (closest_points)

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 280 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      dacastror
      last edited by

      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)

      1 Reply Last reply Reply Quote 0
      • sdmitchS Offline
        sdmitch
        last edited by

        @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.

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

        1 Reply Last reply Reply Quote 0
        • D Offline
          dacastror
          last edited by

          sorry for my silly mistake, thanks Sdmitch

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement