Model.sweep_envelope#
- Model.sweep_envelope(collection, line=Entity(), path_rotation='MAX', path_reverse=False, axis_base=hwTriple(0.0, 0.0, 0.0), axis_direction=hwTriple(0.0, 0.0, 0.0), angle_range=hwDoubleList())#
Sweeps a volume along a given trajectory, outputting the envelope mesh of the volume formed by the sweeping motion. The input can be either surfaces, solids, elements, or components. When solids or surfaces are given, they are faceted and subsequently swept. The trajectory can be specified by either a line (for sweep) or a spin axis and angles (for spin). The output is organized in a component called “envelope N” (N starting with 0).
- Parameters:
collection (Collection) – The collection containing the entities to be swept. Valid entities are elements, components, solids and surfaces.
line (Entity) – The object describing the line entity that the input entities are swept along.
path_rotation (hwString) –
Specifies whether the volume to be swept is rotated and aligned with the tangent ofmotion. Valid values are:
line_tangent - Rotation is enabled
fixed_frame - Rotation is disabled
path_reverse (bool) – Indicates whether to reverse the trajectory specified by the path line.
axis_base (hwTriple) – The coordinates of a sample point on the axis line.
axis_direction (hwTriple) – The components of the directional vector of the axis.
angle_range (hwDoubleList) – The start and end angle of the spin motion, specified in degrees.
Examples#
Sweep the displayed elements along the line ID 5 and rotate the input entities to follow the line ‘s tangent#import hm import hm.entities as ent model = hm.Model() model.sweep_envelope( collection=hm.CollectionByDisplayed(model, ent.Element), line=ent.Line(model, 5), path_rotation="line_tangent", )
Spin all solids along an axis that goes through the point ( 1.0 , 2.5 , 3.0 ) and is parallel to the y axis , from -30.0 degrees to +30.0 degrees#import hm import hm.entities as ent model = hm.Model() model.sweep_envelope( collection=hm.Collection(model, ent.Solid), axis_base=[1.0, 2.5, 3.0], axis_direction=[0.0, 1.0, 0.0], angle_range=[-30.0, 30.0], )