Skip to content

Commit 022ec50

Browse files
committed
Updated doc strings for both Geometry.align_center and CompoundGeometry.align_center
1 parent 456d3f3 commit 022ec50

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

sectionproperties/pre/geometry.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22
from ntpath import join
3-
from typing import List, Optional, Union, Tuple, Any
3+
from typing import List, Optional, Union, Tuple, List, Any
44

55
import copy
66
import math
@@ -479,15 +479,16 @@ def align_to(
479479

480480
return new_geom
481481

482-
def align_center(self, align_to: Optional[Geometry] = None):
482+
def align_center(self, align_to: Optional[Union[Geometry, Tuple[float, float]]] = None):
483483
"""
484484
Returns a new Geometry object, translated in both x and y, so that the
485-
center-point of the new object's centroid will be aligned with
486-
centroid of the object in 'align_to'. If 'align_to' is None then the new
487-
object will be aligned with it's centroid at the origin.
485+
the new object's centroid will be aligned with the centroid of the object
486+
in 'align_to'. If 'align_to' is an x, y coordinate, then the centroid will
487+
be aligned to the coordinate. If 'align_to' is None then the new
488+
object will be aligned with its centroid at the origin.
488489
489490
:param align_to: Another Geometry to align to or None (default is None)
490-
:type align_to: Optional[:class:`~sectionproperties.pre.geometry.Geometry`]
491+
:type align_to: Optional[Union[:class:`~sectionproperties.pre.geometry.Geometry`, Tuple[float, float]]]
491492
492493
:return: Geometry object translated to new alignment
493494
:rtype: :class:`~sectionproperties.pre.geometry.Geometry`
@@ -1569,21 +1570,22 @@ def mirror_section(
15691570
return new_geom
15701571

15711572
def align_center(
1572-
self, align_to: Optional[Union[Geometry, List[float, float]]] = None
1573+
self, align_to: Optional[Union[Geometry, Tuple[float, float]]] = None
15731574
):
15741575
"""
15751576
Returns a new CompoundGeometry object, translated in both x and y, so that the
15761577
center-point of the new object's material-weighted centroid will be aligned with
1577-
centroid of the object in 'align_to'. If 'align_to' is None then the new
1578-
object will be aligned with it's centroid at the origin.
1578+
centroid of the object in 'align_to'. If 'align_to' is an x, y coordinate, then
1579+
the centroid will be aligned to the coordinate. If 'align_to' is None then the new
1580+
object will be aligned with its centroid at the origin.
15791581
15801582
Note: The material-weighted centroid refers to when individual geometries within
15811583
the CompoundGeometry object have been assigned differing materials. The centroid
15821584
of the compound geometry is calculated by using the E modulus of each
15831585
geometry's assigned material.
15841586
15851587
:param align_to: Another Geometry to align to, an xy coordinate, or None (default is None)
1586-
:type align_to: Optional[:class:`~sectionproperties.pre.geometry.Geometry`, List[float, float]]
1588+
:type align_to: Optional[Union[:class:`~sectionproperties.pre.geometry.Geometry`, Tuple[float, float]]]
15871589
15881590
:return: Geometry object translated to new alignment
15891591
:rtype: :class:`~sectionproperties.pre.geometry.Geometry`

0 commit comments

Comments
 (0)