Custom deepcopy() implementations to help speed things up

This commit is contained in:
Jan Petykiewicz 2019-05-15 00:19:37 -07:00
commit a461446059
9 changed files with 80 additions and 8 deletions

View file

@ -1,4 +1,4 @@
from typing import List, Tuple
from typing import List, Tuple, Dict
import math
import numpy
from numpy import pi
@ -98,6 +98,13 @@ class Ellipse(Shape):
self.poly_num_points = poly_num_points
self.poly_max_arclen = poly_max_arclen
def __deepcopy__(self, memo: Dict = None) -> 'Ellipse':
memo = {} if memo is None else memo
new = copy.copy(self)
new._offset = self._offset.copy()
new._radii = self._radii.copy()
return new
def to_polygons(self,
poly_num_points: int=None,
poly_max_arclen: float=None