Skip to content

Commit a81d034

Browse files
scottshambaughAlexanderFabischnmayorov
authored
ENH: spatial.transform: baseline implementation of RigidTransform (scipy#22267)
* Draft baseline implementation for ProperRigidTransformations * ENH: Implement ProperRigidTransformation.from_expcoords * DOC: Document shape of expcoords * DOC: More information on exp. coordinate convention * ENH: Check input shape of expcoords * TST: Add test for individual components * Fix Transformation __pow__ * TST: additional tests for from_expcoords * ENH: Implement ProperRigidTransformation.as_expcoords() * TST: test ProperRigidTransformation.as_expcoords * Change from_transrot to from_rottrans, added as_rottrans * tests for internal consistency * Normalize rotation matrix input for proper rigid transformations * Rename ProperRigidTransformation to RigidTransformation * RigidTransformation docs * Fix doc build errors * More RigidTransformation docs * More docs * docs cleanup * Finish up first pass at docs * fix refguide checks * more docs updates tweak * ENH: Implement RigidTransformation.as_dualquat() * ENH: implement RigidTransformation.from_dualquat() * TST: Test RigidTransformation.from/as_dualquat * ENH: reuse _compose_quat from _rotation.pyx * TST: Test conversion of pure translation dualquats * TST: test multiple dualquats * DOC: Document from_expcoords * DOC: examples of how to use dualquat/expcoords * Docs cleanup * more docs cleanup * Docs fixes * build errors * RigidTransformation __repr__ * docs tweaks * tests tweaks * DOC: Add more examples for exp. coordinates * File rename * Code review updates * docs tweak * reshuffle method order * rename methods * Exact check for last row of transformation matrix * rename doc variables t -> tf, d -> t * More tests * ENH: normalize dual quaternions * MAINT: extract dual quaternion operations * RigidTransformation.*_rot_trans renamed to *_components * Input validation for from_rotation * TST: enforce unit norm of dual quaternion * TST: test orthogonality after normalization * TST: from_dual_quat with precision loss * Extract function * BUG: fix array shape * MAINT: vectorize dual quaternion normalization * MAINT: cdef internal function * DOC: document that we normalize dual quaternions * argument order * ENH: Robust implementation of RigidTransformation.from_exp_coords * ENH: Robust implementation of RigidTransformation.as_exp_coords * MNT: Minor adjustment in RigidTransformation.from_exp_coords * TST: Improve tests for exp_coords * TST: Move exp_coords reciprocity test into test_from_as_internal_consistency * DOC: Document exp_coords helper functions * TST: test special case of invalid dual quaternion * Code review updates * code review updates * More efficient orthonormalization * More efficient inversion * Remove RigidTransformation.random() * Use Rotation.from_matrix for transformation matrix normalization * Test for left-handed rotation matrix * Remove normalization checks for speed in RigidTransformation * docstring * DOC: remove confusing explanation of exp. coords * Faster quaternion conjugate * DOC: More details on SE3 exponential mapping * DOC: Adjustments for from_exp_coords docstring * docstring * DOC: More adjustments to from_exp_coords docstring * DOC: Clarify expected input for `from_exp_coords` * Implement RigidTransformation fractional powers * Rename RigidTransformation to RigidTransform * rename rigid transform files * pow docstring * docstring * pow docstring * test for pow equivalence with rotations --------- Co-authored-by: Scott Shambaugh <[email protected]> Co-authored-by: Alexander Fabisch <[email protected]> Co-authored-by: Nikolay Mayorov <[email protected]>
1 parent e802233 commit a81d034

File tree

7 files changed

+2868
-3
lines changed

7 files changed

+2868
-3
lines changed

mypy.ini

+3
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ ignore_missing_imports = True
192192
[mypy-scipy.spatial.transform._rotation]
193193
ignore_missing_imports = True
194194

195+
[mypy-scipy.spatial.transform._rigid_transform]
196+
ignore_missing_imports = True
197+
195198
[mypy-scipy.fft._pocketfft.pypocketfft]
196199
ignore_missing_imports = True
197200

scipy/spatial/transform/__init__.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,27 @@
44
55
.. currentmodule:: scipy.spatial.transform
66
7-
This package implements various spatial transformations. For now,
8-
only rotations are supported.
7+
This package implements various spatial transformations. For now, rotations
8+
and rigid transforms (rotations and translations) are supported.
99
1010
Rotations in 3 dimensions
1111
-------------------------
1212
.. autosummary::
1313
:toctree: generated/
1414
15+
RigidTransform
1516
Rotation
1617
Slerp
1718
RotationSpline
1819
"""
20+
from ._rigid_transform import RigidTransform
1921
from ._rotation import Rotation, Slerp
2022
from ._rotation_spline import RotationSpline
2123

2224
# Deprecated namespaces, to be removed in v2.0.0
2325
from . import rotation
2426

25-
__all__ = ['Rotation', 'Slerp', 'RotationSpline']
27+
__all__ = ['Rotation', 'Slerp', 'RotationSpline', 'RigidTransform']
2628

2729
from scipy._lib._testutils import PytestTester
2830
test = PytestTester(__name__)

0 commit comments

Comments
 (0)