sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Find (3d point) intersection of 2 lines?

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 434 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](http://thingsvirtual.blogspot.ca/)
      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
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement