# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+import math
from ModelAPI import *
from GeomAPI import *
def isOk(self, theShape, theResult, theArgs):
""" True if theShape is applicable for the filter """
- selectedShapeAttr = modelAPI_AttributeSelection(theArgs.argument("SameNormalFaces"))
+ selectedShapeAttr = modelAPI_AttributeSelection(theArgs.argument("Face"))
if selectedShapeAttr is None:
return False
selectedShape = selectedShapeAttr.value()
Face = GeomAPI_Face(theShape)
if not Face.isPlanar():
- return self.myCached[selectedShape]
+ return False
Plane = Face.getPlane()
Normal = Plane.direction()
if selectedPlane.intersect(Plane) is None and selectedNormal.angle(Normal) < math.pi/360:
def initAttributes(self, theArgs):
""" Initializes arguments of a filter """
- theArgs.initAttribute("SameNormalFaces", ModelAPI_AttributeSelection_typeId())
+ theArgs.initAttribute("Face", ModelAPI_AttributeSelection_typeId())
def adjacentFaces(self, theFace, theMapSA, theShapeType, theApplicableFaces, theRecursive = True):
""" Find all faces neighbour to theFace """