Model.solid_extrude_from_surfs#
- Model.solid_extrude_from_surfs(collection, vec_x, vec_y, vec_z, options, comp_mode)#
Creates solids by extruding a set of selected surfaces along a given vector.
- Parameters:
collection (Collection) – The collection containing the surface entities to extrude in order to create solids.
vec_x (double) – The x-component of the extrusion vector.
vec_y (double) – The y-component of the extrusion vector.
vec_z (double) – The z-component of the extrusion vector.
options (int) –
Flags that indicate different modes for the extrusion.
Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2 + 8*Bit3 + 16*Bit4 + 32*Bit5). Valid Bit options are:
Bit0
Extrude both free and internal edges of surfaces. Valid values are:
0 - Only free edges of surfaces are extruded.
1 - Both free and internal edges are extruded, thus creating separate solids from surfaces separated by shared edges.
Bit1
Create only boundary surfaces. Valid values are:
0 - Create solid entities.
1 - Create only boundary surfaces.
Bit2
Surfaces are extruded in both directions. Valid values are:
0 - Surfaces are extruded in one direction (positive or negative based on the surface normal).
1 - Surfaces are extruded in both directions.
Bit3
Connectivity between selected and non-selected surfaces is preserved before creating solids. Valid values are:
0 - Selected surfaces are disconnected from non-selected attached surfaces before creating solids.
1 - Connectivity between selected and non-selected surfaces is preserved.
Bit4
When extrusion is made in both directions (Bit2=1), keep original surfaces. Valid values are:
0 - When extrusion is made in both directions (Bit2=1), delete original surfaces.
1 - When extrusion is made in both directions (Bit2=1), keep original surfaces and use them as separating surfaces between created solids.
Bit5
Copy of original selected surfaces is made before creating solids. Valid values are:
0 - Original selected surfaces become part of created solid boundary.
1 - Copy of original selected surfaces is made before creating solids.
Show Bit value calculator
Radio Button Table Option Name Value Extrude both free and internal edges of surfaces (Bit0) Create only boundary surfaces (Bit1) Surfaces are extruded in both directions (Bit2) Connectivity between selected and non-selected surfaces is preserved before creating solids (Bit3) When extrusion is made in both directions (Bit2=1), keep original surfaces (Bit4) Copy of original selected surfaces is made before creating solids (Bit5) Calculated argument value: 0 comp_mode (int) –
Determines how new solids are distributed into components:
0 - Solids are created in the current component and boundary surfaces are moved to the same component.
1 - Solids are created in the current component, but surfaces remain in their original component.
2 - Solids are created in the same component as the selected surfaces (the result is not predictable if the surfaces are originally in different components).
Example#
Create a solid by extrusion of the surface with ID 1, use vector (1.0, 2.0, 3.0), and create the solid in the surface’s component#import hm import hm.entities as ent model = hm.Model() model.solid_extrude_from_surfs( collection=hm.Collection(model, ent.Surface, [1]), vec_x=1.0, vec_y=2.0, vec_z=3.0, options=0, comp_mode=2, )