def to_spline(self, replace=True) -> 'Spline': """ Convert CIRCLE/ARC to a :class:`~ezdxf.entities.Spline` entity. Adds the new SPLINE entity to the entity database and to the same layout as the source entity. Args: replace: replace (delete) source entity by SPLINE entity if ``True`` .. versionadded:: 0.13 """ from ezdxf.entities import Spline spline = Spline.from_arc(self) if replace: replace_entity(self, spline) else: add_entity(self, spline) return spline
def to_spline(self, replace=True) -> 'Spline': """ Convert ELLIPSE to a :class:`~ezdxf.entities.Spline` entity. Adds the new SPLINE entity to the entity database and to the same layout as the source entity. Args: replace: replace (delete) source entity by SPLINE entity if ``True`` """ from ezdxf.entities import Spline spline = Spline.from_arc(self) layout = self.get_layout() if replace: replace_entity(self, spline, layout) else: add_entity(spline, layout) return spline
def to_spline(self, replace=True) -> "Spline": """Convert CIRCLE/ARC to a :class:`~ezdxf.entities.Spline` entity. Adds the new SPLINE entity to the entity database and to the same layout as the source entity. Args: replace: replace (delete) source entity by SPLINE entity if ``True`` """ from ezdxf.entities import Spline layout = self.get_layout() if layout is None: raise DXFValueError("valid layout required") spline = Spline.from_arc(self) if replace: replace_entity(self, spline, layout) else: add_entity(spline, layout) return spline