Ejemplo n.º 1
0
 def tol_max(self):
     """
     :return: The minimum global tolerance.
     :rtype: float
     """
     tol = ShapeAnalysis_ShapeTolerance()
     tol.AddTolerance(self.object)
     return tol.GlobalTolerance(1)
Ejemplo n.º 2
0
 def tol_avg(self):
     """
     :return: The average global tolerance.
     :rtype: float
     """
     tol = ShapeAnalysis_ShapeTolerance()
     tol.AddTolerance(self.object)
     return tol.GlobalTolerance(0)
Ejemplo n.º 3
0
    def global_tolerance(shape, mode=0):
        """
        Compute the global tolerance of the shape.

        :param OCCT.TopoDS.TopoDS_Shape shape: The shape.
        :param int mode: Average (0), maximal (1), minimal (2)

        :return: The tolerance.
        :rtype: float
        """
        tol = ShapeAnalysis_ShapeTolerance()
        tol.AddTolerance(shape)
        return tol.GlobalTolerance(mode)
Ejemplo n.º 4
0
    def local_tolerance(shape, mode=0, styp=TopAbs_SHAPE):
        """
        Compute the local tolerance of the shape.

        :param OCCT.TopoDS.TopoDS_Shape shape: The shape.
        :param int mode: Average (0), maximal (1), minimal (2)
        :param OCCT.TopAbs.TopAbs_ShapeEnum styp: The level of shape to examine
            (i.e., only vertices, only edges, only faces, or all shapes).

        :return: The tolerance.
        :rtype: float
        """
        tol = ShapeAnalysis_ShapeTolerance()
        return tol.Tolerance(shape, mode, styp)