various fixes and cleanup

mainly involving ports_to_data and data_to_ports
This commit is contained in:
Jan Petykiewicz 2023-01-25 23:57:02 -08:00 committed by jan
commit 963918d1d9
13 changed files with 62 additions and 54 deletions

View file

@ -7,12 +7,12 @@ from numpy import pi
from numpy.typing import NDArray, ArrayLike
from . import Shape, Polygon, normalized_shape_tuple, DEFAULT_POLY_NUM_POINTS
from .. import PatternError
from ..error import PatternError
from ..repetition import Repetition
from ..utils import is_scalar, layer_t, AutoSlots, annotations_t
from ..utils import is_scalar, layer_t, annotations_t
class Arc(Shape, metaclass=AutoSlots):
class Arc(Shape):
"""
An elliptical arc, formed by cutting off an elliptical ring with two rays which exit from its
center. It has a position, two radii, a start and stop angle, a rotation, and a width.

View file

@ -6,12 +6,12 @@ from numpy import pi
from numpy.typing import NDArray, ArrayLike
from . import Shape, Polygon, normalized_shape_tuple, DEFAULT_POLY_NUM_POINTS
from .. import PatternError
from ..error import PatternError
from ..repetition import Repetition
from ..utils import is_scalar, layer_t, AutoSlots, annotations_t
from ..utils import is_scalar, layer_t, annotations_t
class Circle(Shape, metaclass=AutoSlots):
class Circle(Shape):
"""
A circle, which has a position and radius.
"""

View file

@ -7,12 +7,12 @@ from numpy import pi
from numpy.typing import ArrayLike, NDArray
from . import Shape, Polygon, normalized_shape_tuple, DEFAULT_POLY_NUM_POINTS
from .. import PatternError
from ..error import PatternError
from ..repetition import Repetition
from ..utils import is_scalar, rotation_matrix_2d, layer_t, AutoSlots, annotations_t
from ..utils import is_scalar, rotation_matrix_2d, layer_t, annotations_t
class Ellipse(Shape, metaclass=AutoSlots):
class Ellipse(Shape):
"""
An ellipse, which has a position, two radii, and a rotation.
The rotation gives the angle from x-axis, counterclockwise, to the first (x) radius.

View file

@ -7,9 +7,9 @@ from numpy import pi, inf
from numpy.typing import NDArray, ArrayLike
from . import Shape, normalized_shape_tuple, Polygon, Circle
from .. import PatternError
from ..error import PatternError
from ..repetition import Repetition
from ..utils import is_scalar, rotation_matrix_2d, layer_t, AutoSlots
from ..utils import is_scalar, rotation_matrix_2d, layer_t
from ..utils import remove_colinear_vertices, remove_duplicate_vertices, annotations_t
@ -21,7 +21,7 @@ class PathCap(Enum):
# # defined by path.cap_extensions
class Path(Shape, metaclass=AutoSlots):
class Path(Shape):
"""
A path, consisting of a bunch of vertices (Nx2 ndarray), a width, an end-cap shape,
and an offset.

View file

@ -6,13 +6,13 @@ from numpy import pi
from numpy.typing import NDArray, ArrayLike
from . import Shape, normalized_shape_tuple
from .. import PatternError
from ..error import PatternError
from ..repetition import Repetition
from ..utils import is_scalar, rotation_matrix_2d, layer_t, AutoSlots
from ..utils import is_scalar, rotation_matrix_2d, layer_t
from ..utils import remove_colinear_vertices, remove_duplicate_vertices, annotations_t
class Polygon(Shape, metaclass=AutoSlots):
class Polygon(Shape):
"""
A polygon, consisting of a bunch of vertices (Nx2 ndarray) which specify an
implicitly-closed boundary, and an offset.

View file

@ -6,10 +6,10 @@ from numpy import pi, inf
from numpy.typing import NDArray, ArrayLike
from . import Shape, Polygon, normalized_shape_tuple
from .. import PatternError
from ..error import PatternError
from ..repetition import Repetition
from ..traits import RotatableImpl
from ..utils import is_scalar, get_bit, normalize_mirror, layer_t, AutoSlots
from ..utils import is_scalar, get_bit, normalize_mirror, layer_t
from ..utils import annotations_t
# Loaded on use:
@ -17,7 +17,7 @@ from ..utils import annotations_t
# from matplotlib.path import Path
class Text(RotatableImpl, Shape, metaclass=AutoSlots):
class Text(RotatableImpl, Shape):
"""
Text (to be printed e.g. as a set of polygons).
This is distinct from non-printed Label objects.