Auto-scale object mesh to match specified cuboid dimensions
scaledMesh = scaleToFit(mesh,dims)
example
scaledMesh = scaleToFit(mesh,dims) auto-scales the object mesh to match the dimensions of a cuboid specified in the structure dims.
scaledMesh
mesh
dims
collapse all
This example shows how to create an extendedObjectMesh object and auto-scale the object to the required dimensions.
extendedObjectMesh
Construct a sphere mesh of unit dimensions.
sph = extendedObjectMesh('sphere');
Auto-scale the mesh to the dimensions in dims.
dims = struct('Length',5,'Width',10,'Height',3,'OriginOffset',[0 0 -3]); sph = scaleToFit(sph,dims);
Visualize the mesh.
show(sph);
Extended object mesh, specified as an extendedObjectMesh
Dimensions of the cuboid to scale an object mesh, specified as a struct with these fields:
struct
Length – Length of the cuboid
Length
Width – Width of the cuboid
Width
Height – Height of the cuboid
Height
OriginOffset – Origin offset in 3-D coordinates
OriginOffset
All the dimensions are in meters.
Data Types: struct
Scaled object mesh, returned as an extendedObjectMesh object.
applyTransform
join
rotate
scale
show
translate
You have a modified version of this example. Do you want to open this example with your edits?