diff --git a/src/ezdxf/math/circle.py b/src/ezdxf/math/circle.py index 5ef35e979..1f25a51eb 100644 --- a/src/ezdxf/math/circle.py +++ b/src/ezdxf/math/circle.py @@ -37,7 +37,7 @@ def __str__(self) -> str: return f"ConstructionCircle({self.center}, {self.radius})" @staticmethod - def from_3p(p1: UVec, p2: UVec, p3: UVec) -> "ConstructionCircle": + def from_3p(p1: UVec, p2: UVec, p3: UVec) -> ConstructionCircle: """Creates a circle from three points, all points have to be compatible to :class:`Vec2` class. """ @@ -52,7 +52,7 @@ def from_3p(p1: UVec, p2: UVec, p3: UVec) -> "ConstructionCircle": return ConstructionCircle(center, center.distance(_p1)) @property - def bounding_box(self) -> "BoundingBox2d": + def bounding_box(self) -> BoundingBox2d: """2D bounding box of circle as :class:`BoundingBox2d` object.""" rvec = Vec2((self.radius, self.radius)) return BoundingBox2d((self.center - rvec, self.center + rvec)) diff --git a/src/ezdxf/math/line.py b/src/ezdxf/math/line.py index 50d69f975..366331434 100644 --- a/src/ezdxf/math/line.py +++ b/src/ezdxf/math/line.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010-2022, Manfred Moitzi +# Copyright (c) 2010-2024, Manfred Moitzi # License: MIT License from __future__ import annotations from typing import Optional @@ -108,7 +108,7 @@ def __repr__(self) -> str: "angle={0.angle:.5f})".format(self) ) - def is_parallel(self, other: "ConstructionRay") -> bool: + def is_parallel(self, other: ConstructionRay) -> bool: """Returns ``True`` if rays are parallel.""" if self._is_vertical: return other._is_vertical @@ -119,7 +119,7 @@ def is_parallel(self, other: "ConstructionRay") -> bool: # guards above guarantee that no slope is None return math.isclose(self._slope, other._slope, abs_tol=ABS_TOL) # type: ignore - def intersect(self, other: "ConstructionRay") -> Vec2: + def intersect(self, other: ConstructionRay) -> Vec2: """Returns the intersection point as ``(x, y)`` tuple of `self` and `other`. @@ -158,7 +158,7 @@ def intersect(self, other: "ConstructionRay") -> Vec2: y = ray1.yof(x) return Vec2((x, y)) - def orthogonal(self, location: UVec) -> "ConstructionRay": + def orthogonal(self, location: UVec) -> ConstructionRay: """Returns orthogonal ray at `location`.""" return ConstructionRay(location, angle=self.angle + HALF_PI) @@ -188,7 +188,7 @@ def xof(self, y: float) -> float: else: raise ArithmeticError - def bisectrix(self, other: "ConstructionRay") -> "ConstructionRay": + def bisectrix(self, other: ConstructionRay) -> ConstructionRay: """Bisectrix between `self` and `other`.""" intersection = self.intersect(other) alpha = (self.angle + other.angle) / 2.0 @@ -260,7 +260,7 @@ def length(self) -> float: """Returns length of line.""" return (self.end - self.start).magnitude - def midpoint(self) -> "Vec2": + def midpoint(self) -> Vec2: """Returns mid point of line.""" return self.start.lerp(self.end) @@ -279,8 +279,8 @@ def inside_bounding_box(self, point: UVec) -> bool: return self.bounding_box.inside(point) def intersect( - self, other: "ConstructionLine", abs_tol: float = TOLERANCE - ) -> Optional["Vec2"]: + self, other: ConstructionLine, abs_tol: float = TOLERANCE + ) -> Optional[Vec2]: """Returns the intersection point of to lines or ``None`` if they have no intersection point. @@ -297,7 +297,7 @@ def intersect( ) def has_intersection( - self, other: "ConstructionLine", abs_tol: float = TOLERANCE + self, other: ConstructionLine, abs_tol: float = TOLERANCE ) -> bool: """Returns ``True`` if has intersection with `other` line.""" return self.intersect(other, abs_tol=abs_tol) is not None