Model.morphmapedgestoequationoffset#

Model.morphmapedgestoequationoffset(user_mark_id, equation, origin, origin_id, use_symmetry, use_constraints, project, vector, number_of_mid_handles, offset)#

Maps the handles on the morph volume edges in the collection to a function along the specified vector, equation surface normal, or normal to any attached shell elements (unusual for morph volume edges).

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

  • equation (hwString) – String containing an equation f(x,y,z). The equation can contain x, y, and z variables but should not contain an equals sign. The surface of the function is located where the value of the function equals zero.

  • origin (int) –

    0 - Use global origin and system

    1 - Use global system with node ID = origin_id as the origin

    2 - Use local system with ID = origin_id as the origin and system

  • origin_id (unsigned int) – The ID of node or system specified in origin. Ignored if origin=0.

  • 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

    1 or 11 - Project normal to surface of equation

    2 or 12 - Project normal to attached shell elements

    If offset is non-zero, the offset will be measured from the closest point on the equation for values of 0, 1 and 2. The offset will be measured along the projection vector or normal for values of 10, 11, and 12.

  • vector (hwTriple) – The hwTriple object defining the vector components for the projection direction. 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.

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

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

Examples#

Map edges on user mark 0 to an equation (sphere of radius 10.0) with an offset of 1.2 using the global system along a vector 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.morphmapedgestoequationoffset(
    user_mark_id=0,
    equation="x*x+y*y+z*z-100.0",
    origin=0,
    origin_id=0,
    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 an equation (sphere of radius 10.0) using a local system 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.morphmapedgestoequationoffset(
    user_mark_id=1,
    equation="x*x+y*y+z*z-100.0",
    origin=2,
    origin_id=1,
    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)