Model.morphaltercurvectr#

Model.morphaltercurvectr(domcollection, holdnode, type, curve, sym, con, hold, mode, node, plane_normal, plane_base, line, project, force, add)#

Alter the radius, curvature, or arc angle of edge or 2D domains on collection.

Parameters:
  • domcollection (Collection) – The collection containing the input domain entities.

  • holdnode (Collection) – The collection containing the node entities.

  • type (int) –

    The type of alteration to be made:

    0 - Alter radius

    1 - Alter curvature

    2 - Alter arc angle

  • curve (double) –

    Numerical value by which to alter the curve; actual effect depends on the type previously specified and the value of the add flag listed at the end of the function:

    If type = 0 - New radius

    If type = 1 - Curvature multiplier

    If type = 2 - New arc angle

    If add = 1 and type = 0 - Number added to radii

    If add = 1 and type = 2 - Number added to arc angle

  • sym (int) – 0 - Do not use symmetry (only option)

  • con (int) –

    Flag to use/not use constraints:

    0 - Do not use constraints

    1 - Use constraints

  • hold (int) –

    Specifies which part of the curve to anchor:

    0 - Hold angle

    1 - Hold ends

    2 - Hold center

  • mode (int) –

    Method of determining center or edges of curve:

    0 - Edge approximation, use symmetry

    1 - Use axis for center

    2 - Use line for center

    3 - Infer center using normals

    4 - Use node for center

    5 - Edge approximation, do not use symmetry

  • node (Entity) – The entity node

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

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

  • line (Entity) – The entity line

  • project (int) –

    Flag to project curve edges to a plane:

    0 - Do not project edges to plane

    1 - Project edges to plane

  • force (int) –

    Flag to force circular edges when using edge approximation (mode=5):

    0 - Do not force edges to be circular (edge approximation only)

    1 - Force edges to be circular (edge approximation only)

  • add (int) –

    Determines whether the value specified for curve is added to the existing curve’s value, or replaces it:

    0 - Use ‘curve’ as target value

    1 - Add ‘curve’ to current value(s)

Example#

The domains selected interactively will have the curvature altered. The radii or arc angle will be set to ‘curve’.#
import hm
import hm.entities as ent

model = hm.Model()

model.morphaltercurvectr(
    domcollection=hm.CollectionByInteractiveSelection(model, ent.Domain),
    holdnode=hm.CollectionByInteractiveSelection(model, ent.Node),
    type=1,
    curve=5.0,
    sym=0,
    con=1,
    hold=0,
    mode=0,
    node=ent.Node(model, 32),
    plane_normal=[1.0, 0.0, 0.0],
    plane_base=[0.0, 0.0, 0.0],
    line=ent.Line(model, 43),
    project=0,
    force=0,
    add=0,
)

Note

The domains on the collections will have either their radius, curvature, or arc angle altered depending on type. If add=1, curve; will be added to the current radii or arc angle of the selected domains, otherwise the radii or arc angle will be set to ‘curve’.

Allows you to choose the mode used to determine the center for the selected domains. Only one of ‘node’, ‘plane’, or ‘line’ needs to be filled in depending on mode (or none if 0, 3, or 5 is selected).

Setting project=1 will force the nodes for an edge to lie in a plane as part of the altered curve. Setting force=1 will force the calculated center for each node of an edge to be the same point, thus forcing the edge to be circular after the curve is altered.

If constraints are used they will be applied to the perturbations. Symmetry is not supported for Model.morphaltercurvectr().