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!
    Urasik Extensions | Lots of new extensions to check out Learn More

    Find (3d point) intersection of 2 lines?

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 568 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.
    • T Offline
      tomot
      last edited by

      I can't find via search if this has been answered before. 😞

      1. 2 lines including each of their end point coordinates are known,
        they also intersect and share a common plane.
      2. The common plane these 2 lines intersect on may be xy, yz or xz planes
      3. Since the end points of each line may change their common intersection point will also change.

      How do I quickly derive the intersecting point, for any varying 2 line intersection?

      TIA!

      my plugins
      tomot

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Try

        point = Geom.intersect_line_line(edge1.line, edge2.line)

        You either get a point or nil if the two 'lines' don't intersect.
        Unlike an 'edge', a 'line' is infinite, so two 'edges' might not physically intersect even though their 'lines' do.
        If you get a point you can then test if it actually falls on an end point of an edge
        point == edge1.start.position point == edge2.end.position point == edge1.start.position point == edge2.end.position
        where true shows it is at a vertex
        AND if the point falls between the start/end of each edge, the test is...
        point.vector_to(edge1.start.position) == point.vector_to(edge1.end.position) point.vector_to(edge2.start.position) == point.vector_to(edge2.end.position)
        Note that getting true means that the point is not physically on the edge because the vectors are both in the same direction, and false means that the point is on the edge and between the start/end...

        TIG

        1 Reply Last reply Reply Quote 0

        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 Login
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement