Model.midsurface_imprint#
- Model.midsurface_imprint(imprint_collection, target_collection, line_extend_option, surface_imprint_option, min_gap_size, reserved1, reserved2, reserved3, reserved4)#
The function modifies surfaces by adding extra trim lines obtained from the lines or surfaces specified by the user. The new trim lines are obtained by trimming the corresponding surfaces in the direction normal to that surface using the selected lines or edges of the selected surfaces. The function tries to detect the corresponding mid-surface automatically, or uses the surfaces explicitly specified by the user.
- Parameters:
imprint_collection (Collection) – The collection containing the entities selected for imprinting. Valid options are surfaces and lines.
target_collection (Collection) – The collection containing the input line or surface entities.
line_extend_option (int) –
Specifies whether and how the new trim edges added upon imprinting are extended towards the pre-existing middle surface edges. Valid options are:
0 - Imprint lines as-is without any extension, without preserving fixed or end points.
1 - Imprint lines and extend their projections on the middle surface via a shortcut to the nearest surface edge, without preserving fixed or end points.
2 - Imprint lines and extend their projections on the middle surface in the direction of tangents at the line endpoints towards the edge of the corresponding middle surface, without preserving fixed or end points.
3 - Imprint lines as-is without any extension, preserving fixed and end points.
4 - Imprint lines and extend their projections on the middle surface via a shortcut to the nearest surface edge, preserving fixed and end points.
5 - Imprint lines and extend their projections on the middle surface in the direction
of tangents at the line endpoints towards the edge of the corresponding middle surface, preserving fixed and end points.
surface_imprint_option (int) –
Specifies which edges of selected surfaces will be imprinted.
Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2). Valid Bit options are:
Bit0
Imprint only necessary edges of the selected surfaces. Valid values are:
0 - Imprint all edges of the selected surfaces
1 - Use “smart imprint” to imprint only the necessary edges of the selected surfaces. The algorithm will decide if the edge needs to be imprinted or not; heuristically, the algorithm will skip edges that imprinted edge would come too close to a pre-exisiting surface edge on the target surface.
Bit1
Skip edges not on the external boundary of the selected surfaces, as well as edges that are common to several selected surfaces. Valid values are:
0 - Imprint edges not on the external boundary of the selected surfaces, as well as edges that are common to several selected surfaces
1 - Skip edges not on the external boundary of the selected surfaces, as well as edges that are common to several selected surfaces
Bit2
Skip edges close to junctions. Valid values are:
0 - Imprint edges close to junctions
1 - Skip edges close to junctions; i.e. edges whose projections are closer than a given distance to other mid-surface edges. This distance can be defined by min_gap_size or detected automatically.
Show Bit value calculator
Radio Button Table Option Name Value Imprint only necessary edges of the selected surface (Bit0) Skip edges not on the external boundary of the selected surfaces, as well as edges that are common to several selected surface (Bit1) Skip edges close to junctions (Bit2) Calculated argument value: 0 min_gap_size (double) – When
surface_imprint_optionthe Bit2 is used, the imprinted lines should be no closer than this distance to any pre-existing edges of the mid-surface. The default value ismin_gap_size=0.0, which indicates the parameter is calculated internally automatically.reserved1 (double) – Reserved for future use. Must be set to 0.0.
reserved2 (double) – Reserved for future use. Must be set to 0.0.
reserved3 (int) – Reserved for future use. Must be set to 0.
reserved4 (int) – Reserved for future use. Must be set to 0.
Example#
Imprint lines with IDs 36800 - 36802 onto the appropriate mid - surfaces , extend the projected lines in the direction of tangents , without preserve fixed points or endpoints#import hm import hm.entities as ent model = hm.Model() line_collection = hm.Collection(model, ent.Line, [36800, 36801, 36802]) surface_outputcollection = hm.Collection(model, ent.Surface, populate=False) model.midsurface_imprint( imprint_collection=line_collection, target_collection=surface_outputcollection, line_extend_option=2, surface_imprint_option=0, min_gap_size=0.0, reserved1=0.0, reserved2=0.0, reserved3=0, reserved4=0, )