Skip to content

Commit

Permalink
Merge pull request #2305 from clemense/ce/fix_primitive_visual_copy
Browse files Browse the repository at this point in the history
Fix missing visual copy for primitives
  • Loading branch information
mikedh authored Oct 22, 2024
2 parents b96511e + 1f6f648 commit 657020e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion trimesh/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def to_dict(self):
"""
raise NotImplementedError()

def copy(self, **kwargs):
def copy(self, include_visual=True, **kwargs):
"""
Return a copy of the Primitive object.
Expand All @@ -129,6 +129,11 @@ def copy(self, **kwargs):
kwargs.pop("kind")
# create a new object with kwargs
primitive_copy = type(self)(**kwargs)

if include_visual:
# copy visual information
primitive_copy.visual = self.visual.copy()

# copy metadata
primitive_copy.metadata = self.metadata.copy()

Expand Down

0 comments on commit 657020e

Please sign in to comment.