diff --git a/src/ezdxf/math/_bezier3p.py b/src/ezdxf/math/_bezier3p.py index 29f046d42..e99d772fc 100644 --- a/src/ezdxf/math/_bezier3p.py +++ b/src/ezdxf/math/_bezier3p.py @@ -2,7 +2,6 @@ # License: MIT License from __future__ import annotations from typing import ( - Iterable, Iterator, Sequence, Optional, @@ -31,14 +30,11 @@ class Bezier3P(Generic[T]): """Implements an optimized quadratic `Bézier curve`_ for exact 3 control points. - Special behavior: - - - 2D control points in, returns 2D results as :class:`~ezdxf.math.Vec2` objects - - 3D control points in, returns 3D results as :class:`~ezdxf.math.Vec3` objects - - Object is immutable. + The class supports points of type :class:`Vec2` and :class:`Vec3` as input, the + class instances are immutable. Args: - defpoints: iterable of definition points as :class:`Vec2` or + defpoints: sequence of definition points as :class:`Vec2` or :class:`Vec3` compatible objects. """ @@ -60,8 +56,7 @@ def __init__(self, defpoints: Sequence[T]): @property def control_points(self) -> Sequence[T]: - """Control points as tuple of :class:`~ezdxf.math.Vec3` or - :class:`~ezdxf.math.Vec2` objects. + """Control points as tuple of :class:`Vec3` or :class:`Vec2` objects. """ # ezdxf optimization: p0 is always (0, 0, 0) p0, p1, p2 = self._control_points @@ -80,7 +75,7 @@ def tangent(self, t: float) -> T: return self._get_curve_tangent(t) def point(self, t: float) -> T: - """Returns point for location `t`` at the Bèzier-curve. + """Returns point for location `t` at the Bèzier-curve. Args: t: curve position in the range ``[0, 1]`` @@ -199,7 +194,7 @@ def transform(self, m: Matrix44) -> Bezier3P[Vec3]: curve and it is always a 3D curve. Args: - m: 4x4 transformation matrix (:class:`ezdxf.math.Matrix44`) + m: 4x4 transformation :class:`Matrix44` """ defpoints = Vec3.generate(self.control_points) diff --git a/src/ezdxf/math/_bezier4p.py b/src/ezdxf/math/_bezier4p.py index c3b138aa2..57c623311 100644 --- a/src/ezdxf/math/_bezier4p.py +++ b/src/ezdxf/math/_bezier4p.py @@ -65,11 +65,11 @@ class Bezier4P(Generic[T]): A `Bézier curve`_ is a parametric curve, parameter `t` goes from 0 to 1, where 0 is the first control point and 1 is the fourth control point. - The class supports the point types `~ezdxf.math.Vec2` and `~ezdxf.math.Vec3`, - and the class instances are immutable. + The class supports points of type :class:`Vec2` and :class:`Vec3` as input, the + class instances are immutable. Args: - defpoints: iterable of definition points as :class:`Vec2` or + defpoints: sequence of definition points as :class:`Vec2` or :class:`Vec3` compatible objects. """ @@ -91,8 +91,7 @@ def __init__(self, defpoints: Sequence[T]): @property def control_points(self) -> Sequence[T]: - """Control points as tuple of :class:`~ezdxf.math.Vec3` or - :class:`~ezdxf.math.Vec2` objects. + """Control points as tuple of :class:`Vec3` or :class:`Vec2` objects. """ # ezdxf optimization: p0 is always (0, 0, 0) p0, p1, p2, p3 = self._control_points @@ -112,7 +111,7 @@ def tangent(self, t: float) -> T: return self._get_curve_tangent(t) def point(self, t: float) -> T: - """Returns point for location `t`` at the Bèzier-curve. + """Returns point for location `t` at the Bèzier-curve. Args: t: curve position in the range ``[0, 1]`` @@ -228,7 +227,7 @@ def transform(self, m: Matrix44) -> Bezier4P[Vec3]: curve as a 3D curve. Args: - m: 4x4 transformation matrix (:class:`ezdxf.math.Matrix44`) + m: 4x4 transformation :class:`Matrix44` """ defpoints = Vec3.generate(self.control_points)