Model.solid_rotate#

Model.solid_rotate(solid_collection, axis, base_point, projection_point=0, create_spunsolid=0, create_crosssection=0, create_spunoutline=0, offset_method=0, offset_dist=0.0, dest_component='current', comp_name='')#

Creates a profile from the outline of one or more solids by spinning them around a fixed axis. The optional argument offset_dist can be used to give a distance value by which the spun outline is offset. You have the option to create surfaces from this outline or to create solids which represents the volume swept by the rotating input solids. At least one of the actions create_spunoutline, create_crosssection, or create_spunsolid needs to be enabled for the function to proceed.

Parameters:
  • solid_collection (Collection) – The collection containing the input solid entities.

  • axis (hwTriple) – The direction of the axis around which the input solids are spun.

  • base_point (hwTriple) – The position of the spin axis.

  • projection_point (int) – Together with axis and base_point, it specifies the projection plane on which the spun outline is positioned. If not given, the plane is determined automatically.

  • create_spunsolid (int) –

    Specifies whether solids are created.

    0 - Do not create solids. (default)

    1 - Create solids by spinning the profile surfaces.

  • create_crosssection (int) –

    Specifies whether spun profile surfaces are created.

    0 - Do not create spun surfaces. (default)

    1 - Create spun surfaces.

  • create_spunoutline (int) –

    Specifies whether spun outlines are created on the projection plane.

    0 - Do not create spun outlines. (default)

    1 - Create spun outlines.

  • offset_method (int) –

    0 - Offset is done using ‘s line offsetting functionality. (default)

    1 - Offset is done using AFC surface edge offsetting functionality.

  • offset_dist (double) – When a positive offset distance is given, the spun outline is offset by this distance and the output spun profile surfaces or solids are defined using this offset outline. (default=0).

  • dest_component (hwString) –

    current - New entities are created in the current component. (default)

    original - New entities are created in the component of the input solid.

    named_comp - New entities are created in the component defined in comp_name. If a component with the given name does not exist, it is created.

  • comp_name (hwString) – The name of the component in which the result entities are created.

Example#

Create spun outlines, spun solid and its cross-section surface, with offset distance 5.0, by spin solids ID 2 and 3 around the z-axis, based at point (2.0 , 3.0 , 5.0)#
import hm
import hm.entities as ent

model = hm.Model()

model.solid_rotate(
    solid_collection=hm.Collection(model, ent.Solid, [2, 3]),
    axis=[0, 0, 0.0, 1.0],
    base_point=[2.0, 3.0, 5.0],
    create_spunsolid=1,
    create_spunoutline=1,
    create_crosssection=1,
    dest_component="named_comp",
    comp_name="SPUN OUTLIN",
    offset_dist=5.0,
)