From a55783659734dbc5b30259cd5f023c7d121b6ecc Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 12 Nov 2016 16:14:46 +0100 Subject: [PATCH] methods to fix shape tolerances --- src/Mod/Part/App/TopoShapePy.xml | 39 ++++++++++++++ src/Mod/Part/App/TopoShapePyImp.cpp | 82 +++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/src/Mod/Part/App/TopoShapePy.xml b/src/Mod/Part/App/TopoShapePy.xml index 1ba66c04e..d2a0f23be 100644 --- a/src/Mod/Part/App/TopoShapePy.xml +++ b/src/Mod/Part/App/TopoShapePy.xml @@ -543,6 +543,7 @@ infos contains additional info on the solutions. It is a list of tuples: getTolerance(mode, ShapeType=Shape) -> float + Determines a tolerance from the ones stored in a shape mode = 0 : returns the average value between sub-shapes, mode > 0 : returns the maximal found, @@ -561,6 +562,7 @@ infos contains additional info on the solutions. It is a list of tuples: overTolerance(value, ShapeType=Shape) -> float + Determines which shapes have a tolerance over the given value ShapeType is interpreted as in the method getTolerance @@ -570,6 +572,7 @@ infos contains additional info on the solutions. It is a list of tuples: inTolerance(value, ShapeType=Shape) -> float + Determines which shapes have a tolerance within a given interval ShapeType is interpreted as in the method getTolerance @@ -579,6 +582,7 @@ infos contains additional info on the solutions. It is a list of tuples: globalTolerance(mode) -> float + Returns the computed tolerance according to the mode mode = 0 : average mode > 0 : maximal @@ -586,6 +590,41 @@ infos contains additional info on the solutions. It is a list of tuples: + + + + fixTolerance(value, ShapeType=Shape) + + Sets (enforces) tolerances in a shape to the given value + ShapeType = Vertex : only vertices are set + ShapeType = Edge : only edges are set + ShapeType = Face : only faces are set + ShapeType = Wire : to have edges and their vertices set + ShapeType = other value : all (vertices,edges,faces) are set + + + + + + + limitTolerance(tmin, tmax=0, ShapeType=Shape) + + Limits tolerances in a shape as follows : + tmin = tmax -> as fixTolerance (forces) + tmin = 0 -> maximum tolerance will be tmax + tmax = 0 or not given (more generally, tmax < tmin) -> + tmax ignored, minimum will be tmin + else, maximum will be max and minimum will be min + ShapeType = Vertex : only vertices are set + ShapeType = Edge : only edges are set + ShapeType = Face : only faces are set + ShapeType = Wire : to have edges and their vertices set + ShapeType = other value : all (vertices,edges,faces) are set + Returns True if at least one tolerance of the sub-shape has + been modified + + +