mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
typing
This commit is contained in:
@@ -33,14 +33,14 @@ def _has_occ():
|
||||
# Previous versions (pythonocc<=0.17.3) are using just OCC.
|
||||
|
||||
try:
|
||||
import OCC.Core.BRepTools
|
||||
import OCC.Core.BRepTools # pyright: ignore[reportMissingImports]
|
||||
|
||||
return True
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
import OCC.BRepTools # noqa: F401
|
||||
import OCC.BRepTools # noqa: F401 # pyright: ignore[reportMissingImports]
|
||||
|
||||
return True
|
||||
except ImportError:
|
||||
|
||||
@@ -28,7 +28,7 @@ from ..file import file
|
||||
from . import has_occ
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from OCC.Core import TopoDS
|
||||
from OCC.Core import TopoDS # pyright: ignore[reportMissingImports]
|
||||
|
||||
IteratorOutput = Union["ShapeElementType", "utils.shape_tuple"]
|
||||
|
||||
@@ -47,9 +47,9 @@ if has_occ:
|
||||
from . import occ_utils as utils
|
||||
|
||||
try:
|
||||
from OCC.Core import TopoDS
|
||||
from OCC.Core import TopoDS # pyright: ignore[reportMissingImports]
|
||||
except ImportError:
|
||||
from OCC import TopoDS
|
||||
from OCC import TopoDS # pyright: ignore[reportMissingImports]
|
||||
|
||||
def wrap_shape_creation(settings: settings, shape: ifcopenshell_wrapper.Element):
|
||||
if getattr(settings, "use_python_opencascade", False):
|
||||
|
||||
@@ -26,17 +26,17 @@ import warnings
|
||||
from collections.abc import Iterable
|
||||
from typing import NamedTuple, Union
|
||||
|
||||
import OCC
|
||||
import OCC # pyright: ignore[reportMissingImports]
|
||||
from typing_extensions import assert_never
|
||||
|
||||
import ifcopenshell.ifcopenshell_wrapper as ifcopenshell_wrapper
|
||||
|
||||
try:
|
||||
from OCC.Core import AIS, BRepTools, Graphic3d, Quantity, TopoDS, V3d, gp
|
||||
from OCC.Core import AIS, BRepTools, Graphic3d, Quantity, TopoDS, V3d, gp # pyright: ignore[reportMissingImports]
|
||||
|
||||
USE_OCCT_HANDLE = False
|
||||
except ImportError:
|
||||
from OCC import AIS, BRepTools, Graphic3d, Quantity, TopoDS, V3d, gp
|
||||
from OCC import AIS, BRepTools, Graphic3d, Quantity, TopoDS, V3d, gp # pyright: ignore[reportMissingImports]
|
||||
|
||||
USE_OCCT_HANDLE = True
|
||||
|
||||
@@ -68,7 +68,7 @@ DEFAULT_STYLES = {
|
||||
|
||||
|
||||
def initialize_display():
|
||||
import OCC.Display.SimpleGui
|
||||
import OCC.Display.SimpleGui # pyright: ignore[reportMissingImports]
|
||||
|
||||
global handle, main_loop, add_menu, add_function_to_menu
|
||||
handle, main_loop, add_menu, add_function_to_menu = OCC.Display.SimpleGui.init_display()
|
||||
|
||||
Reference in New Issue
Block a user