Mesh/Voxel spheres, ellipsoids, toroids, and test objects

A collection of functions to build spheres/ellipsoids, toroids, unions of spheres and test objects and voxel arrays or triangulated meshes.

https://github.com/JBKacerovsky/matlabSnippets

You are now following this Submission

A collection of functions to build spheres/ellipsoids, unions of spheres and test objects and voxel arrays or triangulated meshes.

meshSphereCreator.m - builds a single sphere or deformed sphere (ellipsoid) as a triangulated FV mesh struct.

voxelSphereCreator.m - adds a single sphere/deformed sphere to an input array (sets voxels inside the sphere to 1)

multiMeshElipsoidCreator.m - builds multiple spheres as FV mesh. overlapping spheres are united into a single object. Spheres can be deformed and rotated. Useful for building more complex objects from a union of spheres/ellipsoids

multiVoxelElipsoidCreator.m - builds multiple spheres as a binary array. overlapping spheres are united into a single object. Spheres can be deformed and rotated. Useful for building more complex objects from a union of spheres/ellipsoids

mulitiMeshToroidCreator.m - builds a set of tori (defined by major and minor radii and centre points) as FV meshes. Tori can be deformed and rotated to obtain different of toroids.

drawConnectingCylinders.m - draws a cylinders of user-defined width that connect sets of input points

starship.m/starship_voxel.m - apply the above functions to build a test object that loosely resembles a starship as an FV mesh or a binary array respectively.

Cite As

J. Benjamin Kacerovsky (2026). Mesh/Voxel spheres, ellipsoids, toroids, and test objects (https://uk.mathworks.com/matlabcentral/fileexchange/75241-mesh-voxel-spheres-ellipsoids-toroids-and-test-objects), MATLAB Central File Exchange. Retrieved .

Tags

Add Tags

Add the first tag.

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.7

added mulitiMeshToroidCreator.m and drawConnectingCylinders.m

1.0.6

fixed issues that caused multiMeshEllipsoidCreator and voxelMeshEllipsoidCreator to cut off some stretched (deform <1) ellipsoids and slight improvement to efficiency/memory usage

improved syntax for meshSphereCreator and voxelSphereCreator

1.0.5

.

1.0.4

fix to make the voxel and mesh versions of the starship test object align with each other

1.0.3

.

1.0.2

fixed a bug in multiVoxelElipsoidCreator.m that caused spheres not to be located at the absolute position specified by centres.

1.0.1

updated comments

1.0.0