Skip to content

Commit

Permalink
edit doc string
Browse files Browse the repository at this point in the history
  • Loading branch information
mozman committed Jan 5, 2024
1 parent 9936794 commit aca3d9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
17 changes: 6 additions & 11 deletions src/ezdxf/math/_bezier3p.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# License: MIT License
from __future__ import annotations
from typing import (
Iterable,
Iterator,
Sequence,
Optional,
Expand Down Expand Up @@ -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.
"""
Expand All @@ -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
Expand All @@ -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]``
Expand Down Expand Up @@ -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)
Expand Down
13 changes: 6 additions & 7 deletions src/ezdxf/math/_bezier4p.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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
Expand All @@ -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]``
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit aca3d9b

Please sign in to comment.