Model.mechplacebodytopoint#

Model.mechplacebodytopoint(name, sx, sy, sz, tx, ty, tz, 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.

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

Example#

Move body “LEFT LOWER LEG” on the enabled mechanism, with tolerance 0.001, with source-target point pair as (-129.289718, 83.6107788, -53.376587) and target point (-146.452326, 80.1099172, -12.7053014)#
import hm
import hm.entities as ent

model = hm.Model()

model.mechplacebodytopoint(
    name="LEFT LOWER LEG",
    sx=-129.289718,
    sy=83.6107788,
    sz=-53.376587,
    tx=-146.452326,
    ty=80.1099172,
    tz=-12.7053014,
    tolerance=0.001,
)