Skip to content

Commit 47d23d2

Browse files
fix: make sure export_glb is handling a single Polydata object (#2032)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent b86542b commit 47d23d2

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

doc/changelog.d/2032.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make sure export_glb is handling a single polydata object

src/ansys/geometry/core/plotting/plotter.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,26 @@ def export_glb(
557557
~pathlib.Path
558558
Path to the exported glb file.
559559
"""
560+
# Export to GLB requires merging the object into a single mesh
561+
LOG.debug(
562+
"Exporting to GLB requires merging the object into a single mesh. "
563+
"This may take some time depending on the size of the object."
564+
)
565+
LOG.debug(
566+
"When calling export_glb, if you had previously set the plotting_options "
567+
"'merge_bodies' or 'merge_component' to False, they will be ignored."
568+
)
569+
plotting_options["merge_component"] = True
570+
plotting_options["merge_bodies"] = True
571+
560572
if plotting_object is not None:
561573
self.plot(plotting_object, **plotting_options)
574+
else:
575+
LOG.warning(
576+
"If you had previously added the objects to the plotter, "
577+
"make sure that the options 'merge_bodies' and 'merge_component' "
578+
"are set to True, otherwise the export will not work as expected."
579+
)
562580

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

0 commit comments

Comments
 (0)