|
1 | 1 | from __future__ import annotations |
2 | 2 | from ntpath import join |
3 | | -from typing import List, Optional, Union, Tuple, Any |
| 3 | +from typing import List, Optional, Union, Tuple, List, Any |
4 | 4 |
|
5 | 5 | import copy |
6 | 6 | import math |
@@ -479,15 +479,16 @@ def align_to( |
479 | 479 |
|
480 | 480 | return new_geom |
481 | 481 |
|
482 | | - def align_center(self, align_to: Optional[Geometry] = None): |
| 482 | + def align_center(self, align_to: Optional[Union[Geometry, Tuple[float, float]]] = None): |
483 | 483 | """ |
484 | 484 | 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. |
488 | 489 |
|
489 | 490 | :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]]] |
491 | 492 |
|
492 | 493 | :return: Geometry object translated to new alignment |
493 | 494 | :rtype: :class:`~sectionproperties.pre.geometry.Geometry` |
@@ -1569,21 +1570,22 @@ def mirror_section( |
1569 | 1570 | return new_geom |
1570 | 1571 |
|
1571 | 1572 | 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 |
1573 | 1574 | ): |
1574 | 1575 | """ |
1575 | 1576 | Returns a new CompoundGeometry object, translated in both x and y, so that the |
1576 | 1577 | 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. |
1579 | 1581 |
|
1580 | 1582 | Note: The material-weighted centroid refers to when individual geometries within |
1581 | 1583 | the CompoundGeometry object have been assigned differing materials. The centroid |
1582 | 1584 | of the compound geometry is calculated by using the E modulus of each |
1583 | 1585 | geometry's assigned material. |
1584 | 1586 |
|
1585 | 1587 | :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]]] |
1587 | 1589 |
|
1588 | 1590 | :return: Geometry object translated to new alignment |
1589 | 1591 | :rtype: :class:`~sectionproperties.pre.geometry.Geometry` |
|
0 commit comments