pyvista_cad.read_three_mf

On this page

pyvista_cad.read_three_mf#

read_three_mf(path, /, **_)[source]#

Read a 3MF file as a pyvista.MultiBlock.

Each <object> in the 3MF package becomes one block. Block names match the object name when set; otherwise object_<n>. field_data['cad.units'] records the document unit ('micron', 'mm', 'cm', 'inch', 'foot', 'm').

Parameters:
pathstr or os.PathLike

Path to a .3mf file.

**_Any

Forward-compat keyword arguments are accepted and ignored.

Returns:
pyvista.MultiBlock

One block per mesh object.

Parameters:
Return type:

MultiBlock

Examples

Read the bundled two-part 3MF assembly fixture:

>>> import pyvista_cad
>>> from pyvista_cad import read_three_mf
>>> mb = read_three_mf(pyvista_cad.examples.assembly_3mf_path())
>>> type(mb).__name__
'MultiBlock'
>>> str(mb.field_data['cad.source_format'][0])
'3mf'