Model.surfacesplineonlinesloop#

Model.surfacesplineonlinesloop(collection, fill_gaps, use_surfs, options)#

Create surface spline using lines selected by the Collection. If lines are not connected into closed loop, create connecting lines. If selected lines are topological lines connected to some other surfaces, tangency of lines created to close the gaps in the loop should match tangency of connected surfaces. Tangency of created spline matches the tangency of connected surfaces (if any). Created spline is placed into the same component that selected lines belong to.

Parameters:
  • collection (Collection) – The collection containing the line entities that are used for the loop to create the spline on. Both topological and free lines can be used.

  • fill_gaps (int) –

    Gap filling mode

    0 - Input lines must be all connected into a closed loop within the internal tolerance.

    1 - Connection lines are built for gaps exceeding the internal tolerance. If use_surfs=1, the tangency of the attached surfaces is used to construct the filling lines.

  • use_surfs (int) –

    Connected surfaces usage mode.

    0 - Tangency constraints are not used.

    1 - Surfaces attached to input lines are used to maintain tangency for the constructed spline.

  • 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.

    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.

    0 - Vertices are created automatically on constructed surface.

    are created at input line ends.

    Bit3

    Surface stitching option. Used to override the default stitching algorithm.

    0 - Default stitching algorithm as defined by the function setoption() in the “geom_stitching” argument.

    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 surfacemode function.

    0 - New mesh is not connected.

    1 - In Model.surfacemode() when mode=1, existing mesh nodes on input lines are used if new spline edges are stitched to those lines. In Model.surfacemode() when mode=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 a surface spline by use the lines with IDs 1,2 and 3#
import hm
import hm.entities as ent

model = hm.Model()

model.surfacesplineonlinesloop(
    collection=hm.Collection(model, ent.Line, [1, 2, 3]),
    fill_gaps=1,
    use_surfs=1,
    options=1,
)