Model.body_split_with_morphed_lines#

Model.body_split_with_morphed_lines(collection, entitylist, coords, target_type, options)#

Splits surfaces or solids using swept lines.

Parameters:
  • collection (Collection) – The collection containing the entities to split. Valid values are solids or surfaces.

  • entitylist (EntityList) – A list containing the line entity objects from which to to generate the swept surface used for splitting.

  • coords (hwDoubleList) – The list of coordinates or offsets used to indicate sweeping direction of line ends. The values in the double list are given as a sequence of x, y, z values for either the offset, or the absolute value of the swept line ends (the particular usage depends on the target_type parameter value).

  • target_type (int) –

    Controls the way that the values given by coords indicate sweeping direction of line ends. Permissible values of this parameter are 0, 1, 2, 3, 4, 5, 6, and 7:

    0 - The first 3 values of coords are used as x, y, z values of the offset of the line start point; the next 3 values, if present, are used as the offset of the line end point. If the second trio of values is not provided then the same offset is used for both start and end points.

    1 - The first 3 values of coords are used as x, y, z values of the position of swept line start. The second set of x, y, z values is used as the position of swept line end point. If only one point is given on input then the position of the endpoint is calculated to give the same offset from original line end point as the start point (line translation).

    2 - The same as 0.

    3 - The values in coords are used as positions of swept line end points. The choice of points’ order is made automatically to minimize swept surface distortion.

    (n+4) - Adding 4 to above values (e.g. using 4-7) results in creating splitting lines without surface creation.

  • options (int) –

    0 - The swept surface is used as-is.

    1 - The surface is extended to cover trimmed entities.

Example#

Split the solid with ID 1 with the surface swept in x direction from the line formed by combining lines with IDs 10 and 11#
import hm
import hm.entities as ent

model = hm.Model()

model.body_split_with_morphed_lines(
    collection=hm.Collection(model, ent.Solid, [1]),
    entitylist=[ent.Line(model, 10), ent.Line(model,11)],
    coords=[1.0, 0.0, 0.0],
    target_type=0,
    options=1
)