Intersection between two lines

Hi all,

Is it possible to know if two straight lines can intersect? 

I need to know if the extension of two lines (A-B and C-D) intersect at a point. Is there any function or method?

Thanks in advance

Parents
  • Unknown said:
    Is it possible to know if two straight lines can intersect? 

    2D or 3D?  If 3D, you must first check that the lines lie on the same plane.  If non-planar, they never intersect.

     
    Regards, Jon Summers
    LA Solutions

  • Jhon, The lines are in the same plane. I've a DGN 2D.

    Jan, I think that i've to use the Ray3dRay3dIntersectXY method but I don't understand the VBA help. Any example?

    In the help I need Ray0 and Ray1 that are my lines, but I don't know to put in the Point0, Fraction0, Point1 and Fraction1. Always it's True.

    Regards

    Dim LineA As LineElementDim LineB As LineElement
    Dim sRayA As Ray3dDim sRayB As Ray3dDim boolResultado As Boolean.......................................sRayA.Origin = lineA.Origin
    sRayA.Direction = (lineA.EndPoint)
    sRayB.Origin = lineB.Origin
    sRayB.Direction = (lineB.EndPoint)

    boolResultado = Ray3dRay3dIntersectXY(sRayA, sRayB, lineA.EndPoint, -1, lineB.EndPoint, -1)

Reply
  • Jhon, The lines are in the same plane. I've a DGN 2D.

    Jan, I think that i've to use the Ray3dRay3dIntersectXY method but I don't understand the VBA help. Any example?

    In the help I need Ray0 and Ray1 that are my lines, but I don't know to put in the Point0, Fraction0, Point1 and Fraction1. Always it's True.

    Regards

    Dim LineA As LineElementDim LineB As LineElement
    Dim sRayA As Ray3dDim sRayB As Ray3dDim boolResultado As Boolean.......................................sRayA.Origin = lineA.Origin
    sRayA.Direction = (lineA.EndPoint)
    sRayB.Origin = lineB.Origin
    sRayB.Direction = (lineB.EndPoint)

    boolResultado = Ray3dRay3dIntersectXY(sRayA, sRayB, lineA.EndPoint, -1, lineB.EndPoint, -1)

Children