Model.nodecreateatplaneintersection#
- Model.nodecreateatplaneintersection(collection, plane_normal, plane_base, plane_use, point_flag)#
Creates nodes or points at locations of intersection between a selection of input geometries and a plane or vector.
If there is overlap (continuous intersection) between the entities, the result is undefined. For example, finding the intersection of a line that lies exactly on the specified plane is undefined and can return unexpected or varied results.
- Parameters:
collection (Collection) –
The collection containing the input entities. Based on the
plane_usevalue, the valid entities are:If
plane_use=0(plane as input entity), then the only valid entities are lines.If
plane_useis 1, 2 or 3 (vector as input entity), then valid entities are lines, surfaces, faces or solids.plane_normal (hwTriple) – The hwTriple object defining the plane normal components of the temporary plane. User can also supply a Python list of three doubles.
plane_base (hwTriple) – The hwTriple object defining the base point components of the temporary plane. User can also supply a Python list of three doubles.
plane_use (int) –
Parameter specifying whether input data specified by plane parameter is interpreted as a plane of vector. Valid values are:
0 - Input data specified by plane parameter is used as plane.
1 - Input data specified by plane parameter is used as undirected vector (straight line that passes through the base point specified by plane parameter in the direction of the normal specified by plane parameter).
2 - Input data specified by plane parameter is used as directed vector (ray that starts at base point specified by plane parameter and continues in the direction of normal specified by plane parameter).
3 - Input data specified by plane parameter is used as finite length vector (segment that starts at base point specified by plane parameter and ends at the end of normal vector specified by plane parameter).
point_flag (int) –
Parameter specifying whether nodes or points are created. Valid values are:
0 - Create nodes
1 - Create points
Examples#
Create nodes at the intersections between the line with ID 12 and the plane z=2.0#import hm import hm.entities as ent model = hm.Model() model.nodecreateatplaneintersection( collection=hm.Collection(model, ent.Node, [12]), plane_normal=[0.0, 0.0, 1.0], plane_base=[0.0, 0.0, 2.0], plane_use=0, point_flag=0, )
Create points at the intersection between surface with ID 10 and a ray that starts at point ( 1.0 , 2.0 , 4.0 ) and propagates in the direction of y axis#import hm import hm.entities as ent model = hm.Model() model.nodecreateatplaneintersection( collection=hm.Collection(model, ent.Surface, [10]), plane_normal=[0.0, 1.0, 0.0], plane_base=[1.0, 2.0, 4.0], plane_use=2, point_flag=1, )