Model.solidcreatespinsurfwithoffsetangle#

Model.solidcreatespinsurfwithoffsetangle(surf_collection, rotation_plane_normal, rotation_plane_base, start_angle, end_angle, options, comp_mode)#

Creates one or more solids by rotating a given set of surfaces around a given axis.

Parameters:
  • surf_collection (Collection) – The collection containing the surface entities to rotate and create solids.

  • rotation_plane_normal (hwTriple) – The hwTriple object defining the plane normal components which is used as the rotation axis. User can also supply a Python list of three doubles.

  • rotation_plane_base (hwTriple) – The hwTriple object defining the base point components to be used as rotation center of the plane which is used as the rotation axis. User can also supply a Python list of three doubles.

  • start_angle (double) – Degrees value of initial rotation angle: selected surfaces are rotated by this value before solid “sweeping” begins.

  • end_angle (double) – Degrees value of final rotation angle: solid “sweeping” stops at this value.

  • 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 + 8*Bit3). Valid Bit options are:

    Bit0

    Rotate free and internal edges. Valid values are:

    0 - Only free edges of surfaces are rotated.

    1 - Both free and internal edges rotate, thus creating boundaries between solids created from each individual surface.

    Bit1

    Create only bounding surfaces. Valid values are:

    0 - Create solid entities.

    1 - Create only the boundary of solids.

    Bit2

    Selected surfaces remain intact. Valid values are:

    0 - Selected surfaces become part of solid boundary.

    1 - Selected surfaces remain intact.

    Bit3

    Solid surfaces are used as input. Valid values are:

    0 - Solid surfaces are ignored as input.

    1 - Solid surfaces are copied and the new copied surfaces are used to create spin solids.

    Show Bit value calculator
    Radio Button Table
    Option Name Value
    Rote free and internal edges (Bit0)
    Create only bounding surfaces (Bit1)
    Selected surfaces remain intact (Bit2)
    Solid surfaces are used as input (Bit3)
    Calculated argument value: 0

  • comp_mode (int) –

    Determines how new solids are organized into components. Valid values are:

    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 unpredictable if surfaces from different components become a part of the same solid body).

Example#

Create a solid by rotate the surface with ID 1 around an axis defined by the direction vector (1.0, 2.0, 3.0) with a rotation center at point (4.0, 5.0, 6.0) and use a full 360.0 degrees angle, create a solid in the same component as the surface with ID 1, and keep the surface with ID 1 intact#
import hm
import hm.entities as ent

model = hm.Model()

model.solidcreatespinsurfwithoffsetangle(
    surf_collection=hm.Collection(model, ent.Surface, [1]),
    rotation_plane_normal=[1.0, 2.0, 3.0],
    rotation_plane_base=[4.0, 5.0, 6.0],
    start_angle=0.0,
    end_angle=360.0,
    options=4,
    comp_mode=2,
)