MCPcopy
hub / github.com/CadQuery/cadquery / _copy

Method _copy

cadquery/assembly.py:169–190  ·  view source on GitHub ↗

Make a deep copy of an assembly

(self)

Source from the content-addressed store, hash-verified

167 self._subshape_layers = BiDict()
168
169 def _copy(self) -> "Assembly":
170 """
171 Make a deep copy of an assembly
172 """
173
174 rv = self.__class__(
175 self.obj, self.loc, self.name, self.color, self.material, self.metadata
176 )
177
178 rv._subshape_colors = BiDict(self._subshape_colors)
179 rv._subshape_names = BiDict(self._subshape_names)
180 rv._subshape_layers = BiDict(self._subshape_layers)
181
182 for ch in self.children:
183 ch_copy = ch._copy()
184 ch_copy.parent = rv
185
186 rv.children.append(ch_copy)
187 rv.objects[ch_copy.name] = ch_copy
188 rv.objects.update(ch_copy.objects)
189
190 return rv
191
192 @overload
193 def add(

Callers 1

addMethod · 0.80

Calls 2

BiDictClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected