(self)
return other
Provides a copy of this object and all children,
        but doesn't copy self.parent, meaning the new object belongs
        to a different tree
        Initialize an instance of this class with the same params
        that created self, the object being copied.
Provides a copy of this object and all children,
        but doesn't copy self.parent, meaning the new object belongs
        to a different tree
        Initialize an instance of this class with the same params
        that created self, the object being copied.
Provides a copy of this object and all children but doesn t copy self . parent meaning the new object belongs to a different tree Initialize an instance of this class with the same params that created self the object being copied .
def copy(self) -> "OpenSCADObject":
        """
        Provides a copy of this object and all children,
        but doesn't copy self.parent, meaning the new object belongs
        to a different tree
        Initialize an instance of this class with the same params
        that created self, the object being copied.
        """

        # Python can't handle an '$fn' argument, while openSCAD only wants
        # '$fn'.  Swap back and forth as needed; the final renderer will
        # sort this out.
        if '$fn' in self.params:
            self.params['segments'] = self.params.pop('$fn')

        other = type(self)(**self.params)
        other.set_modifier(self.modifier)
        other.set_hole(self.is_hole)
        other.set_part_root(self.is_part_root)
        other.has_hole_children = self.has_hole_children
        for c in self.children:
            other.add(c.copy())
        return other
def copy ( self ) -> "OpenSCADObject" : # Python can't handle an '$fn' argument, while openSCAD only wants # '$fn'.  Swap back and forth as needed; the final renderer will # sort this out. if '$fn' in self . params : self . params [ 'segments' ] = self . params . pop ( '$fn' ) other = type ( self ) ( * * self . params ) other . set_modifier ( self . modifier ) other . set_hole ( self . is_hole ) other . set_part_root ( self . is_part_root ) other . has_hole_children = self . has_hole_children for c in self . children : other . add ( c . copy ( ) ) return other