Model.solidcreateruled#

Model.solidcreateruled(surf_list, link_coords_array, guide_collection_set, ruled_type, options, comp_mode)#

Creates solid entities by interpolating linearly or smoothly between input surfaces. Optionally, a list of linking points and/or guiding lines and surfaces can be provided for better interpolation and shape control.

The link points are given in link_coords_array, using their x-y-z coordinates. Link points should be given in pairs since each link between input surfaces is specified by its two end points. Furthermore, the pair of points must not skip any surface in between. For instance, if you have surfaces 1, 2, 3 and 4 as the input surfaces in this order, the link points can link surface 2 to 3 but not 2 to 4, by skipping 3. If such a skip is detected, the corresponding pair of points is ignored. One point may be linked to multiple points, which results in triangular surfaces.

In the smooth interpolation case, the linking between surfaces may also be given by selecting guiding lines and/or guiding surfaces using guide_collection_set. Guiding lines are used as part of the boundary of the final interpolating solid. If more than one guiding line is selected, the edges of the solid between these lines are obtained by smoothly interpolating these lines. If linear interpolation is selected, the guiding lines or guiding surfaces are ignored. If a guiding line extends beyond just connecting the input surfaces, that part of the line is ignored.

In order for guiding lines to be valid, they must:

  • Connect the input surfaces at their boundaries.

  • Connect to all intermediate input surfaces.

In order for guiding surfaces to be valid, they must:

  • Link the step surfaces as a single piece surface. In other words, if edge-A of a step surface is linked to edge-B of a step surface the linking surface must be a single surface.

  • Be stitched to the edges of step surfaces.

  • Link all the level surfaces of the solid. For example, if there are 3 step surfaces and one wants to use guiding surfaces, it is not enough to link only bottom and middle surfaces by a guiding surface. One needs to link the middle and the top surface also.

  • If two or more guiding surfaces are located next to each other, they must be stitched together properly.

If any conditions are not met, those guiding lines/surfaces will be ignored.

In the case of a surface with a scratch, if one of the internal points of the scratch is not linked to another surface at its boundary, this scratch is treated as if it is not part of the boundary, i.e. as if it does not exit. If the scratch is linked upward but not downward, then is it considered a part of the boundary while constructing surfaces between its level and the level above, but it is ignored while constructing boundary with the surface below.

All the surfaces at each level must have the same number of internal loops, if any. Currently, only one internal loop at each level is supported. Cases with more than one internal loop will generate solids, but the matching between loops may not be desirable.

Parameters:
  • surf_list (EntityList) – The list containing the input surface entities.

  • link_coords_array (hwDoubleList) – List of coordinates for the points which are supposed to be linked by an edge in the solid. The points are given in pairs.

  • guide_collection_set (CollectionSet) – The set of collections containing possibly multiple type of entities. Valid entities are lines and surfaces.

  • ruled_type (int) –

    Type of surface interpolation between input surfaces.

    0 - Smooth interpolation.

    1 - Linear interpolation.

  • options (int) –

    Flags that indicate different modes for solid creation.

    Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2). Valid Bit options are:

    Bit0

    Parameter that controls merging of the solid at input surfaces. Valid values are:

    0 - Merge solids at shared input surfaces. Creates a single solid.

    1 - Split solid at shared input surfaces. Creates as many as one less than the number of input surfaces.

    Bit1

    Create closed ring solid. Valid values are:

    0 - Create an open-ended solid.

    1 - Create a closed ring solid.

    Bit2

    Create only bounding surfaces. Valid values are:

    0 - Create solid entities.

    1 - Create only bounding surfaces.

    Show Bit value calculator
    Radio Button Table
    Option Name Value
    Parameter that controls merging of the solid at input surfaces (Bit0)
    Create closed ring solid (Bit1)
    Create only bounding surfaces (Bit2)
    Calculated argument value: 0

  • comp_mode (int) –

    Parameter specifying how entities are organized 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.

Examples#

Create a linear ruled solid between surfaces with IDs 11, 23 and 12#
import hm
import hm.entities as ent

model = hm.Model()

guide_collection_set = hm.CollectionSet(model)
model.solidcreateruled(
    surf_list=[ent.Surface(model, 11), ent.Surface(model, 23), ent.Surface(model, 12)],
    link_coords_array=hm.hwDoubleList([]),
    guide_collection_set=guide_collection_set,
    ruled_type=1,
    options=0,
    comp_mode=2,
)
Create a smooth ring solid in the surfs component component, split at the input surfaces , interpolate the surfaces with IDs 11, 12 and 15, links point P1 = (2.3, 4.5, 6.0) of surface with ID 11 corresponds to point P2 = (12.3, 2.25, 36.30) of surface with ID 12, uses the lines with IDs 57 and 68#
import hm
import hm.entities as ent

model = hm.Model()

# Creating the collection set that contains the collection with the lines with IDs 57 and 68
guide_collection_set = hm.CollectionSet(model)
line_collection = hm.Collection(model, ent.Line, [57, 68])
guide_collection_set.set(line_collection)

model.solidcreateruled(
    surf_list=[ent.Surface(model, 11), ent.Surface(model, 23), ent.Surface(model, 12)],
    link_coords_array=[2.3, 4.5, 6.0, 12.3, 2.25, 36.30],
    guide_collection_set=guide_collection_set,
    ruled_type=0,
    options=3,
    comp_mode=2,
)
Smootly interpolating the surfaces with IDs 9, 1, 3 and 15. Coordinates of 4 points are given that specify the locations that must be linked together at the boundaries of these surfaces. Furthermore, the line with ID 416 is given as a guiding line and the surfaces with IDs 44, 45 and 4 are given as guiding surfaces. Thus, the line with ID 416 will be part of the boundary of the final solid as well as the surfaces with IDs 44-46. All of the other boundary lines connecting the surfaces with IDs 9, 1, 3 and 15 will be obtained by smoothly interpolating the line with ID 416 and the related boundary lines of the surfaces with IDs 44-46#
import hm
import hm.entities as ent

model = hm.Model()

# Creating the collection set that contains the collections with the lines and the surfaces needed
guide_collection_set = hm.CollectionSet(model)
line_collection = hm.Collection(model, ent.Line, [416])
surface_collection = hm.Collection(model, ent.Surface, [44, 45, 46])
guide_collection_set.set(line_collection)
guide_collection_set.set(surface_collection)

model.solidcreateruled(
    surf_list=[
        ent.Surface(model, 9),
        ent.Surface(model, 1),
        ent.Surface(model, 3),
        ent.Surface(model, 15),
    ],
    link_coords_array=[
        65.7154694,
        -45.6232033,
        0.0,
        79.955162,
        -60.0597343,
        60.0,
        79.955162,
        -60.0597343,
        60.0,
        39.7798615,
        -30.2912979,
        150.0,
    ],
    guide_collection_set=guide_collection_set,
    ruled_type=0,
    options=0,
    comp_mode=2,
)