2222"""
2323
2424from __future__ import with_statement
25- from functools import wraps
26- import warnings
27- import operator
25+
2826import math
27+ import operator
28+ import warnings
29+ from functools import wraps
2930
3031from OCC .Core .BRep import BRep_Tool
3132from OCC .Core .BRepAdaptor import BRepAdaptor_Curve
33+ from OCC .Core .BRepBuilderAPI import (BRepBuilderAPI_FindPlane , BRepBuilderAPI_MakeEdge , BRepBuilderAPI_MakeEdge2d ,
34+ BRepBuilderAPI_MakeFace , BRepBuilderAPI_MakePolygon , BRepBuilderAPI_MakeShell ,
35+ BRepBuilderAPI_MakeSolid , BRepBuilderAPI_MakeVertex , BRepBuilderAPI_MakeWire ,
36+ BRepBuilderAPI_Sewing , BRepBuilderAPI_Transform )
3237from OCC .Core .BRepOffset import BRepOffset_Skin
38+ from OCC .Core .BRepOffsetAPI import BRepOffsetAPI_MakeEvolved
39+ from OCC .Core .BRepPrimAPI import BRepPrimAPI_MakeBox , BRepPrimAPI_MakePrism
3340from OCC .Core .Geom import Geom_TrimmedCurve
41+ from OCC .Core .GeomAbs import (GeomAbs_Arc , GeomAbs_C0 , GeomAbs_C1 , GeomAbs_C2 , GeomAbs_Intersection , GeomAbs_Tangent )
3442from OCC .Core .GeomConvert import GeomConvert_ApproxCurve
3543from OCC .Core .GeomLProp import GeomLProp_SLProps
36- from OCC .Core .BRepBuilderAPI import (
37- BRepBuilderAPI_MakeFace ,
38- BRepBuilderAPI_Transform ,
39- BRepBuilderAPI_Sewing ,
40- BRepBuilderAPI_MakePolygon ,
41- BRepBuilderAPI_MakeWire ,
42- BRepBuilderAPI_MakeSolid ,
43- BRepBuilderAPI_MakeShell ,
44- BRepBuilderAPI_MakeEdge2d ,
45- BRepBuilderAPI_MakeEdge ,
46- BRepBuilderAPI_MakeVertex ,
47- BRepBuilderAPI_FindPlane ,
48- )
49- from OCC .Core .BRepPrimAPI import BRepPrimAPI_MakeBox , BRepPrimAPI_MakePrism
50- from OCC .Core .BRepOffsetAPI import BRepOffsetAPI_MakeEvolved
51- from OCC .Core .GeomAbs import (
52- GeomAbs_Arc ,
53- GeomAbs_C2 ,
54- GeomAbs_C0 ,
55- GeomAbs_Tangent ,
56- GeomAbs_Intersection ,
57- GeomAbs_G1 ,
58- GeomAbs_G2 ,
59- GeomAbs_C1 ,
60- )
44+ from OCC .Core .TColgp import TColgp_HArray1OfPnt , TColgp_SequenceOfVec
6145from OCC .Core .TopAbs import TopAbs_REVERSED
62- from OCC .Core .TopoDS import (
63- TopoDS_Wire ,
64- TopoDS_Solid ,
65- TopoDS_Vertex ,
66- TopoDS_Shape ,
67- TopoDS_Builder ,
68- TopoDS_Compound ,
69- )
70- from OCC .Core .TColgp import TColgp_SequenceOfVec , TColgp_HArray1OfPnt
71- from OCC .Core .gp import (
72- gp_Vec ,
73- gp_Pnt ,
74- gp_Dir ,
75- gp_Trsf ,
76- gp_Ax1 ,
77- gp_Quaternion ,
78- gp_Circ ,
79- gp_Pln ,
80- )
81-
82- from OCCUtils .Common import (
83- TOLERANCE ,
84- assert_isdone ,
85- to_tcol_ ,
86- to_adaptor_3d ,
87- vertex2pnt ,
88- smooth_pnts ,
89- points_to_bspline ,
90- project_point_on_curve ,
91- )
92- from OCCUtils .types_lut import ShapeToTopology
93- from OCCUtils .Topology import Topo
46+ from OCC .Core .TopoDS import (TopoDS_Builder , TopoDS_Compound , TopoDS_Shape , TopoDS_Vertex , TopoDS_Wire )
47+ from OCC .Core .gp import (gp_Ax1 , gp_Circ , gp_Dir , gp_Pln , gp_Pnt , gp_Quaternion , gp_Trsf , gp_Vec )
9448
49+ from ..OCCUtils .Common import (TOLERANCE , assert_isdone , points_to_bspline , project_point_on_curve , smooth_pnts ,
50+ to_adaptor_3d , to_tcol_ , vertex2pnt )
51+ from ..OCCUtils .Topology import Topo
52+ from ..OCCUtils .types_lut import ShapeToTopology
9553
9654EPSILON = TOLERANCE = 1e-6
9755ST = ShapeToTopology ()
@@ -587,7 +545,7 @@ def make_n_sections(edges):
587545
588546
589547def make_coons (edges ):
590- from OCC .GeomFill import GeomFill_BSplineCurves , GeomFill_StretchStyle
548+ from OCC .Core . GeomFill import GeomFill_BSplineCurves , GeomFill_StretchStyle
591549
592550 if len (edges ) == 4 :
593551 spl1 , spl2 , spl3 , spl4 = edges
@@ -852,7 +810,7 @@ def face_normal(face):
852810
853811
854812def face_from_plane (_geom_plane , lowerLimit = - 1000 , upperLimit = 1000 ):
855- from OCC .Geom import Geom_RectangularTrimmedSurface
813+ from OCC .Core . Geom import Geom_RectangularTrimmedSurface
856814
857815 _trim_plane = make_face (
858816 Geom_RectangularTrimmedSurface (
@@ -878,7 +836,7 @@ def fit_plane_through_face_vertices(_face):
878836 :param _face: OCC.KBE.face.Face instance
879837 :return: Geom_Plane
880838 """
881- from OCC .GeomPlate import GeomPlate_BuildAveragePlane
839+ from OCC .Core . GeomPlate import GeomPlate_BuildAveragePlane
882840
883841 uvs_from_vertices = [
884842 _face .project_vertex (vertex2pnt (i )) for i in Topo (_face ).vertices ()
@@ -903,7 +861,7 @@ def project_edge_onto_plane(edg, plane):
903861 :param plane: Geom_Plane
904862 :return: TopoDS_Edge projected on the plane
905863 """
906- from OCC .GeomProjLib import geomprojlib_ProjectOnPlane
864+ from OCC .Core . GeomProjLib import geomprojlib_ProjectOnPlane
907865
908866 proj = geomprojlib_ProjectOnPlane (
909867 edg .adaptor .Curve ().Curve (), plane , plane .Axis ().Direction (), 1
0 commit comments