1616##along with pythonOCC. If not, see <http://www.gnu.org/licenses/>
1717
1818'''
19- Sketch for a high-level API for pythonOCC
20-
2119Please note the following;
2220@readonly
2321means that the decorated method is a readonly descriptor
3634Can be a module, class or namespace.
3735
3836'''
39- # occ
37+
38+ import functools
39+
4040from OCC .BRepBuilderAPI import BRepBuilderAPI_Copy
41- from OCC .BRepGProp import brepgprop_VolumeProperties , brepgprop_LinearProperties , brepgprop_SurfaceProperties
42- from OCC .BRepCheck import *
43- # occ high level
41+ from OCC .BRepGProp import (brepgprop_VolumeProperties ,
42+ brepgprop_LinearProperties ,
43+ brepgprop_SurfaceProperties )
44+ from OCC .BRepCheck import (BRepCheck_Vertex , BRepCheck_Edge , BRepCheck_Wire ,
45+ BRepCheck_Face , BRepCheck_Shell , BRepCheck_Analyzer )
46+ from OCC .GProp import GProp_GProps
4447from OCC .Display .SimpleGui import init_display
45- from Construct import *
46- # KBE
47- from types_lut import shape_lut , topo_lut , orient_lut , state_lut , curve_lut , surface_lut
48- # stdlib
49- import functools
5048
49+ from OCCUtils .Common import get_boundingbox
50+ from OCCUtils .Construct import (make_vertex , TOLERANCE )
51+ from OCCUtils .types_lut import shape_lut , topo_lut , curve_lut , surface_lut
5152
5253#===========================================================================
5354# DISPLAY
@@ -71,7 +72,7 @@ def __call__(self, *args, **kwargs):
7172class Display (object ):
7273 def __init__ (self ):
7374 self .display , self .start_display , self .add_menu , self .add_function_to_menu = init_display ()
74-
75+
7576 def __call__ (self , * args , ** kwargs ):
7677 return self .display .DisplayShape (* args , ** kwargs )
7778
@@ -80,14 +81,13 @@ def __call__(self, *args, **kwargs):
8081#============
8182
8283
83- class KbeObject (object ):
84- """base class for all KBE objects"""
85- def __init__ (self , name = None ):
86- """Constructor for KbeObject"""
84+ class BaseObject (object ):
85+ """base class for all objects"""
86+ def __init__ (self , name = None , tolerance = TOLERANCE ):
8787 self .GlobalProperties = GlobalProperties (self )
8888 self .name = name
8989 self ._dirty = False
90- self .tolerance = TOLERANCE
90+ self .tolerance = tolerance
9191 self .display_set = False
9292
9393 @property
@@ -180,7 +180,7 @@ def __eq__(self, other):
180180 return self .IsEqual (other )
181181
182182 def __ne__ (self , other ):
183- return not ( self .__eq__ (other ) )
183+ return not self .__eq__ (other )
184184
185185
186186class GlobalProperties (object ):
@@ -222,12 +222,3 @@ def bbox(self):
222222 returns the bounding box of the face
223223 '''
224224 return get_boundingbox (self .instance )
225-
226- def oriented_bbox (self ):
227- """
228- return the minimal bounding box
229-
230- has dependencies with scipy.spatial
231- [ has an implementation at hb-robo-code ]
232- """
233- pass
0 commit comments