[mirror / flip_across] improve documentation
This commit is contained in:
parent
d40bdb1cb2
commit
abf236a046
3 changed files with 18 additions and 6 deletions
|
|
@ -104,10 +104,12 @@ class Label(PositionableImpl, RepeatableImpl, AnnotatableImpl, Bounded, Pivotabl
|
||||||
|
|
||||||
def flip_across(self, axis: int | None = None, *, x: float | None = None, y: float | None = None) -> Self:
|
def flip_across(self, axis: int | None = None, *, x: float | None = None, y: float | None = None) -> Self:
|
||||||
"""
|
"""
|
||||||
Mirror the object across a line.
|
Flip the label across a line in the pattern's coordinate system.
|
||||||
|
|
||||||
|
This operation mirrors the label's offset relative to the pattern's origin.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
axis: Axis to mirror across. 0 mirrors across x=0. 1 mirrors across y=0.
|
axis: Axis to mirror across. 0 mirrors across y=0. 1 mirrors across x=0.
|
||||||
x: Vertical line x=val to mirror across.
|
x: Vertical line x=val to mirror across.
|
||||||
y: Horizontal line y=val to mirror across.
|
y: Horizontal line y=val to mirror across.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,9 @@ class Port(PivotableImpl, PositionableImpl, Mirrorable, Flippable, Copyable):
|
||||||
|
|
||||||
def flip_across(self, axis: int | None = None, *, x: float | None = None, y: float | None = None) -> Self:
|
def flip_across(self, axis: int | None = None, *, x: float | None = None, y: float | None = None) -> Self:
|
||||||
"""
|
"""
|
||||||
Mirror the object across a line.
|
Mirror the object across a line in the container's coordinate system.
|
||||||
|
|
||||||
|
Note this operation is performed relative to the pattern's origin and modifies the port's offset.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
axis: Axis to mirror across. 0 mirrors across y=0. 1 mirrors across x=0.
|
axis: Axis to mirror across. 0 mirrors across y=0. 1 mirrors across x=0.
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,11 @@ class Mirrorable(metaclass=ABCMeta):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def mirror(self, axis: int = 0) -> Self:
|
def mirror(self, axis: int = 0) -> Self:
|
||||||
"""
|
"""
|
||||||
Mirror the entity across an axis through its origin, ignoring its offset.
|
Mirror the entity across an axis through its origin.
|
||||||
|
|
||||||
|
This operation is performed relative to the object's internal origin (ignoring
|
||||||
|
its offset). For objects like `Polygon` and `Path` where the offset is forced
|
||||||
|
to (0, 0), this is equivalent to mirroring in the container's coordinate system.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
axis: Axis to mirror across (0: x-axis, 1: y-axis).
|
axis: Axis to mirror across (0: x-axis, 1: y-axis).
|
||||||
|
|
@ -70,10 +74,14 @@ class Flippable(Positionable, metaclass=ABCMeta):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def flip_across(self, axis: int | None = None, *, x: float | None = None, y: float | None = None) -> Self:
|
def flip_across(self, axis: int | None = None, *, x: float | None = None, y: float | None = None) -> Self:
|
||||||
"""
|
"""
|
||||||
Mirror the object across a line.
|
Mirror the object across a line in the container's coordinate system.
|
||||||
|
|
||||||
|
Unlike `mirror()`, this operation is performed relative to the container's origin
|
||||||
|
(e.g. the `Pattern` origin, in the case of shapes) and takes the object's offset
|
||||||
|
into account.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
axis: Axis to mirror across. 0 mirrors across x=0. 1 mirrors across y=0.
|
axis: Axis to mirror across. 0 mirrors across y=0. 1 mirrors across x=0.
|
||||||
x: Vertical line x=val to mirror across.
|
x: Vertical line x=val to mirror across.
|
||||||
y: Horizontal line y=val to mirror across.
|
y: Horizontal line y=val to mirror across.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue