1 # -*- coding: utf-8 -*-
4 from .geomsmesh import geompy
5 from .geomsmesh import geomPublish
6 from .geomsmesh import geomPublishInFather
9 from .whichSide import whichSide
11 # -----------------------------------------------------------------------------
12 # --- renvoie l'extraction des shapes d'un objet selon leur position par rapport à la face.
14 def extractionOrientee(face, obj, ref, shapeType, tol, prefix=""):
16 renvoie l'extraction des shapes d'un objet selon leur position
17 par rapport à la face.
18 shapeType in ["VERTEX", "EDGE", "FACE",...]
22 sideRef = whichSide(face, ref)
23 logging.debug("ref side %s", sideRef)
27 shapes = geompy.ExtractShapes(obj, geompy.ShapeType[shapeType], False)
31 prefix = prefix + shapeType
33 side = whichSide(face, shape, tol)
35 shapesInside.append(shape)
37 name = prefix + "_Inside%d"%i
38 geomPublishInFather(initLog.debug, obj, shape, name)
40 elif side == -sideRef:
41 shapesOutside.append(shape)
43 name = prefix + "_Outside%d"%j
44 geomPublishInFather(initLog.debug, obj, shape, name)
47 shapesOnside.append(shape)
49 name = prefix + "_Onside%d"%k
50 geomPublishInFather(initLog.debug, obj, shape, name)
52 logging.debug("--- shape was %s", name)
53 return [shapesInside, shapesOutside, shapesOnside]