Main Content

translate

Translate mesh along coordinate axes

Since R2020b

Description

example

translatedMesh = translate(mesh,deltaPos) translates the object mesh by the distances specified by deltaPos along the coordinate axes.

Examples

collapse all

Create an extendedObjectMesh object and translate the object.

Construct a cuboid mesh.

mesh = extendedObjectMesh('cuboid');

Translate the mesh by 5 units along the negative y axis.

mesh = translate(mesh,[0 -5 0]);

Visualize the mesh.

ax = show(mesh);
ax.YLim = [-6 0];

Input Arguments

collapse all

Extended object mesh, specified as an extendedObjectMesh object.

Translation vector for an object mesh, specified as a three-element real-valued vector. The three elements in the vector define the translation along the x, y, and z axes.

Data Types: single | double

Output Arguments

collapse all

Translated object mesh, returned as an extendedObjectMesh object.

Version History

Introduced in R2020b