mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8415a280ed | ||
|
85c81d703f | ||
|
7aad5710fb | ||
|
f7e8fe1d88 | ||
|
472c48335d | ||
|
a8301722d0 | ||
|
1abff7396b | ||
|
a5806fd49e | ||
|
65b387bd75 | ||
|
3e9d304d46 | ||
|
916851661a | ||
|
5ed5c561b0 | ||
|
36228fd825 | ||
|
168b9ec45a | ||
|
7ed3f1cf33 | ||
|
c3cf76dfbd | ||
|
3d9cefa6a7 | ||
|
dca967d0b8 | ||
|
064a93b073 | ||
|
b015a803fc | ||
|
43809f7eec | ||
|
eeb913ae52 |
@@ -21,6 +21,10 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <BRepBuilderAPI_MakeShape.ixx>
|
#include <BRepBuilderAPI_MakeShape.ixx>
|
||||||
|
#include <BRep_TEdge.hxx>
|
||||||
|
#include <BRep_TFace.hxx>
|
||||||
|
#include <BRep_TVertex.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
#include <TopoDS_Face.hxx>
|
#include <TopoDS_Face.hxx>
|
||||||
@@ -113,7 +117,3 @@ Standard_Boolean BRepBuilderAPI_MakeShape::IsDeleted (const TopoDS_Shape& S)
|
|||||||
{
|
{
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -212,6 +212,9 @@ is
|
|||||||
raises NoSuchObject from Standard; -- raised if shape has not been modified
|
raises NoSuchObject from Standard; -- raised if shape has not been modified
|
||||||
---Purpose: Gives a modifieded subshape
|
---Purpose: Gives a modifieded subshape
|
||||||
|
|
||||||
|
IsProtectedFromModification(me; theS : Shape from TopoDS) returns Boolean;
|
||||||
|
---Purpose: Indicates if theS is protected from modification.
|
||||||
|
|
||||||
Dump(me);
|
Dump(me);
|
||||||
---Purpose: print the informations
|
---Purpose: print the informations
|
||||||
|
|
||||||
@@ -554,4 +557,6 @@ fields
|
|||||||
|
|
||||||
myReShape : ReShape from BRepTools is protected;
|
myReShape : ReShape from BRepTools is protected;
|
||||||
myMergedEdges : MapOfShape from TopTools;
|
myMergedEdges : MapOfShape from TopTools;
|
||||||
|
|
||||||
|
myProtectedFromModificationShapes : IndexedMapOfShape from TopTools;
|
||||||
end Sewing;
|
end Sewing;
|
||||||
|
@@ -55,6 +55,7 @@
|
|||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <BRepLib.hxx>
|
#include <BRepLib.hxx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
#include <BRepTools_Quilt.hxx>
|
#include <BRepTools_Quilt.hxx>
|
||||||
#include <BSplCLib.hxx>
|
#include <BSplCLib.hxx>
|
||||||
#include <Extrema_ExtPC.hxx>
|
#include <Extrema_ExtPC.hxx>
|
||||||
@@ -1736,7 +1737,12 @@ void BRepBuilderAPI_Sewing::Load(const TopoDS_Shape& theShape)
|
|||||||
{
|
{
|
||||||
myReShape->Clear();
|
myReShape->Clear();
|
||||||
if (theShape.IsNull()) myShape.Nullify();
|
if (theShape.IsNull()) myShape.Nullify();
|
||||||
else myShape = myReShape->Apply(theShape);
|
else
|
||||||
|
{
|
||||||
|
TopExp::MapShapes(theShape, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
|
myShape = myReShape->Apply(theShape);
|
||||||
|
}
|
||||||
mySewedShape.Nullify();
|
mySewedShape.Nullify();
|
||||||
// Nullify flags and counters
|
// Nullify flags and counters
|
||||||
myNbShapes = myNbEdges = myNbVertices = 0;
|
myNbShapes = myNbEdges = myNbVertices = 0;
|
||||||
@@ -1766,6 +1772,9 @@ void BRepBuilderAPI_Sewing::Load(const TopoDS_Shape& theShape)
|
|||||||
void BRepBuilderAPI_Sewing::Add(const TopoDS_Shape& aShape)
|
void BRepBuilderAPI_Sewing::Add(const TopoDS_Shape& aShape)
|
||||||
{
|
{
|
||||||
if (aShape.IsNull()) return;
|
if (aShape.IsNull()) return;
|
||||||
|
//
|
||||||
|
TopExp::MapShapes(aShape, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
TopoDS_Shape oShape = myReShape->Apply(aShape);
|
TopoDS_Shape oShape = myReShape->Apply(aShape);
|
||||||
myOldShapes.Add(aShape,oShape);
|
myOldShapes.Add(aShape,oShape);
|
||||||
myNbShapes = myOldShapes.Extent();
|
myNbShapes = myOldShapes.Extent();
|
||||||
@@ -1909,6 +1918,8 @@ void BRepBuilderAPI_Sewing::Perform(const Handle(Message_ProgressIndicator)& the
|
|||||||
mySewedShape.Nullify();
|
mySewedShape.Nullify();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(
|
||||||
|
mySewedShape, *this);
|
||||||
}
|
}
|
||||||
#if DEB
|
#if DEB
|
||||||
chr_total.Stop();
|
chr_total.Stop();
|
||||||
@@ -2147,6 +2158,16 @@ TopoDS_Shape BRepBuilderAPI_Sewing::ModifiedSubShape(const TopoDS_Shape& aShape)
|
|||||||
return myReShape->Apply(aShape);
|
return myReShape->Apply(aShape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsProtectedFromModification
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean BRepBuilderAPI_Sewing::IsProtectedFromModification(
|
||||||
|
const TopoDS_Shape & theS) const
|
||||||
|
{
|
||||||
|
return myProtectedFromModificationShapes.Contains(theS);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Dump
|
//function : Dump
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -80,110 +80,44 @@ Standard_Boolean BRepCheck::SelfIntersection(const TopoDS_Wire& W,
|
|||||||
void BRepCheck::Print(const BRepCheck_Status stat,
|
void BRepCheck::Print(const BRepCheck_Status stat,
|
||||||
Standard_OStream& OS)
|
Standard_OStream& OS)
|
||||||
{
|
{
|
||||||
|
#define PRINT_CASE(stat) case stat: OS << #stat "\n"; break
|
||||||
|
|
||||||
switch (stat) {
|
switch (stat) {
|
||||||
case BRepCheck_NoError:
|
PRINT_CASE(BRepCheck_NoError);
|
||||||
OS << "BRepCheck_NoError\n";
|
PRINT_CASE(BRepCheck_InvalidPointOnCurve);
|
||||||
break;
|
PRINT_CASE(BRepCheck_InvalidPointOnCurveOnSurface);
|
||||||
case BRepCheck_InvalidPointOnCurve:
|
PRINT_CASE(BRepCheck_InvalidPointOnSurface);
|
||||||
OS << "BRepCheck_InvalidPointOnCurve\n";
|
PRINT_CASE(BRepCheck_No3DCurve);
|
||||||
break;
|
PRINT_CASE(BRepCheck_Multiple3DCurve);
|
||||||
case BRepCheck_InvalidPointOnCurveOnSurface:
|
PRINT_CASE(BRepCheck_Invalid3DCurve);
|
||||||
OS << "BRepCheck_InvalidPointOnCurveOnSurface\n";
|
PRINT_CASE(BRepCheck_NoCurveOnSurface);
|
||||||
break;
|
PRINT_CASE(BRepCheck_InvalidCurveOnSurface);
|
||||||
case BRepCheck_InvalidPointOnSurface:
|
PRINT_CASE(BRepCheck_InvalidCurveOnClosedSurface);
|
||||||
OS << "BRepCheck_InvalidPointOnSurface\n";
|
PRINT_CASE(BRepCheck_InvalidSameRangeFlag);
|
||||||
break;
|
PRINT_CASE(BRepCheck_InvalidSameParameterFlag);
|
||||||
case BRepCheck_No3DCurve:
|
PRINT_CASE(BRepCheck_InvalidDegeneratedFlag);
|
||||||
OS << "BRepCheck_No3DCurve\n";
|
PRINT_CASE(BRepCheck_FreeEdge);
|
||||||
break;
|
PRINT_CASE(BRepCheck_InvalidMultiConnexity);
|
||||||
case BRepCheck_Multiple3DCurve:
|
PRINT_CASE(BRepCheck_InvalidRange);
|
||||||
OS << "BRepCheck_Multiple3DCurve\n";
|
PRINT_CASE(BRepCheck_EmptyWire);
|
||||||
break;
|
PRINT_CASE(BRepCheck_RedundantEdge);
|
||||||
case BRepCheck_Invalid3DCurve:
|
PRINT_CASE(BRepCheck_SelfIntersectingWire);
|
||||||
OS << "BRepCheck_Invalid3DCurve\n";
|
PRINT_CASE(BRepCheck_NoSurface);
|
||||||
break;
|
PRINT_CASE(BRepCheck_InvalidWire);
|
||||||
case BRepCheck_NoCurveOnSurface:
|
PRINT_CASE(BRepCheck_RedundantWire);
|
||||||
OS << "BRepCheck_NoCurveOnSurface\n";
|
PRINT_CASE(BRepCheck_IntersectingWires);
|
||||||
break;
|
PRINT_CASE(BRepCheck_InvalidImbricationOfWires);
|
||||||
case BRepCheck_InvalidCurveOnSurface:
|
PRINT_CASE(BRepCheck_EmptyShell);
|
||||||
OS << "BRepCheck_InvalidCurveOnSurface\n";
|
PRINT_CASE(BRepCheck_RedundantFace);
|
||||||
break;
|
PRINT_CASE(BRepCheck_UnorientableShape);
|
||||||
case BRepCheck_InvalidCurveOnClosedSurface:
|
PRINT_CASE(BRepCheck_NotClosed);
|
||||||
OS << "BRepCheck_InvalidCurveOnClosedSurface\n";
|
PRINT_CASE(BRepCheck_NotConnected);
|
||||||
break;
|
PRINT_CASE(BRepCheck_SubshapeNotInShape);
|
||||||
case BRepCheck_InvalidSameRangeFlag:
|
PRINT_CASE(BRepCheck_BadOrientation);
|
||||||
OS << "BRepCheck_InvalidSameRangeFlag\n";
|
PRINT_CASE(BRepCheck_BadOrientationOfSubshape);
|
||||||
break;
|
PRINT_CASE(BRepCheck_InvalidToleranceValue);
|
||||||
case BRepCheck_InvalidSameParameterFlag:
|
PRINT_CASE(BRepCheck_CheckFail);
|
||||||
OS << "BRepCheck_InvalidSameParameterFlag\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_InvalidDegeneratedFlag:
|
|
||||||
OS << "BRepCheck_InvalidDegeneratedFlag\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_FreeEdge:
|
|
||||||
OS << "BRepCheck_FreeEdge\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_InvalidMultiConnexity:
|
|
||||||
OS << "BRepCheck_InvalidMultiConnexity\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_InvalidRange:
|
|
||||||
OS << "BRepCheck_InvalidRange\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_EmptyWire:
|
|
||||||
OS << "BRepCheck_EmptyWire\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_RedundantEdge:
|
|
||||||
OS << "BRepCheck_RedundantEdge\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_SelfIntersectingWire:
|
|
||||||
OS << "BRepCheck_SelfIntersectingWire\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_NoSurface:
|
|
||||||
OS << "BRepCheck_NoSurface\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_InvalidWire:
|
|
||||||
OS << "BRepCheck_InvalidWire\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_RedundantWire:
|
|
||||||
OS << "BRepCheck_RedundantWire\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_IntersectingWires:
|
|
||||||
OS << "BRepCheck_IntersectingWires\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_InvalidImbricationOfWires:
|
|
||||||
OS << "BRepCheck_InvalidImbricationOfWires\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_EmptyShell:
|
|
||||||
OS << "BRepCheck_EmptyShell\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_RedundantFace:
|
|
||||||
OS << "BRepCheck_RedundantFace\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_UnorientableShape:
|
|
||||||
OS << "BRepCheck_UnorientableShape\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_NotClosed:
|
|
||||||
OS << "BRepCheck_NotClosed\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_NotConnected:
|
|
||||||
OS << "BRepCheck_NotConnected\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_SubshapeNotInShape:
|
|
||||||
OS << "BRepCheck_SubshapeNotInShape\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_BadOrientation:
|
|
||||||
OS << "BRepCheck_BadOrientation\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_BadOrientationOfSubshape:
|
|
||||||
OS << "BRepCheck_BadOrientationOfSubshape\n";
|
|
||||||
break;
|
|
||||||
case BRepCheck_CheckFail:
|
|
||||||
OS << "BRepCheck_CheckFail\n";
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -63,8 +63,6 @@
|
|||||||
#include <TopoDS_Face.hxx>
|
#include <TopoDS_Face.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
|
|
||||||
//modified by NIZNHY-PKV Thu May 05 09:01:57 2011f
|
|
||||||
static
|
static
|
||||||
Standard_Boolean Validate(const Adaptor3d_Curve&,
|
Standard_Boolean Validate(const Adaptor3d_Curve&,
|
||||||
const Adaptor3d_CurveOnSurface&,
|
const Adaptor3d_CurveOnSurface&,
|
||||||
@@ -83,12 +81,6 @@ static
|
|||||||
static
|
static
|
||||||
Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS);
|
Standard_Real PrecSurface(const Adaptor3d_CurveOnSurface& aACS);
|
||||||
|
|
||||||
//static Standard_Boolean Validate(const Adaptor3d_Curve&,
|
|
||||||
// const Adaptor3d_Curve&,
|
|
||||||
// const Standard_Real,
|
|
||||||
// const Standard_Boolean);
|
|
||||||
//modified by NIZNHY-PKV Thu May 05 09:02:01 2011t
|
|
||||||
|
|
||||||
#define NCONTROL 23
|
#define NCONTROL 23
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -230,7 +222,6 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
|
|||||||
Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Edge(myShape));
|
Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Edge(myShape));
|
||||||
|
|
||||||
TopAbs_ShapeEnum styp = S.ShapeType();
|
TopAbs_ShapeEnum styp = S.ShapeType();
|
||||||
// for (TopExp_Explorer exp(S,TopAbs_EDGE); exp.More(); exp.Next()) {
|
|
||||||
TopExp_Explorer exp(S,TopAbs_EDGE) ;
|
TopExp_Explorer exp(S,TopAbs_EDGE) ;
|
||||||
for ( ; exp.More(); exp.Next()) {
|
for ( ; exp.More(); exp.Next()) {
|
||||||
if (exp.Current().IsSame(myShape)) {
|
if (exp.Current().IsSame(myShape)) {
|
||||||
@@ -244,6 +235,9 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
|
|||||||
|
|
||||||
switch (styp) {
|
switch (styp) {
|
||||||
case TopAbs_FACE:
|
case TopAbs_FACE:
|
||||||
|
if(BRep_Tool::Tolerance(TopoDS::Face(S)) - Tol > Precision::Confusion())
|
||||||
|
BRepCheck::Add(lst,BRepCheck_InvalidToleranceValue);
|
||||||
|
|
||||||
if (!myCref.IsNull()) {
|
if (!myCref.IsNull()) {
|
||||||
|
|
||||||
Standard_Boolean SameParameter = TE->SameParameter();
|
Standard_Boolean SameParameter = TE->SameParameter();
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <BRepCheck_Vertex.ixx>
|
#include <BRepCheck_Vertex.ixx>
|
||||||
|
|
||||||
|
#include <BRepCheck.hxx>
|
||||||
#include <BRepCheck_ListOfStatus.hxx>
|
#include <BRepCheck_ListOfStatus.hxx>
|
||||||
|
|
||||||
#include <BRep_TVertex.hxx>
|
#include <BRep_TVertex.hxx>
|
||||||
@@ -46,9 +47,9 @@
|
|||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
|
|
||||||
#include <BRepCheck.hxx>
|
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <TopoDS_Edge.hxx>
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <Precision.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BRepCheck_Vertex
|
//function : BRepCheck_Vertex
|
||||||
@@ -115,7 +116,6 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
|
|||||||
case TopAbs_EDGE:
|
case TopAbs_EDGE:
|
||||||
{
|
{
|
||||||
// Try to find the vertex on the edge
|
// Try to find the vertex on the edge
|
||||||
|
|
||||||
const TopoDS_Edge& E = TopoDS::Edge(S);
|
const TopoDS_Edge& E = TopoDS::Edge(S);
|
||||||
TopoDS_Iterator itv(E.Oriented(TopAbs_FORWARD));
|
TopoDS_Iterator itv(E.Oriented(TopAbs_FORWARD));
|
||||||
TopoDS_Vertex VFind;
|
TopoDS_Vertex VFind;
|
||||||
@@ -149,9 +149,15 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
|
|||||||
// VFind is not null for sure
|
// VFind is not null for sure
|
||||||
TopAbs_Orientation orv = VFind.Orientation();
|
TopAbs_Orientation orv = VFind.Orientation();
|
||||||
|
|
||||||
Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape));
|
Standard_Real TolV = TV->Tolerance();
|
||||||
Tol = Max(Tol,BRep_Tool::Tolerance(E)); // to check
|
Standard_Real TolE = BRep_Tool::Tolerance(E);
|
||||||
Tol *= Tol;
|
if (TolE > TolV)
|
||||||
|
{
|
||||||
|
if (TolE - TolV > Precision::Confusion())
|
||||||
|
BRepCheck::Add(myMap(S),BRepCheck_InvalidToleranceValue);
|
||||||
|
TolV = TolE;
|
||||||
|
}
|
||||||
|
Standard_Real aTol2 = TolV * TolV;
|
||||||
|
|
||||||
Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&E.TShape());
|
Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&E.TShape());
|
||||||
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
|
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
|
||||||
@@ -173,7 +179,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
|
|||||||
if (pr->IsPointOnCurve(C,L)) {
|
if (pr->IsPointOnCurve(C,L)) {
|
||||||
Controlp = C->Value(pr->Parameter());
|
Controlp = C->Value(pr->Parameter());
|
||||||
Controlp.Transform(L.Transformation());
|
Controlp.Transform(L.Transformation());
|
||||||
if (prep.SquareDistance(Controlp)> Tol) {
|
if (prep.SquareDistance(Controlp) > aTol2) {
|
||||||
BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnCurve);
|
BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnCurve);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,14 +190,14 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
|
|||||||
if (orv == TopAbs_FORWARD || multiple) {
|
if (orv == TopAbs_FORWARD || multiple) {
|
||||||
Controlp = C->Value(GC->First());
|
Controlp = C->Value(GC->First());
|
||||||
Controlp.Transform(L.Transformation());
|
Controlp.Transform(L.Transformation());
|
||||||
if (prep.SquareDistance(Controlp)> Tol) {
|
if (prep.SquareDistance(Controlp) > aTol2) {
|
||||||
BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnCurve);
|
BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnCurve);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (orv == TopAbs_REVERSED || multiple) {
|
if (orv == TopAbs_REVERSED || multiple) {
|
||||||
Controlp = C->Value(GC->Last());
|
Controlp = C->Value(GC->Last());
|
||||||
Controlp.Transform(L.Transformation());
|
Controlp.Transform(L.Transformation());
|
||||||
if (prep.SquareDistance(Controlp)> Tol) {
|
if (prep.SquareDistance(Controlp) > aTol2) {
|
||||||
BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnCurve);
|
BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnCurve);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,18 +218,16 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
|
|||||||
gp_Pnt2d p2d = PC->Value(pr->Parameter());
|
gp_Pnt2d p2d = PC->Value(pr->Parameter());
|
||||||
Controlp = Su->Value(p2d.X(),p2d.Y());
|
Controlp = Su->Value(p2d.X(),p2d.Y());
|
||||||
Controlp.Transform(L.Transformation());
|
Controlp.Transform(L.Transformation());
|
||||||
if (prep.SquareDistance(Controlp)> Tol) {
|
if (prep.SquareDistance(Controlp) > aTol2) {
|
||||||
BRepCheck::Add(myMap(S),
|
BRepCheck::Add(myMap(S), BRepCheck_InvalidPointOnCurveOnSurface);
|
||||||
BRepCheck_InvalidPointOnCurveOnSurface);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!PC2.IsNull() && pr->IsPointOnCurveOnSurface(PC2,Su,L)) {
|
if (!PC2.IsNull() && pr->IsPointOnCurveOnSurface(PC2,Su,L)) {
|
||||||
gp_Pnt2d p2d = PC2->Value(pr->Parameter());
|
gp_Pnt2d p2d = PC2->Value(pr->Parameter());
|
||||||
Controlp = Su->Value(p2d.X(),p2d.Y());
|
Controlp = Su->Value(p2d.X(),p2d.Y());
|
||||||
Controlp.Transform(L.Transformation());
|
Controlp.Transform(L.Transformation());
|
||||||
if (prep.SquareDistance(Controlp)> Tol) {
|
if (prep.SquareDistance(Controlp) > aTol2) {
|
||||||
BRepCheck::Add(myMap(S),
|
BRepCheck::Add(myMap(S), BRepCheck_InvalidPointOnCurveOnSurface);
|
||||||
BRepCheck_InvalidPointOnCurveOnSurface);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
itpr.Next();
|
itpr.Next();
|
||||||
@@ -247,9 +251,15 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
|
|||||||
const Handle(Geom_Surface)& Su = TF->Surface();
|
const Handle(Geom_Surface)& Su = TF->Surface();
|
||||||
TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location());
|
TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location());
|
||||||
|
|
||||||
Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape));
|
Standard_Real TolV = TV->Tolerance();
|
||||||
Tol = Max(Tol,BRep_Tool::Tolerance(TopoDS::Face(S))); // to check
|
Standard_Real TolF = TF->Tolerance();
|
||||||
Tol *= Tol;
|
if (TolF > TolV)
|
||||||
|
{
|
||||||
|
if (TolF - TolV > Precision::Confusion())
|
||||||
|
BRepCheck::Add(myMap(S),BRepCheck_InvalidToleranceValue);
|
||||||
|
TolV = TolF;
|
||||||
|
}
|
||||||
|
Standard_Real aTol2 = TolV * TolV;
|
||||||
|
|
||||||
BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points());
|
BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points());
|
||||||
while (itpr.More()) {
|
while (itpr.More()) {
|
||||||
@@ -257,7 +267,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
|
|||||||
if (pr->IsPointOnSurface(Su,L)) {
|
if (pr->IsPointOnSurface(Su,L)) {
|
||||||
Controlp = Su->Value(pr->Parameter(),pr->Parameter2());
|
Controlp = Su->Value(pr->Parameter(),pr->Parameter2());
|
||||||
Controlp.Transform(L.Transformation());
|
Controlp.Transform(L.Transformation());
|
||||||
if (prep.SquareDistance(Controlp)> Tol) {
|
if (prep.SquareDistance(Controlp) > aTol2) {
|
||||||
BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnSurface);
|
BRepCheck::Add(myMap(S),BRepCheck_InvalidPointOnSurface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,8 @@ uses Shape from TopoDS,
|
|||||||
DataMapOfShapeShape from TopTools,
|
DataMapOfShapeShape from TopTools,
|
||||||
SequenceOfCurve from TColGeom,
|
SequenceOfCurve from TColGeom,
|
||||||
Curve from Geom,
|
Curve from Geom,
|
||||||
StatusError from BRepFeat
|
StatusError from BRepFeat,
|
||||||
|
IndexedMapOfShape from TopTools
|
||||||
|
|
||||||
raises ConstructionError from Standard
|
raises ConstructionError from Standard
|
||||||
|
|
||||||
@@ -168,6 +169,10 @@ is
|
|||||||
BarycCurve(me: in out)
|
BarycCurve(me: in out)
|
||||||
returns Curve from Geom;
|
returns Curve from Geom;
|
||||||
---Purpose: Generates a curve along the center of mass of the primitive.
|
---Purpose: Generates a curve along the center of mass of the primitive.
|
||||||
|
|
||||||
|
IsProtectedFromModification(me; theS : Shape from TopoDS)
|
||||||
|
returns Boolean from Standard;
|
||||||
|
---Purpose: Indicates if theS is protected from modification.
|
||||||
fields
|
fields
|
||||||
|
|
||||||
myPbase : Shape from TopoDS;
|
myPbase : Shape from TopoDS;
|
||||||
@@ -176,5 +181,6 @@ fields
|
|||||||
myCurves : SequenceOfCurve from TColGeom;
|
myCurves : SequenceOfCurve from TColGeom;
|
||||||
myBCurve : Curve from Geom;
|
myBCurve : Curve from Geom;
|
||||||
myStatusError : StatusError from BRepFeat;
|
myStatusError : StatusError from BRepFeat;
|
||||||
|
myProtectedFromModificationShapes : IndexedMapOfShape from TopTools;
|
||||||
|
|
||||||
end MakePrism;
|
end MakePrism;
|
||||||
|
@@ -45,6 +45,8 @@
|
|||||||
|
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
|
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
|
|
||||||
#include <BRepTools.hxx>
|
#include <BRepTools.hxx>
|
||||||
|
|
||||||
|
|
||||||
@@ -139,6 +141,10 @@ void BRepFeat_MakePrism::Init(const TopoDS_Shape& Sbase,
|
|||||||
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
||||||
if (trc) cout << "BRepFeat_MakePrism::Init" << endl;
|
if (trc) cout << "BRepFeat_MakePrism::Init" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
TopExp::MapShapes(Sbase, myProtectedFromModificationShapes);
|
||||||
|
TopExp::MapShapes(Pbase, myProtectedFromModificationShapes);
|
||||||
|
TopExp::MapShapes(Skface, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
mySkface = Skface;
|
mySkface = Skface;
|
||||||
SketchFaceValid();
|
SketchFaceValid();
|
||||||
mySbase = Sbase;
|
mySbase = Sbase;
|
||||||
@@ -204,6 +210,8 @@ void BRepFeat_MakePrism::Add(const TopoDS_Edge& E,
|
|||||||
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
||||||
if (trc) cout << "BRepFeat_MakePrism::Add(Edge,face)" << endl;
|
if (trc) cout << "BRepFeat_MakePrism::Add(Edge,face)" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
TopExp::MapShapes(E, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
TopExp_Explorer exp;
|
TopExp_Explorer exp;
|
||||||
for (exp.Init(mySbase,TopAbs_FACE);exp.More();exp.Next()) {
|
for (exp.Init(mySbase,TopAbs_FACE);exp.More();exp.Next()) {
|
||||||
if (exp.Current().IsSame(F)) {
|
if (exp.Current().IsSame(F)) {
|
||||||
@@ -364,6 +372,8 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
|
|||||||
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
||||||
if (trc) cout << "BRepFeat_MakePrism::Perform(Until)" << endl;
|
if (trc) cout << "BRepFeat_MakePrism::Perform(Until)" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
TopExp::MapShapes(Until, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
if (Until.IsNull()) {
|
if (Until.IsNull()) {
|
||||||
Standard_ConstructionError::Raise();
|
Standard_ConstructionError::Raise();
|
||||||
}
|
}
|
||||||
@@ -463,6 +473,7 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myShape, *this);
|
||||||
/* // loop of control of descendance
|
/* // loop of control of descendance
|
||||||
|
|
||||||
TopExp_Explorer expr(mySbase, TopAbs_FACE);
|
TopExp_Explorer expr(mySbase, TopAbs_FACE);
|
||||||
@@ -514,6 +525,9 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
|
|||||||
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
||||||
if (trc) cout << "BRepFeat_MakePrism::Perform(From,Until)" << endl;
|
if (trc) cout << "BRepFeat_MakePrism::Perform(From,Until)" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
TopExp::MapShapes(From, myProtectedFromModificationShapes);
|
||||||
|
TopExp::MapShapes(Until, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
if (From.IsNull() || Until.IsNull()) {
|
if (From.IsNull() || Until.IsNull()) {
|
||||||
Standard_ConstructionError::Raise();
|
Standard_ConstructionError::Raise();
|
||||||
}
|
}
|
||||||
@@ -785,6 +799,8 @@ void BRepFeat_MakePrism::PerformFromEnd(const TopoDS_Shape& Until)
|
|||||||
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
||||||
if (trc) cout << "BRepFeat_MakePrism::PerformFromEnd(From,Until)" << endl;
|
if (trc) cout << "BRepFeat_MakePrism::PerformFromEnd(From,Until)" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
TopExp::MapShapes(Until, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
if (Until.IsNull()) {
|
if (Until.IsNull()) {
|
||||||
Standard_ConstructionError::Raise();
|
Standard_ConstructionError::Raise();
|
||||||
}
|
}
|
||||||
@@ -988,6 +1004,8 @@ void BRepFeat_MakePrism::PerformUntilHeight(const TopoDS_Shape& Until,
|
|||||||
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
||||||
if (trc) cout << "BRepFeat_MakePrism::PerformUntilHeight(Until,Length)" << endl;
|
if (trc) cout << "BRepFeat_MakePrism::PerformUntilHeight(Until,Length)" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
TopExp::MapShapes(Until, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
if (Until.IsNull()) {
|
if (Until.IsNull()) {
|
||||||
Perform(Length);
|
Perform(Length);
|
||||||
}
|
}
|
||||||
@@ -1432,8 +1450,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
|
|||||||
return ValRet;
|
return ValRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsProtectedFromModification
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean BRepFeat_MakePrism::IsProtectedFromModification(
|
||||||
|
const TopoDS_Shape & theS) const
|
||||||
|
{
|
||||||
|
return myProtectedFromModificationShapes.Contains(theS);
|
||||||
|
}
|
||||||
|
@@ -33,9 +33,10 @@
|
|||||||
void BRepFeat_SplitShape::Build ()
|
void BRepFeat_SplitShape::Build ()
|
||||||
{
|
{
|
||||||
mySShape.Perform(myWOnShape);
|
mySShape.Perform(myWOnShape);
|
||||||
if (mySShape.IsDone()) {
|
if (mySShape.IsDone())
|
||||||
Done();
|
{
|
||||||
myShape = mySShape.ResultingShape();
|
myShape = mySShape.ResultingShape();
|
||||||
|
Done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,7 +41,8 @@ uses
|
|||||||
ListOfShape from TopTools,
|
ListOfShape from TopTools,
|
||||||
SecHArray1 from ChFiDS,
|
SecHArray1 from ChFiDS,
|
||||||
HBuilder from TopOpeBRepBuild,
|
HBuilder from TopOpeBRepBuild,
|
||||||
ShapeModification from BRepBuilderAPI
|
ShapeModification from BRepBuilderAPI,
|
||||||
|
IndexedMapOfShape from TopTools
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -379,6 +380,10 @@ is
|
|||||||
returns Boolean
|
returns Boolean
|
||||||
is redefined virtual;
|
is redefined virtual;
|
||||||
|
|
||||||
|
IsProtectedFromModification(me; theS : Shape from TopoDS)
|
||||||
|
returns Boolean from Standard;
|
||||||
|
---Purpose: Indicates if theS is protected from modification.
|
||||||
|
|
||||||
-------------------------------
|
-------------------------------
|
||||||
---Methods for quick simulation
|
---Methods for quick simulation
|
||||||
-------------------------------
|
-------------------------------
|
||||||
@@ -396,6 +401,7 @@ fields
|
|||||||
|
|
||||||
myBuilder : ChBuilder from ChFi3d;
|
myBuilder : ChBuilder from ChFi3d;
|
||||||
myMap : MapOfShape from TopTools;
|
myMap : MapOfShape from TopTools;
|
||||||
|
myProtectedFromModificationShapes : IndexedMapOfShape from TopTools;
|
||||||
|
|
||||||
end MakeChamfer;
|
end MakeChamfer;
|
||||||
|
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
#include <ChFiDS_Spine.hxx>
|
#include <ChFiDS_Spine.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -34,6 +36,7 @@
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
BRepFilletAPI_MakeChamfer::BRepFilletAPI_MakeChamfer(const TopoDS_Shape &S):myBuilder(S)
|
BRepFilletAPI_MakeChamfer::BRepFilletAPI_MakeChamfer(const TopoDS_Shape &S):myBuilder(S)
|
||||||
{
|
{
|
||||||
|
TopExp::MapShapes(S, myProtectedFromModificationShapes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -391,6 +394,7 @@ void BRepFilletAPI_MakeChamfer::Build()
|
|||||||
if (myBuilder.IsDone()){
|
if (myBuilder.IsDone()){
|
||||||
Done();
|
Done();
|
||||||
myShape = myBuilder.Shape();
|
myShape = myBuilder.Shape();
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myShape, *this);
|
||||||
|
|
||||||
//creation of the Map.
|
//creation of the Map.
|
||||||
TopExp_Explorer ex;
|
TopExp_Explorer ex;
|
||||||
@@ -470,6 +474,16 @@ Standard_Boolean BRepFilletAPI_MakeChamfer::IsDeleted(const TopoDS_Shape& F)
|
|||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsProtectedFromModification
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean BRepFilletAPI_MakeChamfer::IsProtectedFromModification(
|
||||||
|
const TopoDS_Shape & theS) const
|
||||||
|
{
|
||||||
|
return myProtectedFromModificationShapes.Contains(theS);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Simulate
|
//function : Simulate
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -47,7 +47,8 @@ uses
|
|||||||
FilletShape from ChFi3d,
|
FilletShape from ChFi3d,
|
||||||
HBuilder from TopOpeBRepBuild,
|
HBuilder from TopOpeBRepBuild,
|
||||||
MapOfShape from TopTools,
|
MapOfShape from TopTools,
|
||||||
ShapeModification from BRepBuilderAPI
|
ShapeModification from BRepBuilderAPI,
|
||||||
|
IndexedMapOfShape from TopTools
|
||||||
|
|
||||||
raises
|
raises
|
||||||
NotDone from StdFail ,
|
NotDone from StdFail ,
|
||||||
@@ -450,6 +451,10 @@ is
|
|||||||
returns Boolean
|
returns Boolean
|
||||||
is redefined virtual;
|
is redefined virtual;
|
||||||
|
|
||||||
|
IsProtectedFromModification(me; theS : Shape from TopoDS)
|
||||||
|
returns Boolean from Standard;
|
||||||
|
---Purpose: Indicates if theS is protected from modification.
|
||||||
|
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
-- Methods usefull for BRepCtx utilities --
|
-- Methods usefull for BRepCtx utilities --
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
@@ -538,5 +543,6 @@ fields
|
|||||||
|
|
||||||
myBuilder : FilBuilder from ChFi3d;
|
myBuilder : FilBuilder from ChFi3d;
|
||||||
myMap : MapOfShape from TopTools;
|
myMap : MapOfShape from TopTools;
|
||||||
|
myProtectedFromModificationShapes : IndexedMapOfShape from TopTools;
|
||||||
|
|
||||||
end MakeFillet;
|
end MakeFillet;
|
||||||
|
@@ -30,6 +30,8 @@
|
|||||||
#include <Law_Linear.hxx>
|
#include <Law_Linear.hxx>
|
||||||
#include <Law_S.hxx>
|
#include <Law_S.hxx>
|
||||||
#include <Law_Interpol.hxx>
|
#include <Law_Interpol.hxx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BRepFilletAPI_MakeFillet
|
//function : BRepFilletAPI_MakeFillet
|
||||||
@@ -40,6 +42,7 @@ BRepFilletAPI_MakeFillet::BRepFilletAPI_MakeFillet(const TopoDS_Shape& S,
|
|||||||
const ChFi3d_FilletShape FShape):
|
const ChFi3d_FilletShape FShape):
|
||||||
myBuilder(S,FShape)
|
myBuilder(S,FShape)
|
||||||
{
|
{
|
||||||
|
TopExp::MapShapes(S, myProtectedFromModificationShapes);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -532,6 +535,7 @@ void BRepFilletAPI_MakeFillet::Build()
|
|||||||
if(myBuilder.IsDone()) {
|
if(myBuilder.IsDone()) {
|
||||||
Done();
|
Done();
|
||||||
myShape = myBuilder.Shape();
|
myShape = myBuilder.Shape();
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myShape, *this);
|
||||||
|
|
||||||
// creation of the Map.
|
// creation of the Map.
|
||||||
TopExp_Explorer ex;
|
TopExp_Explorer ex;
|
||||||
@@ -665,6 +669,16 @@ Standard_Boolean BRepFilletAPI_MakeFillet::IsDeleted(const TopoDS_Shape& F)
|
|||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsProtectedFromModification
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean BRepFilletAPI_MakeFillet::IsProtectedFromModification(
|
||||||
|
const TopoDS_Shape & theS) const
|
||||||
|
{
|
||||||
|
return myProtectedFromModificationShapes.Contains(theS);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : NbFaultyContours
|
//function : NbFaultyContours
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -24,7 +24,9 @@
|
|||||||
#include <BRepGProp_VinertGK.hxx>
|
#include <BRepGProp_VinertGK.hxx>
|
||||||
#include <BRepGProp_Face.hxx>
|
#include <BRepGProp_Face.hxx>
|
||||||
#include <BRepGProp_Domain.hxx>
|
#include <BRepGProp_Domain.hxx>
|
||||||
|
#include <GProp_PGProps.hxx>
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
|
|
||||||
#include <TopTools.hxx>
|
#include <TopTools.hxx>
|
||||||
@@ -32,6 +34,8 @@
|
|||||||
#include <TopTools_ListOfShape.hxx>
|
#include <TopTools_ListOfShape.hxx>
|
||||||
#include <BRepCheck_Shell.hxx>
|
#include <BRepCheck_Shell.hxx>
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <BRep_TEdge.hxx>
|
||||||
|
#include <BRep_TVertex.hxx>
|
||||||
#ifdef DEB
|
#ifdef DEB
|
||||||
static Standard_Integer AffichEps = 0;
|
static Standard_Integer AffichEps = 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -55,9 +59,15 @@ void BRepGProp::LinearProperties(const TopoDS_Shape& S, GProp_GProps& SProps){
|
|||||||
// Standard_Integer n,i;
|
// Standard_Integer n,i;
|
||||||
TopExp_Explorer ex;
|
TopExp_Explorer ex;
|
||||||
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) {
|
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) {
|
||||||
BAC.Initialize(TopoDS::Edge(ex.Current()));
|
TopoDS_Edge anES = TopoDS::Edge(ex.Current());
|
||||||
BRepGProp_Cinert CG(BAC,P);
|
Handle_BRep_TEdge & anEG = (Handle_BRep_TEdge &)anES.TShape();
|
||||||
SProps.Add(CG);
|
BRep_TEdge dsd;
|
||||||
|
if (!anEG->Degenerated())
|
||||||
|
{
|
||||||
|
BAC.Initialize(anES);
|
||||||
|
BRepGProp_Cinert CG(BAC,P);
|
||||||
|
SProps.Add(CG);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -86,6 +86,7 @@
|
|||||||
#include <BRepBndLib.hxx>
|
#include <BRepBndLib.hxx>
|
||||||
#include <Approx_CurvilinearParameter.hxx>
|
#include <Approx_CurvilinearParameter.hxx>
|
||||||
#include <Geom_BSplineSurface.hxx>
|
#include <Geom_BSplineSurface.hxx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
|
|
||||||
|
|
||||||
// TODO - not thread-safe static variables
|
// TODO - not thread-safe static variables
|
||||||
@@ -1308,159 +1309,12 @@ void BRepLib::SameParameter(const TopoDS_Edge& AnEdge,
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : UpdateTolerances
|
//function : UpdateTolerances
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
|
void BRepLib::UpdateTolerances(const TopoDS_Shape & theS,
|
||||||
const Standard_Boolean verifyTolerance)
|
const Standard_Boolean theMinimizeTolerances)
|
||||||
{
|
{
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(theS, theMinimizeTolerances);
|
||||||
// Harmonize tolerances
|
|
||||||
// with rule Tolerance(VERTEX)>=Tolerance(EDGE)>=Tolerance(FACE)
|
|
||||||
BRep_Builder B;
|
|
||||||
Standard_Real tol=0;
|
|
||||||
if (verifyTolerance) {
|
|
||||||
// Set tolerance to its minimum value
|
|
||||||
Handle(Geom_Surface) S;
|
|
||||||
TopLoc_Location l;
|
|
||||||
TopExp_Explorer ex;
|
|
||||||
Bnd_Box aB;
|
|
||||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, dMax;
|
|
||||||
for (ex.Init(aShape, TopAbs_FACE); ex.More(); ex.Next()) {
|
|
||||||
const TopoDS_Face& curf=TopoDS::Face(ex.Current());
|
|
||||||
S = BRep_Tool::Surface(curf, l);
|
|
||||||
if (!S.IsNull()) {
|
|
||||||
aB.SetVoid();
|
|
||||||
BRepBndLib::Add(curf,aB);
|
|
||||||
if (S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
|
|
||||||
S = (*((Handle(Geom_RectangularTrimmedSurface)*)&S))->BasisSurface();
|
|
||||||
}
|
|
||||||
GeomAdaptor_Surface AS(S);
|
|
||||||
switch (AS.GetType()) {
|
|
||||||
case GeomAbs_Plane:
|
|
||||||
case GeomAbs_Cylinder:
|
|
||||||
case GeomAbs_Cone:
|
|
||||||
{
|
|
||||||
tol=Precision::Confusion();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GeomAbs_Sphere:
|
|
||||||
case GeomAbs_Torus:
|
|
||||||
{
|
|
||||||
tol=Precision::Confusion()*2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
tol=Precision::Confusion()*4;
|
|
||||||
}
|
|
||||||
if (!aB.IsWhole()) {
|
|
||||||
aB.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
|
||||||
dMax=1.;
|
|
||||||
if (!aB.IsOpenXmin() && !aB.IsOpenXmax()) dMax=aXmax-aXmin;
|
|
||||||
if (!aB.IsOpenYmin() && !aB.IsOpenYmax()) aYmin=aYmax-aYmin;
|
|
||||||
if (!aB.IsOpenZmin() && !aB.IsOpenZmax()) aZmin=aZmax-aZmin;
|
|
||||||
if (aYmin>dMax) dMax=aYmin;
|
|
||||||
if (aZmin>dMax) dMax=aZmin;
|
|
||||||
tol=tol*dMax;
|
|
||||||
// Do not process tolerances > 1.
|
|
||||||
if (tol>1.) tol=0.99;
|
|
||||||
}
|
|
||||||
const Handle(BRep_TFace)& Tf = *((Handle(BRep_TFace)*)&curf.TShape());
|
|
||||||
Tf->Tolerance(tol);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Process edges
|
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape parents;
|
|
||||||
TopExp::MapShapesAndAncestors(aShape, TopAbs_EDGE, TopAbs_FACE, parents);
|
|
||||||
TopTools_ListIteratorOfListOfShape lConx;
|
|
||||||
Standard_Integer iCur;
|
|
||||||
for (iCur=1; iCur<=parents.Extent(); iCur++) {
|
|
||||||
tol=0;
|
|
||||||
for (lConx.Initialize(parents(iCur)); lConx.More(); lConx.Next()) {
|
|
||||||
tol=Max(tol, BRep_Tool::Tolerance(TopoDS::Face(lConx.Value())));
|
|
||||||
}
|
|
||||||
// Update can only increase tolerance, so if the edge has a greater
|
|
||||||
// tolerance than its faces it is not concerned
|
|
||||||
B.UpdateEdge(TopoDS::Edge(parents.FindKey(iCur)), tol);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Vertices are processed
|
|
||||||
parents.Clear();
|
|
||||||
TopExp::MapShapesAndAncestors(aShape, TopAbs_VERTEX, TopAbs_EDGE, parents);
|
|
||||||
TColStd_MapOfTransient Initialized;
|
|
||||||
TopTools_MapOfShape Done;
|
|
||||||
Standard_Integer nbV = parents.Extent();
|
|
||||||
for (iCur=1; iCur<=nbV; iCur++) {
|
|
||||||
tol=0;
|
|
||||||
Done.Clear();
|
|
||||||
const TopoDS_Vertex& V = TopoDS::Vertex(parents.FindKey(iCur));
|
|
||||||
Bnd_Box box;
|
|
||||||
box.Add(BRep_Tool::Pnt(V));
|
|
||||||
gp_Pnt p3d;
|
|
||||||
for (lConx.Initialize(parents(iCur)); lConx.More(); lConx.Next()) {
|
|
||||||
const TopoDS_Edge& E = TopoDS::Edge(lConx.Value());
|
|
||||||
if(!Done.Add(E)) continue;
|
|
||||||
tol=Max(tol, BRep_Tool::Tolerance(E));
|
|
||||||
if(!BRep_Tool::SameRange(E)) continue;
|
|
||||||
Standard_Real par = BRep_Tool::Parameter(V,E);
|
|
||||||
Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&E.TShape());
|
|
||||||
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
|
|
||||||
const TopLoc_Location& Eloc = E.Location();
|
|
||||||
while (itcr.More()) {
|
|
||||||
// For each CurveRepresentation, check the provided parameter
|
|
||||||
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
|
|
||||||
const TopLoc_Location& loc = cr->Location();
|
|
||||||
TopLoc_Location L = (Eloc * loc);
|
|
||||||
if (cr->IsCurve3D()) {
|
|
||||||
const Handle(Geom_Curve)& C = cr->Curve3D();
|
|
||||||
if (!C.IsNull()) { // edge non degenerated
|
|
||||||
p3d = C->Value(par);
|
|
||||||
p3d.Transform(L.Transformation());
|
|
||||||
box.Add(p3d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (cr->IsCurveOnSurface()) {
|
|
||||||
const Handle(Geom_Surface)& Su = cr->Surface();
|
|
||||||
const Handle(Geom2d_Curve)& PC = cr->PCurve();
|
|
||||||
Handle(Geom2d_Curve) PC2;
|
|
||||||
if (cr->IsCurveOnClosedSurface()) {
|
|
||||||
PC2 = cr->PCurve2();
|
|
||||||
}
|
|
||||||
gp_Pnt2d p2d = PC->Value(par);
|
|
||||||
p3d = Su->Value(p2d.X(),p2d.Y());
|
|
||||||
p3d.Transform(L.Transformation());
|
|
||||||
box.Add(p3d);
|
|
||||||
if (!PC2.IsNull()) {
|
|
||||||
p2d = PC2->Value(par);
|
|
||||||
p3d = Su->Value(p2d.X(),p2d.Y());
|
|
||||||
p3d.Transform(L.Transformation());
|
|
||||||
box.Add(p3d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
itcr.Next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
|
||||||
box.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
|
||||||
aXmax -= aXmin; aYmax -= aYmin; aZmax -= aZmin;
|
|
||||||
tol = Max(tol,sqrt(aXmax*aXmax+aYmax*aYmax+aZmax*aZmax));
|
|
||||||
tol += 2.*Epsilon(tol);
|
|
||||||
if (verifyTolerance) {
|
|
||||||
// ASet minimum value of the tolerance
|
|
||||||
// Attention to sharing of the vertex by other shapes
|
|
||||||
const Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*)&V.TShape());
|
|
||||||
if (Initialized.Add(TV))
|
|
||||||
TV->Tolerance(tol);
|
|
||||||
else
|
|
||||||
B.UpdateVertex(V, tol);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Update can only increase tolerance, so if the edge has a greater
|
|
||||||
// tolerance than its faces it is not concerned
|
|
||||||
B.UpdateVertex(V, tol);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
255
src/BRepLib/BRepLib_ToleranceRule.cxx
Normal file
255
src/BRepLib/BRepLib_ToleranceRule.cxx
Normal file
@@ -0,0 +1,255 @@
|
|||||||
|
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// The content of this file is subject to the Open CASCADE Technology Public
|
||||||
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||||
|
// except in compliance with the License. Please obtain a copy of the License
|
||||||
|
// at http://www.opencascade.org and read it completely before using this file.
|
||||||
|
//
|
||||||
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||||
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||||
|
//
|
||||||
|
// The Original Code and all software distributed under the License is
|
||||||
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||||
|
// Initial Developer hereby disclaims all such warranties, including without
|
||||||
|
// limitation, any warranties of merchantability, fitness for a particular
|
||||||
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
|
|
||||||
|
#include <Bnd_Box.hxx>
|
||||||
|
#include <BRep_CurveRepresentation.hxx>
|
||||||
|
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||||
|
#include <BRepBndLib.hxx>
|
||||||
|
#include <Geom_Curve.hxx>
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||||
|
#include <Geom2d_Curve.hxx>
|
||||||
|
#include <GeomAdaptor_Surface.hxx>
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <Precision.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS_Vertex.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ProperTolerances
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void BRepLib_ToleranceRule::ProperTolerances(const TopoDS_Shape & theS,
|
||||||
|
NCollection_DataMap<TopoDS_Shape, Standard_Real,
|
||||||
|
TopTools_ShapeMapHasher> & theTs,
|
||||||
|
Standard_Boolean theMinimizeTolerances)
|
||||||
|
{
|
||||||
|
// Process faces.
|
||||||
|
for (TopExp_Explorer aFIt(theS, TopAbs_FACE); aFIt.More(); aFIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Face & aF = TopoDS::Face(aFIt.Current());
|
||||||
|
Standard_Real aFT = Precision::Confusion() * 4;
|
||||||
|
if (!theMinimizeTolerances)
|
||||||
|
{
|
||||||
|
aFT = BRep_Tool::Tolerance(aF);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TopLoc_Location aL;
|
||||||
|
Handle_Geom_Surface aS = BRep_Tool::Surface(aF, aL);
|
||||||
|
if (!aS.IsNull())
|
||||||
|
{
|
||||||
|
if (theTs.IsBound(aF))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (aS->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface))
|
||||||
|
{
|
||||||
|
Handle_Geom_RectangularTrimmedSurface aTS =
|
||||||
|
Handle_Geom_RectangularTrimmedSurface::DownCast(aS);
|
||||||
|
aS = aTS->BasisSurface();
|
||||||
|
}
|
||||||
|
//
|
||||||
|
switch (GeomAdaptor_Surface(aS).GetType())
|
||||||
|
{
|
||||||
|
case GeomAbs_Plane:
|
||||||
|
case GeomAbs_Cylinder:
|
||||||
|
case GeomAbs_Cone:
|
||||||
|
{
|
||||||
|
aFT = Precision::Confusion();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case GeomAbs_Sphere:
|
||||||
|
case GeomAbs_Torus:
|
||||||
|
{
|
||||||
|
aFT = Precision::Confusion() * 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
Bnd_Box aBox;
|
||||||
|
BRepBndLib::Add(aF, aBox);
|
||||||
|
if (!aBox.IsWhole())
|
||||||
|
{
|
||||||
|
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
||||||
|
aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||||
|
Standard_Real dMax = 1;
|
||||||
|
if (!aBox.IsOpenXmin() && !aBox.IsOpenXmax())
|
||||||
|
{
|
||||||
|
dMax = aXmax - aXmin;
|
||||||
|
}
|
||||||
|
if (!aBox.IsOpenYmin() && !aBox.IsOpenYmax())
|
||||||
|
{
|
||||||
|
aYmin = aYmax - aYmin;
|
||||||
|
}
|
||||||
|
if (!aBox.IsOpenZmin() && !aBox.IsOpenZmax())
|
||||||
|
{
|
||||||
|
aZmin = aZmax - aZmin;
|
||||||
|
}
|
||||||
|
if (dMax < aYmin)
|
||||||
|
{
|
||||||
|
dMax = aYmin;
|
||||||
|
}
|
||||||
|
if (dMax < aZmin)
|
||||||
|
{
|
||||||
|
dMax = aZmin;
|
||||||
|
}
|
||||||
|
aFT = aFT * dMax;
|
||||||
|
// Do not process tolerances > 1.
|
||||||
|
if (1 < aFT) aFT = 0.99;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
theTs.Bind(aF, aFT);
|
||||||
|
}
|
||||||
|
// Process face edges.
|
||||||
|
for (TopExp_Explorer anEIt(aF, TopAbs_EDGE); anEIt.More(); anEIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Edge & anE = TopoDS::Edge(anEIt.Current());
|
||||||
|
Standard_Real anET = Max(aFT, BRep_Tool::Tolerance(anE));
|
||||||
|
if (!theTs.IsBound(anE))
|
||||||
|
{
|
||||||
|
theTs.Bind(anE, anET);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Standard_Real & aT = theTs(anE);
|
||||||
|
anET = Max(anET, aT);
|
||||||
|
aT = anET;
|
||||||
|
}
|
||||||
|
// Process face edge vertices.
|
||||||
|
for (TopExp_Explorer aVIt(anE, TopAbs_VERTEX); aVIt.More(); aVIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Vertex & aV = TopoDS::Vertex(aVIt.Current());
|
||||||
|
Standard_Real aVT = anET;
|
||||||
|
if (!theMinimizeTolerances)
|
||||||
|
{
|
||||||
|
aVT = Max(anET, BRep_Tool::Tolerance(aV));
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (BRep_Tool::SameRange(anE))
|
||||||
|
{
|
||||||
|
Bnd_Box aBox;
|
||||||
|
aBox.Add(BRep_Tool::Pnt(aV));
|
||||||
|
Standard_Real aPar = BRep_Tool::Parameter(aV, anE);
|
||||||
|
Handle_BRep_TEdge & anED = (Handle_BRep_TEdge &)anE.TShape();
|
||||||
|
const TopLoc_Location & anEL = anE.Location();
|
||||||
|
for (BRep_ListIteratorOfListOfCurveRepresentation
|
||||||
|
aRIt(anED->Curves()); aRIt.More(); aRIt.Next())
|
||||||
|
{
|
||||||
|
// For each CurveRepresentation, check the provided parameter
|
||||||
|
const Handle_BRep_CurveRepresentation & aR = aRIt.Value();
|
||||||
|
const TopLoc_Location & aRL = aR->Location();
|
||||||
|
TopLoc_Location aL = anEL * aRL;
|
||||||
|
if (aR->IsCurve3D())
|
||||||
|
{
|
||||||
|
const Handle_Geom_Curve & aC = aR->Curve3D();
|
||||||
|
if (!aC.IsNull())
|
||||||
|
{
|
||||||
|
// edge non degenerated
|
||||||
|
gp_Pnt aPnt = aC->Value(aPar);
|
||||||
|
aPnt.Transform(aL.Transformation());
|
||||||
|
aBox.Add(aPnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (aR->IsCurveOnSurface())
|
||||||
|
{
|
||||||
|
const Handle_Geom_Surface & aS = aR->Surface();
|
||||||
|
const Handle_Geom2d_Curve & aC = aR->PCurve();
|
||||||
|
const Handle_Geom2d_Curve * aC2 = 0;
|
||||||
|
if (aR->IsCurveOnClosedSurface())
|
||||||
|
{
|
||||||
|
aC2 = &(aR->PCurve2());
|
||||||
|
}
|
||||||
|
gp_Pnt2d a2DP = aC->Value(aPar);
|
||||||
|
gp_Pnt a3DP = aS->Value(a2DP.X(), a2DP.Y());
|
||||||
|
a3DP.Transform(aL.Transformation());
|
||||||
|
aBox.Add(a3DP);
|
||||||
|
if (aC2 != 0)
|
||||||
|
{
|
||||||
|
a2DP = (*aC2)->Value(aPar);
|
||||||
|
a3DP = aS->Value(a2DP.X(), a2DP.Y());
|
||||||
|
a3DP.Transform(aL.Transformation());
|
||||||
|
aBox.Add(a3DP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
||||||
|
aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
||||||
|
aXmax -= aXmin; aYmax -= aYmin; aZmax -= aZmin;
|
||||||
|
Standard_Real aT =
|
||||||
|
sqrt(aXmax * aXmax + aYmax * aYmax + aZmax * aZmax);
|
||||||
|
aT += 2 * Epsilon(aT);
|
||||||
|
aVT = Max(aVT, aT);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!theTs.IsBound(aV))
|
||||||
|
{
|
||||||
|
theTs.Bind(aV, aVT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Standard_Real & aT = theTs(aV);
|
||||||
|
aT = Max(aVT, aT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Process face vertices.
|
||||||
|
for (TopExp_Explorer aVIt(aF, TopAbs_VERTEX, TopAbs_EDGE);
|
||||||
|
aVIt.More(); aVIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Vertex & aV = TopoDS::Vertex(aVIt.Current());
|
||||||
|
Standard_Real aVT = Max(aFT, BRep_Tool::Tolerance(aV));
|
||||||
|
if (!theTs.IsBound(aV))
|
||||||
|
{
|
||||||
|
theTs.Bind(aV, aVT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Standard_Real & aT = theTs(aV);
|
||||||
|
aT = Max(aVT, aT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Process edges without faces.
|
||||||
|
for (TopExp_Explorer anEIt(theS, TopAbs_EDGE, TopAbs_FACE);
|
||||||
|
anEIt.More(); anEIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Edge & anE = TopoDS::Edge(anEIt.Current());
|
||||||
|
Standard_Real anET = BRep_Tool::Tolerance(anE);
|
||||||
|
// Process edge vertices.
|
||||||
|
for (TopExp_Explorer aVIt(anE, TopAbs_VERTEX); aVIt.More(); aVIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Vertex & aV = TopoDS::Vertex(aVIt.Current());
|
||||||
|
Standard_Real aVT = Max(anET, BRep_Tool::Tolerance(aV));
|
||||||
|
if (!theTs.IsBound(aV))
|
||||||
|
{
|
||||||
|
theTs.Bind(aV, aVT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Standard_Real & aT = theTs(aV);
|
||||||
|
aT = Max(aVT, aT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
75
src/BRepLib/BRepLib_ToleranceRule.hxx
Normal file
75
src/BRepLib/BRepLib_ToleranceRule.hxx
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// The content of this file is subject to the Open CASCADE Technology Public
|
||||||
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||||
|
// except in compliance with the License. Please obtain a copy of the License
|
||||||
|
// at http://www.opencascade.org and read it completely before using this file.
|
||||||
|
//
|
||||||
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||||
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||||
|
//
|
||||||
|
// The Original Code and all software distributed under the License is
|
||||||
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||||
|
// Initial Developer hereby disclaims all such warranties, including without
|
||||||
|
// limitation, any warranties of merchantability, fitness for a particular
|
||||||
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
#ifndef _BRepLib_ToleranceRule_HeaderFile
|
||||||
|
#define _BRepLib_ToleranceRule_HeaderFile
|
||||||
|
|
||||||
|
#include <BRep_TEdge.hxx>
|
||||||
|
#include <BRep_TFace.hxx>
|
||||||
|
#include <BRep_TVertex.hxx>
|
||||||
|
#include <NCollection_DataMap.hxx>
|
||||||
|
#include <TopTools_ShapeMapHasher.hxx>
|
||||||
|
|
||||||
|
//! The type is intended to work with shape tolerances by tolerance rule.<br>
|
||||||
|
class BRepLib_ToleranceRule
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DEFINE_STANDARD_ALLOC
|
||||||
|
//! In shape theS context calculates proper tolerance theTs(S) for every
|
||||||
|
//! shape theS shape S so that
|
||||||
|
//! - S is edge contained by a face of shape theS or
|
||||||
|
//! - S is vertex contained by an edge or a face of shape theS.
|
||||||
|
//! Shape S tolerance t(S) may be only increased:
|
||||||
|
//! t(S) <= theTs(S).
|
||||||
|
//! Calculation is made by the tolerance rule:
|
||||||
|
//! face F contains edge E ==> t(F) <= theTs(E),
|
||||||
|
//! edge E contains vertex V ==> theTs(E) <= theTs(V),
|
||||||
|
//! face F contains vertex V ==> t(F) <= theTs(V).
|
||||||
|
//!
|
||||||
|
//! If flag theMinimizeTolerances is Standard_True then
|
||||||
|
//! - theTs(F) is calculated for every face F of shape theS as
|
||||||
|
//! only face F type and size dependent value,
|
||||||
|
//! - theTs(F) is used instead of t(F),
|
||||||
|
//! - tolerance of vertex V representations is used instead of t(V).
|
||||||
|
Standard_EXPORT static void ProperTolerances(const TopoDS_Shape & theS,
|
||||||
|
NCollection_DataMap<TopoDS_Shape, Standard_Real,
|
||||||
|
TopTools_ShapeMapHasher> & theTs,
|
||||||
|
Standard_Boolean theMinimizeTolerances = Standard_False);
|
||||||
|
//! Auxiliary method. Returns Standard_False.
|
||||||
|
Standard_Boolean IsProtectedFromModification(
|
||||||
|
const TopoDS_Shape & theS) const;
|
||||||
|
//! The method is intended for any class T which contains method
|
||||||
|
//! IsProtectedFromModification with the following definition:
|
||||||
|
//! Standard_Boolean IsProtectedFromModification(
|
||||||
|
//! const TopoDS_Shape & theShape) const.
|
||||||
|
//! Gets proper tolerances by
|
||||||
|
//! ProperTolerances(theS, aTs, theMinimizeTolerances).
|
||||||
|
//! Toleranse t(S) is set to aTs(S) for every shape S so that
|
||||||
|
//! aTs.IsBound(S) is Standard_True and
|
||||||
|
//! theObj.IsProtectedFromModification(S) is Standard_False.
|
||||||
|
template <typename T> static void SetProperTolerances(
|
||||||
|
const TopoDS_Shape & theS, const T & theObj,
|
||||||
|
Standard_Boolean theMinimizeTolerances = Standard_False);
|
||||||
|
//! Calls SetProperTolerances(
|
||||||
|
//! theS, BRepLib_ToleranceRule(), theMinimizeTolerances).
|
||||||
|
static void SetProperTolerances(const TopoDS_Shape & theS,
|
||||||
|
Standard_Boolean theMinimizeTolerances = Standard_False);
|
||||||
|
};
|
||||||
|
|
||||||
|
#include <BRepLib_ToleranceRule.lxx>
|
||||||
|
|
||||||
|
#endif
|
117
src/BRepLib/BRepLib_ToleranceRule.lxx
Normal file
117
src/BRepLib/BRepLib_ToleranceRule.lxx
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// The content of this file is subject to the Open CASCADE Technology Public
|
||||||
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||||
|
// except in compliance with the License. Please obtain a copy of the License
|
||||||
|
// at http://www.opencascade.org and read it completely before using this file.
|
||||||
|
//
|
||||||
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||||
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||||
|
//
|
||||||
|
// The Original Code and all software distributed under the License is
|
||||||
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||||
|
// Initial Developer hereby disclaims all such warranties, including without
|
||||||
|
// limitation, any warranties of merchantability, fitness for a particular
|
||||||
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Face.hxx>
|
||||||
|
#include <TopoDS_Vertex.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsProtectedFromModification
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
inline Standard_Boolean BRepLib_ToleranceRule::IsProtectedFromModification(
|
||||||
|
const TopoDS_Shape &) const
|
||||||
|
{
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetProperTolerances
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
template <typename T>
|
||||||
|
void BRepLib_ToleranceRule::SetProperTolerances(const TopoDS_Shape & theS,
|
||||||
|
const T & theObj, Standard_Boolean theMinimizeTolerances)
|
||||||
|
{
|
||||||
|
// Get proper tolerances.
|
||||||
|
NCollection_DataMap<TopoDS_Shape, Standard_Real,
|
||||||
|
TopTools_ShapeMapHasher> aTs;
|
||||||
|
ProperTolerances(theS, aTs, theMinimizeTolerances);
|
||||||
|
// Process faces.
|
||||||
|
if (theMinimizeTolerances)
|
||||||
|
{
|
||||||
|
for (TopExp_Explorer aFIt(theS, TopAbs_FACE); aFIt.More(); aFIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Face & aF = TopoDS::Face(aFIt.Current());
|
||||||
|
if (!theObj.IsProtectedFromModification(aF))
|
||||||
|
{
|
||||||
|
Handle_BRep_TFace & aFD = Handle_BRep_TFace::DownCast(aF.TShape());
|
||||||
|
aFD->Tolerance(aTs(aF));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Process edges and vertices with face.
|
||||||
|
for (TopExp_Explorer aFIt(theS, TopAbs_FACE); aFIt.More(); aFIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Face & aF = TopoDS::Face(aFIt.Current());
|
||||||
|
// Process face edges.
|
||||||
|
for (TopExp_Explorer anEIt(aF, TopAbs_EDGE); anEIt.More(); anEIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Edge & anE = TopoDS::Edge(anEIt.Current());
|
||||||
|
if (!theObj.IsProtectedFromModification(anE))
|
||||||
|
{
|
||||||
|
Handle_BRep_TEdge & anED = Handle_BRep_TEdge::DownCast(anE.TShape());
|
||||||
|
anED->Tolerance(aTs(anE));
|
||||||
|
}
|
||||||
|
// Process face edge vertices.
|
||||||
|
for (TopExp_Explorer aVIt(anE, TopAbs_VERTEX); aVIt.More(); aVIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Vertex & aV = TopoDS::Vertex(aVIt.Current());
|
||||||
|
if (!theObj.IsProtectedFromModification(aV))
|
||||||
|
{
|
||||||
|
Handle_BRep_TVertex & aVD =
|
||||||
|
Handle_BRep_TVertex::DownCast(aV.TShape());
|
||||||
|
aVD->Tolerance(aTs(aV));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Process face vertices.
|
||||||
|
for (TopExp_Explorer aVIt(aF, TopAbs_VERTEX, TopAbs_EDGE);
|
||||||
|
aVIt.More(); aVIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Vertex & aV = TopoDS::Vertex(aVIt.Current());
|
||||||
|
if (!theObj.IsProtectedFromModification(aV))
|
||||||
|
{
|
||||||
|
Handle_BRep_TVertex & aVD = Handle_BRep_TVertex::DownCast(aV.TShape());
|
||||||
|
aVD->Tolerance(aTs(aV));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Process edge vertices without faces.
|
||||||
|
for (TopExp_Explorer anEIt(theS, TopAbs_EDGE, TopAbs_FACE);
|
||||||
|
anEIt.More(); anEIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Edge & anE = TopoDS::Edge(anEIt.Current());
|
||||||
|
for (TopExp_Explorer aVIt(anE, TopAbs_VERTEX); aVIt.More(); aVIt.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Vertex & aV = TopoDS::Vertex(aVIt.Current());
|
||||||
|
if (!theObj.IsProtectedFromModification(aV))
|
||||||
|
{
|
||||||
|
Handle_BRep_TVertex & aVD = Handle_BRep_TVertex::DownCast(aV.TShape());
|
||||||
|
aVD->Tolerance(aTs(aV));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void BRepLib_ToleranceRule::SetProperTolerances(
|
||||||
|
const TopoDS_Shape & theS, Standard_Boolean theMinimizeTolerances)
|
||||||
|
{
|
||||||
|
SetProperTolerances(theS, BRepLib_ToleranceRule(), theMinimizeTolerances);
|
||||||
|
}
|
@@ -1 +1,4 @@
|
|||||||
BRepLib_MakeWire_1.cxx
|
BRepLib_MakeWire_1.cxx
|
||||||
|
BRepLib_ToleranceRule.hxx
|
||||||
|
BRepLib_ToleranceRule.lxx
|
||||||
|
BRepLib_ToleranceRule.cxx
|
||||||
|
@@ -44,6 +44,7 @@
|
|||||||
#include <BRepCheck_Vertex.hxx>
|
#include <BRepCheck_Vertex.hxx>
|
||||||
#include <BRepLib.hxx>
|
#include <BRepLib.hxx>
|
||||||
#include <BRepLib_MakeVertex.hxx>
|
#include <BRepLib_MakeVertex.hxx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <BRep_TVertex.hxx>
|
#include <BRep_TVertex.hxx>
|
||||||
@@ -761,10 +762,10 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
|
|||||||
// ----------------------------
|
// ----------------------------
|
||||||
if (!myOffsetShape.IsNull()) {
|
if (!myOffsetShape.IsNull()) {
|
||||||
UpdateTolerance (myOffsetShape,myFaces);
|
UpdateTolerance (myOffsetShape,myFaces);
|
||||||
BRepLib::UpdateTolerances( myOffsetShape );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CorrectConicalFaces();
|
CorrectConicalFaces();
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myOffsetShape);
|
||||||
|
|
||||||
myDone = Standard_True;
|
myDone = Standard_True;
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,8 @@ uses
|
|||||||
Wire from TopoDS,
|
Wire from TopoDS,
|
||||||
Shape from TopoDS,
|
Shape from TopoDS,
|
||||||
Edge from TopoDS,
|
Edge from TopoDS,
|
||||||
ListOfShape from TopTools
|
ListOfShape from TopTools,
|
||||||
|
IndexedMapOfShape from TopTools
|
||||||
|
|
||||||
is
|
is
|
||||||
|
|
||||||
@@ -86,8 +87,14 @@ is
|
|||||||
returns Shape from TopoDS;
|
returns Shape from TopoDS;
|
||||||
|
|
||||||
|
|
||||||
|
IsProtectedFromModification(me; theS : Shape from TopoDS)
|
||||||
|
---Purpose: Indicates if theS is protected from modification.
|
||||||
|
returns Boolean from Standard;
|
||||||
|
|
||||||
fields
|
fields
|
||||||
|
|
||||||
myPipe : Pipe from BRepFill;
|
myPipe : Pipe from BRepFill;
|
||||||
|
|
||||||
|
myProtectedFromModificationShapes : IndexedMapOfShape from TopTools;
|
||||||
|
|
||||||
end MakePipe;
|
end MakePipe;
|
||||||
|
@@ -21,12 +21,14 @@
|
|||||||
|
|
||||||
#include <BRepOffsetAPI_MakePipe.ixx>
|
#include <BRepOffsetAPI_MakePipe.ixx>
|
||||||
|
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <TopoDS_Face.hxx>
|
#include <TopoDS_Face.hxx>
|
||||||
#include <TopoDS_Edge.hxx>
|
#include <TopoDS_Edge.hxx>
|
||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <TopAbs_ShapeEnum.hxx>
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BRepOffsetAPI_MakePipe
|
//function : BRepOffsetAPI_MakePipe
|
||||||
@@ -37,6 +39,8 @@ BRepOffsetAPI_MakePipe::BRepOffsetAPI_MakePipe(const TopoDS_Wire& Spine ,
|
|||||||
const TopoDS_Shape& Profile)
|
const TopoDS_Shape& Profile)
|
||||||
: myPipe(Spine, Profile)
|
: myPipe(Spine, Profile)
|
||||||
{
|
{
|
||||||
|
TopExp::MapShapes(Profile, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
Build();
|
Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,6 +63,7 @@ const BRepFill_Pipe& BRepOffsetAPI_MakePipe::Pipe() const
|
|||||||
void BRepOffsetAPI_MakePipe::Build()
|
void BRepOffsetAPI_MakePipe::Build()
|
||||||
{
|
{
|
||||||
myShape = myPipe.Shape();
|
myShape = myPipe.Shape();
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myShape, *this);
|
||||||
Done();
|
Done();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,3 +110,12 @@ TopoDS_Shape BRepOffsetAPI_MakePipe::Generated (const TopoDS_Shape& SSpine,
|
|||||||
return bid;
|
return bid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsProtectedFromModification
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean BRepOffsetAPI_MakePipe::IsProtectedFromModification(
|
||||||
|
const TopoDS_Shape & theS) const
|
||||||
|
{
|
||||||
|
return myProtectedFromModificationShapes.Contains(theS);
|
||||||
|
}
|
||||||
|
@@ -53,7 +53,8 @@ uses
|
|||||||
Vertex from TopoDS,
|
Vertex from TopoDS,
|
||||||
TransitionMode from BRepBuilderAPI,
|
TransitionMode from BRepBuilderAPI,
|
||||||
PipeError from BRepBuilderAPI,
|
PipeError from BRepBuilderAPI,
|
||||||
PipeShell from BRepFill
|
PipeShell from BRepFill,
|
||||||
|
IndexedMapOfShape from TopTools
|
||||||
|
|
||||||
raises
|
raises
|
||||||
DomainError from Standard,
|
DomainError from Standard,
|
||||||
@@ -320,9 +321,15 @@ is
|
|||||||
returns ListOfShape from TopTools
|
returns ListOfShape from TopTools
|
||||||
is redefined;
|
is redefined;
|
||||||
|
|
||||||
|
IsProtectedFromModification(me; theS : Shape)
|
||||||
|
---Purpose: Indicates if theS is protected from modification.
|
||||||
|
returns Boolean;
|
||||||
|
|
||||||
fields
|
fields
|
||||||
myPipe : PipeShell from BRepFill;
|
myPipe : PipeShell from BRepFill;
|
||||||
|
|
||||||
|
myProtectedFromModificationShapes : IndexedMapOfShape from TopTools;
|
||||||
|
|
||||||
end MakePipeShell;
|
end MakePipeShell;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -22,9 +22,11 @@
|
|||||||
|
|
||||||
#include <BRepOffsetAPI_MakePipeShell.ixx>
|
#include <BRepOffsetAPI_MakePipeShell.ixx>
|
||||||
|
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
#include <GeomFill_PipeError.hxx>
|
#include <GeomFill_PipeError.hxx>
|
||||||
#include <Standard_NotImplemented.hxx>
|
#include <Standard_NotImplemented.hxx>
|
||||||
#include <StdFail_NotDone.hxx>
|
#include <StdFail_NotDone.hxx>
|
||||||
|
#include <TopExp.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function :
|
//function :
|
||||||
@@ -95,6 +97,7 @@ BRepOffsetAPI_MakePipeShell::BRepOffsetAPI_MakePipeShell(const TopoDS_Wire& Spin
|
|||||||
const Standard_Boolean WithContact,
|
const Standard_Boolean WithContact,
|
||||||
const Standard_Boolean WithCorrection)
|
const Standard_Boolean WithCorrection)
|
||||||
{
|
{
|
||||||
|
TopExp::MapShapes(Profile, myProtectedFromModificationShapes);
|
||||||
myPipe->Add(Profile, WithContact, WithCorrection);
|
myPipe->Add(Profile, WithContact, WithCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +110,7 @@ BRepOffsetAPI_MakePipeShell::BRepOffsetAPI_MakePipeShell(const TopoDS_Wire& Spin
|
|||||||
const Standard_Boolean WithContact,
|
const Standard_Boolean WithContact,
|
||||||
const Standard_Boolean WithCorrection)
|
const Standard_Boolean WithCorrection)
|
||||||
{
|
{
|
||||||
|
TopExp::MapShapes(Profile, myProtectedFromModificationShapes);
|
||||||
myPipe->Add(Profile, Location, WithContact, WithCorrection);
|
myPipe->Add(Profile, Location, WithContact, WithCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,6 +123,7 @@ BRepOffsetAPI_MakePipeShell::BRepOffsetAPI_MakePipeShell(const TopoDS_Wire& Spin
|
|||||||
const Standard_Boolean WithContact,
|
const Standard_Boolean WithContact,
|
||||||
const Standard_Boolean WithCorrection)
|
const Standard_Boolean WithCorrection)
|
||||||
{
|
{
|
||||||
|
TopExp::MapShapes(Profile, myProtectedFromModificationShapes);
|
||||||
myPipe->SetLaw(Profile, L, WithContact, WithCorrection);
|
myPipe->SetLaw(Profile, L, WithContact, WithCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,6 +137,7 @@ BRepOffsetAPI_MakePipeShell::BRepOffsetAPI_MakePipeShell(const TopoDS_Wire& Spin
|
|||||||
const Standard_Boolean WithContact,
|
const Standard_Boolean WithContact,
|
||||||
const Standard_Boolean WithCorrection)
|
const Standard_Boolean WithCorrection)
|
||||||
{
|
{
|
||||||
|
TopExp::MapShapes(Profile, myProtectedFromModificationShapes);
|
||||||
myPipe->SetLaw(Profile, L, Location, WithContact, WithCorrection);
|
myPipe->SetLaw(Profile, L, Location, WithContact, WithCorrection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,6 +231,7 @@ void BRepOffsetAPI_MakePipeShell::Delete( const TopoDS_Shape& Profile)
|
|||||||
Ok = myPipe->Build();
|
Ok = myPipe->Build();
|
||||||
if (Ok) {
|
if (Ok) {
|
||||||
myShape = myPipe->Shape();
|
myShape = myPipe->Shape();
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myShape, *this);
|
||||||
Done();
|
Done();
|
||||||
}
|
}
|
||||||
else NotDone();
|
else NotDone();
|
||||||
@@ -272,3 +279,12 @@ BRepOffsetAPI_MakePipeShell::Generated(const TopoDS_Shape& S)
|
|||||||
return myGenerated;
|
return myGenerated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsProtectedFromModification
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean BRepOffsetAPI_MakePipeShell::IsProtectedFromModification(
|
||||||
|
const TopoDS_Shape & theS) const
|
||||||
|
{
|
||||||
|
return myProtectedFromModificationShapes.Contains(theS);
|
||||||
|
}
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <BRepOffsetAPI_NormalProjection.ixx>
|
#include <BRepOffsetAPI_NormalProjection.ixx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
|
|
||||||
BRepOffsetAPI_NormalProjection::BRepOffsetAPI_NormalProjection()
|
BRepOffsetAPI_NormalProjection::BRepOffsetAPI_NormalProjection()
|
||||||
{
|
{
|
||||||
@@ -64,6 +65,7 @@ BRepOffsetAPI_NormalProjection::BRepOffsetAPI_NormalProjection()
|
|||||||
{
|
{
|
||||||
myNormalProjector.Build();
|
myNormalProjector.Build();
|
||||||
myShape = myNormalProjector.Projection();
|
myShape = myNormalProjector.Projection();
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myShape);
|
||||||
Done();
|
Done();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -76,6 +76,7 @@
|
|||||||
|
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
|
#include <NCollection_Array1.hxx>
|
||||||
|
|
||||||
//#ifdef WNT
|
//#ifdef WNT
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -114,13 +115,13 @@ Standard_IMPORT Standard_Integer BRepCheck_Trace(const Standard_Integer phase);
|
|||||||
//function : FindNamed
|
//function : FindNamed
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
static Standard_Boolean FindNamed(const TopoDS_Shape& S,
|
static Standard_Boolean FindNamed(const TopoDS_Shape& S,
|
||||||
char*& Name)
|
const char*& Name)
|
||||||
{
|
{
|
||||||
for (Standard_Integer i = 1 ;i <= lfaulty.Length(); i++) {
|
for (Standard_Integer i = 1 ;i <= lfaulty.Length(); i++) {
|
||||||
Handle(DBRep_DrawableShape) DS =
|
Handle(DBRep_DrawableShape) DS =
|
||||||
Handle(DBRep_DrawableShape)::DownCast(lfaulty(i));
|
Handle(DBRep_DrawableShape)::DownCast(lfaulty(i));
|
||||||
if (DS->Shape().IsSame(S)) {
|
if (DS->Shape().IsSame(S)) {
|
||||||
Name = (char*)DS->Name();
|
Name = DS->Name();
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -154,7 +155,6 @@ static void PrintSub(Standard_OStream& OS,
|
|||||||
const TopAbs_ShapeEnum Subtype)
|
const TopAbs_ShapeEnum Subtype)
|
||||||
|
|
||||||
{
|
{
|
||||||
char* Name;
|
|
||||||
BRepCheck_ListIteratorOfListOfStatus itl;
|
BRepCheck_ListIteratorOfListOfStatus itl;
|
||||||
TopExp_Explorer exp;
|
TopExp_Explorer exp;
|
||||||
for (exp.Init(S,Subtype); exp.More(); exp.Next()) {
|
for (exp.Init(S,Subtype); exp.More(); exp.Next()) {
|
||||||
@@ -168,25 +168,27 @@ static void PrintSub(Standard_OStream& OS,
|
|||||||
theMap(sub).Append(S);
|
theMap(sub).Append(S);
|
||||||
itl.Initialize(res->StatusOnShape());
|
itl.Initialize(res->StatusOnShape());
|
||||||
if (itl.Value() != BRepCheck_NoError) {
|
if (itl.Value() != BRepCheck_NoError) {
|
||||||
if (!FindNamed(sub,Name)) {
|
const char* pName;
|
||||||
|
if (!FindNamed(sub,pName)) {
|
||||||
nbfaulty++;
|
nbfaulty++;
|
||||||
Name = (char*)malloc(18*sizeof(char));
|
char aName[256];
|
||||||
Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
|
Sprintf(aName,"%.80s%d",checkfaultyname,nbfaulty);
|
||||||
DBRep::Set(Name,sub);
|
DBRep::Set(aName,sub);
|
||||||
lfaulty.Append(Draw::Get((Standard_CString&)Name));
|
pName = aName;
|
||||||
}
|
lfaulty.Append(Draw::Get(pName));
|
||||||
OS << "Shape " << Name << " ";
|
OS << "Shape " << pName << " ";
|
||||||
if (!FindNamed(S,Name)) {
|
if (!FindNamed(S,pName)) {
|
||||||
nbfaulty++;
|
nbfaulty++;
|
||||||
Name = (char*)malloc(18*sizeof(char));
|
Sprintf(aName,"%.80s%d",checkfaultyname,nbfaulty);
|
||||||
Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
|
DBRep::Set(aName,S);
|
||||||
DBRep::Set(Name,S);
|
pName = aName;
|
||||||
lfaulty.Append(Draw::Get((Standard_CString&)Name));
|
lfaulty.Append(Draw::Get(pName));
|
||||||
}
|
}
|
||||||
OS << " on shape " << Name << " :\n";
|
OS << " on shape " << pName << " :\n";
|
||||||
for (;itl.More(); itl.Next()) {
|
for (;itl.More(); itl.Next()) {
|
||||||
BRepCheck::Print(itl.Value(),OS);
|
BRepCheck::Print(itl.Value(),OS);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -206,20 +208,21 @@ static void Print(Standard_OStream& OS,
|
|||||||
Print(OS,Ana,iter.Value());
|
Print(OS,Ana,iter.Value());
|
||||||
}
|
}
|
||||||
|
|
||||||
char* Name;
|
|
||||||
TopAbs_ShapeEnum styp = S.ShapeType();
|
TopAbs_ShapeEnum styp = S.ShapeType();
|
||||||
BRepCheck_ListIteratorOfListOfStatus itl;
|
BRepCheck_ListIteratorOfListOfStatus itl;
|
||||||
if (!Ana.Result(S).IsNull() && !theMap.IsBound(S)) {
|
if (!Ana.Result(S).IsNull() && !theMap.IsBound(S)) {
|
||||||
itl.Initialize(Ana.Result(S)->Status());
|
itl.Initialize(Ana.Result(S)->Status());
|
||||||
if (itl.Value() != BRepCheck_NoError) {
|
if (itl.Value() != BRepCheck_NoError) {
|
||||||
if (!FindNamed(S,Name)) {
|
const char* pName;
|
||||||
|
char aName[256];
|
||||||
|
if (!FindNamed(S,pName)) {
|
||||||
nbfaulty++;
|
nbfaulty++;
|
||||||
Name = (char*)malloc(18*sizeof(char));
|
Sprintf(aName,"%.80s%d",checkfaultyname,nbfaulty);
|
||||||
Sprintf(Name,"%s%d",checkfaultyname,nbfaulty);
|
DBRep::Set(aName,S);
|
||||||
DBRep::Set(Name,S);
|
pName = aName;
|
||||||
lfaulty.Append(Draw::Get((Standard_CString&)Name));
|
lfaulty.Append(Draw::Get(pName));
|
||||||
}
|
}
|
||||||
OS << "On Shape " << Name << " :\n";
|
OS << "On Shape " << pName << " :\n";
|
||||||
|
|
||||||
for (;itl.More(); itl.Next()) {
|
for (;itl.More(); itl.Next()) {
|
||||||
BRepCheck::Print(itl.Value(),OS);
|
BRepCheck::Print(itl.Value(),OS);
|
||||||
@@ -466,99 +469,18 @@ void ContextualDump(Draw_Interpretor& theCommands,
|
|||||||
nbfaulty = 0;
|
nbfaulty = 0;
|
||||||
lfaulty.Clear();
|
lfaulty.Clear();
|
||||||
|
|
||||||
//Print(cout, theAna, theShape);
|
|
||||||
Standard_SStream aSStream;
|
Standard_SStream aSStream;
|
||||||
Print(aSStream, theAna, theShape);
|
Print(aSStream, theAna, theShape);
|
||||||
theCommands << aSStream;
|
theCommands << aSStream;
|
||||||
//cout<<"\n";
|
|
||||||
theCommands<<"\n";
|
theCommands<<"\n";
|
||||||
theMap.Clear();
|
theMap.Clear();
|
||||||
|
|
||||||
if (nbfaulty !=0)
|
if (nbfaulty !=0)
|
||||||
theCommands<<"Faulty shapes in variables "<<checkfaultyname<<"1 to "<<checkfaultyname<<nbfaulty<<" \n";
|
theCommands<<"Faulty shapes in variables "<<checkfaultyname<<"1 to "<<checkfaultyname<<nbfaulty<<" \n";
|
||||||
//cout<<"Faulty shapes in variables "<<checkfaultyname<<"1 to "<<checkfaultyname<<nbfaulty<<" \n";
|
|
||||||
|
|
||||||
//cout<<endl;
|
|
||||||
theCommands<<"\n";
|
theCommands<<"\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : FillProblems
|
|
||||||
// purpose : auxilary for StructuralDump
|
|
||||||
//=======================================================================
|
|
||||||
static void FillProblems(const BRepCheck_Status stat,
|
|
||||||
Handle(TColStd_HArray1OfInteger)& NbProblems)
|
|
||||||
{
|
|
||||||
switch (stat) {
|
|
||||||
case BRepCheck_InvalidPointOnCurve:
|
|
||||||
NbProblems->SetValue(1,NbProblems->Value(1)+1); break;
|
|
||||||
case BRepCheck_InvalidPointOnCurveOnSurface:
|
|
||||||
NbProblems->SetValue(2,NbProblems->Value(2)+1); break;
|
|
||||||
case BRepCheck_InvalidPointOnSurface:
|
|
||||||
NbProblems->SetValue(3,NbProblems->Value(3)+1); break;
|
|
||||||
case BRepCheck_No3DCurve:
|
|
||||||
NbProblems->SetValue(4,NbProblems->Value(4)+1); break;
|
|
||||||
case BRepCheck_Multiple3DCurve:
|
|
||||||
NbProblems->SetValue(5,NbProblems->Value(5)+1); break;
|
|
||||||
case BRepCheck_Invalid3DCurve:
|
|
||||||
NbProblems->SetValue(6,NbProblems->Value(6)+1); break;
|
|
||||||
case BRepCheck_NoCurveOnSurface:
|
|
||||||
NbProblems->SetValue(7,NbProblems->Value(7)+1); break;
|
|
||||||
case BRepCheck_InvalidCurveOnSurface:
|
|
||||||
NbProblems->SetValue(8,NbProblems->Value(8)+1); break;
|
|
||||||
case BRepCheck_InvalidCurveOnClosedSurface:
|
|
||||||
NbProblems->SetValue(9,NbProblems->Value(9)+1); break;
|
|
||||||
case BRepCheck_InvalidSameRangeFlag:
|
|
||||||
NbProblems->SetValue(10,NbProblems->Value(10)+1); break;
|
|
||||||
case BRepCheck_InvalidSameParameterFlag:
|
|
||||||
NbProblems->SetValue(11,NbProblems->Value(11)+1); break;
|
|
||||||
case BRepCheck_InvalidDegeneratedFlag:
|
|
||||||
NbProblems->SetValue(12,NbProblems->Value(12)+1); break;
|
|
||||||
case BRepCheck_FreeEdge:
|
|
||||||
NbProblems->SetValue(13,NbProblems->Value(13)+1); break;
|
|
||||||
case BRepCheck_InvalidMultiConnexity:
|
|
||||||
NbProblems->SetValue(14,NbProblems->Value(14)+1); break;
|
|
||||||
case BRepCheck_InvalidRange:
|
|
||||||
NbProblems->SetValue(15,NbProblems->Value(15)+1); break;
|
|
||||||
case BRepCheck_EmptyWire:
|
|
||||||
NbProblems->SetValue(16,NbProblems->Value(16)+1); break;
|
|
||||||
case BRepCheck_RedundantEdge:
|
|
||||||
NbProblems->SetValue(17,NbProblems->Value(17)+1); break;
|
|
||||||
case BRepCheck_SelfIntersectingWire:
|
|
||||||
NbProblems->SetValue(18,NbProblems->Value(18)+1); break;
|
|
||||||
case BRepCheck_NoSurface:
|
|
||||||
NbProblems->SetValue(19,NbProblems->Value(19)+1); break;
|
|
||||||
case BRepCheck_InvalidWire:
|
|
||||||
NbProblems->SetValue(20,NbProblems->Value(20)+1); break;
|
|
||||||
case BRepCheck_RedundantWire:
|
|
||||||
NbProblems->SetValue(21,NbProblems->Value(21)+1); break;
|
|
||||||
case BRepCheck_IntersectingWires:
|
|
||||||
NbProblems->SetValue(22,NbProblems->Value(22)+1); break;
|
|
||||||
case BRepCheck_InvalidImbricationOfWires:
|
|
||||||
NbProblems->SetValue(23,NbProblems->Value(23)+1); break;
|
|
||||||
case BRepCheck_EmptyShell:
|
|
||||||
NbProblems->SetValue(24,NbProblems->Value(24)+1); break;
|
|
||||||
case BRepCheck_RedundantFace:
|
|
||||||
NbProblems->SetValue(25,NbProblems->Value(25)+1); break;
|
|
||||||
case BRepCheck_UnorientableShape:
|
|
||||||
NbProblems->SetValue(26,NbProblems->Value(26)+1); break;
|
|
||||||
case BRepCheck_NotClosed:
|
|
||||||
NbProblems->SetValue(27,NbProblems->Value(27)+1); break;
|
|
||||||
case BRepCheck_NotConnected:
|
|
||||||
NbProblems->SetValue(28,NbProblems->Value(28)+1); break;
|
|
||||||
case BRepCheck_SubshapeNotInShape:
|
|
||||||
NbProblems->SetValue(29,NbProblems->Value(29)+1); break;
|
|
||||||
case BRepCheck_BadOrientation:
|
|
||||||
NbProblems->SetValue(30,NbProblems->Value(30)+1); break;
|
|
||||||
case BRepCheck_BadOrientationOfSubshape:
|
|
||||||
NbProblems->SetValue(31,NbProblems->Value(31)+1); break;
|
|
||||||
case BRepCheck_CheckFail:
|
|
||||||
NbProblems->SetValue(32,NbProblems->Value(32)+1); break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -593,13 +515,13 @@ static void GetProblemSub(const BRepCheck_Analyzer& Ana,
|
|||||||
|
|
||||||
if(ii>sl->Length()) {
|
if(ii>sl->Length()) {
|
||||||
sl->Append(sub);
|
sl->Append(sub);
|
||||||
FillProblems(itl.Value(),NbProblems);
|
NbProblems->ChangeValue(itl.Value())++;
|
||||||
}
|
}
|
||||||
for(ii=1; ii<=sl->Length(); ii++)
|
for(ii=1; ii<=sl->Length(); ii++)
|
||||||
if(sl->Value(ii).IsSame(Shape)) break;
|
if(sl->Value(ii).IsSame(Shape)) break;
|
||||||
if(ii>sl->Length()) {
|
if(ii>sl->Length()) {
|
||||||
sl->Append(Shape);
|
sl->Append(Shape);
|
||||||
FillProblems(itl.Value(),NbProblems);
|
NbProblems->ChangeValue(itl.Value())++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -628,7 +550,7 @@ static void GetProblemShapes(const BRepCheck_Analyzer& Ana,
|
|||||||
|
|
||||||
if (itl.Value() != BRepCheck_NoError) {
|
if (itl.Value() != BRepCheck_NoError) {
|
||||||
sl->Append(Shape);
|
sl->Append(Shape);
|
||||||
FillProblems(itl.Value(),NbProblems);
|
NbProblems->ChangeValue(itl.Value())++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!theMap.IsBound(Shape)) {
|
if (!theMap.IsBound(Shape)) {
|
||||||
@@ -653,7 +575,6 @@ static void GetProblemShapes(const BRepCheck_Analyzer& Ana,
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -672,122 +593,60 @@ void StructuralDump(Draw_Interpretor& theCommands,
|
|||||||
const TopoDS_Shape &theShape)
|
const TopoDS_Shape &theShape)
|
||||||
{
|
{
|
||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
//cout << "StructuralDump" << endl;
|
|
||||||
//cout << " -- The Shape " << ShName << " has problems :"<<endl;
|
|
||||||
//cout<<" Check Count"<<endl;
|
|
||||||
//cout<<" ------------------------------------------------"<<endl;
|
|
||||||
theCommands << " -- The Shape " << ShName << " has problems :"<<"\n";
|
theCommands << " -- The Shape " << ShName << " has problems :"<<"\n";
|
||||||
theCommands<<" Check Count"<<"\n";
|
theCommands<<" Check Count"<<"\n";
|
||||||
theCommands<<" ------------------------------------------------"<<"\n";
|
theCommands<<" ------------------------------------------------"<<"\n";
|
||||||
|
|
||||||
Handle(TColStd_HArray1OfInteger) NbProblems = new TColStd_HArray1OfInteger(1,32);
|
Handle(TColStd_HArray1OfInteger) NbProblems = new TColStd_HArray1OfInteger(1,33);
|
||||||
for(i=1; i<=32; i++) NbProblems->SetValue(i,0);
|
for (i=1; i<=33; i++) NbProblems->SetValue (i,0);
|
||||||
Handle(TopTools_HSequenceOfShape) sl,slv,sle,slw,slf,sls,slo;
|
Handle(TopTools_HSequenceOfShape) sl,slv,sle,slw,slf,sls,slo;
|
||||||
sl = new TopTools_HSequenceOfShape();
|
sl = new TopTools_HSequenceOfShape();
|
||||||
theMap.Clear();
|
theMap.Clear();
|
||||||
GetProblemShapes(theAna, theShape, sl, NbProblems);
|
GetProblemShapes(theAna, theShape, sl, NbProblems);
|
||||||
theMap.Clear();
|
theMap.Clear();
|
||||||
|
|
||||||
if(NbProblems->Value(1)>0)
|
NCollection_Array1<const char*> aProblems (1,33);
|
||||||
theCommands<<" Invalid Point on Curve ................... "<<NbProblems->Value(1)<<"\n";
|
|
||||||
//cout<<" Invalid Point on Curve ................... "<<NbProblems->Value(1)<<endl;
|
aProblems.SetValue( BRepCheck_InvalidPointOnCurve, " Invalid Point on Curve ................... ");
|
||||||
if(NbProblems->Value(2)>0)
|
aProblems.SetValue(BRepCheck_InvalidPointOnCurveOnSurface, " Invalid Point on CurveOnSurface .......... ");
|
||||||
theCommands<<" Invalid Point on CurveOnSurface .......... "<<NbProblems->Value(2)<<"\n";
|
aProblems.SetValue(BRepCheck_InvalidPointOnSurface, " Invalid Point on Surface ................. ");
|
||||||
//cout<<" Invalid Point on CurveOnSurface .......... "<<NbProblems->Value(2)<<endl;
|
aProblems.SetValue(BRepCheck_No3DCurve, " No 3D Curve .............................. ");
|
||||||
if(NbProblems->Value(3)>0)
|
aProblems.SetValue(BRepCheck_Multiple3DCurve, " Multiple 3D Curve ........................ ");
|
||||||
theCommands<<" Invalid Point on Surface ................. "<<NbProblems->Value(3)<<"\n";
|
aProblems.SetValue(BRepCheck_Invalid3DCurve, " Invalid 3D Curve ......................... ");
|
||||||
//cout<<" Invalid Point on Surface ................. "<<NbProblems->Value(3)<<endl;
|
aProblems.SetValue(BRepCheck_NoCurveOnSurface, " No Curve on Surface ...................... ");
|
||||||
if(NbProblems->Value(4)>0)
|
aProblems.SetValue(BRepCheck_InvalidCurveOnSurface, " Invalid Curve on Surface ................. ");
|
||||||
theCommands<<" No 3D Curve .............................. "<<NbProblems->Value(4)<<"\n";
|
aProblems.SetValue(BRepCheck_InvalidCurveOnClosedSurface, " Invalid Curve on Closed Surface ................. ");
|
||||||
//cout<<" No 3D Curve .............................. "<<NbProblems->Value(4)<<endl;
|
aProblems.SetValue(BRepCheck_InvalidSameRangeFlag, " Invalid SameRange Flag ................... ");
|
||||||
if(NbProblems->Value(5)>0)
|
aProblems.SetValue(BRepCheck_InvalidSameParameterFlag, " Invalid SameParameter Flag ............... ");
|
||||||
theCommands<<" Multiple 3D Curve ........................ "<<NbProblems->Value(5)<<"\n";
|
aProblems.SetValue(BRepCheck_InvalidDegeneratedFlag, " Invalid Degenerated Flag ................. ");
|
||||||
//cout<<" Multiple 3D Curve ........................ "<<NbProblems->Value(5)<<endl;
|
aProblems.SetValue(BRepCheck_FreeEdge, " Free Edge ................................ ");
|
||||||
if(NbProblems->Value(6)>0)
|
aProblems.SetValue(BRepCheck_InvalidMultiConnexity, " Invalid Multi Connexity ................... ");
|
||||||
theCommands<<" Invalid 3D Curve ......................... "<<NbProblems->Value(6)<<"\n";
|
aProblems.SetValue(BRepCheck_InvalidRange, " Invalid Range ................... ");
|
||||||
//cout<<" Invalid 3D Curve ......................... "<<NbProblems->Value(6)<<endl;
|
aProblems.SetValue(BRepCheck_EmptyWire, " Empty Wire ................... ");
|
||||||
if(NbProblems->Value(7)>0)
|
aProblems.SetValue(BRepCheck_RedundantEdge, " BRepCheck_RedundantEdge ................... ");
|
||||||
theCommands<<" No Curve on Surface ...................... "<<NbProblems->Value(7)<<"\n";
|
aProblems.SetValue(BRepCheck_SelfIntersectingWire, " Self Intersecting Wire ................... ");
|
||||||
//cout<<" No Curve on Surface ...................... "<<NbProblems->Value(7)<<endl;
|
aProblems.SetValue(BRepCheck_NoSurface, " No Surface ................... ");
|
||||||
if(NbProblems->Value(8)>0)
|
aProblems.SetValue(BRepCheck_InvalidWire, " Invalid Wire ................... ");
|
||||||
theCommands<<" Invalid Curve on Surface ................. "<<NbProblems->Value(8)<<"\n";
|
aProblems.SetValue(BRepCheck_RedundantWire, " Redundant Wire ................... ");
|
||||||
//cout<<" Invalid Curve on Surface ................. "<<NbProblems->Value(8)<<endl;
|
aProblems.SetValue(BRepCheck_IntersectingWires, " Intersecting Wires ................... ");
|
||||||
if(NbProblems->Value(9)>0)
|
aProblems.SetValue(BRepCheck_InvalidImbricationOfWires, " Invalid Imbrication Of Wires .................. ");
|
||||||
theCommands<<" Invalid Curve on closed Surface .......... "<<NbProblems->Value(9)<<"\n";
|
aProblems.SetValue(BRepCheck_EmptyShell, " Empty Shell ................... ");
|
||||||
//cout<<" Invalid Curve on closed Surface .......... "<<NbProblems->Value(9)<<endl;
|
aProblems.SetValue(BRepCheck_RedundantFace, " Redundant Face ................... ");
|
||||||
if(NbProblems->Value(10)>0)
|
aProblems.SetValue(BRepCheck_UnorientableShape, " Unorientable Shape ................... ");
|
||||||
theCommands<<" Invalid SameRange Flag ................... "<<NbProblems->Value(10)<<"\n";
|
aProblems.SetValue(BRepCheck_NotClosed, " Not Closed ................... ");
|
||||||
//cout<<" Invalid SameRange Flag ................... "<<NbProblems->Value(10)<<endl;
|
aProblems.SetValue(BRepCheck_NotConnected, " Not Connected ................... ");
|
||||||
if(NbProblems->Value(11)>0)
|
aProblems.SetValue(BRepCheck_SubshapeNotInShape, " Subshape Not In Shape ................... ");
|
||||||
theCommands<<" Invalid SameParameter Flag ............... "<<NbProblems->Value(11)<<"\n";
|
aProblems.SetValue(BRepCheck_BadOrientation, " Bad Orientation ................... ");
|
||||||
//cout<<" Invalid SameParameter Flag ............... "<<NbProblems->Value(11)<<endl;
|
aProblems.SetValue(BRepCheck_BadOrientationOfSubshape, " Bad Orientation of Subshape .............. ");
|
||||||
if(NbProblems->Value(12)>0)
|
aProblems.SetValue(BRepCheck_InvalidToleranceValue, " Invalid tolerance value................... ");
|
||||||
theCommands<<" Invalid Degenerated Flag ................. "<<NbProblems->Value(12)<<"\n";
|
aProblems.SetValue(BRepCheck_CheckFail, " Checkshape failure....................... ");
|
||||||
//cout<<" Invalid Degenerated Flag ................. "<<NbProblems->Value(12)<<endl;
|
|
||||||
if(NbProblems->Value(13)>0)
|
for (Standard_Integer i = (Standard_Integer)BRepCheck_InvalidPointOnCurve; i <= (Standard_Integer)BRepCheck_CheckFail; ++i)
|
||||||
theCommands<<" Free Edge ................................ "<<NbProblems->Value(13)<<"\n";
|
{
|
||||||
//cout<<" Free Edge ................................ "<<NbProblems->Value(13)<<endl;
|
if (NbProblems->Value (i) > 0)
|
||||||
if(NbProblems->Value(14)>0)
|
theCommands << i << aProblems.Value (i) << "\n";
|
||||||
theCommands<<" Invalid MultiConnexity ................... "<<NbProblems->Value(14)<<"\n";
|
}
|
||||||
//cout<<" Invalid MultiConnexity ................... "<<NbProblems->Value(14)<<endl;
|
|
||||||
if(NbProblems->Value(15)>0)
|
|
||||||
theCommands<<" Invalid Range ............................ "<<NbProblems->Value(15)<<"\n";
|
|
||||||
//cout<<" Invalid Range ............................ "<<NbProblems->Value(15)<<endl;
|
|
||||||
if(NbProblems->Value(16)>0)
|
|
||||||
theCommands<<" Empty Wire ............................... "<<NbProblems->Value(16)<<"\n";
|
|
||||||
//cout<<" Empty Wire ............................... "<<NbProblems->Value(16)<<endl;
|
|
||||||
if(NbProblems->Value(17)>0)
|
|
||||||
theCommands<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<"\n";
|
|
||||||
//cout<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<endl;
|
|
||||||
if(NbProblems->Value(18)>0)
|
|
||||||
theCommands<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<"\n";
|
|
||||||
//cout<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<endl;
|
|
||||||
if(NbProblems->Value(19)>0)
|
|
||||||
theCommands<<" No Surface ............................... "<<NbProblems->Value(19)<<"\n";
|
|
||||||
//cout<<" No Surface ............................... "<<NbProblems->Value(19)<<endl;
|
|
||||||
if(NbProblems->Value(20)>0)
|
|
||||||
theCommands<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<"\n";
|
|
||||||
//cout<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<endl;
|
|
||||||
if(NbProblems->Value(21)>0)
|
|
||||||
theCommands<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<"\n";
|
|
||||||
//cout<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<endl;
|
|
||||||
if(NbProblems->Value(22)>0)
|
|
||||||
theCommands<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<"\n";
|
|
||||||
//cout<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<endl;
|
|
||||||
if(NbProblems->Value(23)>0)
|
|
||||||
theCommands<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<"\n";
|
|
||||||
//cout<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<endl;
|
|
||||||
if(NbProblems->Value(24)>0)
|
|
||||||
theCommands<<" Empty Shell .............................. "<<NbProblems->Value(24)<<"\n";
|
|
||||||
//cout<<" Empty Shell .............................. "<<NbProblems->Value(24)<<endl;
|
|
||||||
if(NbProblems->Value(25)>0)
|
|
||||||
theCommands<<" Redundant Face ........................... "<<NbProblems->Value(25)<<"\n";
|
|
||||||
//cout<<" Redundant Face ........................... "<<NbProblems->Value(25)<<endl;
|
|
||||||
if(NbProblems->Value(26)>0)
|
|
||||||
theCommands<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<"\n";
|
|
||||||
//cout<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<endl;
|
|
||||||
if(NbProblems->Value(27)>0)
|
|
||||||
theCommands<<" Not Closed ............................... "<<NbProblems->Value(27)<<"\n";
|
|
||||||
//cout<<" Not Closed ............................... "<<NbProblems->Value(27)<<endl;
|
|
||||||
if(NbProblems->Value(28)>0)
|
|
||||||
theCommands<<" Not Connected ............................ "<<NbProblems->Value(28)<<"\n";
|
|
||||||
//cout<<" Not Connected ............................ "<<NbProblems->Value(28)<<endl;
|
|
||||||
if(NbProblems->Value(29)>0)
|
|
||||||
theCommands<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<"\n";
|
|
||||||
//cout<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<endl;
|
|
||||||
if(NbProblems->Value(30)>0)
|
|
||||||
theCommands<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<"\n";
|
|
||||||
//cout<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<endl;
|
|
||||||
if(NbProblems->Value(31)>0)
|
|
||||||
theCommands<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<"\n";
|
|
||||||
//cout<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<endl;
|
|
||||||
if(NbProblems->Value(32)>0)
|
|
||||||
theCommands<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<"\n";
|
|
||||||
//cout<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<endl;
|
|
||||||
|
|
||||||
//cout<<" ------------------------------------------------"<<endl;
|
|
||||||
//cout<<"*** Shapes with problems : "<<sl->Length()<<endl;
|
|
||||||
//cout<<endl;
|
|
||||||
theCommands<<" ------------------------------------------------"<<"\n";
|
theCommands<<" ------------------------------------------------"<<"\n";
|
||||||
theCommands<<"*** Shapes with problems : "<<sl->Length()<<"\n";
|
theCommands<<"*** Shapes with problems : "<<sl->Length()<<"\n";
|
||||||
|
|
||||||
|
@@ -859,12 +859,12 @@ void BRepTest::SweepCommands(Draw_Interpretor& theCommands)
|
|||||||
"deletesweep wire, To delete a section",
|
"deletesweep wire, To delete a section",
|
||||||
__FILE__,deletesweep,g);
|
__FILE__,deletesweep,g);
|
||||||
|
|
||||||
theCommands.Add("buildsweep", "builsweep [r] [option] [Tol] , no args to get help"
|
theCommands.Add("buildsweep", "buildsweep [r] [option] [Tol] , no args to get help",
|
||||||
__FILE__,buildsweep,g);
|
__FILE__,buildsweep,g);
|
||||||
|
|
||||||
theCommands.Add("simulsweep", "simulsweep r [n] [option]"
|
theCommands.Add("simulsweep", "simulsweep r [n] [option]",
|
||||||
__FILE__,simulsweep,g);
|
__FILE__,simulsweep,g);
|
||||||
theCommands.Add("geompipe", "geompipe r spineedge profileedge radius [byACR [byrotate]]"
|
theCommands.Add("geompipe", "geompipe r spineedge profileedge radius [byACR [byrotate]]",
|
||||||
__FILE__,geompipe,g);
|
__FILE__,geompipe,g);
|
||||||
|
|
||||||
theCommands.Add("middlepath", "middlepath res shape startshape endshape",
|
theCommands.Add("middlepath", "middlepath res shape startshape endshape",
|
||||||
|
@@ -308,6 +308,9 @@ is
|
|||||||
---Purpose: Computes the center lines
|
---Purpose: Computes the center lines
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
|
IsProtectedFromModification(me; theS : Shape from TopoDS) returns Boolean from Standard;
|
||||||
|
---Purpose: Indicates if theS is protected from modification.
|
||||||
|
|
||||||
ComputeSurfaces( me : in out)
|
ComputeSurfaces( me : in out)
|
||||||
---Purpose: Perform the generated surfaces.
|
---Purpose: Perform the generated surfaces.
|
||||||
is static private;
|
is static private;
|
||||||
@@ -359,5 +362,6 @@ fields
|
|||||||
myNbBranches : Integer from Standard;
|
myNbBranches : Integer from Standard;
|
||||||
myIndices : HArray1OfInteger from TColStd;
|
myIndices : HArray1OfInteger from TColStd;
|
||||||
myDone : Boolean from Standard;
|
myDone : Boolean from Standard;
|
||||||
|
myProtectedFromModificationShapes : IndexedMapOfShape from TopTools;
|
||||||
|
|
||||||
end Blend;
|
end Blend;
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
#include <BRepLib_MakeEdge.hxx>
|
#include <BRepLib_MakeEdge.hxx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
#include <BRepOffset_DataMapOfShapeOffset.hxx>
|
#include <BRepOffset_DataMapOfShapeOffset.hxx>
|
||||||
#include <BRepOffset_DataMapIteratorOfDataMapOfShapeOffset.hxx>
|
#include <BRepOffset_DataMapIteratorOfDataMapOfShapeOffset.hxx>
|
||||||
#include <BRepOffset_Offset.hxx>
|
#include <BRepOffset_Offset.hxx>
|
||||||
@@ -844,6 +845,8 @@ BiTgte_Blend::BiTgte_Blend(const TopoDS_Shape& S,
|
|||||||
const Standard_Real Tol,
|
const Standard_Real Tol,
|
||||||
const Standard_Boolean NUBS)
|
const Standard_Boolean NUBS)
|
||||||
{
|
{
|
||||||
|
TopExp::MapShapes(S, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
myAsDes = new BRepAlgo_AsDes();
|
myAsDes = new BRepAlgo_AsDes();
|
||||||
Init(S,Radius,Tol,NUBS);
|
Init(S,Radius,Tol,NUBS);
|
||||||
}
|
}
|
||||||
@@ -859,6 +862,8 @@ void BiTgte_Blend::Init(const TopoDS_Shape& S,
|
|||||||
const Standard_Real Tol,
|
const Standard_Real Tol,
|
||||||
const Standard_Boolean NUBS)
|
const Standard_Boolean NUBS)
|
||||||
{
|
{
|
||||||
|
TopExp::MapShapes(S, myProtectedFromModificationShapes);
|
||||||
|
//
|
||||||
Clear();
|
Clear();
|
||||||
myShape = S;
|
myShape = S;
|
||||||
myTol = Tol;
|
myTol = Tol;
|
||||||
@@ -1060,6 +1065,7 @@ void BiTgte_Blend::Perform(const Standard_Boolean BuildShape)
|
|||||||
// Finally construct curves 3d from edges to be transfered
|
// Finally construct curves 3d from edges to be transfered
|
||||||
// since the partition is provided ( A Priori);
|
// since the partition is provided ( A Priori);
|
||||||
BRepLib::BuildCurves3d(myResult, Precision::Confusion());
|
BRepLib::BuildCurves3d(myResult, Precision::Confusion());
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myResult, *this);
|
||||||
|
|
||||||
#ifdef DEB
|
#ifdef DEB
|
||||||
ChFi3d_ResultChron(cl_total, t_total);
|
ChFi3d_ResultChron(cl_total, t_total);
|
||||||
@@ -1855,6 +1861,15 @@ void BiTgte_Blend::ComputeCenters()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : IsProtectedFromModification
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean BiTgte_Blend::IsProtectedFromModification(
|
||||||
|
const TopoDS_Shape & theS) const
|
||||||
|
{
|
||||||
|
return myProtectedFromModificationShapes.Contains(theS);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ComputeSurfaces
|
//function : ComputeSurfaces
|
||||||
|
@@ -912,7 +912,8 @@ static Standard_Integer cfindp (Draw_Interpretor& , Standard_Integer n, const ch
|
|||||||
|
|
||||||
Draw_Display d = dout.MakeDisplay(view);
|
Draw_Display d = dout.MakeDisplay(view);
|
||||||
|
|
||||||
Handle(Draw_Drawable3D) D = Draw::Get(a[1]);
|
Handle(
|
||||||
|
Draw_Drawable3D) D = Draw::Get(a[1]);
|
||||||
|
|
||||||
Handle(DrawTrSurf_BezierCurve) DBz =
|
Handle(DrawTrSurf_BezierCurve) DBz =
|
||||||
Handle(DrawTrSurf_BezierCurve)::DownCast(D);
|
Handle(DrawTrSurf_BezierCurve)::DownCast(D);
|
||||||
|
@@ -56,6 +56,7 @@
|
|||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
|
|
||||||
#include <Standard_ConstructionError.hxx>
|
#include <Standard_ConstructionError.hxx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
|
|
||||||
|
|
||||||
// Modified by skv - Mon May 31 13:00:30 2004 OCC5865 Begin
|
// Modified by skv - Mon May 31 13:00:30 2004 OCC5865 Begin
|
||||||
@@ -99,6 +100,8 @@ void LocOpe_Spliter::Perform(const Handle(LocOpe_ProjectedWires)& PW)
|
|||||||
BRepTools_Substitution theSubs;
|
BRepTools_Substitution theSubs;
|
||||||
BRep_Builder BB;
|
BRep_Builder BB;
|
||||||
|
|
||||||
|
// LocOpe_ProjectedWires::InitEdgeIterator() is much more then simple
|
||||||
|
// initialization.
|
||||||
for (PW->InitEdgeIterator(); PW->MoreEdge(); PW->NextEdge()) {
|
for (PW->InitEdgeIterator(); PW->MoreEdge(); PW->NextEdge()) {
|
||||||
const TopoDS_Edge& edg = PW->Edge();
|
const TopoDS_Edge& edg = PW->Edge();
|
||||||
mapE.Add(edg);
|
mapE.Add(edg);
|
||||||
@@ -432,6 +435,7 @@ void LocOpe_Spliter::Perform(const Handle(LocOpe_ProjectedWires)& PW)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myRes);
|
||||||
myDone = Standard_True;
|
myDone = Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -55,23 +55,24 @@ is
|
|||||||
is static;
|
is static;
|
||||||
|
|
||||||
Bind(me: mutable; W: Wire from TopoDS;
|
Bind(me: mutable; W: Wire from TopoDS;
|
||||||
F: Face from TopoDS)
|
F : Face from TopoDS; theCopy : Boolean from Standard = Standard_False)
|
||||||
|
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
Bind(me: mutable; Comp: Compound from TopoDS;
|
Bind(me: mutable; Comp: Compound from TopoDS;
|
||||||
F: Face from TopoDS)
|
F : Face from TopoDS; theCopy : Boolean from Standard = Standard_False)
|
||||||
|
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
Bind(me: mutable; E: Edge from TopoDS;
|
Bind(me: mutable; E: Edge from TopoDS;
|
||||||
F: Face from TopoDS)
|
F : Face from TopoDS; theCopy : Boolean from Standard = Standard_False)
|
||||||
|
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
|
|
||||||
Bind(me: mutable; EfromW: Edge from TopoDS;
|
Bind(me: mutable; EfromW: Edge from TopoDS;
|
||||||
EonFace: Edge from TopoDS)
|
EonFace: Edge from TopoDS;
|
||||||
|
theCopy : Boolean from Standard = Standard_False)
|
||||||
|
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRepBuilderAPI_Copy.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <TopTools_MapOfShape.hxx>
|
#include <TopTools_MapOfShape.hxx>
|
||||||
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
|
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
|
||||||
@@ -117,10 +118,10 @@ void LocOpe_WiresOnShape::Init(const TopoDS_Shape& S)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void LocOpe_WiresOnShape::Bind(const TopoDS_Wire& W,
|
void LocOpe_WiresOnShape::Bind(const TopoDS_Wire& W,
|
||||||
const TopoDS_Face& F)
|
const TopoDS_Face & F, Standard_Boolean theCopy)
|
||||||
{
|
{
|
||||||
for (TopExp_Explorer exp(W, TopAbs_EDGE); exp.More(); exp.Next()) {
|
for (TopExp_Explorer exp(W, TopAbs_EDGE); exp.More(); exp.Next()) {
|
||||||
Bind(TopoDS::Edge(exp.Current()),F);
|
Bind(TopoDS::Edge(exp.Current()), F, theCopy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,10 +131,10 @@ void LocOpe_WiresOnShape::Bind(const TopoDS_Wire& W,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void LocOpe_WiresOnShape::Bind(const TopoDS_Compound& Comp,
|
void LocOpe_WiresOnShape::Bind(const TopoDS_Compound& Comp,
|
||||||
const TopoDS_Face& F)
|
const TopoDS_Face & F, Standard_Boolean theCopy)
|
||||||
{
|
{
|
||||||
for (TopExp_Explorer exp(Comp, TopAbs_EDGE); exp.More(); exp.Next()) {
|
for (TopExp_Explorer exp(Comp, TopAbs_EDGE); exp.More(); exp.Next()) {
|
||||||
Bind(TopoDS::Edge(exp.Current()),F);
|
Bind(TopoDS::Edge(exp.Current()), F, theCopy);
|
||||||
}
|
}
|
||||||
myFacesWithSection.Add(F);
|
myFacesWithSection.Add(F);
|
||||||
}
|
}
|
||||||
@@ -144,7 +145,7 @@ void LocOpe_WiresOnShape::Bind(const TopoDS_Compound& Comp,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& E,
|
void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& E,
|
||||||
const TopoDS_Face& F)
|
const TopoDS_Face & F, Standard_Boolean theCopy)
|
||||||
{
|
{
|
||||||
// if (!myMapEF.IsBound(E)) {
|
// if (!myMapEF.IsBound(E)) {
|
||||||
if (!myMapEF.Contains(E)) {
|
if (!myMapEF.Contains(E)) {
|
||||||
@@ -157,7 +158,12 @@ void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& E,
|
|||||||
}
|
}
|
||||||
if (!exp.More()) {
|
if (!exp.More()) {
|
||||||
// myMapEF.Bind(E,F);
|
// myMapEF.Bind(E,F);
|
||||||
myMapEF.Add(E,F);
|
TopoDS_Shape anE = E;
|
||||||
|
if (theCopy)
|
||||||
|
{
|
||||||
|
anE = BRepBuilderAPI_Copy(E).Shape();
|
||||||
|
}
|
||||||
|
myMapEF.Add(anE, F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -172,12 +178,17 @@ void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& E,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& Ewir,
|
void LocOpe_WiresOnShape::Bind(const TopoDS_Edge& Ewir,
|
||||||
const TopoDS_Edge& Efac)
|
const TopoDS_Edge & Efac, Standard_Boolean theCopy)
|
||||||
{
|
{
|
||||||
if (Ewir.IsSame(Efac)) {
|
if (Ewir.IsSame(Efac)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
myMap.Bind(Ewir,Efac);
|
TopoDS_Shape anE = Ewir;
|
||||||
|
if (theCopy)
|
||||||
|
{
|
||||||
|
anE = BRepBuilderAPI_Copy(Ewir).Shape();
|
||||||
|
}
|
||||||
|
myMap.Bind(anE, Efac);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -49,10 +49,14 @@ is
|
|||||||
Init (me: mutable; shape: Shape from TopoDS);
|
Init (me: mutable; shape: Shape from TopoDS);
|
||||||
---Purpose: Initislises by shape.
|
---Purpose: Initislises by shape.
|
||||||
|
|
||||||
Perform (me : mutable;
|
Perform (me : mutable;
|
||||||
theProgress : ProgressIndicator from Message = 0) returns Boolean;
|
theProgress : ProgressIndicator from Message = 0) returns Boolean;
|
||||||
---Purpose: Iterates on sub- shape and performs fixes
|
---Purpose: Iterates on sub- shape and performs fixes
|
||||||
|
|
||||||
|
PerformR (me : mutable;
|
||||||
|
theProgress : ProgressIndicator from Message ) returns Boolean is private;
|
||||||
|
---Purpose: Internal method. Called by Perform.
|
||||||
|
|
||||||
SameParameter (me : mutable;
|
SameParameter (me : mutable;
|
||||||
shape : Shape from TopoDS;
|
shape : Shape from TopoDS;
|
||||||
enforce : Boolean;
|
enforce : Boolean;
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
#include <TopAbs_ShapeEnum.hxx>
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
#include <BRepTools.hxx>
|
#include <BRepTools.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
|
|
||||||
#include <ShapeFix.hxx>
|
#include <ShapeFix.hxx>
|
||||||
#include <ShapeBuild_ReShape.hxx>
|
#include <ShapeBuild_ReShape.hxx>
|
||||||
@@ -99,7 +100,19 @@ void ShapeFix_Shape::Init(const TopoDS_Shape& shape)
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)& theProgress)
|
Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)& theProgress)
|
||||||
|
{
|
||||||
|
Standard_Boolean aR = PerformR(theProgress);
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myResult);
|
||||||
|
return aR;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : PerformR
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
Standard_Boolean ShapeFix_Shape::PerformR(const Handle(Message_ProgressIndicator)& theProgress)
|
||||||
{
|
{
|
||||||
Standard_Integer savFixSmallAreaWireMode = 0;
|
Standard_Integer savFixSmallAreaWireMode = 0;
|
||||||
|
|
||||||
@@ -157,7 +170,7 @@ Standard_Boolean ShapeFix_Shape::Perform(const Handle(Message_ProgressIndicator)
|
|||||||
for ( TopoDS_Iterator anIter(S); anIter.More() && aPSentry.More(); anIter.Next(), aPSentry.Next() )
|
for ( TopoDS_Iterator anIter(S); anIter.More() && aPSentry.More(); anIter.Next(), aPSentry.Next() )
|
||||||
{
|
{
|
||||||
myShape = anIter.Value();
|
myShape = anIter.Value();
|
||||||
if ( Perform(theProgress) )
|
if ( PerformR(theProgress) )
|
||||||
status = Standard_True;
|
status = Standard_True;
|
||||||
}
|
}
|
||||||
if ( !aPSentry.More() )
|
if ( !aPSentry.More() )
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#include <ShapeUpgrade_WireDivide.hxx>
|
#include <ShapeUpgrade_WireDivide.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
|
#include <BRepLib_ToleranceRule.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ShapeUpgrade_ShapeDivide
|
//function : ShapeUpgrade_ShapeDivide
|
||||||
@@ -174,6 +175,7 @@ Standard_Boolean ShapeUpgrade_ShapeDivide::Perform(const Standard_Boolean newCon
|
|||||||
if ( Status ( ShapeExtend_DONE ) ) {
|
if ( Status ( ShapeExtend_DONE ) ) {
|
||||||
myResult = myContext->Apply ( C, TopAbs_SHAPE );
|
myResult = myContext->Apply ( C, TopAbs_SHAPE );
|
||||||
myContext->Replace ( myShape, myResult );
|
myContext->Replace ( myShape, myResult );
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myResult);
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
myResult = myShape;
|
myResult = myShape;
|
||||||
@@ -282,6 +284,7 @@ Standard_Boolean ShapeUpgrade_ShapeDivide::Perform(const Standard_Boolean newCon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
myResult = myContext->Apply ( myShape, TopAbs_SHAPE );
|
myResult = myContext->Apply ( myShape, TopAbs_SHAPE );
|
||||||
|
BRepLib_ToleranceRule::SetProperTolerances(myResult);
|
||||||
return ! myResult.IsSame ( myShape );
|
return ! myResult.IsSame ( myShape );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
restore [locate_data_file CFI_2_o12ffq.rle] s
|
restore [locate_data_file CFI_2_o12ffq.rle] s
|
||||||
|
updatetolerance s
|
||||||
explode s e
|
explode s e
|
||||||
|
|
||||||
mkevol result s
|
mkevol result s
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
## ====================================
|
## ====================================
|
||||||
|
|
||||||
restore [locate_data_file CTO900_pro12880c.rle] a
|
restore [locate_data_file CTO900_pro12880c.rle] a
|
||||||
|
updatetolerance a
|
||||||
explode a e
|
explode a e
|
||||||
blend result a 5 a_89
|
blend result a 5 a_89
|
||||||
|
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
## ====================================
|
## ====================================
|
||||||
|
|
||||||
restore [locate_data_file CFI_pro12894.rle] a
|
restore [locate_data_file CFI_pro12894.rle] a
|
||||||
|
updatetolerance a
|
||||||
explode a e
|
explode a e
|
||||||
blend result a 5 a_89
|
blend result a 5 a_89
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
## ====================================
|
## ====================================
|
||||||
|
|
||||||
restore [locate_data_file CFI_cfi90fjc.rle] a
|
restore [locate_data_file CFI_cfi90fjc.rle] a
|
||||||
nexplode a e
|
explode a e
|
||||||
blend result a 5 a_5 5 a_13 5 a_28
|
blend result a 5 a_42 5 a_44 5 a_46
|
||||||
|
|
||||||
set square 66620.1
|
set square 66620.1
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
## ====================================
|
## ====================================
|
||||||
|
|
||||||
restore [locate_data_file CFI_ger60206.rle] a
|
restore [locate_data_file CFI_ger60206.rle] a
|
||||||
|
updatetolerance a
|
||||||
explode a e
|
explode a e
|
||||||
mkevol result a
|
mkevol result a
|
||||||
updatevol a_21 0 0.5 1 1
|
updatevol a_21 0 0.5 1 1
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
## ====================================
|
## ====================================
|
||||||
|
|
||||||
restore [locate_data_file CFI_pro8792.rle] a
|
restore [locate_data_file CFI_pro8792.rle] a
|
||||||
|
updatetolerance a
|
||||||
explode a e
|
explode a e
|
||||||
mkevol result a
|
mkevol result a
|
||||||
updatevol a_20 0 15 0.5 20 1 5
|
updatevol a_20 0 15 0.5 20 1 5
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
## ====================================
|
## ====================================
|
||||||
|
|
||||||
restore [locate_data_file CFI_pro10631.rle] a
|
restore [locate_data_file CFI_pro10631.rle] a
|
||||||
|
updatetolerance a
|
||||||
explode a e
|
explode a e
|
||||||
blend result a 5 a_45
|
blend result a 5 a_45
|
||||||
|
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
## ====================================
|
## ====================================
|
||||||
|
|
||||||
restore [locate_data_file CFI_pro10522.rle] a
|
restore [locate_data_file CFI_pro10522.rle] a
|
||||||
|
updatetolerance a
|
||||||
explode a e
|
explode a e
|
||||||
blend result a 2 a_82
|
blend result a 2 a_82
|
||||||
|
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
## ====================================
|
## ====================================
|
||||||
|
|
||||||
restore [locate_data_file CFI_pro10117.rle] a
|
restore [locate_data_file CFI_pro10117.rle] a
|
||||||
|
updatetolerance a
|
||||||
explode a e
|
explode a e
|
||||||
blend result a 2 a_128 1 a_10
|
blend result a 2 a_128 1 a_10
|
||||||
|
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
if { [isdraw result] } {
|
if { [isdraw result] } {
|
||||||
#check if result is valid
|
#check if result is valid
|
||||||
|
|
||||||
|
updatetolerance result
|
||||||
puts "checkshape"
|
puts "checkshape"
|
||||||
set ch [checkshape result]
|
set ch [checkshape result]
|
||||||
puts $ch
|
puts $ch
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
puts "TODO ?OCC12345 ALL: OCC309: Error 2"
|
puts "TODO ?OCC12345 ALL: OCC309: Error"
|
||||||
|
puts "TODO ?OCC12345 ALL: Faulty shapes in variables faulty_"
|
||||||
|
|
||||||
puts "================"
|
puts "================"
|
||||||
puts "OCC309"
|
puts "OCC309"
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
###########################################################
|
###########################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC329.brep] a
|
restore [locate_data_file OCC329.brep] a
|
||||||
|
updatetolerance a
|
||||||
|
|
||||||
checkshape a
|
checkshape a
|
||||||
set tol1 [maxtolerance a]
|
set tol1 [maxtolerance a]
|
||||||
|
@@ -10,6 +10,7 @@ puts ""
|
|||||||
restore [locate_data_file buc60462a.brep] a
|
restore [locate_data_file buc60462a.brep] a
|
||||||
checkshape a
|
checkshape a
|
||||||
restore [locate_data_file buc60462b.brep] b
|
restore [locate_data_file buc60462b.brep] b
|
||||||
|
updatetolerance b
|
||||||
checkshape b
|
checkshape b
|
||||||
bsection result a b
|
bsection result a b
|
||||||
|
|
||||||
|
@@ -8,8 +8,10 @@ puts "BUC60462"
|
|||||||
puts "=========="
|
puts "=========="
|
||||||
|
|
||||||
restore [locate_data_file buc60462c.brep] a
|
restore [locate_data_file buc60462c.brep] a
|
||||||
|
updatetolerance a
|
||||||
checkshape a
|
checkshape a
|
||||||
restore [locate_data_file buc60462d.brep] b
|
restore [locate_data_file buc60462d.brep] b
|
||||||
|
updatetolerance b
|
||||||
checkshape b
|
checkshape b
|
||||||
puts "Fuse begin"
|
puts "Fuse begin"
|
||||||
bfuse result a b
|
bfuse result a b
|
||||||
|
@@ -10,6 +10,7 @@ cpulimit 1400
|
|||||||
restore [locate_data_file buc60463a.brep] a
|
restore [locate_data_file buc60463a.brep] a
|
||||||
checkshape a
|
checkshape a
|
||||||
restore [locate_data_file buc60463b.brep] b
|
restore [locate_data_file buc60463b.brep] b
|
||||||
|
updatetolerance b
|
||||||
checkshape b
|
checkshape b
|
||||||
bsection result a b
|
bsection result a b
|
||||||
|
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
puts "TODO OCC11111 ALL: Error : Result shape is WRONG"
|
puts "TODO OCC11111 ALL: Error : Result shape is WRONG"
|
||||||
|
puts "TODO ?OCC11111 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||||
|
|
||||||
puts "============"
|
puts "============"
|
||||||
puts "OCC10232"
|
puts "OCC10232"
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
set BugNumber OCC10842
|
set BugNumber OCC10842
|
||||||
|
|
||||||
restore [locate_data_file OCC10842-1.brep] b1
|
restore [locate_data_file OCC10842-1.brep] b1
|
||||||
|
updatetolerance b1
|
||||||
restore [locate_data_file OCC10842-2.brep] b2
|
restore [locate_data_file OCC10842-2.brep] b2
|
||||||
|
|
||||||
puts "Prepare boolean operation ..."
|
puts "Prepare boolean operation ..."
|
||||||
|
@@ -5,6 +5,7 @@ puts ""
|
|||||||
# Exception in command 'section'
|
# Exception in command 'section'
|
||||||
|
|
||||||
restore [locate_data_file OCC1255.brep] a
|
restore [locate_data_file OCC1255.brep] a
|
||||||
|
updatetolerance a
|
||||||
checkshape a
|
checkshape a
|
||||||
|
|
||||||
plane p1 0 -36.8067 0 0 1 0
|
plane p1 0 -36.8067 0 0 1 0
|
||||||
|
@@ -8,6 +8,7 @@ puts ""
|
|||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
restore [locate_data_file OCC1255.brep] a
|
restore [locate_data_file OCC1255.brep] a
|
||||||
|
updatetolerance a
|
||||||
checkshape a
|
checkshape a
|
||||||
|
|
||||||
plane p1 0 -36.8067 0 0 1 0
|
plane p1 0 -36.8067 0 0 1 0
|
||||||
|
@@ -10,6 +10,7 @@ set BugNumber OCC19811
|
|||||||
|
|
||||||
puts "Load shape ..."
|
puts "Load shape ..."
|
||||||
restore [locate_data_file bug19811_VanneMP_supports_tiges_V3.brep] result
|
restore [locate_data_file bug19811_VanneMP_supports_tiges_V3.brep] result
|
||||||
|
updatetolerance result
|
||||||
|
|
||||||
puts "Scaling operation ..."
|
puts "Scaling operation ..."
|
||||||
if [catch { tscale result 0 0 0 0.5 } catch_result] {
|
if [catch { tscale result 0 0 0 0.5 } catch_result] {
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
set BugNumber OCC22781
|
set BugNumber OCC22781
|
||||||
|
|
||||||
restore [locate_data_file OCC22781-BeforeCont.brep] result
|
restore [locate_data_file OCC22781-BeforeCont.brep] result
|
||||||
|
updatetolerance result
|
||||||
|
|
||||||
set length 5.82393
|
set length 5.82393
|
||||||
set 3dviewer 0
|
set 3dviewer 0
|
||||||
|
@@ -11,6 +11,7 @@ puts ""
|
|||||||
set BugNumber OCC22781
|
set BugNumber OCC22781
|
||||||
|
|
||||||
restore [locate_data_file OCC22781-BeforeCont.brep] result
|
restore [locate_data_file OCC22781-BeforeCont.brep] result
|
||||||
|
updatetolerance result
|
||||||
vinit
|
vinit
|
||||||
vdisplay result
|
vdisplay result
|
||||||
vfit
|
vfit
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
set BugNumber OCC22781
|
set BugNumber OCC22781
|
||||||
|
|
||||||
restore [locate_data_file OCC22781-BeforeCont.brep] result
|
restore [locate_data_file OCC22781-BeforeCont.brep] result
|
||||||
|
updatetolerance result
|
||||||
|
|
||||||
set length 5.82393
|
set length 5.82393
|
||||||
set 3dviewer 0
|
set 3dviewer 0
|
||||||
|
@@ -11,6 +11,7 @@ puts ""
|
|||||||
set BugNumber OCC22781
|
set BugNumber OCC22781
|
||||||
|
|
||||||
restore [locate_data_file OCC22781-BeforeCont.brep] result
|
restore [locate_data_file OCC22781-BeforeCont.brep] result
|
||||||
|
updatetolerance result
|
||||||
vinit
|
vinit
|
||||||
vdisplay result
|
vdisplay result
|
||||||
vfit
|
vfit
|
||||||
|
@@ -9,7 +9,9 @@ puts ""
|
|||||||
set BugNumber OCC22864
|
set BugNumber OCC22864
|
||||||
|
|
||||||
restore [locate_data_file bug22864_face1.brep] f1
|
restore [locate_data_file bug22864_face1.brep] f1
|
||||||
|
checkshape f1
|
||||||
restore [locate_data_file bug22864_face2.brep] f2
|
restore [locate_data_file bug22864_face2.brep] f2
|
||||||
|
checkshape f2
|
||||||
|
|
||||||
shape aShape C
|
shape aShape C
|
||||||
add f1 aShape
|
add f1 aShape
|
||||||
@@ -33,6 +35,7 @@ set Numbers 11
|
|||||||
for {set i 0} {$i < ${Numbers}} {incr i} {
|
for {set i 0} {$i < ${Numbers}} {incr i} {
|
||||||
puts "i=$i"
|
puts "i=$i"
|
||||||
rollingball result aShape 15 @ f1 f2
|
rollingball result aShape 15 @ f1 f2
|
||||||
|
checkshape result
|
||||||
|
|
||||||
set nb_info [nbshapes result]
|
set nb_info [nbshapes result]
|
||||||
regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v
|
regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v
|
||||||
|
@@ -9,9 +9,12 @@ puts ""
|
|||||||
set BugNumber OCC22946
|
set BugNumber OCC22946
|
||||||
|
|
||||||
restore [locate_data_file OCC22946-FaceWithNewCurves.brep] a
|
restore [locate_data_file OCC22946-FaceWithNewCurves.brep] a
|
||||||
|
checkshape a
|
||||||
restore [locate_data_file OCC22946-CompoundWithoutPcurves.brep] b
|
restore [locate_data_file OCC22946-CompoundWithoutPcurves.brep] b
|
||||||
|
checkshape b
|
||||||
|
|
||||||
splitshape result a a b
|
splitshape result a a b
|
||||||
|
checkshape result
|
||||||
|
|
||||||
set square 6.06498e+08
|
set square 6.06498e+08
|
||||||
set 3dviewer 0
|
set 3dviewer 0
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
#################################################################
|
#################################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC292.brep] result
|
restore [locate_data_file OCC292.brep] result
|
||||||
|
updatetolerance result
|
||||||
checkshape result
|
checkshape result
|
||||||
|
|
||||||
tclean result
|
tclean result
|
||||||
|
@@ -7,6 +7,7 @@ puts ""
|
|||||||
##################################################
|
##################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC317.brep] result
|
restore [locate_data_file OCC317.brep] result
|
||||||
|
updatetolerance result
|
||||||
|
|
||||||
set che [checkshape result]
|
set che [checkshape result]
|
||||||
if { [regexp {Faulty} $che] == 1} {
|
if { [regexp {Faulty} $che] == 1} {
|
||||||
|
@@ -10,6 +10,7 @@ puts ""
|
|||||||
##################################################
|
##################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC330.brep] result
|
restore [locate_data_file OCC330.brep] result
|
||||||
|
updatetolerance result
|
||||||
|
|
||||||
decho off
|
decho off
|
||||||
set che [checkshape result]
|
set che [checkshape result]
|
||||||
|
@@ -7,6 +7,7 @@ puts "========"
|
|||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
restore [locate_data_file mds-part1.rle] a
|
restore [locate_data_file mds-part1.rle] a
|
||||||
|
updatetolerance a
|
||||||
set che [checkshape a]
|
set che [checkshape a]
|
||||||
if { [regexp {Faulty} $che ] == 1 } {
|
if { [regexp {Faulty} $che ] == 1 } {
|
||||||
puts "Faulty OCC452 (shape 1): Source shape is invalid. It was detected by Checkshape command"
|
puts "Faulty OCC452 (shape 1): Source shape is invalid. It was detected by Checkshape command"
|
||||||
@@ -23,6 +24,7 @@ if { [regexp {Faulty} $che ] == 1 } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
restore [locate_data_file CTO900_ger60239a.rle] c
|
restore [locate_data_file CTO900_ger60239a.rle] c
|
||||||
|
updatetolerance c
|
||||||
set che [checkshape c]
|
set che [checkshape c]
|
||||||
if { [regexp {Faulty} $che ] == 1 } {
|
if { [regexp {Faulty} $che ] == 1 } {
|
||||||
puts "Faulty OCC452 (shape 3): Source shape is invalid. It was detected by Checkshape command"
|
puts "Faulty OCC452 (shape 3): Source shape is invalid. It was detected by Checkshape command"
|
||||||
@@ -31,6 +33,7 @@ if { [regexp {Faulty} $che ] == 1 } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
restore [locate_data_file CTO900_ger60239b.rle] d
|
restore [locate_data_file CTO900_ger60239b.rle] d
|
||||||
|
updatetolerance d
|
||||||
set che [checkshape d]
|
set che [checkshape d]
|
||||||
if { [regexp {Faulty} $che ] == 1 } {
|
if { [regexp {Faulty} $che ] == 1 } {
|
||||||
puts "Faulty OCC452 (shape 4): Source shape is invalid. It was detected by Checkshape command"
|
puts "Faulty OCC452 (shape 4): Source shape is invalid. It was detected by Checkshape command"
|
||||||
|
@@ -7,6 +7,7 @@ puts "========"
|
|||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
restore [locate_data_file CTO900_ger60239a.rle] a
|
restore [locate_data_file CTO900_ger60239a.rle] a
|
||||||
|
updatetolerance a
|
||||||
set che [checkshape a]
|
set che [checkshape a]
|
||||||
if { [regexp {Faulty} $che ] == 1 } {
|
if { [regexp {Faulty} $che ] == 1 } {
|
||||||
puts "Faulty OCC452 (shape 5): Source shape is invalid. It was detected by Checkshape command"
|
puts "Faulty OCC452 (shape 5): Source shape is invalid. It was detected by Checkshape command"
|
||||||
@@ -15,6 +16,7 @@ if { [regexp {Faulty} $che ] == 1 } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
restore [locate_data_file CTO900_ger60239b.rle] b
|
restore [locate_data_file CTO900_ger60239b.rle] b
|
||||||
|
updatetolerance b
|
||||||
set che [checkshape b]
|
set che [checkshape b]
|
||||||
if { [regexp {Faulty} $che ] == 1 } {
|
if { [regexp {Faulty} $che ] == 1 } {
|
||||||
puts "Faulty OCC452 (shape 6): Source shape is invalid. It was detected by Checkshape command"
|
puts "Faulty OCC452 (shape 6): Source shape is invalid. It was detected by Checkshape command"
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
puts "TODO OCC12345 ALL: Error : The command is not valid. The square is"
|
puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||||
|
puts "TODO ?OCC12345 ALL: Error : The command is not valid. The square is"
|
||||||
|
puts "TODO OCC12345 ALL: Error : The length of result shape is"
|
||||||
puts "========================"
|
puts "========================"
|
||||||
puts " OCC472 "
|
puts " OCC472 "
|
||||||
puts "(case 2)"
|
puts "(case 2)"
|
||||||
@@ -9,6 +11,7 @@ puts ""
|
|||||||
#####################################################
|
#####################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC472a.brep] b1
|
restore [locate_data_file OCC472a.brep] b1
|
||||||
|
updatetolerance b1
|
||||||
checkshape b1
|
checkshape b1
|
||||||
|
|
||||||
restore [locate_data_file OCC472b.brep] b2
|
restore [locate_data_file OCC472b.brep] b2
|
||||||
|
@@ -10,6 +10,7 @@ set BugNumber OCC5729
|
|||||||
|
|
||||||
restore [locate_data_file OCC5729-f1.brep] f1
|
restore [locate_data_file OCC5729-f1.brep] f1
|
||||||
restore [locate_data_file OCC5729-f2.brep] f2
|
restore [locate_data_file OCC5729-f2.brep] f2
|
||||||
|
updatetolerance f2
|
||||||
|
|
||||||
decho off
|
decho off
|
||||||
set che_1 [checkshape f1]
|
set che_1 [checkshape f1]
|
||||||
|
@@ -7,6 +7,7 @@ cpulimit 10000
|
|||||||
restore [locate_data_file OCC698_1.brep] b4
|
restore [locate_data_file OCC698_1.brep] b4
|
||||||
checkshape b4
|
checkshape b4
|
||||||
restore [locate_data_file OCC698_2.brep] b5
|
restore [locate_data_file OCC698_2.brep] b5
|
||||||
|
updatetolerance b5
|
||||||
checkshape b5
|
checkshape b5
|
||||||
|
|
||||||
bcut result b5 b4
|
bcut result b5 b4
|
||||||
|
@@ -9,7 +9,9 @@ puts ""
|
|||||||
set BugNumber OCC6181
|
set BugNumber OCC6181
|
||||||
|
|
||||||
restore [locate_data_file OCC6181_A.brep] s1
|
restore [locate_data_file OCC6181_A.brep] s1
|
||||||
|
updatetolerance s1
|
||||||
restore [locate_data_file OCC6181_B.brep] s2
|
restore [locate_data_file OCC6181_B.brep] s2
|
||||||
|
updatetolerance s2
|
||||||
|
|
||||||
decho off
|
decho off
|
||||||
set che_s1 [checkshape s1]
|
set che_s1 [checkshape s1]
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
set BugNumber OCC6182
|
set BugNumber OCC6182
|
||||||
|
|
||||||
restore [locate_data_file OCC6182_A.brep] s1
|
restore [locate_data_file OCC6182_A.brep] s1
|
||||||
|
updatetolerance s1
|
||||||
restore [locate_data_file OCC6182_B.brep] s2
|
restore [locate_data_file OCC6182_B.brep] s2
|
||||||
|
|
||||||
decho off
|
decho off
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
pload QAcommands
|
pload QAcommands
|
||||||
|
|
||||||
restore [locate_data_file OCC625.brep] a
|
restore [locate_data_file OCC625.brep] a
|
||||||
|
updatetolerance a
|
||||||
checkshape a
|
checkshape a
|
||||||
|
|
||||||
vinit
|
vinit
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
set BugNumber OCC6272
|
set BugNumber OCC6272
|
||||||
|
|
||||||
restore [locate_data_file OCC6272_bridge2.brep] a1
|
restore [locate_data_file OCC6272_bridge2.brep] a1
|
||||||
|
updatetolerance a1
|
||||||
|
|
||||||
#
|
#
|
||||||
# a1 is compound. It containes a_3, a_5, a_1, a_2, a_4, a_6 solids
|
# a1 is compound. It containes a_3, a_5, a_1, a_2, a_4, a_6 solids
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
set BugNumber OCC6272
|
set BugNumber OCC6272
|
||||||
|
|
||||||
restore [locate_data_file OCC6272_bridge2.brep] a1
|
restore [locate_data_file OCC6272_bridge2.brep] a1
|
||||||
|
updatetolerance a1
|
||||||
|
|
||||||
#
|
#
|
||||||
# a1 is compound. It containes a_3, a_5, a_1, a_2, a_4, a_6 solids
|
# a1 is compound. It containes a_3, a_5, a_1, a_2, a_4, a_6 solids
|
||||||
|
@@ -10,6 +10,7 @@ puts ""
|
|||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC697_1.brep] b1
|
restore [locate_data_file OCC697_1.brep] b1
|
||||||
|
updatetolerance b1
|
||||||
restore [locate_data_file OCC697_2.brep] b2
|
restore [locate_data_file OCC697_2.brep] b2
|
||||||
|
|
||||||
checkshape b1
|
checkshape b1
|
||||||
|
@@ -10,6 +10,7 @@ puts ""
|
|||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC697_1.brep] b1
|
restore [locate_data_file OCC697_1.brep] b1
|
||||||
|
updatetolerance b1
|
||||||
restore [locate_data_file OCC697_2.brep] b2
|
restore [locate_data_file OCC697_2.brep] b2
|
||||||
|
|
||||||
checkshape b1
|
checkshape b1
|
||||||
|
@@ -10,6 +10,7 @@ puts ""
|
|||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC697_1.brep] b1
|
restore [locate_data_file OCC697_1.brep] b1
|
||||||
|
updatetolerance b1
|
||||||
restore [locate_data_file OCC697_2.brep] b2
|
restore [locate_data_file OCC697_2.brep] b2
|
||||||
|
|
||||||
checkshape b1
|
checkshape b1
|
||||||
|
@@ -10,6 +10,7 @@ puts ""
|
|||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC697_1.brep] b1
|
restore [locate_data_file OCC697_1.brep] b1
|
||||||
|
updatetolerance b1
|
||||||
restore [locate_data_file OCC697_2.brep] b2
|
restore [locate_data_file OCC697_2.brep] b2
|
||||||
|
|
||||||
checkshape b1
|
checkshape b1
|
||||||
|
@@ -8,6 +8,7 @@ puts ""
|
|||||||
############################################
|
############################################
|
||||||
|
|
||||||
restore [locate_data_file OCC767.brep] result
|
restore [locate_data_file OCC767.brep] result
|
||||||
|
updatetolerance result
|
||||||
|
|
||||||
sameparameter result
|
sameparameter result
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@ puts ""
|
|||||||
#################################
|
#################################
|
||||||
|
|
||||||
restore [locate_data_file OCC774.brep] a
|
restore [locate_data_file OCC774.brep] a
|
||||||
|
updatetolerance a
|
||||||
explode a
|
explode a
|
||||||
checkshape a_1
|
checkshape a_1
|
||||||
checkshape a_2
|
checkshape a_2
|
||||||
|
@@ -10,6 +10,7 @@ puts ""
|
|||||||
##########################################
|
##########################################
|
||||||
|
|
||||||
restore [locate_data_file OCC776.brep] a
|
restore [locate_data_file OCC776.brep] a
|
||||||
|
updatetolerance a
|
||||||
explode a
|
explode a
|
||||||
checkshape a_1
|
checkshape a_1
|
||||||
checkshape a_2
|
checkshape a_2
|
||||||
|
@@ -10,6 +10,7 @@ puts ""
|
|||||||
##########################################
|
##########################################
|
||||||
|
|
||||||
restore [locate_data_file OCC776.brep] a
|
restore [locate_data_file OCC776.brep] a
|
||||||
|
updatetolerance a
|
||||||
explode a
|
explode a
|
||||||
checkshape a_1
|
checkshape a_1
|
||||||
checkshape a_2
|
checkshape a_2
|
||||||
|
@@ -8,6 +8,7 @@ puts ""
|
|||||||
##########################################################
|
##########################################################
|
||||||
|
|
||||||
restore [locate_data_file BUC60877_lh.brep] sh
|
restore [locate_data_file BUC60877_lh.brep] sh
|
||||||
|
updatetolerance sh
|
||||||
checkshape sh
|
checkshape sh
|
||||||
|
|
||||||
plane pl 820 198 140 -1e-06 0 1
|
plane pl 820 198 140 -1e-06 0 1
|
||||||
|
@@ -21,8 +21,10 @@ proc myoffset {result sh val tan} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testreadiges [locate_data_file OCC8842_cone_CATIA.igs] a1
|
testreadiges [locate_data_file OCC8842_cone_CATIA.igs] a1
|
||||||
|
checkshape a1
|
||||||
|
|
||||||
sewing con1 a1
|
sewing con1 a1
|
||||||
|
checkshape con1
|
||||||
|
|
||||||
# join type Arc
|
# join type Arc
|
||||||
puts "***** offsetting with join type Arc"
|
puts "***** offsetting with join type Arc"
|
||||||
@@ -31,6 +33,7 @@ puts " cone_CATIA + 5"
|
|||||||
if [catch { myoffset result con1 5 0 } catch_result] {
|
if [catch { myoffset result con1 5 0 } catch_result] {
|
||||||
puts "${BugNumber}: Faulty (1)"
|
puts "${BugNumber}: Faulty (1)"
|
||||||
} else {
|
} else {
|
||||||
|
checkshape result
|
||||||
|
|
||||||
set square 32396.2
|
set square 32396.2
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ explode a
|
|||||||
|
|
||||||
# See comment in CR23244:
|
# See comment in CR23244:
|
||||||
restore [locate_data_file OCC919-PROC.brep] a_1
|
restore [locate_data_file OCC919-PROC.brep] a_1
|
||||||
|
updatetolerance a_1
|
||||||
#
|
#
|
||||||
|
|
||||||
checkshape a_1
|
checkshape a_1
|
||||||
|
@@ -7,6 +7,7 @@ puts "=========="
|
|||||||
pload QAcommands
|
pload QAcommands
|
||||||
|
|
||||||
restore [locate_data_file buc60652b.brep] result
|
restore [locate_data_file buc60652b.brep] result
|
||||||
|
updatetolerance result
|
||||||
checkshape result
|
checkshape result
|
||||||
BUC60652 result
|
BUC60652 result
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ puts "==========="
|
|||||||
pload QAcommands
|
pload QAcommands
|
||||||
|
|
||||||
restore [locate_data_file buc60652c.brep] result
|
restore [locate_data_file buc60652c.brep] result
|
||||||
|
updatetolerance result
|
||||||
checkshape result
|
checkshape result
|
||||||
BUC60652 result
|
BUC60652 result
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@ puts ""
|
|||||||
## Fillets created in CasCade version 3 do not display as shaded surfaces.
|
## Fillets created in CasCade version 3 do not display as shaded surfaces.
|
||||||
#################################################
|
#################################################
|
||||||
restore [locate_data_file buc60707a.brep] result
|
restore [locate_data_file buc60707a.brep] result
|
||||||
|
updatetolerance result
|
||||||
checkshape result
|
checkshape result
|
||||||
|
|
||||||
tclean result
|
tclean result
|
||||||
|
@@ -9,6 +9,7 @@ puts ""
|
|||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
restore [locate_data_file OCC368.brep] result
|
restore [locate_data_file OCC368.brep] result
|
||||||
|
updatetolerance result
|
||||||
checkshape result
|
checkshape result
|
||||||
|
|
||||||
tclean result
|
tclean result
|
||||||
|
@@ -9,11 +9,14 @@ puts "case 2"
|
|||||||
###############################
|
###############################
|
||||||
|
|
||||||
restore [locate_data_file BUC60861_gap1.brep] ss
|
restore [locate_data_file BUC60861_gap1.brep] ss
|
||||||
|
updatetolerance ss
|
||||||
checkshape ss
|
checkshape ss
|
||||||
|
|
||||||
plane pl1 25680.2288 21428 9995 1 0 0
|
plane pl1 25680.2288 21428 9995 1 0 0
|
||||||
mkface f1 pl1 -1 11 -5 5
|
mkface f1 pl1 -1 11 -5 5
|
||||||
|
checkshape f1
|
||||||
bsection result ss f1 -n2d
|
bsection result ss f1 -n2d
|
||||||
|
checkshape result
|
||||||
|
|
||||||
set good_len 10.0009
|
set good_len 10.0009
|
||||||
regexp { +Edge +: +Min +[-0-9.+eE]+ +Max +([-0-9.+eE]+)} [maxtolerance result] full tol
|
regexp { +Edge +: +Min +[-0-9.+eE]+ +Max +([-0-9.+eE]+)} [maxtolerance result] full tol
|
||||||
|
@@ -8,6 +8,7 @@ puts "=================================="
|
|||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
restore [locate_data_file fra62476b.brep] result
|
restore [locate_data_file fra62476b.brep] result
|
||||||
|
updatetolerance result
|
||||||
checkshape result
|
checkshape result
|
||||||
|
|
||||||
tclean result
|
tclean result
|
||||||
|
@@ -5,6 +5,7 @@ puts "==========="
|
|||||||
restore [locate_data_file ger61235a.brep] tool
|
restore [locate_data_file ger61235a.brep] tool
|
||||||
checkshape tool
|
checkshape tool
|
||||||
restore [locate_data_file ger61235b.brep] object
|
restore [locate_data_file ger61235b.brep] object
|
||||||
|
updatetolerance object
|
||||||
checkshape object
|
checkshape object
|
||||||
|
|
||||||
bsection result object tool
|
bsection result object tool
|
||||||
|
@@ -8,6 +8,7 @@ puts "It takes visual check for this BUG"
|
|||||||
puts "=================================="
|
puts "=================================="
|
||||||
|
|
||||||
restore [locate_data_file pro20333a.brep] result
|
restore [locate_data_file pro20333a.brep] result
|
||||||
|
updatetolerance result
|
||||||
checkshape result
|
checkshape result
|
||||||
|
|
||||||
tclean result
|
tclean result
|
||||||
|
@@ -5,6 +5,7 @@ puts "BUC60948"
|
|||||||
puts "========================"
|
puts "========================"
|
||||||
|
|
||||||
restore [locate_data_file pump4.brep] a_1
|
restore [locate_data_file pump4.brep] a_1
|
||||||
|
updatetolerance a_1
|
||||||
checkshape a_1
|
checkshape a_1
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
@@ -7,6 +7,7 @@ puts ""
|
|||||||
########################################################
|
########################################################
|
||||||
|
|
||||||
restore [locate_data_file OCC630.brep] a1
|
restore [locate_data_file OCC630.brep] a1
|
||||||
|
updatetolerance a1
|
||||||
checkshape a1
|
checkshape a1
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
@@ -13,6 +13,7 @@ pload XDE
|
|||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
restore [locate_data_file buc60661a.brep] buc60661
|
restore [locate_data_file buc60661a.brep] buc60661
|
||||||
|
updatetolerance buc60661
|
||||||
checkshape buc60661
|
checkshape buc60661
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
@@ -4,6 +4,7 @@ puts "(case 1)"
|
|||||||
puts "========================"
|
puts "========================"
|
||||||
|
|
||||||
restore [locate_data_file shading_058.brep] result
|
restore [locate_data_file shading_058.brep] result
|
||||||
|
updatetolerance result
|
||||||
checkshape result
|
checkshape result
|
||||||
|
|
||||||
tclean result
|
tclean result
|
||||||
|
@@ -9,6 +9,8 @@ puts ""
|
|||||||
set BugNumber OCC288
|
set BugNumber OCC288
|
||||||
|
|
||||||
restore [locate_data_file shading_151.brep] result
|
restore [locate_data_file shading_151.brep] result
|
||||||
|
updatetolerance result
|
||||||
|
checkshape result
|
||||||
|
|
||||||
set square 54328.8
|
set square 54328.8
|
||||||
|
|
||||||
|
@@ -4,6 +4,7 @@ puts "(case 4)"
|
|||||||
puts "========================"
|
puts "========================"
|
||||||
|
|
||||||
restore [locate_data_file shading_151.brep] result
|
restore [locate_data_file shading_151.brep] result
|
||||||
|
updatetolerance result
|
||||||
checkshape result
|
checkshape result
|
||||||
|
|
||||||
tclean result
|
tclean result
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user