Model.repair_midmesh_line_imprinter#
- Model.repair_midmesh_line_imprinter(line_list, GuideSurfaceCollection=Collection(), LineEndSnapTolerance=0.0, ProjectionDirection=hwTriple(0.0, 0.0, 0.0), ProjectionType=2.0, ProjectOnElemsCollection=Collection())#
This function can be used to imprint geometric lines to the mesh in the direction provided by the user.
If free lines and surface edges are selected together and
ProjectionDirectionis not provided, the projection direction for the free lines will always be by shortest distance. Other directions will be used only for surface edges.- Parameters:
line_list (EntityList) – A list containing the line entity objects.
GuideSurfaceCollection (Collection) – The collection containing the surface entities to consider for the imprint direction calculation.
LineEndSnapTolerance (double) – The tolerance to snap the end of the line to nearby vertex/face boundary edges. Vertex is preferred over the face boundary edges. Vertex nodes are identified based on the turning angle (45 degree) and the number of 1D elements connected (>2). Default is minimum element size.
ProjectionDirection (hwTriple) – The vector in which the lines are to be projected.
ProjectionType (double) –
0 - Shortest distance
1 - Tangential to the
GuideSurfaceCollectionsurfaces.2 - Average normal to the
GuideSurfaceCollectionsurfaces.3 - The direction given by
ProjectionDirection.ProjectOnElemsCollection (Collection) – The collection containing the element entities to consider for imprinting.
Example#
Imprint line with ID 4905 onto elements with IDs 3000-4000, using a snap tolerance of 1.0#import hm import hm.entities as ent model = hm.Model() line_list = [ent.Line(model, 4905)] elem_collection = hm.Collection(model, ent.Element, list(range(3000, 4001))) model.repair_midmesh_line_imprinter( line_list=line_list, ProjectOnElemsCollection=elem_collection, LineEndSnapTolerance=1.0, ProjectionDirection=[0.0, 0.0, 1.0], ProjectionType=3, )