Model.hm_getclosestpointsbetweenlinesurface#
- Model.hm_getclosestpointsbetweenlinesurface(line, surf)#
Find the shortest distance between a line and a surface, and return line and surface points corresponding to this distance.
- Parameters:
line (Entity) – The object describing the line entity.
surf (Entity) – The object describing the surface entity.
- Returns:
hwReturnStatus- Status objectHmQueryResult- Result object containing the output values:Keys valid for case which
lineandsurfintersectintersectionPoints (numpy.ndarray)
Keys valid for case which
lineandsurfdo not intersectsurfacePoint (numpy.ndarray)
linePoint (numpy.ndarray)
dist (double)
Examples#
Find the closest points between a line with ID 1 and a surface with ID 2 which intersect#import hm import hm.entities as ent model = hm.Model() _, result = model.hm_getclosestpointsbetweenlinesurface( line=ent.Line(model, 1), surf=ent.Surface(model, 2) ) print("Intersection points coordinates:", result.intersectionPoints)
Find the closest points between a line with ID 1 and a surface with ID 2 which do not intersect#import hm import hm.entities as ent model = hm.Model() _, result = model.hm_getclosestpointsbetweenlinesurface( line=ent.Line(model, 1), surf=ent.Surface(model, 2) ) print("Surface point:", result.surfacePoint) print("Line point:", result.linePoint) print("Distance:", result.dist)