Model.create_lines_by_mesh_plane_intersection#
- Model.create_lines_by_mesh_plane_intersection(collection, edge_break_angle, x0, y0, z0, x1, y1, z1, x2, y2, z2, x3, y3, z3)#
Creates lines at the intersection between input elements and the plane and further breaks them into different segments based on the input
edge_break_angle. The plane is assumed to be quadrilateral, bounded between four points that are input in cyclic order to the function. The lines at the intersections are created in a new component “mesh_plane_intersection_lines.”- Parameters:
collection (Collection) – The collection containing the input element entities.
edge_break_angle (double) – The line break angle in degrees.
x0 (double) – The x-coordinate of the 0th point.
y0 (double) – The y-coordinate of the 0th point.
z0 (double) – The z-coordinate of the 0th point.
x1 (double) – The x-coordinate of the 1st point.
y1 (double) – The y-coordinate of the 1st point.
z1 (double) – The z-coordinate of the 1st point.
x2 (double) – The x-coordinate of the 2nd point.
y2 (double) – The y-coordinate of the 2nd point.
z2 (double) – The z-coordinate of the 2nd point.
x3 (double) – The x-coordinate of the 3rd point.
y3 (double) – The y-coordinate of the 3rd point.
z3 (double) – The z-coordinate of the 3rd point.
Example#
Create lines at the intersection of any displayed elements and a plane defined by points with IDs 30 , 27 , 22 , 35 ( in cyclic order ) and break them if the angle is greater than 20 degrees#import hm import hm.entities as ent model = hm.Model() # We need the point coordinates from the points with IDs 30, 27, 22, 35 p30 = ent.Point(model, 30) p27 = ent.Point(model, 27) p22 = ent.Point(model, 22) p35 = ent.Point(model, 35) x30, y30, z30 = p30.coordinates x27, y27, z27 = p27.coordinates x22, y22, z22 = p22.coordinates x35, y35, z35 = p35.coordinates # Creating the lines at the intersection of any displayed elements elememt_collection = hm.CollectionByDisplayed(model, ent.Element) model.create_lines_by_mesh_plane_intersection( collection=elememt_collection, edge_break_angle=20.0, x0=x30, y0=y30, z0=z30, x1=x27, y1=y27, z1=z27, x2=x22, y2=y22, z2=z22, x3=x35, y3=y35, z3=z35, )