Model.body_split_with_swept_lines#
- Model.body_split_with_swept_lines(collection, line_collection, vector, back_dist, options)#
Input lines are used to construct cutting surfaces, which are then used to trim selected solids or surfaces.
- Parameters:
collection (Collection) – The collection containing the entities to split. Valid values are solids or surfaces.
line_collection (Collection) – The collection containing the line entities from which to to generate the swept surface used for splitting.
vector (hwTriple) – The hwTriple object defining the vector components. User can also supply a Python list of three doubles. In the case where a limited sweep is specified (see options), the length of the vector defines the position of the back edge of the swept surface relative to the position of the corresponding input line. A positive value results in shifting the position of the back edge in the direction of the input vector.
back_dist (double) – In the case where a limited sweep is specified (see options), this defines the position of the front edge of the cutting surface with respect to the position of corresponding input line. For a value of 0 the front edge coincides with input line. A positive value results in shifting the position of the front edge in the direction of the input vector.
options (int) –
The options to use for trimming the selected entities.
Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2). Valid Bit options are:
Bit0
Limited or unlimited sweep. Valid values are:
0 - Limited sweep. The swept surfaces are created and used as defined by vector length and back_dist.
1 - Unlimited sweep. Cutting surfaces are extended in sweep direction to trim as many input surfaces as possible.
Bit1
Limited or extended lines. Valid values are:
0 - Limited lines. Original input lines are used to generate swept surfaces.
1 - Extended lines. Input lines are extended before sweeping them to generate cutting surfaces.
Bit2
Cutting surfaces become permanent or temporary. Valid values are:
0 - Cutting surfaces become part of the model.
1 - Cutting surfaces are temporary and are only used to generate trimming lines on intersected surfaces.
Show Bit value calculator
Radio Button Table Option Name Value Limited or unlimited sweep (Bit0) Limited or extended lines (Bit1) Cutting surfaces become permanent or temporary (Bit2) Calculated argument value: 0
Example#
Trim solid with ID 111 by sweeping lines with IDs 5 and 6 in the z-direction and extending the cutting surfaces in all directions#import hm import hm.entities as ent model = hm.Model() model.body_split_with_swept_lines( collection=hm.Collection(model, ent.Solid, [111]), line_collection=hm.Collection(model, ent.Line, [5, 6]), vector=(0, 0, 1), back_dist=None, options=3 )