mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
util.shape - move typing stuff to TYPE_CHECKING block
This commit is contained in:
@@ -16,28 +16,36 @@
|
|||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
from math import cos, radians
|
from math import cos, radians
|
||||||
from typing import Literal, Optional, Union
|
from typing import TYPE_CHECKING, Literal, Optional, Union
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import numpy.typing as npt
|
import numpy.typing as npt
|
||||||
import shapely
|
import shapely
|
||||||
import shapely.ops
|
import shapely.ops
|
||||||
|
|
||||||
import ifcopenshell.ifcopenshell_wrapper as W
|
|
||||||
import ifcopenshell.util.element
|
import ifcopenshell.util.element
|
||||||
import ifcopenshell.util.placement
|
import ifcopenshell.util.placement
|
||||||
import ifcopenshell.util.representation
|
import ifcopenshell.util.representation
|
||||||
from ifcopenshell.geom import ShapeElementType
|
|
||||||
from ifcopenshell.util.shape_builder import VectorType
|
|
||||||
|
|
||||||
tol = 1e-6
|
if TYPE_CHECKING:
|
||||||
AXIS_LITERAL = Literal["X", "Y", "Z"]
|
|
||||||
VECTOR_3D = tuple[float, float, float]
|
|
||||||
|
|
||||||
|
import ifcopenshell.ifcopenshell_wrapper as W
|
||||||
|
from ifcopenshell.geom import ShapeElementType
|
||||||
|
from ifcopenshell.util.shape_builder import VectorType
|
||||||
|
|
||||||
|
AXIS_LITERAL = Literal["X", "Y", "Z"]
|
||||||
|
|
||||||
|
VECTOR_3D = tuple[float, float, float]
|
||||||
|
|
||||||
|
# Used only for typing, but reused by `shape.py` users.
|
||||||
MatrixType = npt.NDArray[np.float64]
|
MatrixType = npt.NDArray[np.float64]
|
||||||
"""`npt.NDArray[np.float64]`"""
|
"""`npt.NDArray[np.float64]`"""
|
||||||
|
|
||||||
|
tol = 1e-6
|
||||||
|
|
||||||
# NOTE: See IfcGeomRepresentation.h for W.Triangulation buffer types.
|
# NOTE: See IfcGeomRepresentation.h for W.Triangulation buffer types.
|
||||||
|
|
||||||
# NOTE: For functions that return a single scalar ensure to use .item() to
|
# NOTE: For functions that return a single scalar ensure to use .item() to
|
||||||
|
|||||||
Reference in New Issue
Block a user