Пример #1
0
def face_normal(face):
    from OCC.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
Пример #2
0
def face_normal(face):
    from OCC.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
Пример #3
0
def face_normal(face: TopoDS_Face) -> gp_Dir:
    """

    :param face:
    :return:
    """
    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
Пример #4
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
Пример #5
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
Пример #6
0
 def domain(self):
     '''the u,v domain of the curve
     :return: UMin, UMax, VMin, VMax
     '''
     return breptools_UVBounds(self)
Пример #7
0
 def domain(self):
     '''the u,v domain of the curve
     :return: UMin, UMax, VMin, VMax
     '''
     return breptools_UVBounds(self)
Пример #8
0
    def _uvBounds(self):

        return breptools_UVBounds(self.wrapped)
Пример #9
0
 def domain(self) -> Tuple[float, float, float, float]:
     """the u,v domain of the curve
     :return: UMin, UMax, VMin, VMax
     """
     return breptools_UVBounds(self)