Model.surfacesplinepatchforholes#
- Model.surfacesplinepatchforholes(collection, fill_gaps, options)#
Creates a spline surface inside all loops of selected lines. If the created surface’s NURBS poles are twisting, bad surfaces are deleted. Both topological and free lines can be used for the loop for spline creation. If the lines are not forming a closed loop, connecting lines can be automatically created. The tangencies of the created splines match the tangencies of any connected surfaces. Created splines are organized in the same components as the input lines.
- Parameters:
collection (Collection) – The collection containing the input line entities.
fill_gaps (int) –
The gap filling mode.
0 - Input lines must be all connected into a closed loop within the internal tolerance.
1 - Connection lines are created for gaps exceeding the internal tolerance.
options (int) –
The options for creating the surface.
Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 8*Bit3 + 1024*Bit10). Valid Bit options are:
Bit0
Component mode. Used to determine which component will be used to place created surfaces. Valid values are:
0 - Current component is used.
1 - Component of input lines are used. If different components are used as input, the component to which the majority of the lines belong is used.
Bit1
Line ends usage mode. Used to control creation of vertices on the constructed spline. Currently works only for planar surfaces. Valid values are:
0 - Vertices are created automatically on constructed surface.
1 - Vertices are created at input line ends.
Bit3
Surface stitching option. Used to override the default stitching algorithm. Valid values are:
0 - Default stitching algorithm as defined by the function
setoption()in the “geoms_stitching” argument.1 - Created surface is not stitched to any model surfaces.
Bit10
Mesh stitching option. Used to control the connectivity of the mesh created on the new spline surface in simultaneous meshing modes set by the
Model.surfacemode()function. Valid values are:0 - New mesh is not connected.
1 - In
Model.surfacemode()whenmode=1, existing mesh nodes on input lines are used if new spline edges are stitched to those lines. InModel.surfacemode()whenmode=2, existing mesh nodes on input lines are used to create the mesh on the new spline surface.Show Bit value calculator
Radio Button Table Option Name Value Component mode (Bit0) Line ends usage mode (Bit1) Surface stitching option (Bit3) Mesh stitching option (Bit10) Calculated argument value: 0
Example#
Create spline surfaces for lines with IDs 1 - 10 and fill the gap#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the lines with IDs 1-10 filter_lines = hm.FilterByEnumeration(ent.Line, list(range(1, 11))) lines_collection = hm.Collection(model, filter_lines) model.surfacesplinepatchforholes(collection=lines_collection, fill_gaps=1, options=0)