Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/2032.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make sure export_glb is handling a single polydata object
18 changes: 18 additions & 0 deletions src/ansys/geometry/core/plotting/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,26 @@ def export_glb(
~pathlib.Path
Path to the exported glb file.
"""
# Export to GLB requires merging the object into a single mesh
LOG.debug(
"Exporting to GLB requires merging the object into a single mesh. "
"This may take some time depending on the size of the object."
)
LOG.debug(
"When calling export_glb, if you had previously set the plotting_options "
"'merge_bodies' or 'merge_component' to False, they will be ignored."
)
plotting_options["merge_component"] = True
plotting_options["merge_bodies"] = True

if plotting_object is not None:
self.plot(plotting_object, **plotting_options)
else:
LOG.warning(
"If you had previously added the objects to the plotter, "
"make sure that the options 'merge_bodies' and 'merge_component' "
"are set to True, otherwise the export will not work as expected."
)

# Depending on whether a name is provided, the file will be saved with the name
# provided or with a default name (temp_glb). If a name is provided, the file will
Expand Down
Loading