Skip to content

Commit 35239a7

Browse files
Copilotgonzalocasas
andcommitted
Clarify Shape.transform() docstring per code review feedback
Co-authored-by: gonzalocasas <933277+gonzalocasas@users.noreply.github.com>
1 parent 218d73b commit 35239a7

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/compas/geometry/shapes/shape.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,9 @@ def to_brep(self):
347347
def transform(self, transformation):
348348
"""Transform the shape.
349349
350-
Transformations of a shape are performed by applying the transformation to the frame of the shape,
351-
and by extracting and applying any scale component to the shape's dimensional parameters.
352-
353-
The base implementation in the Shape class only transforms the frame.
354-
Subclasses override this method to also handle scale components appropriately for their geometry.
350+
The base implementation transforms only the frame of the shape.
351+
Subclasses override this method to also extract and apply scale components
352+
from the transformation to their dimensional parameters.
355353
356354
Parameters
357355
----------
@@ -361,6 +359,13 @@ def transform(self, transformation):
361359
Returns
362360
-------
363361
None
362+
363+
Notes
364+
-----
365+
The base Shape class only transforms the frame. Shape subclasses (Box, Sphere,
366+
Cylinder, Cone, Capsule, Torus) override this method to decompose the transformation,
367+
extract the scale component, and apply it appropriately to their dimensions before
368+
transforming the frame.
364369
365370
See Also
366371
--------

0 commit comments

Comments
 (0)