コード例 #1
0
ファイル: Construct.py プロジェクト: jf---/pythonocc-utils
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
ファイル: Construct.py プロジェクト: psavine42/OCCUtilsExt
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
ファイル: face.py プロジェクト: Closius/pythonocc-utils
 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
ファイル: face.py プロジェクト: tpaviot/pythonocc-utils
 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
ファイル: face.py プロジェクト: Closius/pythonocc-utils
 def domain(self):
     '''the u,v domain of the curve
     :return: UMin, UMax, VMin, VMax
     '''
     return breptools_UVBounds(self)
コード例 #7
0
ファイル: face.py プロジェクト: tpaviot/pythonocc-utils
 def domain(self):
     '''the u,v domain of the curve
     :return: UMin, UMax, VMin, VMax
     '''
     return breptools_UVBounds(self)
コード例 #8
0
ファイル: shapes.py プロジェクト: fragmuffin/cadquery
    def _uvBounds(self):

        return breptools_UVBounds(self.wrapped)
コード例 #9
0
ファイル: face.py プロジェクト: psavine42/OCCUtilsExt
 def domain(self) -> Tuple[float, float, float, float]:
     """the u,v domain of the curve
     :return: UMin, UMax, VMin, VMax
     """
     return breptools_UVBounds(self)