1 # -*- coding: utf-8 -*-
4 from geomsmesh import geompy
6 from whichSide import whichSide
8 # -----------------------------------------------------------------------------
9 # --- renvoie l'extraction des shapes d'un objet selon leur position par rapport à la face.
11 def extractionOrientee(face, obj, ref, shapeType, tol, prefix=""):
13 renvoie l'extraction des shapes d'un objet selon leur position
14 par rapport à la face.
15 shapeType in ["VERTEX", "EDGE", "FACE",...]
19 sideRef = whichSide(face, ref)
20 logging.debug("ref side %s", sideRef)
24 shapes = geompy.ExtractShapes(obj, geompy.ShapeType[shapeType], False)
28 prefix = prefix + shapeType
30 side = whichSide(face, shape, tol)
32 shapesInside.append(shape)
34 name = prefix + "_Inside%d"%i
35 geompy.addToStudyInFather(obj, shape, name)
37 elif side == -sideRef:
38 shapesOutside.append(shape)
40 name = prefix + "_Outside%d"%j
41 geompy.addToStudyInFather(obj, shape, name)
44 shapesOnside.append(shape)
46 name = prefix + "_Onside%d"%k
47 geompy.addToStudyInFather(obj, shape, name)
49 logging.debug("--- shape was %s", name)
50 return [shapesInside, shapesOutside, shapesOnside]