Utility Functions

multimodars.to_obj(geometry, output_path, watertight=True, contour_types=None, filename_prefix='')[source]

Convert a PyGeometry object into OBJ files and write them to disk.

Writes the specified contour types as OBJ meshes without UV coordinates. Each contour type is written to its own file together with a corresponding MTL material file.

Parameters:
  • geometry (PyGeometry) – Input geometry instance containing the mesh data.

  • output_path (str) – Directory path where the OBJ and MTL files will be written.

  • watertight (bool) – Whether to write a watertight or shell mesh. Default is True.

  • contour_types (list[PyContourType] | None) – Contour types to export. Default is [PyContourType.Lumen, PyContourType.Catheter, PyContourType.Wall].

  • filename_prefix (str) – Optional prefix prepended to all output filenames. Default is "".

Raises:

RuntimeError – If any of the underlying file writes fail.

Return type:

None

Examples

>>> import multimodars as mm
>>> mm.to_obj(geometry, "output/meshes", watertight=True)