Model.morphmapedgestolineoffset#

Model.morphmapedgestolineoffset(user_mark_id, line_list, node_list, use_symmetry, use_constraints, project, vector, number_of_mid_handles, offset)#

Fits (evenly distribute) or projects (along a vector or normal to the line) the handles on the marked morph volume edges to a line calculated from the specified lines and nodes. If an offset is specified and nproj is not set to 2, the edges will be offset from the given line.

Parameters:
  • user_mark_id (int) – The ID of the user mark containing the morph edges. Valid values are 0-3.

  • line_list (EntityList) – The list containing the input line entities.

  • node_list (EntityList) – The list containing the input node entities.

  • use_symmetry (int) –

    0 - Do not use symmetry links

    1 - Use symmetry links

  • use_constraints (int) –

    0 - Do not use constraints

    1 - Use constraints

  • project (int) –

    0 or 10 - Project along vector defined by vector_id

    1 or 11 - Project normal to line

    2 or 12 - Fit to line

    If offset is non-zero, the offset will be measured from the closest point on the line for values of 0 and 1. The offset will be measured along the projection vector or normal for values of 10 and 11. Offsets will not be applied for a value of 2.

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

  • number_of_mid_handles (int) –

    -1 - Do not change the handles on the edges

    0 - 5 - Update the number of mid-handles on the edges to this number

  • offset (double) –

    The distance to offset nodes from the target. Not used if project is 2.

    The offset will be measured from the closest point on the line for values of project of 0 and 1.

    The offset will be measured along the projection vector normal for values of project of 10 and 11.

Examples#

Map edges on user mark 0 to a line along a vector with offset of 1.2 and leaving the handles unchanged#
import hm
import hm.entities as ent

model = hm.Model()

model.morphmanageedgemark(edge_id=0, user_mark_id=0, mode=3)
model.morphmanageedgemark(edge_id=2, user_mark_id=0, mode=1)
model.morphmanageedgemark(edge_id=4, user_mark_id=0, mode=1)

model.morphmapedgestolineoffset(
    user_mark_id=0,
    line_list=[ent.Line(model, 1), ent.Line(model, 2)],
    node_list=[ent.Node(model, 1), ent.Node(model, 2)],
    use_symmetry=1,
    use_constraints=1,
    project=0,
    vector=[1.0, 0.0, 0.0],
    number_of_mid_handles=-1,
    offset=1.2,
)

model.morphmanageedgemark(edge_id=0, user_mark_id=0, mode=3)
Map edges on user mark 1 to a line along the line normal with 3 mid-handles per edge#
import hm
import hm.entities as ent

model = hm.Model()

model.morphmanageedgemark(edge_id=0, user_mark_id=1, mode=3)
model.morphmanageedgemark(edge_id=2, user_mark_id=1, mode=1)
model.morphmanageedgemark(edge_id=4, user_mark_id=1, mode=1)

model.morphmapedgestolineoffset(
    user_mark_id=1,
    line_list=[ent.Line(model, 1), ent.Line(model, 2)],
    node_list=[ent.Node(model, 1), ent.Node(model, 2)],
    use_symmetry=1,
    use_constraints=1,
    project=1,
    vector=[1.0, 0.0, 0.0],
    number_of_mid_handles=3,
    offset=0.0,
)

model.morphmanageedgemark(edge_id=0, user_mark_id=1, mode=3)