Model.intersectmark2#

Model.intersectmark2(collection, plane_normal, plane_base, combine_flag, break_angle, smooth_flag, comp_mode)#

Creates nodes/lines by intersecting 1D/2D elements with a plane. For 1D elements, nodes are created at each intersection location. For 2D elements, a series of line segments are created at the specified plane that matches the profile of the selected elements that span that plane. These segments are then joined together according to the values selected for combine_flag, break_angle and smooth.

Parameters:
  • collection (Collection) – The collection containing the entities to intersect. Valid entities are elements and components. In components only elements are considered.

  • plane_normal (hwTriple) – The hwTriple object defining the plane normal components of the plane to use for cut. User can also supply a Python list of three doubles.

  • plane_base (hwTriple) – The hwTriple object defining the base point components of the plane to use for cut. User can also supply a Python list of three doubles.

  • combine_flag (int) –

    0 - Do not combine generated lines.

    1 - Combine generated lines.

  • break_angle (double) – The break angle used when combining lines. Ignored if combine_flag=0.

  • smooth_flag (int) –

    0 - Do not smooth combined lines.

    1 - Smooth combined lines. Ignored if combine_flag=0.

  • comp_mode (int) –

    Parameter specifying how lines are organized into components:

    0 - Lines are created in the current component.

    1 - All created intersection lines will be placed in the original element component(s), splitting the lines where necessary if the elements selected are connected and in different components.

Example#

Create intersection lines for the xy - plane with a base node of [ 0.0,10.0,0.0 ] with the displayed elements , with lines organized to the element components#
import hm
import hm.entities as ent

model = hm.Model()

model.intersectmark2(
    collection=hm.CollectionByDisplayed(model, ent.Element),
    plane_normal=[0.0, 0.0, 1.0],
    plane_base=[0.0, 10.0, 0.0],
    combine_flag=0,
    break_angle=0.0,
    smooth_flag=0,
    comp_mode=1,
)