Function Repository Resource:

OptimalRotate

Source Notebook

Rotate a 3D object to best display its shape and features

Contributed by: Chengda Li

ResourceFunction["OptimalRotate"][obj]

displays an animation of the 3D object obj in optimal rotation.

ResourceFunction["OptimalRotate"][obj,n]

displays an animation of the 3D object obj in optimal rotation with n points on the rotational path.

Details

ResourceFunction["OptimalRotate"] accepts three-dimensional graphics objects in Graphics3D and MeshRegion.
The more points on the rotational path, the clearer the animation will be for visualizing the shape and features of the object.
n must be a positive integer.

Examples

Basic Examples

Optimally rotate a Graphics3D object:

In[1]:=
gtr = ExampleData[{"Geometry3D", "BassGuitar"}];
ResourceFunction["OptimalRotate"][gtr]
Out[1]=

Optimally rotate a MeshRegion object:

In[2]:=
shl = Import["ExampleData/seashell.stl"];
ResourceFunction["OptimalRotate"][shl]
Out[2]=

Scope (1) 

By increasing the number of rotational points, you can alter object rotations to be clearer with details:

In[3]:=
gtr = ExampleData[{"Geometry3D", "BassGuitar"}];
ResourceFunction["OptimalRotate"][gtr, 30]
Out[3]=

Publisher

Chengda Li

Version History

  • 1.0.0 – 27 September 2021

Related Resources

License Information