Ejemplo n.º 1
0
def face_normal(face):
    from OCCT.BRepTools import breptools_UVBounds
    umin, umax, vmin, vmax = breptools_UVBounds(face)
    surf = BRep_Tool().Surface(face)
    props = GeomLProp_SLProps(surf, (umin+umax)/2., (vmin+vmax)/2., 1, TOLERANCE)
    norm = props.Normal()
    if face.Orientation() == TopAbs_REVERSED:
        norm.Reverse()
    return norm
Ejemplo n.º 2
0
 def is_trimmed(self):
     """
     :return: True if the Wire delimiting the Face lies on the bounds
     of the surface
     if this is not the case, the wire represents a contour that delimits
     the face [ think cookie cutter ]
     and implies that the surface is trimmed
     """
     _round = lambda x: round(x, 3)
     a = map(_round, breptools_UVBounds(self))
     b = map(_round, self.adaptor.Surface().Surface().GetObject().Bounds())
     if a != b:
         print('a,b', a, b)
         return True
     return False
Ejemplo n.º 3
0
 def domain(self):
     '''the u,v domain of the curve
     :return: UMin, UMax, VMin, VMax
     '''
     return breptools_UVBounds(self)