Skip to content

Commit 657020e

Browse files
authored
Merge pull request #2305 from clemense/ce/fix_primitive_visual_copy
Fix missing visual copy for primitives
2 parents b96511e + 1f6f648 commit 657020e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

trimesh/primitives.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def to_dict(self):
114114
"""
115115
raise NotImplementedError()
116116

117-
def copy(self, **kwargs):
117+
def copy(self, include_visual=True, **kwargs):
118118
"""
119119
Return a copy of the Primitive object.
120120
@@ -129,6 +129,11 @@ def copy(self, **kwargs):
129129
kwargs.pop("kind")
130130
# create a new object with kwargs
131131
primitive_copy = type(self)(**kwargs)
132+
133+
if include_visual:
134+
# copy visual information
135+
primitive_copy.visual = self.visual.copy()
136+
132137
# copy metadata
133138
primitive_copy.metadata = self.metadata.copy()
134139

0 commit comments

Comments
 (0)