Model.hm_intersectlineline#

Model.hm_intersectlineline(segment1Start, segment1End, segment2Start, segment2End)#

Returns the intersection point of two lines consisting of the four 3D points, which are the start and end points of two segments.

Parameters:
  • segment1Start (hwTriple) – Start point of the first segment.

  • segment1End (hwTriple) – End point of the first segment.

  • segment2Start (hwTriple) – Start point of the second segment.

  • segment2End (hwTriple) – End point of the second segment.

Returns:

  • hwReturnStatus - Status object

  • HmQueryResult - Result object containing the output values:

    • intersectionPointCoordinates (numpy.ndarray)

Example#

Return values x , y , z from given segment points#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_intersectlineline(
    segment1Start=[0.0, 0.0, 0.0],
    segment1End=[2.0, 0.0, 0.0],
    segment2Start=[-1.0, 0.0, 0.0],
    segment2End=[1.0, 0.0, 0.0]
)

print("intersectionPointCoordinates", result.intersectionPointCoordinates)