How to find coordinates of an intersection between 2 lines on a same plane in SpaceClaim-Scripting?

Bobin John
Bobin John Member Posts: 8
First Comment
**
edited June 2023 in 3D Design

I am trying to find the point of intersection between two lines on a plane. They currently do not intersect, however, I would like to find the coordinates of the point of intersection. Can someone help me with a script for it?

Answers

  • Stefan
    Stefan Member, Employee Posts: 4
    First Anniversary Name Dropper Ansys Employee First Comment
    ✭✭✭
    edited June 2023

    Hi

    Here a quick code snippet to intersect 2 curves:


    from SpaceClaim.Api.V23.Geometry.Curve import IntersectCurve
    curve_1 = GetRootPart().Curves[0].Shape.Geometry
    curve_2 = GetRootPart().Curves[1].Shape.Geometry
    
    test = IntersectCurve(curve_1,curve_2)[0].Point
    print(test)
    

    the IntersectCurve method returns an array of all Intersection Points