Model.mechplanetranslatebody#

Model.mechplanetranslatebody(name, sx, sy, sz, tx, ty, tz, rx, ry, rz, tolerance)#

Moves a body such that the source point on the body reaches the target point, while satisfying joints and constraints defined in the mechanism.

The mechanism must have the enabled flag set to true for this to be possible.

Parameters:
  • name (hwString) – The name of the body of the mechanism.

  • sx (double) – The x-coordinate of the source point on the body.

  • sy (double) – The y-coordinate of the source point on the body.

  • sz (double) – The z-coordinate of the source point on the body.

  • tx (double) – The x-coordinate of the target point.

  • ty (double) – The y-coordinate of the target point.

  • tz (double) – The z-coordinate of the target point.

  • rx (double) – The x-direction rotation angle.

  • ry (double) – The y-direction rotation angle.

  • rz (double) – The z-direction rotation angle.

  • tolerance (double) – The tolerance allowed during the placement.

Example#

Move body “Seat_Cushion” from (-1447.3297618988, 263.83727318711, 562.87391867592) to (-1400.3297618988, 263.83727318711, 562.87391867592) with tolerance 0.001, with no rotation angles#
import hm
import hm.entities as ent

model = hm.Model()

model.mechplanetranslatebody(
    name="Seat_Cushion",
    sx=-1447.3297618988,
    sy=263.83727318711,
    sz=562.87391867592,
    tx=-1400.3297618988,
    ty=263.83727318711,
    tz=562.87391867592,
    rx=0.0,
    ry=0.0,
    rz=0.0,
    tolerance=0.001,
)