Model.splinesurface#
- Model.splinesurface(collection, plane_flag, plane_normal, plane_base, options)#
Creates a 3D or planar surface defined by a set of lines, and optionally, prepares it for immediate use within the automesher. It can also identify a region in the shape of a Coons patch surface for the automesher to use under the mesh without surface option.
- Parameters:
collection (Collection) – The collection containing the input entities. Valid entities are nodes, points, lines.
plane_flag (int) –
A flag indicating if the lines are planar.
0 - Lines are not on a plane, and a 3D surface is created.
1 - A plane is calculated from the lines.
2 - Lines are projected onto the plane defined by plane.
plane_normal (hwTriple) – The hwTriple object defining the plane normal components used to project lines if
plane_flag=2. User can also supply a Python list of three doubles.plane_base (hwTriple) – The hwTriple object defining the base point components of the plane used to project lines if
plane_flag=2. User can also supply a Python list of three doubles.options (int) –
Specifies 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 is 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
setoption()function with the argumenthm.setoption(geom_stitching=*<value>*).1 - Created surface is not stitched to any of 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
Model.surfacemode()function. Valid values are:0 - New mesh is not connected.
1 - In
surfacemode=1, existing mesh nodes on input lines are used if new spline edges are stitched to those lines. Insurfacemode=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 (Bit2) Mesh stitching option (Bit10) Calculated argument value: 0
Example#
Create a surface from lines with IDs 65 , 66 , 67 and 69 , with no elements#import hm import hm.entities as ent model = hm.Model() model.surfacemode(mode=4) model.splinesurface( collection=hm.Collection(model, ent.Line, [65, 66, 67, 68]), plane_flag=0, plane_normal=[1.0, 0.0, 0.0], plane_base=[0.0, 0.0, 0.0], options=1, )