mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
1 Commits
V7_8_1
...
CR23675_19
Author | SHA1 | Date | |
---|---|---|---|
|
c2fd3dc272 |
@@ -232,11 +232,13 @@ is
|
|||||||
UpdateEdge(me; E : Edge from TopoDS;
|
UpdateEdge(me; E : Edge from TopoDS;
|
||||||
C1,C2 : Curve from Geom2d;
|
C1,C2 : Curve from Geom2d;
|
||||||
F : Face from TopoDS;
|
F : Face from TopoDS;
|
||||||
Tol : Real);
|
Tol : Real;
|
||||||
|
theContinuity : Shape from GeomAbs = GeomAbs_C0);
|
||||||
---C++: inline
|
---C++: inline
|
||||||
|
|
||||||
---Purpose: Sets pcurves for the edge on the closed face. If
|
---Purpose: Sets pcurves (with theContinuity) for the edge on
|
||||||
-- <C1> or <C2> is a null handle, remove any existing
|
-- the closed face.
|
||||||
|
-- If <C1> or <C2> is a null handle, remove any existing
|
||||||
-- pcurve.
|
-- pcurve.
|
||||||
|
|
||||||
UpdateEdge(me; E : Edge from TopoDS;
|
UpdateEdge(me; E : Edge from TopoDS;
|
||||||
@@ -248,7 +250,20 @@ is
|
|||||||
---Purpose: Sets a pcurve for the edge on the face.
|
---Purpose: Sets a pcurve for the edge on the face.
|
||||||
-- If <C> is a null handle, remove any existing pcurve.
|
-- If <C> is a null handle, remove any existing pcurve.
|
||||||
|
|
||||||
UpdateEdge(me; E : Edge from TopoDS;
|
UpdateEdge(me; E : Edge from TopoDS;
|
||||||
|
C : Curve from Geom2d;
|
||||||
|
newSurf : Surface from Geom;
|
||||||
|
newL : Location from TopLoc;
|
||||||
|
theFace : Face from TopoDS;
|
||||||
|
Tol : Real from Standard);
|
||||||
|
|
||||||
|
---Purpose: Sets a pcurve for the edge on the face.
|
||||||
|
-- If <C> is a null handle, remove any existing pcurve.
|
||||||
|
-- New edge will be in the face <theFace>, which
|
||||||
|
-- based on surface newSurf. Old surface must be
|
||||||
|
-- deleted from <theFace> later.
|
||||||
|
|
||||||
|
UpdateEdge(me; E : Edge from TopoDS;
|
||||||
C : Curve from Geom2d;
|
C : Curve from Geom2d;
|
||||||
S : Surface from Geom;
|
S : Surface from Geom;
|
||||||
L : Location from TopLoc;
|
L : Location from TopLoc;
|
||||||
@@ -263,12 +278,28 @@ is
|
|||||||
C1,C2 : Curve from Geom2d;
|
C1,C2 : Curve from Geom2d;
|
||||||
S : Surface from Geom;
|
S : Surface from Geom;
|
||||||
L : Location from TopLoc;
|
L : Location from TopLoc;
|
||||||
Tol : Real);
|
Tol : Real from Standard;
|
||||||
|
theContinuity : Shape from GeomAbs = GeomAbs_C0);
|
||||||
|
|
||||||
---Purpose: Sets pcurves for the edge on the closed surface.
|
---Purpose: Sets pcurves (with theContinuity) for the edge on the
|
||||||
-- <C1> or <C2> is a null handle, remove any existing
|
-- closed surface.
|
||||||
|
-- If <C1> or <C2> is a null handle, remove any existing
|
||||||
-- pcurve.
|
-- pcurve.
|
||||||
|
|
||||||
|
UpdateEdge(me; E : Edge from TopoDS;
|
||||||
|
C1,C2 : Curve from Geom2d;
|
||||||
|
newSurf : Surface from Geom;
|
||||||
|
newL : Location from TopLoc;
|
||||||
|
theFace : Face from TopoDS;
|
||||||
|
Tol : Real from Standard);
|
||||||
|
|
||||||
|
---Purpose: Sets pcurves for the edge on the closed surface.
|
||||||
|
-- If <C1> or <C2> is a null handle, remove any
|
||||||
|
-- existing pcurve.
|
||||||
|
-- New edge will be in the face <theFace>, which
|
||||||
|
-- based on surface newSurf. Old surface must be
|
||||||
|
-- deleted from <theFace> later.
|
||||||
|
|
||||||
UpdateEdge(me; E : Edge from TopoDS;
|
UpdateEdge(me; E : Edge from TopoDS;
|
||||||
C1,C2 : Curve from Geom2d;
|
C1,C2 : Curve from Geom2d;
|
||||||
S : Surface from Geom;
|
S : Surface from Geom;
|
||||||
|
@@ -228,7 +228,8 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
|
|||||||
const Handle(Geom2d_Curve)& C1,
|
const Handle(Geom2d_Curve)& C1,
|
||||||
const Handle(Geom2d_Curve)& C2,
|
const Handle(Geom2d_Curve)& C2,
|
||||||
const Handle(Geom_Surface)& S,
|
const Handle(Geom_Surface)& S,
|
||||||
const TopLoc_Location& L)
|
const TopLoc_Location& L,
|
||||||
|
const GeomAbs_Shape theContinuity = GeomAbs_C0)
|
||||||
{
|
{
|
||||||
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
|
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
|
||||||
Handle(BRep_CurveRepresentation) cr;
|
Handle(BRep_CurveRepresentation) cr;
|
||||||
@@ -254,7 +255,7 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
|
|||||||
|
|
||||||
if ( !C1.IsNull() && !C2.IsNull() ) {
|
if ( !C1.IsNull() && !C2.IsNull() ) {
|
||||||
Handle(BRep_CurveOnClosedSurface) COS =
|
Handle(BRep_CurveOnClosedSurface) COS =
|
||||||
new BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0);
|
new BRep_CurveOnClosedSurface(C1,C2,S,L,theContinuity);
|
||||||
// test if there is already a range
|
// test if there is already a range
|
||||||
if (!GC.IsNull()) {
|
if (!GC.IsNull()) {
|
||||||
COS->SetRange(f,l);
|
COS->SetRange(f,l);
|
||||||
@@ -275,7 +276,8 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
|
|||||||
const Handle(Geom_Surface)& S,
|
const Handle(Geom_Surface)& S,
|
||||||
const TopLoc_Location& L,
|
const TopLoc_Location& L,
|
||||||
const gp_Pnt2d& Pf,
|
const gp_Pnt2d& Pf,
|
||||||
const gp_Pnt2d& Pl)
|
const gp_Pnt2d& Pl,
|
||||||
|
const GeomAbs_Shape theContinuity = GeomAbs_C0)
|
||||||
{
|
{
|
||||||
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
|
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
|
||||||
Handle(BRep_CurveRepresentation) cr;
|
Handle(BRep_CurveRepresentation) cr;
|
||||||
@@ -301,7 +303,7 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
|
|||||||
|
|
||||||
if ( !C1.IsNull() && !C2.IsNull() ) {
|
if ( !C1.IsNull() && !C2.IsNull() ) {
|
||||||
Handle(BRep_CurveOnClosedSurface) COS =
|
Handle(BRep_CurveOnClosedSurface) COS =
|
||||||
new BRep_CurveOnClosedSurface(C1,C2,S,L,GeomAbs_C0);
|
new BRep_CurveOnClosedSurface(C1,C2,S,L,theContinuity);
|
||||||
// test if there is already a range
|
// test if there is already a range
|
||||||
if (!GC.IsNull()) {
|
if (!GC.IsNull()) {
|
||||||
COS->SetRange(f,l);
|
COS->SetRange(f,l);
|
||||||
@@ -338,6 +340,167 @@ static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : UpdateCurves
|
||||||
|
//purpose : Insert two pcurves <C1,C2> on surface <newSurf> with
|
||||||
|
// location <newL> in the list of curve representations <lcr>.
|
||||||
|
// Deletes curves, which belong to <oldSurf> because <oldSurf>
|
||||||
|
// will not be used later (presumably).
|
||||||
|
// Remove the pcurves on <S> from <lcr> if <C1> or <C2> is null
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
|
||||||
|
const Handle(Geom2d_Curve)& C1,
|
||||||
|
const Handle(Geom2d_Curve)& C2,
|
||||||
|
const Handle(Geom_Surface)& newSurf,
|
||||||
|
const TopLoc_Location& newL,
|
||||||
|
const Handle(Geom_Surface)& oldSurf,
|
||||||
|
const TopLoc_Location oldL,
|
||||||
|
const GeomAbs_Shape theContinuity = GeomAbs_C0)
|
||||||
|
{
|
||||||
|
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
|
||||||
|
|
||||||
|
Handle(BRep_GCurve) GC;
|
||||||
|
Standard_Real aFirst = 0.0, aLast = 0.0;
|
||||||
|
|
||||||
|
Standard_Boolean rangeFound = Standard_False;
|
||||||
|
Standard_Boolean isModified = Standard_False;
|
||||||
|
|
||||||
|
while (itcr.More())
|
||||||
|
{
|
||||||
|
Handle(BRep_CurveRepresentation) cr = itcr.Value();
|
||||||
|
GC = Handle(BRep_GCurve)::DownCast(cr);
|
||||||
|
|
||||||
|
if ( !GC.IsNull() )
|
||||||
|
{
|
||||||
|
GC->Range(aFirst, aLast);
|
||||||
|
|
||||||
|
Standard_Boolean undefined = (Precision::IsPositiveInfinite(aLast) ||
|
||||||
|
Precision::IsNegativeInfinite(aFirst));
|
||||||
|
|
||||||
|
if (!undefined)
|
||||||
|
{
|
||||||
|
rangeFound = Standard_True;
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Boolean cond = Standard_False;
|
||||||
|
cond = cond || GC->IsCurveOnSurface(oldSurf, oldL);
|
||||||
|
|
||||||
|
if(!cond)
|
||||||
|
{
|
||||||
|
if(GC->IsCurveOnClosedSurface())
|
||||||
|
{
|
||||||
|
Handle(BRep_CurveOnSurface) aCS = Handle(BRep_CurveOnSurface)::DownCast(GC);
|
||||||
|
cond = aCS->IsCurveOnSurface(oldSurf, oldL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cond)
|
||||||
|
{
|
||||||
|
lcr.Remove(itcr);
|
||||||
|
isModified = Standard_True;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itcr.Next();
|
||||||
|
}
|
||||||
|
}//if ( !GC.IsNull() )
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (cr->IsPolygonOnSurface(oldSurf, oldL))
|
||||||
|
{
|
||||||
|
lcr.Remove(itcr);
|
||||||
|
isModified = Standard_True;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itcr.Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !C1.IsNull() && !C2.IsNull() ) {
|
||||||
|
Handle(BRep_CurveOnClosedSurface) COS =
|
||||||
|
new BRep_CurveOnClosedSurface(C1,C2,newSurf,newL,theContinuity);
|
||||||
|
// test if there is already a range
|
||||||
|
if (rangeFound) {
|
||||||
|
COS->SetRange(aFirst,aLast);
|
||||||
|
}
|
||||||
|
lcr.Append(COS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : UpdateCurves
|
||||||
|
//purpose : Insert the pcurve <C> on surface <newSurf> with
|
||||||
|
// location <newL> in the list of curve representations <lcr>.
|
||||||
|
// Remove the pcurves on <oldSurf> from <lcr> if <C> is null
|
||||||
|
//=======================================================================
|
||||||
|
static void UpdateCurves(BRep_ListOfCurveRepresentation& lcr,
|
||||||
|
const Handle(Geom2d_Curve)& C,
|
||||||
|
const Handle(Geom_Surface)& newSurf,
|
||||||
|
const TopLoc_Location& newL,
|
||||||
|
const Handle(Geom_Surface)& oldSurf,
|
||||||
|
const TopLoc_Location oldL)
|
||||||
|
{
|
||||||
|
BRep_ListIteratorOfListOfCurveRepresentation itcr(lcr);
|
||||||
|
Handle(BRep_CurveRepresentation) cr;
|
||||||
|
Handle(BRep_GCurve) GC;
|
||||||
|
Standard_Real f = 0.0, l = 0.0;
|
||||||
|
Standard_Boolean rangeFound = Standard_False;
|
||||||
|
|
||||||
|
// search the range of the 3d curve
|
||||||
|
// and remove any existing representation
|
||||||
|
|
||||||
|
while (itcr.More()) {
|
||||||
|
GC = Handle(BRep_GCurve)::DownCast(itcr.Value());
|
||||||
|
if (!GC.IsNull()) {
|
||||||
|
if (GC->IsCurve3D()) {
|
||||||
|
GC->Range(f, l);
|
||||||
|
Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
|
||||||
|
Precision::IsNegativeInfinite(f));
|
||||||
|
|
||||||
|
if (!undefined) {
|
||||||
|
rangeFound = Standard_True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (GC->IsCurveOnSurface(oldSurf,oldL))
|
||||||
|
{
|
||||||
|
GC->Range(f, l);
|
||||||
|
Standard_Boolean undefined = (Precision::IsPositiveInfinite(l) ||
|
||||||
|
Precision::IsNegativeInfinite(f));
|
||||||
|
|
||||||
|
if (!undefined)
|
||||||
|
{
|
||||||
|
rangeFound = Standard_True;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove existing curve on surface
|
||||||
|
// cr is used to keep a reference on the curve representation
|
||||||
|
// this avoid deleting it as its content may be referenced by C or S
|
||||||
|
cr = itcr.Value();
|
||||||
|
lcr.Remove(itcr);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
itcr.Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
itcr.Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! C.IsNull()) {
|
||||||
|
Handle(BRep_CurveOnSurface) COS = new BRep_CurveOnSurface(C,newSurf,newL);
|
||||||
|
// test if there is already a range
|
||||||
|
if (rangeFound) {
|
||||||
|
COS->SetRange(f,l);
|
||||||
|
}
|
||||||
|
lcr.Append(COS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void UpdatePoints(BRep_ListOfPointRepresentation& lpr,
|
static void UpdatePoints(BRep_ListOfPointRepresentation& lpr,
|
||||||
Standard_Real p,
|
Standard_Real p,
|
||||||
const Handle(Geom_Curve)& C,
|
const Handle(Geom_Curve)& C,
|
||||||
@@ -573,6 +736,33 @@ void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
|
|||||||
TE->Modified(Standard_True);
|
TE->Modified(Standard_True);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : UpdateEdge
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
|
||||||
|
const Handle(Geom2d_Curve)& C,
|
||||||
|
const Handle(Geom_Surface)& newSurf,
|
||||||
|
const TopLoc_Location& newL,
|
||||||
|
const TopoDS_Face& theFace,
|
||||||
|
const Standard_Real Tol) const
|
||||||
|
{
|
||||||
|
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
|
||||||
|
const TopLoc_Location l = newL.Predivided(E.Location());
|
||||||
|
|
||||||
|
const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &theFace.TShape());
|
||||||
|
const TopLoc_Location &L = theFace.Location() * TF->Location();
|
||||||
|
const Handle(Geom_Surface) &S = TF->Surface();
|
||||||
|
|
||||||
|
//BRep_Tool::Degenerated(E);
|
||||||
|
|
||||||
|
UpdateCurves(TE->ChangeCurves(),
|
||||||
|
C, newSurf, l, S,
|
||||||
|
L.Predivided(E.Location()));
|
||||||
|
|
||||||
|
TE->UpdateTolerance(Tol);
|
||||||
|
TE->Modified(Standard_True);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : UpdateEdge
|
//function : UpdateEdge
|
||||||
@@ -607,12 +797,13 @@ void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
|
|||||||
const Handle(Geom2d_Curve)& C2,
|
const Handle(Geom2d_Curve)& C2,
|
||||||
const Handle(Geom_Surface)& S,
|
const Handle(Geom_Surface)& S,
|
||||||
const TopLoc_Location& L,
|
const TopLoc_Location& L,
|
||||||
const Standard_Real Tol) const
|
const Standard_Real Tol,
|
||||||
|
const GeomAbs_Shape theContinuity) const
|
||||||
{
|
{
|
||||||
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
|
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
|
||||||
const TopLoc_Location l = L.Predivided(E.Location());
|
const TopLoc_Location l = L.Predivided(E.Location());
|
||||||
|
|
||||||
UpdateCurves(TE->ChangeCurves(),C1,C2,S,l);
|
UpdateCurves(TE->ChangeCurves(),C1,C2,S,l,theContinuity);
|
||||||
if (!C1.IsNull() && !C2.IsNull())
|
if (!C1.IsNull() && !C2.IsNull())
|
||||||
TE->Closed(C1->IsClosed() && C2->IsClosed());
|
TE->Closed(C1->IsClosed() && C2->IsClosed());
|
||||||
|
|
||||||
@@ -894,6 +1085,36 @@ void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
|
|||||||
TE->Modified(Standard_True);
|
TE->Modified(Standard_True);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : UpdateEdge
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
|
||||||
|
const Handle(Geom2d_Curve)& C1,
|
||||||
|
const Handle(Geom2d_Curve)& C2,
|
||||||
|
const Handle(Geom_Surface)& newSurf,
|
||||||
|
const TopLoc_Location& newL,
|
||||||
|
const TopoDS_Face& theFace,
|
||||||
|
const Standard_Real Tol) const
|
||||||
|
{
|
||||||
|
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &E.TShape());
|
||||||
|
const TopLoc_Location l = newL.Predivided(E.Location());
|
||||||
|
|
||||||
|
const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &theFace.TShape());
|
||||||
|
const TopLoc_Location &L = theFace.Location() * TF->Location();
|
||||||
|
const Handle(Geom_Surface) &S = TF->Surface();
|
||||||
|
|
||||||
|
|
||||||
|
UpdateCurves(TE->ChangeCurves(),
|
||||||
|
C1,C2,newSurf,l,S,
|
||||||
|
L.Predivided(E.Location()));
|
||||||
|
|
||||||
|
if (!C1.IsNull() && !C2.IsNull())
|
||||||
|
TE->Closed(C1->IsClosed() && C2->IsClosed());
|
||||||
|
|
||||||
|
TE->UpdateTolerance(Tol);
|
||||||
|
TE->Modified(Standard_True);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Continuity
|
//function : Continuity
|
||||||
|
@@ -140,10 +140,11 @@ inline void BRep_Builder::UpdateEdge(const TopoDS_Edge& E,
|
|||||||
const Handle(Geom2d_Curve)& C1,
|
const Handle(Geom2d_Curve)& C1,
|
||||||
const Handle(Geom2d_Curve)& C2,
|
const Handle(Geom2d_Curve)& C2,
|
||||||
const TopoDS_Face& F,
|
const TopoDS_Face& F,
|
||||||
const Standard_Real Tol) const
|
const Standard_Real Tol,
|
||||||
|
const GeomAbs_Shape theContinuity) const
|
||||||
{
|
{
|
||||||
TopLoc_Location l;
|
TopLoc_Location l;
|
||||||
UpdateEdge(E,C1,C2,BRep_Tool::Surface(F,l),l,Tol);
|
UpdateEdge(E,C1,C2,BRep_Tool::Surface(F,l),l,Tol, theContinuity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -69,6 +69,7 @@ is
|
|||||||
FreeEdge,
|
FreeEdge,
|
||||||
InvalidMultiConnexity,
|
InvalidMultiConnexity,
|
||||||
InvalidRange,
|
InvalidRange,
|
||||||
|
PCurveIsOutOfDomainFace,
|
||||||
|
|
||||||
|
|
||||||
-- for wires
|
-- for wires
|
||||||
@@ -78,6 +79,7 @@ is
|
|||||||
|
|
||||||
-- for faces
|
-- for faces
|
||||||
NoSurface,
|
NoSurface,
|
||||||
|
OutOfSurfaceBoundary,
|
||||||
InvalidWire,
|
InvalidWire,
|
||||||
RedundantWire,
|
RedundantWire,
|
||||||
IntersectingWires,
|
IntersectingWires,
|
||||||
|
@@ -175,7 +175,15 @@ void BRepCheck::Print(const BRepCheck_Status stat,
|
|||||||
case BRepCheck_CheckFail:
|
case BRepCheck_CheckFail:
|
||||||
OS << "BRepCheck_CheckFail\n";
|
OS << "BRepCheck_CheckFail\n";
|
||||||
break;
|
break;
|
||||||
|
case BRepCheck_PCurveIsOutOfDomainFace:
|
||||||
|
OS << "BRepCheck_PCurveIsOutOfDomainFace\n";
|
||||||
|
break;
|
||||||
|
case BRepCheck_OutOfSurfaceBoundary:
|
||||||
|
OS << "BRepCheck_OutOfSurfaceBoundary\n";
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
OS << "BRepCheck::Print(...): Undefined status!\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -103,57 +103,64 @@ void BRepCheck_Analyzer::Put(const TopoDS_Shape& S,
|
|||||||
|
|
||||||
void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
|
void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
|
||||||
{
|
{
|
||||||
for(TopoDS_Iterator theIterator(S);theIterator.More();theIterator.Next()) {
|
for(TopoDS_Iterator theIterator(S);theIterator.More();theIterator.Next())
|
||||||
Perform(theIterator.Value());
|
Perform(theIterator.Value());
|
||||||
}
|
|
||||||
//
|
//
|
||||||
TopAbs_ShapeEnum styp;
|
TopAbs_ShapeEnum styp;
|
||||||
TopExp_Explorer exp;
|
TopExp_Explorer exp;
|
||||||
//
|
//
|
||||||
styp = S.ShapeType();
|
styp = S.ShapeType();
|
||||||
switch (styp) {
|
|
||||||
case TopAbs_VERTEX:
|
switch (styp)
|
||||||
|
{
|
||||||
|
case TopAbs_VERTEX:
|
||||||
// modified by NIZHNY-MKK Wed May 19 16:56:16 2004.BEGIN
|
// modified by NIZHNY-MKK Wed May 19 16:56:16 2004.BEGIN
|
||||||
// There is no need to check anything.
|
// There is no need to check anything.
|
||||||
// if (myShape.IsSame(S)) {
|
// if (myShape.IsSame(S)) {
|
||||||
// myMap(S)->Blind();
|
// myMap(S)->Blind();
|
||||||
// }
|
// }
|
||||||
// modified by NIZHNY-MKK Wed May 19 16:56:23 2004.END
|
// modified by NIZHNY-MKK Wed May 19 16:56:23 2004.END
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case TopAbs_EDGE: {
|
case TopAbs_EDGE:
|
||||||
|
{
|
||||||
// Modified by skv - Tue Apr 27 11:38:08 2004 Begin
|
// Modified by skv - Tue Apr 27 11:38:08 2004 Begin
|
||||||
// There is no need to check anything except vertices on single edge.
|
// There is no need to check anything except vertices on single edge.
|
||||||
// if (myShape.IsSame(S)) {
|
// if (myShape.IsSame(S)) {
|
||||||
// myMap(S)->Blind();
|
// myMap(S)->Blind();
|
||||||
// }
|
// }
|
||||||
// Modified by skv - Tue Apr 27 11:38:09 2004 End
|
// Modified by skv - Tue Apr 27 11:38:09 2004 End
|
||||||
TopTools_MapOfShape MapS;
|
|
||||||
|
TopTools_MapOfShape MapS;
|
||||||
for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next()) {
|
for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next())
|
||||||
const TopoDS_Shape& aVertex = exp.Current();
|
{
|
||||||
try {
|
const TopoDS_Shape& aVertex = exp.Current();
|
||||||
OCC_CATCH_SIGNALS
|
try
|
||||||
if (MapS.Add(aVertex)) {
|
{
|
||||||
myMap(aVertex)->InContext(S);
|
OCC_CATCH_SIGNALS
|
||||||
}
|
if (MapS.Add(aVertex))
|
||||||
}
|
myMap(aVertex)->InContext(S);
|
||||||
catch(Standard_Failure) {
|
}
|
||||||
|
catch(Standard_Failure)
|
||||||
|
{
|
||||||
#ifdef DEB
|
#ifdef DEB
|
||||||
cout<<"BRepCheck_Analyzer : ";
|
cout<<"BRepCheck_Analyzer : ";
|
||||||
Standard_Failure::Caught()->Print(cout);
|
Standard_Failure::Caught()->Print(cout);
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
#endif
|
#endif
|
||||||
if ( ! myMap(S).IsNull() ) {
|
if ( ! myMap(S).IsNull() )
|
||||||
myMap(S)->SetFailStatus(S);
|
myMap(S)->SetFailStatus(S);
|
||||||
}
|
|
||||||
Handle(BRepCheck_Result) aRes = myMap(aVertex);
|
Handle(BRepCheck_Result) aRes = myMap(aVertex);
|
||||||
if ( ! aRes.IsNull() ) {
|
|
||||||
aRes->SetFailStatus(aVertex);
|
if ( ! aRes.IsNull() )
|
||||||
aRes->SetFailStatus(S);
|
{
|
||||||
}
|
aRes->SetFailStatus(aVertex);
|
||||||
}
|
aRes->SetFailStatus(S);
|
||||||
}
|
}
|
||||||
|
}//catch(Standard_Failure)
|
||||||
|
}//for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next())
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TopAbs_WIRE:
|
case TopAbs_WIRE:
|
||||||
@@ -171,257 +178,234 @@ void BRepCheck_Analyzer::Perform(const TopoDS_Shape& S)
|
|||||||
case TopAbs_FACE:
|
case TopAbs_FACE:
|
||||||
{
|
{
|
||||||
TopTools_MapOfShape MapS;
|
TopTools_MapOfShape MapS;
|
||||||
for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next()) {
|
for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next())
|
||||||
try {
|
{
|
||||||
OCC_CATCH_SIGNALS
|
try
|
||||||
if (MapS.Add(exp.Current())) {
|
{
|
||||||
myMap(exp.Current())->InContext(S);
|
OCC_CATCH_SIGNALS
|
||||||
}
|
if (MapS.Add(exp.Current()))
|
||||||
}
|
myMap(exp.Current())->InContext(S);
|
||||||
catch(Standard_Failure) {
|
}
|
||||||
|
catch(Standard_Failure)
|
||||||
|
{
|
||||||
#ifdef DEB
|
#ifdef DEB
|
||||||
cout<<"BRepCheck_Analyzer : ";
|
cout<<"BRepCheck_Analyzer : ";
|
||||||
Standard_Failure::Caught()->Print(cout);
|
Standard_Failure::Caught()->Print(cout);
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
#endif
|
#endif
|
||||||
if ( ! myMap(S).IsNull() ) {
|
if ( ! myMap(S).IsNull() )
|
||||||
myMap(S)->SetFailStatus(S);
|
myMap(S)->SetFailStatus(S);
|
||||||
}
|
|
||||||
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
||||||
|
|
||||||
|
if ( ! aRes.IsNull() )
|
||||||
|
{
|
||||||
|
aRes->SetFailStatus(exp.Current());
|
||||||
|
aRes->SetFailStatus(S);
|
||||||
|
}
|
||||||
|
}//catch(Standard_Failure)
|
||||||
|
}//for (exp.Init(S,TopAbs_VERTEX);exp.More(); exp.Next())
|
||||||
|
|
||||||
if ( ! aRes.IsNull() ) {
|
|
||||||
aRes->SetFailStatus(exp.Current());
|
|
||||||
aRes->SetFailStatus(S);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Standard_Boolean performwire = Standard_True;
|
Standard_Boolean performwire = Standard_True;
|
||||||
|
Standard_Boolean isFaceOutBoundary = Standard_False;
|
||||||
|
|
||||||
MapS.Clear();
|
MapS.Clear();
|
||||||
for (exp.Init(S,TopAbs_EDGE);exp.More(); exp.Next()) {
|
for (exp.Init(S,TopAbs_EDGE);exp.More(); exp.Next())
|
||||||
try {
|
{
|
||||||
OCC_CATCH_SIGNALS
|
try
|
||||||
if (MapS.Add(exp.Current())) {
|
{
|
||||||
Handle(BRepCheck_Result)& res = myMap(exp.Current());
|
OCC_CATCH_SIGNALS
|
||||||
res->InContext(S);
|
if (MapS.Add(exp.Current()))
|
||||||
if (performwire) {
|
{
|
||||||
for (res->InitContextIterator();
|
Handle(BRepCheck_Result)& res = myMap(exp.Current());
|
||||||
res->MoreShapeInContext();
|
res->InContext(S);
|
||||||
res->NextShapeInContext()) {
|
if (performwire)
|
||||||
if(res->ContextualShape().IsSame(S)) {
|
{
|
||||||
break;
|
for (res->InitContextIterator();
|
||||||
}
|
res->MoreShapeInContext();
|
||||||
}
|
res->NextShapeInContext())
|
||||||
BRepCheck_ListIteratorOfListOfStatus itl(res->StatusOnShape());
|
{
|
||||||
for (; itl.More(); itl.Next()) {
|
if(res->ContextualShape().IsSame(S))
|
||||||
BRepCheck_Status ste = itl.Value();
|
break;
|
||||||
if (ste == BRepCheck_NoCurveOnSurface ||
|
}
|
||||||
ste == BRepCheck_InvalidCurveOnSurface ||
|
|
||||||
ste == BRepCheck_InvalidRange ||
|
BRepCheck_ListIteratorOfListOfStatus itl(res->StatusOnShape());
|
||||||
ste == BRepCheck_InvalidCurveOnClosedSurface) {
|
for (; itl.More(); itl.Next())
|
||||||
performwire = Standard_False;
|
{
|
||||||
break;
|
BRepCheck_Status ste = itl.Value();
|
||||||
}
|
if (ste == BRepCheck_NoCurveOnSurface ||
|
||||||
}
|
ste == BRepCheck_InvalidCurveOnSurface ||
|
||||||
}
|
ste == BRepCheck_InvalidRange ||
|
||||||
}
|
ste == BRepCheck_InvalidCurveOnClosedSurface)
|
||||||
}
|
{
|
||||||
catch(Standard_Failure) {
|
performwire = Standard_False;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ste == BRepCheck_PCurveIsOutOfDomainFace)
|
||||||
|
{
|
||||||
|
isFaceOutBoundary = Standard_True;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}//for (; itl.More(); itl.Next())
|
||||||
|
}//if (performwire)
|
||||||
|
}//if (MapS.Add(exp.Current()))
|
||||||
|
}
|
||||||
|
catch(Standard_Failure)
|
||||||
|
{
|
||||||
#ifdef DEB
|
#ifdef DEB
|
||||||
cout<<"BRepCheck_Analyzer : ";
|
cout<<"BRepCheck_Analyzer : ";
|
||||||
Standard_Failure::Caught()->Print(cout);
|
Standard_Failure::Caught()->Print(cout);
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
if ( ! myMap(S).IsNull() )
|
||||||
|
myMap(S)->SetFailStatus(S);
|
||||||
|
|
||||||
|
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
||||||
|
|
||||||
if ( ! myMap(S).IsNull() ) {
|
if ( ! aRes.IsNull() )
|
||||||
myMap(S)->SetFailStatus(S);
|
{
|
||||||
}
|
aRes->SetFailStatus(exp.Current());
|
||||||
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
aRes->SetFailStatus(S);
|
||||||
|
}
|
||||||
|
}//catch(Standard_Failure)
|
||||||
|
}//for (exp.Init(S,TopAbs_EDGE);exp.More(); exp.Next())
|
||||||
|
|
||||||
if ( ! aRes.IsNull() ) {
|
|
||||||
aRes->SetFailStatus(exp.Current());
|
|
||||||
aRes->SetFailStatus(S);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Standard_Boolean orientofwires = performwire;
|
Standard_Boolean orientofwires = performwire;
|
||||||
for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next()) {
|
for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next())
|
||||||
try {
|
{
|
||||||
OCC_CATCH_SIGNALS
|
try
|
||||||
Handle(BRepCheck_Result)& res = myMap(exp.Current());
|
{
|
||||||
res->InContext(S);
|
OCC_CATCH_SIGNALS
|
||||||
if (orientofwires) {
|
Handle(BRepCheck_Result)& res = myMap(exp.Current());
|
||||||
for (res->InitContextIterator();
|
res->InContext(S);
|
||||||
res->MoreShapeInContext();
|
if (orientofwires)
|
||||||
res->NextShapeInContext()) {
|
{
|
||||||
if(res->ContextualShape().IsSame(S)) {
|
for (res->InitContextIterator();
|
||||||
break;
|
res->MoreShapeInContext();
|
||||||
}
|
res->NextShapeInContext())
|
||||||
}
|
{
|
||||||
BRepCheck_ListIteratorOfListOfStatus itl(res->StatusOnShape());
|
if(res->ContextualShape().IsSame(S))
|
||||||
for (; itl.More(); itl.Next()) {
|
break;
|
||||||
BRepCheck_Status ste = itl.Value();
|
}
|
||||||
if (ste != BRepCheck_NoError) {
|
|
||||||
orientofwires = Standard_False;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Standard_Failure) {
|
|
||||||
#ifdef DEB
|
|
||||||
cout<<"BRepCheck_Analyzer : ";
|
|
||||||
Standard_Failure::Caught()->Print(cout);
|
|
||||||
cout<<endl;
|
|
||||||
#endif
|
|
||||||
if ( ! myMap(S).IsNull() ) {
|
|
||||||
myMap(S)->SetFailStatus(S);
|
|
||||||
}
|
|
||||||
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
|
||||||
|
|
||||||
if ( ! aRes.IsNull() ) {
|
BRepCheck_ListIteratorOfListOfStatus itl(res->StatusOnShape());
|
||||||
aRes->SetFailStatus(exp.Current());
|
for (; itl.More(); itl.Next())
|
||||||
aRes->SetFailStatus(S);
|
{
|
||||||
}
|
BRepCheck_Status ste = itl.Value();
|
||||||
}
|
if (ste != BRepCheck_NoError)
|
||||||
}
|
{
|
||||||
|
orientofwires = Standard_False;
|
||||||
try {
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//if (orientofwires)
|
||||||
|
}
|
||||||
|
catch(Standard_Failure)
|
||||||
|
{
|
||||||
|
#ifdef DEB
|
||||||
|
cout<<"BRepCheck_Analyzer : ";
|
||||||
|
Standard_Failure::Caught()->Print(cout);
|
||||||
|
cout<<endl;
|
||||||
|
#endif
|
||||||
|
if ( ! myMap(S).IsNull() )
|
||||||
|
myMap(S)->SetFailStatus(S);
|
||||||
|
|
||||||
|
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
||||||
|
|
||||||
|
if ( ! aRes.IsNull() )
|
||||||
|
{
|
||||||
|
aRes->SetFailStatus(exp.Current());
|
||||||
|
aRes->SetFailStatus(S);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next())
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
if (performwire) {
|
if (performwire)
|
||||||
if (orientofwires) {
|
{
|
||||||
Handle(BRepCheck_Face)::DownCast(myMap(S))->
|
if (isFaceOutBoundary)
|
||||||
OrientationOfWires(Standard_True);// on enregistre
|
Handle(BRepCheck_Face)::DownCast(myMap(S))->
|
||||||
}
|
SetStatus(BRepCheck_OutOfSurfaceBoundary);
|
||||||
// else {
|
else if (orientofwires)
|
||||||
// Handle(BRepCheck_Face)::DownCast(myMap(S))->
|
Handle(BRepCheck_Face)::DownCast(myMap(S))->
|
||||||
// IntersectWires(Standard_True); // on enregistre
|
OrientationOfWires(Standard_True);// on enregistre
|
||||||
// }
|
else
|
||||||
else {
|
Handle(BRepCheck_Face)::DownCast(myMap(S))->
|
||||||
Handle(BRepCheck_Face)::DownCast(myMap(S))->SetUnorientable();
|
SetUnorientable();
|
||||||
}
|
}//if (performwire)
|
||||||
}
|
else
|
||||||
else {
|
Handle(BRepCheck_Face)::DownCast(myMap(S))->
|
||||||
Handle(BRepCheck_Face)::DownCast(myMap(S))->SetUnorientable();
|
SetUnorientable();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(Standard_Failure) {
|
catch(Standard_Failure)
|
||||||
|
{
|
||||||
#ifdef DEB
|
#ifdef DEB
|
||||||
cout<<"BRepCheck_Analyzer : ";
|
cout<<"BRepCheck_Analyzer : ";
|
||||||
Standard_Failure::Caught()->Print(cout);
|
Standard_Failure::Caught()->Print(cout);
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( ! myMap(S).IsNull() ) {
|
if ( ! myMap(S).IsNull() )
|
||||||
myMap(S)->SetFailStatus(S);
|
{
|
||||||
}
|
myMap(S)->SetFailStatus(S);
|
||||||
|
}
|
||||||
for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next()) {
|
|
||||||
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
|
||||||
|
|
||||||
if ( ! aRes.IsNull() ) {
|
for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next())
|
||||||
aRes->SetFailStatus(exp.Current());
|
{
|
||||||
aRes->SetFailStatus(S);
|
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
||||||
myMap(S)->SetFailStatus(exp.Current());
|
|
||||||
}
|
if ( ! aRes.IsNull() )
|
||||||
}
|
{
|
||||||
}
|
aRes->SetFailStatus(exp.Current());
|
||||||
|
aRes->SetFailStatus(S);
|
||||||
|
myMap(S)->SetFailStatus(exp.Current());
|
||||||
|
}
|
||||||
|
}//for (exp.Init(S,TopAbs_WIRE);exp.More(); exp.Next())
|
||||||
|
}//catch(Standard_Failure)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case TopAbs_SHELL:
|
||||||
case TopAbs_SHELL:
|
|
||||||
//modified by NIZNHY-PKV Mon Oct 13 14:23:53 2008f
|
//modified by NIZNHY-PKV Mon Oct 13 14:23:53 2008f
|
||||||
/* {
|
|
||||||
Standard_Boolean VerifyOrientation, bFlag;
|
|
||||||
//
|
|
||||||
VerifyOrientation = Standard_True;
|
|
||||||
//
|
|
||||||
exp.Init(S,TopAbs_FACE);
|
|
||||||
for (; exp.More(); exp.Next()) {
|
|
||||||
const TopoDS_Shape& aF=exp.Current();
|
|
||||||
try {
|
|
||||||
OCC_CATCH_SIGNALS
|
|
||||||
bFlag= !(Handle(BRepCheck_Face)::DownCast(myMap(aF))->IsUnorientable());
|
|
||||||
VerifyOrientation = (VerifyOrientation && bFlag);
|
|
||||||
}
|
|
||||||
catch(Standard_Failure) {
|
|
||||||
#ifdef DEB
|
|
||||||
cout<<"BRepCheck_Analyzer : ";
|
|
||||||
Standard_Failure::Caught()->Print(cout);
|
|
||||||
cout<<endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( ! myMap(S).IsNull() ) {
|
|
||||||
myMap(S)->SetFailStatus(S);
|
|
||||||
}
|
|
||||||
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
|
||||||
|
|
||||||
if ( ! aRes.IsNull() ) {
|
|
||||||
aRes->SetFailStatus(exp.Current());
|
|
||||||
aRes->SetFailStatus(S);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} //
|
|
||||||
try {
|
|
||||||
OCC_CATCH_SIGNALS
|
|
||||||
if (VerifyOrientation) {
|
|
||||||
Handle(BRepCheck_Shell)::DownCast(myMap(S))->Orientation(Standard_True);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Handle(BRepCheck_Shell)::DownCast(myMap(S))->SetUnorientable();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Standard_Failure) {
|
|
||||||
#ifdef DEB
|
|
||||||
cout<<"BRepCheck_Analyzer : ";
|
|
||||||
Standard_Failure::Caught()->Print(cout);
|
|
||||||
cout<<endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( ! myMap(S).IsNull() ) {
|
|
||||||
myMap(S)->SetFailStatus(S);
|
|
||||||
}
|
|
||||||
exp.Init(S,TopAbs_FACE);
|
|
||||||
for (; exp.More(); exp.Next()) {
|
|
||||||
Handle(BRepCheck_Result) aRes = myMap(exp.Current());
|
|
||||||
if ( ! aRes.IsNull() ) {
|
|
||||||
aRes->SetFailStatus(exp.Current());
|
|
||||||
aRes->SetFailStatus(S);
|
|
||||||
myMap(S)->SetFailStatus(exp.Current());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//modified by NIZNHY-PKV Mon Oct 13 14:24:04 2008t
|
//modified by NIZNHY-PKV Mon Oct 13 14:24:04 2008t
|
||||||
break;
|
break;
|
||||||
//
|
|
||||||
case TopAbs_SOLID: {
|
case TopAbs_SOLID:
|
||||||
exp.Init(S,TopAbs_SHELL);
|
{
|
||||||
for (; exp.More(); exp.Next()) {
|
exp.Init(S,TopAbs_SHELL);
|
||||||
const TopoDS_Shape& aShell=exp.Current();
|
for (; exp.More(); exp.Next())
|
||||||
try {
|
{
|
||||||
OCC_CATCH_SIGNALS
|
const TopoDS_Shape& aShell=exp.Current();
|
||||||
myMap(aShell)->InContext(S);
|
try
|
||||||
}
|
{
|
||||||
catch(Standard_Failure) {
|
OCC_CATCH_SIGNALS
|
||||||
|
myMap(aShell)->InContext(S);
|
||||||
|
}
|
||||||
|
catch(Standard_Failure)
|
||||||
|
{
|
||||||
#ifdef DEB
|
#ifdef DEB
|
||||||
cout<<"BRepCheck_Analyzer : ";
|
cout<<"BRepCheck_Analyzer : ";
|
||||||
Standard_Failure::Caught()->Print(cout);
|
Standard_Failure::Caught()->Print(cout);
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
#endif
|
#endif
|
||||||
if ( ! myMap(S).IsNull() ) {
|
if ( ! myMap(S).IsNull() )
|
||||||
myMap(S)->SetFailStatus(S);
|
{
|
||||||
}
|
myMap(S)->SetFailStatus(S);
|
||||||
//
|
}
|
||||||
Handle(BRepCheck_Result) aRes = myMap(aShell);
|
|
||||||
if (!aRes.IsNull() ) {
|
//
|
||||||
aRes->SetFailStatus(exp.Current());
|
Handle(BRepCheck_Result) aRes = myMap(aShell);
|
||||||
aRes->SetFailStatus(S);
|
if (!aRes.IsNull() )
|
||||||
}
|
{
|
||||||
}
|
aRes->SetFailStatus(exp.Current());
|
||||||
|
aRes->SetFailStatus(S);
|
||||||
|
}
|
||||||
|
}//catch(Standard_Failure)
|
||||||
|
}//for (; exp.More(); exp.Next())
|
||||||
}
|
}
|
||||||
}
|
break;//case TopAbs_SOLID
|
||||||
break;//case TopAbs_SOLID
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}//switch (styp) {
|
}//switch (styp) {
|
||||||
|
@@ -58,12 +58,14 @@
|
|||||||
#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&,
|
BRepCheck_Status Validate(const Adaptor3d_Curve&,
|
||||||
const Adaptor3d_CurveOnSurface&,
|
const Adaptor3d_CurveOnSurface&,
|
||||||
const Standard_Real,
|
const Standard_Real,
|
||||||
const Standard_Boolean);
|
const Standard_Boolean,
|
||||||
|
const Standard_Boolean theSurfIsUPeriodic,
|
||||||
|
const Standard_Boolean theSurfIsVPeriodic);
|
||||||
|
|
||||||
static
|
static
|
||||||
void PrintProblematicPoint(const gp_Pnt&,
|
void PrintProblematicPoint(const gp_Pnt&,
|
||||||
const Standard_Real,
|
const Standard_Real,
|
||||||
@@ -77,13 +79,9 @@ 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
|
//modified by NIZNHY-PKV Thu May 05 09:02:01 2011t
|
||||||
|
|
||||||
#define NCONTROL 23
|
static const Standard_Integer aNbControl = 23;
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : BRepCheck_Edge
|
//function : BRepCheck_Edge
|
||||||
@@ -213,9 +211,9 @@ void BRepCheck_Edge::Minimum()
|
|||||||
|
|
||||||
void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
|
void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
|
||||||
{
|
{
|
||||||
if (myMap.IsBound(S)) {
|
if (myMap.IsBound(S))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
BRepCheck_ListOfStatus thelist;
|
BRepCheck_ListOfStatus thelist;
|
||||||
myMap.Bind(S, thelist);
|
myMap.Bind(S, thelist);
|
||||||
BRepCheck_ListOfStatus& lst = myMap(S);
|
BRepCheck_ListOfStatus& lst = myMap(S);
|
||||||
@@ -224,191 +222,238 @@ 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))
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!exp.More()) {
|
|
||||||
|
if (!exp.More())
|
||||||
|
{
|
||||||
BRepCheck::Add(lst,BRepCheck_SubshapeNotInShape);
|
BRepCheck::Add(lst,BRepCheck_SubshapeNotInShape);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (styp) {
|
|
||||||
case TopAbs_FACE:
|
|
||||||
if (!myCref.IsNull()) {
|
|
||||||
|
|
||||||
Standard_Boolean SameParameter = TE->SameParameter();
|
|
||||||
Standard_Boolean SameRange = TE->SameRange();
|
|
||||||
// Modified by skv - Tue Apr 27 11:48:13 2004 Begin
|
|
||||||
if (!SameParameter || !SameRange) {
|
|
||||||
if (!SameParameter)
|
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
|
||||||
if (!SameRange)
|
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
|
|
||||||
|
|
||||||
return;
|
switch (styp)
|
||||||
}
|
{
|
||||||
// Modified by skv - Tue Apr 27 11:48:14 2004 End
|
case TopAbs_FACE:
|
||||||
Standard_Real First = myHCurve->FirstParameter();
|
if (myCref.IsNull())
|
||||||
Standard_Real Last = myHCurve->LastParameter();
|
break;
|
||||||
|
|
||||||
Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &S.TShape());
|
{
|
||||||
const TopLoc_Location& Floc = S.Location();
|
Standard_Boolean SameParameter = TE->SameParameter();
|
||||||
const TopLoc_Location& TFloc = TF->Location();
|
Standard_Boolean SameRange = TE->SameRange();
|
||||||
const Handle(Geom_Surface)& Su = TF->Surface();
|
|
||||||
TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location());
|
|
||||||
Standard_Boolean pcurvefound = Standard_False;
|
|
||||||
|
|
||||||
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
|
if (!SameParameter || !SameRange)
|
||||||
while (itcr.More()) {
|
{
|
||||||
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
|
if (!SameParameter)
|
||||||
if (cr != myCref && cr->IsCurveOnSurface(Su,L)) {
|
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
||||||
pcurvefound = Standard_True;
|
|
||||||
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
|
|
||||||
Standard_Real f,l;
|
|
||||||
GC->Range(f,l);
|
|
||||||
// gka OCC
|
|
||||||
// Modified by skv - Tue Apr 27 11:50:35 2004 Begin
|
|
||||||
// if (SameRange && (fabs(f-First) > Precision::PConfusion() || fabs(l-Last)> Precision::PConfusion())) { //f != First || l != Last)) { gka OCC
|
|
||||||
if (fabs(f-First) > Precision::PConfusion() ||
|
|
||||||
fabs(l-Last) > Precision::PConfusion()) {
|
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
|
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
|
||||||
// if (SameParameter) {
|
|
||||||
// BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
// Modified by skv - Tue Apr 27 11:50:37 2004 End
|
|
||||||
if (myGctrl) {
|
|
||||||
Handle(Geom_Surface) Sb = cr->Surface();
|
|
||||||
Sb = Handle(Geom_Surface)::DownCast
|
|
||||||
// (Su->Transformed(L.Transformation()));
|
|
||||||
(Su->Transformed(/*L*/(Floc * TFloc).Transformation()));
|
|
||||||
Handle(Geom2d_Curve) PC = cr->PCurve();
|
|
||||||
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(Sb);
|
|
||||||
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(PC,f,l);
|
|
||||||
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
|
|
||||||
Standard_Boolean ok =
|
|
||||||
Validate(myHCurve->Curve(),ACS,Tol,SameParameter);
|
|
||||||
if (!ok) {
|
|
||||||
if (cr->IsCurveOnClosedSurface()) {
|
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
|
|
||||||
}
|
|
||||||
// Modified by skv - Tue Apr 27 11:53:00 2004 Begin
|
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
|
||||||
// if (SameParameter) {
|
|
||||||
// BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
|
||||||
// }
|
|
||||||
// Modified by skv - Tue Apr 27 11:53:01 2004 End
|
|
||||||
}
|
|
||||||
if (cr->IsCurveOnClosedSurface()) {
|
|
||||||
GHPC->ChangeCurve2d().Load(cr->PCurve2(),f,l); // same bounds
|
|
||||||
ACS.Load(GAHS); // sans doute inutile
|
|
||||||
ACS.Load(GHPC); // meme remarque...
|
|
||||||
ok = Validate(myHCurve->Curve(),ACS,Tol,SameParameter);
|
|
||||||
if (!ok) {
|
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
|
|
||||||
// Modified by skv - Tue Apr 27 11:53:20 2004 Begin
|
|
||||||
if (SameParameter) {
|
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
|
||||||
}
|
|
||||||
// Modified by skv - Tue Apr 27 11:53:23 2004 End
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
itcr.Next();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pcurvefound) {
|
if (!SameRange)
|
||||||
Handle(Geom_Plane) P;
|
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
|
||||||
Handle(Standard_Type) dtyp = Su->DynamicType();
|
|
||||||
if (dtyp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
|
|
||||||
P = Handle(Geom_Plane)::DownCast
|
|
||||||
(Handle(Geom_RectangularTrimmedSurface)::
|
|
||||||
DownCast(Su)->BasisSurface());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
P = Handle(Geom_Plane)::DownCast(Su);
|
|
||||||
}
|
|
||||||
if (P.IsNull()) { // not a plane
|
|
||||||
BRepCheck::Add(lst,BRepCheck_NoCurveOnSurface);
|
|
||||||
}
|
|
||||||
else { // on fait la projection a la volee, comme BRep_Tool
|
|
||||||
// plan en position
|
|
||||||
if (myGctrl) {
|
|
||||||
P = Handle(Geom_Plane)::
|
|
||||||
DownCast(P->Transformed(/*L*/(Floc * TFloc).Transformation()));// eap occ332
|
|
||||||
//on projette Cref sur ce plan
|
|
||||||
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(P);
|
|
||||||
|
|
||||||
// Dub - Normalement myHCurve est une GeomAdaptor_HCurve
|
return;
|
||||||
GeomAdaptor_Curve& Gac =
|
}//if (!SameParameter || !SameRange)
|
||||||
Handle(GeomAdaptor_HCurve)::DownCast(myHCurve)->ChangeCurve();
|
|
||||||
Handle(Geom_Curve) C3d = Gac.Curve();
|
|
||||||
Handle(Geom_Curve) ProjOnPlane =
|
|
||||||
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,First,Last),
|
|
||||||
P, P->Position().Direction(),
|
|
||||||
Standard_True);
|
|
||||||
Handle(GeomAdaptor_HCurve) aHCurve =
|
|
||||||
new GeomAdaptor_HCurve(ProjOnPlane);
|
|
||||||
|
|
||||||
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
|
const Standard_Real First = myHCurve->FirstParameter();
|
||||||
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
|
const Standard_Real Last = myHCurve->LastParameter();
|
||||||
Handle(Geom2dAdaptor_HCurve) GHPC =
|
|
||||||
new Geom2dAdaptor_HCurve(PC,
|
|
||||||
myHCurve->FirstParameter(),
|
|
||||||
myHCurve->LastParameter());
|
|
||||||
|
|
||||||
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
|
Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &S.TShape());
|
||||||
|
const TopLoc_Location& Floc = S.Location();
|
||||||
Standard_Boolean ok = Validate(myHCurve->Curve(),ACS,
|
const TopLoc_Location& TFloc = TF->Location();
|
||||||
Tol,Standard_True); // voir dub...
|
const Handle(Geom_Surface)& Su = TF->Surface();
|
||||||
if (!ok) {
|
TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location());
|
||||||
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
|
Standard_Boolean pcurvefound = Standard_False;
|
||||||
}
|
|
||||||
}
|
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
|
||||||
}
|
|
||||||
|
while (itcr.More())
|
||||||
|
{
|
||||||
|
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
|
||||||
|
if (cr != myCref && cr->IsCurveOnSurface(Su,L))
|
||||||
|
{
|
||||||
|
pcurvefound = Standard_True;
|
||||||
|
const Handle(BRep_GCurve)& GC = *((Handle(BRep_GCurve)*)&cr);
|
||||||
|
Standard_Real f,l;
|
||||||
|
GC->Range(f,l);
|
||||||
|
|
||||||
|
if (fabs(f-First) > Precision::PConfusion() ||
|
||||||
|
fabs(l-Last) > Precision::PConfusion())
|
||||||
|
{
|
||||||
|
BRepCheck::Add(lst,BRepCheck_InvalidSameRangeFlag);
|
||||||
|
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myGctrl)
|
||||||
|
{
|
||||||
|
Handle(Geom_Surface) Sb = cr->Surface();
|
||||||
|
{
|
||||||
|
Standard_Real U1Su, U2Su, V1Su, V2Su;
|
||||||
|
Standard_Real U1Sb, U2Sb, V1Sb, V2Sb;
|
||||||
|
|
||||||
|
Standard_Boolean isTrimU = Standard_False, isTrimV = Standard_False;
|
||||||
|
if(Su->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface))
|
||||||
|
{
|
||||||
|
Handle(Geom_RectangularTrimmedSurface) TS =
|
||||||
|
Handle(Geom_RectangularTrimmedSurface)::DownCast(Su);
|
||||||
|
|
||||||
|
TS->GetTrimmedFlags(isTrimU, isTrimV);
|
||||||
|
}
|
||||||
|
|
||||||
|
Su->Bounds(U1Su, U2Su, V1Su, V2Su);
|
||||||
|
Sb = Handle(Geom_Surface)::DownCast
|
||||||
|
(Su->Transformed((Floc * TFloc).Transformation()));
|
||||||
|
|
||||||
|
Sb->Bounds(U1Sb, U2Sb, V1Sb, V2Sb);
|
||||||
|
Standard_Boolean isUtr = ((Abs(U1Su - U1Sb) + Abs(U2Su - U2Sb)) > Precision::PConfusion()),
|
||||||
|
isVtr = ((Abs(V1Su - V1Sb) + Abs(V2Su - V2Sb)) > Precision::PConfusion());
|
||||||
|
|
||||||
|
if(isUtr || isVtr)
|
||||||
|
{
|
||||||
|
Handle(Geom_Surface) St = Handle(Geom_RectangularTrimmedSurface)::DownCast(Sb)->BasisSurface();
|
||||||
|
Sb = new Geom_RectangularTrimmedSurface(St, isTrimU || isUtr, isVtr || isTrimV, U1Su, U2Su, V1Su, V2Su);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Handle(Geom2d_Curve) PC = cr->PCurve();
|
||||||
|
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(Sb);
|
||||||
|
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(PC,f,l);
|
||||||
|
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
|
||||||
|
BRepCheck_Status aStatus = Validate(myHCurve->Curve(),ACS,Tol,SameParameter,
|
||||||
|
Sb->IsUPeriodic(),Sb->IsVPeriodic());
|
||||||
|
|
||||||
|
if(aStatus == BRepCheck_PCurveIsOutOfDomainFace)
|
||||||
|
BRepCheck::Add(lst,BRepCheck_PCurveIsOutOfDomainFace);
|
||||||
|
else if(aStatus == BRepCheck_InvalidCurveOnSurface)
|
||||||
|
{
|
||||||
|
if (cr->IsCurveOnClosedSurface())
|
||||||
|
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
|
||||||
|
else
|
||||||
|
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnSurface);
|
||||||
|
|
||||||
|
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
||||||
|
}
|
||||||
|
else if(aStatus != BRepCheck_NoError)
|
||||||
|
BRepCheck::Add(lst,aStatus);
|
||||||
|
|
||||||
|
if (cr->IsCurveOnClosedSurface())
|
||||||
|
{
|
||||||
|
GHPC->ChangeCurve2d().Load(cr->PCurve2(),f,l); // same bounds
|
||||||
|
ACS.Load(GAHS); // sans doute inutile
|
||||||
|
ACS.Load(GHPC); // meme remarque...
|
||||||
|
aStatus = Validate(myHCurve->Curve(),ACS,Tol,SameParameter,
|
||||||
|
Sb->IsUPeriodic(),Sb->IsVPeriodic());
|
||||||
|
|
||||||
|
if(aStatus == BRepCheck_PCurveIsOutOfDomainFace)
|
||||||
|
BRepCheck::Add(lst,BRepCheck_PCurveIsOutOfDomainFace);
|
||||||
|
else if(aStatus == BRepCheck_InvalidCurveOnSurface)
|
||||||
|
{
|
||||||
|
BRepCheck::Add(lst,BRepCheck_InvalidCurveOnClosedSurface);
|
||||||
|
if (SameParameter)
|
||||||
|
BRepCheck::Add(lst,BRepCheck_InvalidSameParameterFlag);
|
||||||
|
}
|
||||||
|
else if(aStatus != BRepCheck_NoError)
|
||||||
|
BRepCheck::Add(lst,aStatus);
|
||||||
|
}//if (cr->IsCurveOnClosedSurface())
|
||||||
|
}//if (myGctrl)
|
||||||
|
}//if (cr != myCref && cr->IsCurveOnSurface(Su,L))
|
||||||
|
itcr.Next();
|
||||||
|
}//while (itcr.More())
|
||||||
|
|
||||||
|
if (!pcurvefound)
|
||||||
|
{
|
||||||
|
Handle(Geom_Plane) P;
|
||||||
|
Handle(Standard_Type) dtyp = Su->DynamicType();
|
||||||
|
if (dtyp == STANDARD_TYPE(Geom_RectangularTrimmedSurface))
|
||||||
|
{
|
||||||
|
P = Handle(Geom_Plane)::DownCast
|
||||||
|
(Handle(Geom_RectangularTrimmedSurface)::
|
||||||
|
DownCast(Su)->BasisSurface());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
P = Handle(Geom_Plane)::DownCast(Su);
|
||||||
|
|
||||||
|
if (P.IsNull()) // not a plane
|
||||||
|
BRepCheck::Add(lst,BRepCheck_NoCurveOnSurface);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// on fait la projection a la volee, comme BRep_Tool plan en position
|
||||||
|
if (myGctrl)
|
||||||
|
{
|
||||||
|
P = Handle(Geom_Plane)::DownCast(
|
||||||
|
P->Transformed((Floc * TFloc).Transformation()));// eap occ332
|
||||||
|
|
||||||
|
//on projette Cref sur ce plan
|
||||||
|
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(P);
|
||||||
|
|
||||||
|
// Dub - Normalement myHCurve est une GeomAdaptor_HCurve
|
||||||
|
GeomAdaptor_Curve& Gac =
|
||||||
|
Handle(GeomAdaptor_HCurve)::DownCast(myHCurve)->ChangeCurve();
|
||||||
|
|
||||||
|
Handle(Geom_Curve) C3d = Gac.Curve();
|
||||||
|
Handle(Geom_Curve) ProjOnPlane =
|
||||||
|
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,First,Last),
|
||||||
|
P, P->Position().Direction(),Standard_True);
|
||||||
|
|
||||||
|
Handle(GeomAdaptor_HCurve) aHCurve =
|
||||||
|
new GeomAdaptor_HCurve(ProjOnPlane);
|
||||||
|
|
||||||
|
ProjLib_ProjectedCurve proj(GAHS,aHCurve);
|
||||||
|
Handle(Geom2d_Curve) PC = Geom2dAdaptor::MakeCurve(proj);
|
||||||
|
Handle(Geom2dAdaptor_HCurve) GHPC = new Geom2dAdaptor_HCurve(PC,
|
||||||
|
myHCurve->FirstParameter(),
|
||||||
|
myHCurve->LastParameter());
|
||||||
|
|
||||||
|
Adaptor3d_CurveOnSurface ACS(GHPC,GAHS);
|
||||||
|
|
||||||
|
BRepCheck_Status aStatus = Validate(myHCurve->Curve(),ACS,Tol,
|
||||||
|
Standard_True, P->IsUPeriodic(),P->IsVPeriodic()); // voir dub...
|
||||||
|
|
||||||
|
if (aStatus != BRepCheck_NoError)
|
||||||
|
BRepCheck::Add(lst,aStatus);
|
||||||
|
}//if (myGctrl)
|
||||||
|
}//else of "if (P.IsNull())" condition
|
||||||
|
}//if (!pcurvefound)
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
case TopAbs_SOLID:
|
||||||
break;
|
{
|
||||||
case TopAbs_SOLID:
|
// on verifie que l`edge est bien connectee 2 fois (pas de bord libre)
|
||||||
{
|
Standard_Integer nbconnection = 0;
|
||||||
// on verifie que l`edge est bien connectee 2 fois (pas de bord libre)
|
|
||||||
Standard_Integer nbconnection = 0;
|
//TopExp_Explorer exp;
|
||||||
//TopExp_Explorer exp;
|
for (exp.Init(S,TopAbs_FACE); exp.More(); exp.Next())
|
||||||
for (exp.Init(S,TopAbs_FACE); exp.More(); exp.Next()) {
|
{
|
||||||
const TopoDS_Face& fac = TopoDS::Face(exp.Current());
|
const TopoDS_Face& fac = TopoDS::Face(exp.Current());
|
||||||
TopExp_Explorer exp2;
|
TopExp_Explorer exp2;
|
||||||
for (exp2.Init(fac,TopAbs_EDGE); exp2.More(); exp2.Next()) {
|
|
||||||
if (exp2.Current().IsSame(myShape)) {
|
for (exp2.Init(fac,TopAbs_EDGE); exp2.More(); exp2.Next())
|
||||||
nbconnection++;
|
{
|
||||||
}
|
if (exp2.Current().IsSame(myShape))
|
||||||
}
|
nbconnection++;
|
||||||
|
}//for (exp2.Init(fac,TopAbs_EDGE); exp2.More(); exp2.Next())
|
||||||
|
}//for (exp.Init(S,TopAbs_FACE); exp.More(); exp.Next())
|
||||||
|
|
||||||
|
if (nbconnection < 2 && !TE->Degenerated())
|
||||||
|
BRepCheck::Add(myMap(S),BRepCheck_FreeEdge);
|
||||||
|
else if (nbconnection > 2)
|
||||||
|
{
|
||||||
|
BRepCheck::Add(myMap(S),BRepCheck_InvalidMultiConnexity);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
BRepCheck::Add(myMap(S),BRepCheck_NoError);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (nbconnection < 2 && !TE->Degenerated()) {
|
break;
|
||||||
BRepCheck::Add(myMap(S),BRepCheck_FreeEdge);
|
|
||||||
}
|
default:
|
||||||
else if (nbconnection > 2) {
|
break;
|
||||||
BRepCheck::Add(myMap(S),BRepCheck_InvalidMultiConnexity);
|
}//switch (styp)
|
||||||
}
|
|
||||||
else {
|
if (myMap(S).IsEmpty())
|
||||||
BRepCheck::Add(myMap(S),BRepCheck_NoError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (myMap(S).IsEmpty()) {
|
|
||||||
myMap(S).Append(BRepCheck_NoError);
|
myMap(S).Append(BRepCheck_NoError);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -530,8 +575,8 @@ Standard_Real BRepCheck_Edge::Tolerance()
|
|||||||
Standard_Real dist2, tol2, tolCal=0., prm;
|
Standard_Real dist2, tol2, tolCal=0., prm;
|
||||||
gp_Pnt center, othP;
|
gp_Pnt center, othP;
|
||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
for (i= 0; i< NCONTROL; i++) {
|
for (i= 0; i< aNbControl; i++) {
|
||||||
prm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1);
|
prm = ((aNbControl-1-i)*First + i*Last)/(aNbControl-1);
|
||||||
tol2=dist2=0.;
|
tol2=dist2=0.;
|
||||||
center=(*(Handle(Adaptor3d_HCurve)*)&theRep(1))->Value(prm);
|
center=(*(Handle(Adaptor3d_HCurve)*)&theRep(1))->Value(prm);
|
||||||
for (iRep=2; iRep<=nbRep; iRep++) {
|
for (iRep=2; iRep<=nbRep; iRep++) {
|
||||||
@@ -549,74 +594,383 @@ Standard_Real BRepCheck_Edge::Tolerance()
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Validate
|
//function : Validate
|
||||||
//purpose :
|
//purpose :
|
||||||
|
//Remark : If the original surface is not periodic in U or V direction
|
||||||
|
// (for example, rectangular trimmed on periodic surface),
|
||||||
|
// the surface that <Adaptor3d_CurveOnSurface> contains
|
||||||
|
// can be periodic.
|
||||||
|
// To use true values of flags, the parameters
|
||||||
|
// <theSurfIsUPeriodic> and <theSurfIsVPeriodic> have been added.
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean Validate(const Adaptor3d_Curve& CRef,
|
BRepCheck_Status Validate (const Adaptor3d_Curve& CRef,
|
||||||
const Adaptor3d_CurveOnSurface& Other,
|
const Adaptor3d_CurveOnSurface& Other,
|
||||||
const Standard_Real Tol,
|
const Standard_Real Tol,
|
||||||
const Standard_Boolean SameParameter)
|
const Standard_Boolean SameParameter,
|
||||||
|
const Standard_Boolean theSurfIsUPeriodic,
|
||||||
|
const Standard_Boolean theSurfIsVPeriodic)
|
||||||
{
|
{
|
||||||
Standard_Boolean Status, proj;
|
BRepCheck_Status Status = BRepCheck_NoError;
|
||||||
Standard_Real aPC, First, Last, Error;
|
const Standard_Real aPC = Precision::PConfusion(),
|
||||||
gp_Pnt problematic_point ;
|
First = CRef.FirstParameter(),
|
||||||
//
|
Last = CRef.LastParameter();
|
||||||
Status = Standard_True;
|
|
||||||
Error = 0.;
|
const Standard_Boolean proj = (!SameParameter ||
|
||||||
First = CRef.FirstParameter();
|
fabs(Other.FirstParameter()-First) > aPC ||
|
||||||
Last = CRef.LastParameter();
|
fabs(Other.LastParameter()-Last) > aPC);
|
||||||
//
|
|
||||||
aPC=Precision::PConfusion();
|
if (!proj)
|
||||||
proj = (!SameParameter ||
|
{
|
||||||
fabs(Other.FirstParameter()-First) > aPC ||
|
|
||||||
fabs( Other.LastParameter()-Last) > aPC);
|
|
||||||
if (!proj) {
|
|
||||||
Standard_Integer i;
|
|
||||||
Standard_Real Tol2, prm, dD;
|
|
||||||
gp_Pnt pref, pother;
|
|
||||||
//modified by NIZNHY-PKV Thu May 05 09:06:41 2011f
|
//modified by NIZNHY-PKV Thu May 05 09:06:41 2011f
|
||||||
//OCC22428
|
//OCC22428
|
||||||
dD=Prec(CRef, Other);//3.e-15;
|
const Standard_Real dD = Prec(CRef, Other);//3.e-15;
|
||||||
Tol2=Tol+dD;
|
Standard_Real Tol2=Tol+dD;
|
||||||
Tol2=Tol2*Tol2;
|
Tol2=Tol2*Tol2;
|
||||||
|
|
||||||
//Tol2=Tol*Tol;
|
//Tol2=Tol*Tol;
|
||||||
//modified by NIZNHY-PKV Thu May 05 09:06:47 2011t
|
//modified by NIZNHY-PKV Thu May 05 09:06:47 2011t
|
||||||
|
|
||||||
|
const Standard_Real uf = Other.GetSurface()->FirstUParameter ();
|
||||||
|
const Standard_Real ul = Other.GetSurface()->LastUParameter ();
|
||||||
|
const Standard_Real vf = Other.GetSurface()->FirstVParameter();
|
||||||
|
const Standard_Real vl = Other.GetSurface()->LastVParameter();
|
||||||
|
|
||||||
for (i = 0; i< NCONTROL; ++i) {
|
//These values are used for estimation of toleranves of
|
||||||
prm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1);
|
//"plane-like" surfaces
|
||||||
pref = CRef.Value(prm);
|
const Standard_Real aDeltaU = (ul - uf);
|
||||||
pother = Other.Value(prm);
|
const Standard_Real aDeltaV = (vl - vf);
|
||||||
if (pref.SquareDistance(pother) > Tol2) {
|
|
||||||
problematic_point = pref ;
|
//(for Rectangular trimmed surface for example)
|
||||||
Status = Standard_False;
|
const Standard_Boolean isBaseSurfUPeriodic = Other.GetSurface()->IsUPeriodic() && !theSurfIsUPeriodic;
|
||||||
Error = pref.Distance(pother);
|
const Standard_Boolean isBaseSurfVPeriodic = Other.GetSurface()->IsVPeriodic() && !theSurfIsVPeriodic;
|
||||||
PrintProblematicPoint(problematic_point, Error, Tol);
|
|
||||||
return Status;
|
const Standard_Boolean isUPeriodic = isBaseSurfUPeriodic || theSurfIsUPeriodic;
|
||||||
//goto FINISH ;
|
const Standard_Boolean isVPeriodic = isBaseSurfVPeriodic || theSurfIsVPeriodic;
|
||||||
|
|
||||||
|
const Standard_Boolean isUClosedOrPeriodic = Other.GetSurface()->IsUClosed() || theSurfIsUPeriodic;
|
||||||
|
const Standard_Boolean isVClosedOrPeriodic = Other.GetSurface()->IsVClosed() || theSurfIsVPeriodic;
|
||||||
|
|
||||||
|
const Standard_Real UResSt =Other.GetSurface()->UResolution(Tol);
|
||||||
|
const Standard_Real VResSt =Other.GetSurface()->VResolution(Tol);
|
||||||
|
|
||||||
|
// if(isUClosedOrPeriodic)
|
||||||
|
// {
|
||||||
|
// const Standard_Real aF = Other.GetCurve()->Value(First).X();
|
||||||
|
// const Standard_Real aL = Other.GetCurve()->Value(Last).X();
|
||||||
|
// const Standard_Real aDim = theSurfIsUPeriodic ?
|
||||||
|
// Other.GetSurface()->UPeriod() :
|
||||||
|
// aDeltaU;
|
||||||
|
//
|
||||||
|
// if(Abs(aL - aF) - aDim > 2 * UResSt)
|
||||||
|
// {
|
||||||
|
//#ifdef DEB
|
||||||
|
// cout << endl << "----\nFunction Validate(...); file: "
|
||||||
|
// "BRepCheck_Edge.cxx" << endl;
|
||||||
|
// if(theSurfIsUPeriodic)
|
||||||
|
// cout << "The surface is U-periodic." << endl;
|
||||||
|
// else
|
||||||
|
// cout << "The surface is U-closed." << endl;
|
||||||
|
//
|
||||||
|
// cout << "P1.X() = " << aF << "; P2.X() = " << aL << endl;
|
||||||
|
// cout << "Surface dimension D = " << aDim <<
|
||||||
|
// ". (P2.X() - P1.X()) > D." << "\n-----" << endl;
|
||||||
|
//#endif
|
||||||
|
// Status = BRepCheck_PCurveIsOutOfDomainFace;
|
||||||
|
// return Status;
|
||||||
|
// }//if(aL - aF - aT > 2* URes)
|
||||||
|
// }//if(theSurfIsUPeriodic)
|
||||||
|
//
|
||||||
|
// if(isVClosedOrPeriodic)
|
||||||
|
// {
|
||||||
|
// const Standard_Real aF = Other.GetCurve()->Value(First).Y();
|
||||||
|
// const Standard_Real aL = Other.GetCurve()->Value(Last).Y();
|
||||||
|
// const Standard_Real aDim = theSurfIsVPeriodic ?
|
||||||
|
// Other.GetSurface()->VPeriod() :
|
||||||
|
// aDeltaV;
|
||||||
|
//
|
||||||
|
// if(Abs(aL - aF) - aDim > 2 * VResSt)
|
||||||
|
// {
|
||||||
|
//#ifdef DEB
|
||||||
|
// cout << endl << "----\nFunction Validate(...); file: "
|
||||||
|
// "RepCheck_Edge.cxx" << endl;
|
||||||
|
// if(theSurfIsVPeriodic)
|
||||||
|
// cout << "The surface is V-periodic." << endl;
|
||||||
|
// else
|
||||||
|
// cout << "The surface is V-closed." << endl;
|
||||||
|
//
|
||||||
|
// cout << "P1.Y() = " << aF << "; P2.Y() = " << aL << endl;
|
||||||
|
// cout << "Surface dimension D = " << aDim <<
|
||||||
|
// ". (P2.Y() - P1.Y()) > D." << "\n-----" << endl;
|
||||||
|
//#endif
|
||||||
|
// Status = BRepCheck_PCurveIsOutOfDomainFace;
|
||||||
|
// return Status;
|
||||||
|
// }//if(aL - aF - aT > 2* VRes)
|
||||||
|
// }//if(theSurfIsVPeriodic)
|
||||||
|
|
||||||
|
Standard_Real aCriticalParameterU = First,
|
||||||
|
aCriticalParameterV = First;
|
||||||
|
|
||||||
|
Standard_Real aDeltaUmax = 0.0,
|
||||||
|
aDeltaVmax = 0.0;
|
||||||
|
|
||||||
|
Standard_Real dUmaxU = 0.0, dUmaxV = 0.0;
|
||||||
|
Standard_Real dVmaxU = 0.0, dVmaxV = 0.0;
|
||||||
|
|
||||||
|
Standard_Boolean isIntoBoundaries = Standard_True;
|
||||||
|
|
||||||
|
for (Standard_Integer i = 0; i < aNbControl; ++i)
|
||||||
|
{
|
||||||
|
const Standard_Real prm = ((aNbControl-1-i)*First + i*Last)/(aNbControl-1);
|
||||||
|
const gp_Pnt pref = CRef.Value(prm);
|
||||||
|
const gp_Pnt pother = Other.Value(prm);
|
||||||
|
|
||||||
|
if (pref.SquareDistance(pother) > Tol2)
|
||||||
|
{
|
||||||
|
const gp_Pnt problematic_point(pref) ;
|
||||||
|
Status = BRepCheck_InvalidCurveOnSurface;
|
||||||
|
const Standard_Real Error = pref.Distance(pother);
|
||||||
|
PrintProblematicPoint(problematic_point, Error, Tol);
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
const gp_Pnt2d CP = Other.GetCurve()->Value(prm);
|
||||||
else {
|
|
||||||
|
if(isUClosedOrPeriodic && isVClosedOrPeriodic)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const Standard_Real u = Max(uf, Min(CP.X(), ul));
|
||||||
|
const Standard_Real v = Max(vf, Min(CP.Y(), vl));
|
||||||
|
|
||||||
|
const Standard_Boolean isUbound = ((uf <= CP.X()) && (CP.X() <= ul)) || isUClosedOrPeriodic,
|
||||||
|
isVbound = ((vf <= CP.Y()) && (CP.Y() <= vl)) || isVClosedOrPeriodic;
|
||||||
|
|
||||||
|
//Point CP is in surface boundary.
|
||||||
|
if(isUbound && isVbound)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
isIntoBoundaries = Standard_False;
|
||||||
|
|
||||||
|
//Values of overrun of surface boundaries
|
||||||
|
const Standard_Real dUpar = (isUPeriodic || isUbound) ? 0.0 : CP.X() - u,
|
||||||
|
dVpar = (isVPeriodic || isVbound) ? 0.0 : CP.Y() - v;
|
||||||
|
|
||||||
|
if(Abs(dUpar) > aDeltaUmax)
|
||||||
|
{
|
||||||
|
aCriticalParameterU = prm;
|
||||||
|
aDeltaUmax = Abs(dUpar);
|
||||||
|
dUmaxU = dUpar;
|
||||||
|
dUmaxV = dVpar;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Abs(dVpar) > aDeltaVmax)
|
||||||
|
{
|
||||||
|
aCriticalParameterV = prm;
|
||||||
|
aDeltaVmax = Abs(dVpar);
|
||||||
|
dVmaxU = dUpar;
|
||||||
|
dVmaxV = dVpar;
|
||||||
|
}
|
||||||
|
}//for (i = 0; i< aNbControl; ++i)
|
||||||
|
|
||||||
|
if(!isIntoBoundaries)
|
||||||
|
{
|
||||||
|
// Max U(V) resolution is calculated from condition:
|
||||||
|
// |S'|*dU > aCoeff*(0.5*|S"|dU*dU), it means that
|
||||||
|
// first order differential of surface >> second order one
|
||||||
|
const Standard_Real aCoeff = 10.;
|
||||||
|
//Value to check modulus of derivatives against zero
|
||||||
|
const Standard_Real eps = 1.e-16;
|
||||||
|
//Value for estimation Max resolution if |S"| < eps
|
||||||
|
const Standard_Real aFactor = 10.;
|
||||||
|
|
||||||
|
for(Standard_Integer anIndex = 0; anIndex < 2; anIndex++)
|
||||||
|
{
|
||||||
|
const Standard_Real aParam = !anIndex ? aCriticalParameterU : aCriticalParameterV;
|
||||||
|
const Standard_Real du = !anIndex ? dUmaxU : dUmaxV;
|
||||||
|
const Standard_Real dv = !anIndex ? dVmaxU : dVmaxV;
|
||||||
|
|
||||||
|
const gp_Pnt2d CP = Other.GetCurve()->Value(aParam);
|
||||||
|
|
||||||
|
const Standard_Real u = Max(uf, Min(CP.X(), ul));
|
||||||
|
const Standard_Real v = Max(vf, Min(CP.Y(), vl));
|
||||||
|
|
||||||
|
gp_Pnt aPref;
|
||||||
|
gp_Vec aDSdu, aDSdv, aD2Sdu2, aD2Sdv2, aD2Sdudv;
|
||||||
|
Other.GetSurface()->D2(u, v, aPref, aDSdu, aDSdv, aD2Sdu2, aD2Sdv2, aD2Sdudv);
|
||||||
|
|
||||||
|
Standard_Real UResMax = 0.0, VResMax = 0.0;
|
||||||
|
const Standard_Real aModDSdu = aDSdu.Magnitude();
|
||||||
|
const Standard_Real aModDSdv = aDSdv.Magnitude();
|
||||||
|
const Standard_Real aModD2Sdu2 = aD2Sdu2.Magnitude();
|
||||||
|
const Standard_Real aModD2Sdv2 = aD2Sdv2.Magnitude();
|
||||||
|
|
||||||
|
if(aModDSdu > eps)
|
||||||
|
{
|
||||||
|
if(aModD2Sdu2 > aModDSdu / aCoeff)
|
||||||
|
{
|
||||||
|
UResMax = aModDSdu / (.5 * aCoeff * aModD2Sdu2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Surface seems to be "plane-like" in U direction
|
||||||
|
UResMax = aDeltaU / aFactor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UResMax = aFactor * UResSt;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(aModDSdv > eps)
|
||||||
|
{
|
||||||
|
if(aModD2Sdv2 > aModDSdv / aCoeff)
|
||||||
|
{
|
||||||
|
VResMax = aModDSdv / (5. * aModD2Sdv2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Surface seems to be "plane-like" in V direction
|
||||||
|
VResMax = aDeltaV / aFactor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VResMax = aFactor * VResSt;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Standard_Real anURes = isBaseSurfUPeriodic ? UResSt : UResMax,
|
||||||
|
aVRes = isBaseSurfVPeriodic ? VResSt : VResMax;
|
||||||
|
|
||||||
|
const Standard_Boolean isUbound = ((uf - anURes <= CP.X()) && (CP.X() <= ul + anURes)) || isUClosedOrPeriodic,
|
||||||
|
isVbound = ((vf - aVRes <= CP.Y()) && (CP.Y() <= vl + aVRes)) || isVClosedOrPeriodic;
|
||||||
|
|
||||||
|
if(isUbound && isVbound)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
#ifdef DEB
|
||||||
|
if(!isUbound)
|
||||||
|
{
|
||||||
|
cout << endl << "----\nFunction Validate(...); file: "
|
||||||
|
"BRepCheck_Edge.cxx" << endl;
|
||||||
|
|
||||||
|
if(isBaseSurfUPeriodic)
|
||||||
|
cout << "RTS from U-periodic" << endl;
|
||||||
|
else if(theSurfIsUPeriodic)
|
||||||
|
cout << "U-periodic surface" << endl;
|
||||||
|
else if(isUClosedOrPeriodic)
|
||||||
|
cout << "U-closed surface" << endl;
|
||||||
|
|
||||||
|
|
||||||
|
cout << "Point(prm = " << aParam << "): (" <<
|
||||||
|
CP.X() << "; " << CP.Y() <<")." << endl;
|
||||||
|
cout << "u = (" << uf << ")...(" << ul << "). "
|
||||||
|
"Delta = " << Max(uf - CP.X(),CP.X()-ul) << " Tol3D = " << Tol <<
|
||||||
|
". URes = " << anURes << "\n-----" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isVbound)
|
||||||
|
{
|
||||||
|
cout << endl << "----\nFunction Validate(...); file: "
|
||||||
|
"BRepCheck_Edge.cxx" << endl;
|
||||||
|
|
||||||
|
if(isBaseSurfVPeriodic)
|
||||||
|
cout << "RTS from V-periodic" << endl;
|
||||||
|
else if(theSurfIsVPeriodic)
|
||||||
|
cout << "V-periodic surface" << endl;
|
||||||
|
else if(isVClosedOrPeriodic)
|
||||||
|
cout << "V-closed surface" << endl;
|
||||||
|
|
||||||
|
cout << "Point(prm = " << aParam << "): (" <<
|
||||||
|
CP.X() << "; " << CP.Y() <<")." << endl;
|
||||||
|
cout << "v = (" << vf << ")...(" << vl << "). "
|
||||||
|
"Delta = " << Max(vf - CP.Y(),CP.Y()-vl) << " Tol3D = " << Tol <<
|
||||||
|
". VRes = " << aVRes << "\n-----" << endl;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//Expected and real point
|
||||||
|
gp_Pnt aPe, aPf;
|
||||||
|
//1st degree estimation
|
||||||
|
aPe.SetXYZ(gp_XYZ(aPref.X() + (aDSdu.X()*du+aDSdv.X()*dv),
|
||||||
|
aPref.Y() + (aDSdu.Y()*du+aDSdv.Y()*dv),
|
||||||
|
aPref.Z() + (aDSdu.Z()*du+aDSdv.Z()*dv)));
|
||||||
|
|
||||||
|
Other.GetSurface()->D0(CP.X(), CP.Y(), aPf);
|
||||||
|
const Standard_Real aTol = Tol2;
|
||||||
|
Standard_Real dist = aPe.SquareDistance(aPf);
|
||||||
|
|
||||||
|
if(dist < aTol)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
#ifdef DEB
|
||||||
|
cout << endl << "++++\nFunction Validate(...); file: "
|
||||||
|
"BRepCheck_Edge.cxx (1st degree)" << endl;
|
||||||
|
cout << "Exp. point: (" << aPe.X() << ", " << aPe.Y() << ", " <<
|
||||||
|
aPe.Z() << ")." << endl;
|
||||||
|
cout << "Real point: (" << aPf.X() << ", " << aPf.Y() << ", " <<
|
||||||
|
aPf.Z() << ")." << endl;
|
||||||
|
cout << "dist**2 = " << dist <<
|
||||||
|
"; Tol = " << aTol << "\n-----" << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const Standard_Real dUpar2 = du*du;
|
||||||
|
const Standard_Real dVpar2 = dv*dv;
|
||||||
|
const Standard_Real dUVpar = du*dv;
|
||||||
|
|
||||||
|
//2nd degree estimation
|
||||||
|
aPe.SetXYZ(gp_XYZ(aPe.X() + (aD2Sdu2.X()*dUpar2 +
|
||||||
|
2.0*aD2Sdudv.X()*dUVpar + aD2Sdv2.X()*dVpar2)/2.0,
|
||||||
|
aPe.Y() + (aD2Sdu2.Y()*dUpar2 +
|
||||||
|
2.0*aD2Sdudv.Y()*dUVpar + aD2Sdv2.Y()*dVpar2)/2.0,
|
||||||
|
aPe.Z() + (aD2Sdu2.Z()*dUpar2 +
|
||||||
|
2.0*aD2Sdudv.Z()*dUVpar + aD2Sdv2.Z()*dVpar2)/2.0));
|
||||||
|
|
||||||
|
dist = aPe.SquareDistance(aPf);
|
||||||
|
|
||||||
|
if(dist > aTol)
|
||||||
|
{
|
||||||
|
#ifdef DEB
|
||||||
|
cout << endl << "++++\nFunction Validate(...); file: "
|
||||||
|
"BRepCheck_Edge.cxx (2nd degree)" << endl;
|
||||||
|
cout << "Exp. point: (" << aPe.X() << ", " << aPe.Y() << ", " <<
|
||||||
|
aPe.Z() << ")." << endl;
|
||||||
|
cout << "Real point: (" << aPf.X() << ", " << aPf.Y() << ", " <<
|
||||||
|
aPf.Z() << ")." << endl;
|
||||||
|
cout << "dist**2 = " << dist <<
|
||||||
|
"; Tol = " << aTol << "\n-----" << endl;
|
||||||
|
#endif
|
||||||
|
Status = BRepCheck_PCurveIsOutOfDomainFace;
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
}//for(Standard_Integer anIndex = 0; anIndex < 2; anIndex++)
|
||||||
|
}//if(!isIntoBoundaries)
|
||||||
|
}//if (!proj)
|
||||||
|
else
|
||||||
|
{
|
||||||
Extrema_LocateExtPC refd,otherd;
|
Extrema_LocateExtPC refd,otherd;
|
||||||
Standard_Real OFirst = Other.FirstParameter();
|
Standard_Real OFirst = Other.FirstParameter();
|
||||||
Standard_Real OLast = Other.LastParameter();
|
Standard_Real OLast = Other.LastParameter();
|
||||||
gp_Pnt pd = CRef.Value(First);
|
gp_Pnt pd = CRef.Value(First);
|
||||||
gp_Pnt pdo = Other.Value(OFirst);
|
gp_Pnt pdo = Other.Value(OFirst);
|
||||||
Standard_Real distt = pd.SquareDistance(pdo);
|
Standard_Real distt = pd.SquareDistance(pdo);
|
||||||
if (distt > Tol*Tol) {
|
|
||||||
problematic_point = pd ;
|
if (distt > Tol*Tol)
|
||||||
Status = Standard_False ;
|
{
|
||||||
Error = Sqrt(distt);
|
const gp_Pnt problematic_point(pd);
|
||||||
|
Status = BRepCheck_InvalidCurveOnSurface ;
|
||||||
|
const Standard_Real Error = Sqrt(distt);
|
||||||
PrintProblematicPoint(problematic_point, Error, Tol);
|
PrintProblematicPoint(problematic_point, Error, Tol);
|
||||||
return Status;
|
return Status;
|
||||||
//goto FINISH ;
|
//goto FINISH ;
|
||||||
}
|
}
|
||||||
|
|
||||||
pd = CRef.Value(Last);
|
pd = CRef.Value(Last);
|
||||||
pdo = Other.Value(OLast);
|
pdo = Other.Value(OLast);
|
||||||
distt = pd.SquareDistance(pdo);
|
distt = pd.SquareDistance(pdo);
|
||||||
if (distt > Tol*Tol) {
|
|
||||||
problematic_point = pd ;
|
if (distt > Tol*Tol)
|
||||||
Status = Standard_False ;
|
{
|
||||||
Error = Sqrt(distt);
|
const gp_Pnt problematic_point(pd);
|
||||||
|
Status = BRepCheck_InvalidCurveOnSurface ;
|
||||||
|
const Standard_Real Error = Sqrt(distt);
|
||||||
PrintProblematicPoint(problematic_point, Error, Tol);
|
PrintProblematicPoint(problematic_point, Error, Tol);
|
||||||
return Status;
|
return Status;
|
||||||
//goto FINISH ;
|
//goto FINISH ;
|
||||||
@@ -624,57 +978,50 @@ Standard_Boolean Validate(const Adaptor3d_Curve& CRef,
|
|||||||
|
|
||||||
refd.Initialize(CRef,First,Last,CRef.Resolution(Tol));
|
refd.Initialize(CRef,First,Last,CRef.Resolution(Tol));
|
||||||
otherd.Initialize(Other,OFirst,OLast,Other.Resolution(Tol));
|
otherd.Initialize(Other,OFirst,OLast,Other.Resolution(Tol));
|
||||||
for (Standard_Integer i = 2; i< NCONTROL-1; i++) {
|
|
||||||
Standard_Real rprm = ((NCONTROL-1-i)*First + i*Last)/(NCONTROL-1);
|
for (Standard_Integer i = 2; i< aNbControl-1; i++)
|
||||||
|
{
|
||||||
|
Standard_Real rprm = ((aNbControl-1-i)*First + i*Last)/(aNbControl-1);
|
||||||
gp_Pnt pref = CRef.Value(rprm);
|
gp_Pnt pref = CRef.Value(rprm);
|
||||||
Standard_Real oprm = ((NCONTROL-1-i)*OFirst + i*OLast)/(NCONTROL-1);
|
Standard_Real oprm = ((aNbControl-1-i)*OFirst + i*OLast)/(aNbControl-1);
|
||||||
gp_Pnt pother = Other.Value(oprm);
|
gp_Pnt pother = Other.Value(oprm);
|
||||||
refd.Perform(pother,rprm);
|
refd.Perform(pother,rprm);
|
||||||
if (!refd.IsDone() || refd.SquareDistance() > Tol * Tol) {
|
|
||||||
problematic_point = pref ;
|
if (!refd.IsDone() || refd.SquareDistance() > Tol * Tol)
|
||||||
Status = Standard_False ;
|
{
|
||||||
if (refd.IsDone()) {
|
const gp_Pnt problematic_point(pref);
|
||||||
Error = sqrt (refd.SquareDistance());
|
Status = BRepCheck_InvalidCurveOnSurface ;
|
||||||
}
|
|
||||||
else {
|
const Standard_Real Error = refd.IsDone() ?
|
||||||
Error = RealLast();
|
sqrt (refd.SquareDistance()) :
|
||||||
}
|
RealLast();
|
||||||
PrintProblematicPoint(problematic_point, Error, Tol);
|
|
||||||
return Status;
|
PrintProblematicPoint(problematic_point, Error, Tol);
|
||||||
|
return Status;
|
||||||
//goto FINISH ;
|
//goto FINISH ;
|
||||||
}
|
}
|
||||||
|
|
||||||
otherd.Perform(pref,oprm);
|
otherd.Perform(pref,oprm);
|
||||||
if (!otherd.IsDone() || otherd.SquareDistance() > Tol * Tol) {
|
|
||||||
problematic_point = pref ;
|
if (!otherd.IsDone() || otherd.SquareDistance() > Tol * Tol)
|
||||||
Status = Standard_False ;
|
{
|
||||||
if (otherd.IsDone()) {
|
const gp_Pnt problematic_point(pref);
|
||||||
Error = sqrt (otherd.SquareDistance());
|
Status = BRepCheck_InvalidCurveOnSurface ;
|
||||||
}
|
|
||||||
else {
|
const Standard_Real Error = otherd.IsDone() ?
|
||||||
Error = RealLast();
|
sqrt (otherd.SquareDistance()) :
|
||||||
}
|
RealLast();
|
||||||
PrintProblematicPoint(problematic_point, Error, Tol);
|
|
||||||
return Status;
|
PrintProblematicPoint(problematic_point, Error, Tol);
|
||||||
//goto FINISH ;
|
return Status;
|
||||||
|
//goto FINISH ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//FINISH :
|
|
||||||
/*
|
|
||||||
#ifdef DEB
|
|
||||||
if (! Status) {
|
|
||||||
cout << " **** probleme de SameParameter au point :" << endl;
|
|
||||||
cout << " " << problematic_point.Coord(1) << " "
|
|
||||||
<< problematic_point.Coord(2) << " "
|
|
||||||
<< problematic_point.Coord(3) << endl ;
|
|
||||||
cout << " Erreur detectee :" << Error << " Tolerance :" << Tol << endl;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
return Status ;
|
|
||||||
|
|
||||||
|
return Status ;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Prec
|
//function : Prec
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -66,6 +66,13 @@ is
|
|||||||
|
|
||||||
is static;
|
is static;
|
||||||
|
|
||||||
|
SetStatus(me: mutable;
|
||||||
|
theStatus:Status from BRepCheck)
|
||||||
|
|
||||||
|
--- Purpose: Sets status of Face;
|
||||||
|
is static;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IsUnorientable(me)
|
IsUnorientable(me)
|
||||||
|
|
||||||
|
@@ -494,6 +494,15 @@ void BRepCheck_Face::SetUnorientable()
|
|||||||
BRepCheck::Add(myMap(myShape),BRepCheck_UnorientableShape);
|
BRepCheck::Add(myMap(myShape),BRepCheck_UnorientableShape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetStatus
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void BRepCheck_Face::SetStatus(const BRepCheck_Status theStatus)
|
||||||
|
{
|
||||||
|
BRepCheck::Add(myMap(myShape),theStatus);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsUnorientable
|
//function : IsUnorientable
|
||||||
|
@@ -384,7 +384,7 @@ Standard_Boolean IsDistanceIn3DTolerance (const BRepAdaptor_Surface& /*aFaceSurf
|
|||||||
#ifdef DEB
|
#ifdef DEB
|
||||||
cout << endl;
|
cout << endl;
|
||||||
cout << "--------Function IsDistanceIn3DTolerance(...)----------" << endl;
|
cout << "--------Function IsDistanceIn3DTolerance(...)----------" << endl;
|
||||||
cout << "--- BRepCheck Wire: Closed3d -> Error" << endl;
|
cout << "--- BRepCheck Wire: Not closed in 3D" << endl;
|
||||||
cout << "--- Dist (" << Dist << ") > Tol3d (" << aTol3d << ")" << endl;
|
cout << "--- Dist (" << Dist << ") > Tol3d (" << aTol3d << ")" << endl;
|
||||||
cout << "Pnt1(" << thePnt_f.X() << "; " << thePnt_f.Y() << "; " << thePnt_f.Z() << ")" << endl;
|
cout << "Pnt1(" << thePnt_f.X() << "; " << thePnt_f.Y() << "; " << thePnt_f.Z() << ")" << endl;
|
||||||
cout << "Pnt2(" << thePnt_l.X() << "; " << thePnt_l.Y() << "; " << thePnt_l.Z() << ")" << endl;
|
cout << "Pnt2(" << thePnt_l.X() << "; " << thePnt_l.Y() << "; " << thePnt_l.Z() << ")" << endl;
|
||||||
@@ -422,7 +422,7 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
|
|||||||
{
|
{
|
||||||
cout << endl;
|
cout << endl;
|
||||||
cout << "--------Function IsDistanceIn2DTolerance(...)----------" << endl;
|
cout << "--------Function IsDistanceIn2DTolerance(...)----------" << endl;
|
||||||
cout << "--- BRepCheck Wire: Not closed in 2d" << endl;
|
cout << "--- BRepCheck Wire: Not closed in 2D" << endl;
|
||||||
cout << "*****************************************************" << endl;
|
cout << "*****************************************************" << endl;
|
||||||
cout << "*dumin = " << dumin << "; dumax = " << dumax << endl;
|
cout << "*dumin = " << dumin << "; dumax = " << dumax << endl;
|
||||||
cout << "* dvmin = " << dvmin << "; dvmax = " << dvmax << endl;
|
cout << "* dvmin = " << dvmin << "; dvmax = " << dvmax << endl;
|
||||||
@@ -471,7 +471,7 @@ Standard_Boolean IsDistanceIn2DTolerance (const BRepAdaptor_Surface& aFaceSurfac
|
|||||||
{
|
{
|
||||||
cout << endl;
|
cout << endl;
|
||||||
cout << "--------Function IsDistanceIn2DTolerance(...)----------" << endl;
|
cout << "--------Function IsDistanceIn2DTolerance(...)----------" << endl;
|
||||||
cout << "--- BRepCheck Wire: Not closed in 2d" << endl;
|
cout << "--- BRepCheck Wire: Not closed in 2D" << endl;
|
||||||
cout << "*****************************************************" << endl;
|
cout << "*****************************************************" << endl;
|
||||||
cout << "* Dist = " << Dist << " > Tol2d = " << aTol2d << endl;
|
cout << "* Dist = " << Dist << " > Tol2d = " << aTol2d << endl;
|
||||||
cout << "*****************************************************" << endl;
|
cout << "*****************************************************" << endl;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -76,6 +76,12 @@
|
|||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//Number of BRepCheck_Statuses in BRepCheck_Status.hxx file
|
||||||
|
//(BRepCheck_NoError is not considered, i.e. general status
|
||||||
|
//is smaller by one specified in file)
|
||||||
|
static const Standard_Integer NumberOfStatus = 35;
|
||||||
|
|
||||||
|
|
||||||
static char* checkfaultyname = NULL;
|
static char* checkfaultyname = NULL;
|
||||||
Standard_EXPORT void BRepTest_CheckCommands_SetFaultyName(const char* name)
|
Standard_EXPORT void BRepTest_CheckCommands_SetFaultyName(const char* name)
|
||||||
{
|
{
|
||||||
@@ -511,40 +517,46 @@ static void FillProblems(const BRepCheck_Status stat,
|
|||||||
NbProblems->SetValue(14,NbProblems->Value(14)+1); break;
|
NbProblems->SetValue(14,NbProblems->Value(14)+1); break;
|
||||||
case BRepCheck_InvalidRange:
|
case BRepCheck_InvalidRange:
|
||||||
NbProblems->SetValue(15,NbProblems->Value(15)+1); break;
|
NbProblems->SetValue(15,NbProblems->Value(15)+1); break;
|
||||||
case BRepCheck_EmptyWire:
|
case BRepCheck_PCurveIsOutOfDomainFace:
|
||||||
NbProblems->SetValue(16,NbProblems->Value(16)+1); break;
|
NbProblems->SetValue(16,NbProblems->Value(16)+1); break;
|
||||||
case BRepCheck_RedundantEdge:
|
case BRepCheck_EmptyWire:
|
||||||
NbProblems->SetValue(17,NbProblems->Value(17)+1); break;
|
NbProblems->SetValue(17,NbProblems->Value(17)+1); break;
|
||||||
case BRepCheck_SelfIntersectingWire:
|
case BRepCheck_RedundantEdge:
|
||||||
NbProblems->SetValue(18,NbProblems->Value(18)+1); break;
|
NbProblems->SetValue(18,NbProblems->Value(18)+1); break;
|
||||||
case BRepCheck_NoSurface:
|
case BRepCheck_SelfIntersectingWire:
|
||||||
NbProblems->SetValue(19,NbProblems->Value(19)+1); break;
|
NbProblems->SetValue(19,NbProblems->Value(19)+1); break;
|
||||||
case BRepCheck_InvalidWire:
|
case BRepCheck_NoSurface:
|
||||||
NbProblems->SetValue(20,NbProblems->Value(20)+1); break;
|
NbProblems->SetValue(20,NbProblems->Value(20)+1); break;
|
||||||
case BRepCheck_RedundantWire:
|
case BRepCheck_OutOfSurfaceBoundary:
|
||||||
NbProblems->SetValue(21,NbProblems->Value(21)+1); break;
|
NbProblems->SetValue(21,NbProblems->Value(21)+1); break;
|
||||||
case BRepCheck_IntersectingWires:
|
case BRepCheck_InvalidWire:
|
||||||
NbProblems->SetValue(22,NbProblems->Value(22)+1); break;
|
NbProblems->SetValue(22,NbProblems->Value(22)+1); break;
|
||||||
case BRepCheck_InvalidImbricationOfWires:
|
case BRepCheck_RedundantWire:
|
||||||
NbProblems->SetValue(23,NbProblems->Value(23)+1); break;
|
NbProblems->SetValue(23,NbProblems->Value(23)+1); break;
|
||||||
case BRepCheck_EmptyShell:
|
case BRepCheck_IntersectingWires:
|
||||||
NbProblems->SetValue(24,NbProblems->Value(24)+1); break;
|
NbProblems->SetValue(24,NbProblems->Value(24)+1); break;
|
||||||
case BRepCheck_RedundantFace:
|
case BRepCheck_InvalidImbricationOfWires:
|
||||||
NbProblems->SetValue(25,NbProblems->Value(25)+1); break;
|
NbProblems->SetValue(25,NbProblems->Value(25)+1); break;
|
||||||
case BRepCheck_UnorientableShape:
|
case BRepCheck_EmptyShell:
|
||||||
NbProblems->SetValue(26,NbProblems->Value(26)+1); break;
|
NbProblems->SetValue(26,NbProblems->Value(26)+1); break;
|
||||||
case BRepCheck_NotClosed:
|
case BRepCheck_RedundantFace:
|
||||||
NbProblems->SetValue(27,NbProblems->Value(27)+1); break;
|
NbProblems->SetValue(27,NbProblems->Value(27)+1); break;
|
||||||
case BRepCheck_NotConnected:
|
case BRepCheck_UnorientableShape:
|
||||||
NbProblems->SetValue(28,NbProblems->Value(28)+1); break;
|
NbProblems->SetValue(28,NbProblems->Value(28)+1); break;
|
||||||
case BRepCheck_SubshapeNotInShape:
|
case BRepCheck_NotClosed:
|
||||||
NbProblems->SetValue(29,NbProblems->Value(29)+1); break;
|
NbProblems->SetValue(29,NbProblems->Value(29)+1); break;
|
||||||
case BRepCheck_BadOrientation:
|
case BRepCheck_NotConnected:
|
||||||
NbProblems->SetValue(30,NbProblems->Value(30)+1); break;
|
NbProblems->SetValue(30,NbProblems->Value(30)+1); break;
|
||||||
case BRepCheck_BadOrientationOfSubshape:
|
case BRepCheck_SubshapeNotInShape:
|
||||||
NbProblems->SetValue(31,NbProblems->Value(31)+1); break;
|
NbProblems->SetValue(31,NbProblems->Value(31)+1); break;
|
||||||
case BRepCheck_CheckFail:
|
case BRepCheck_BadOrientation:
|
||||||
NbProblems->SetValue(32,NbProblems->Value(32)+1); break;
|
NbProblems->SetValue(32,NbProblems->Value(32)+1); break;
|
||||||
|
case BRepCheck_BadOrientationOfSubshape:
|
||||||
|
NbProblems->SetValue(33,NbProblems->Value(33)+1); break;
|
||||||
|
case BRepCheck_InvalidToleranceValue:
|
||||||
|
NbProblems->SetValue(34,NbProblems->Value(34)+1); break;
|
||||||
|
case BRepCheck_CheckFail:
|
||||||
|
NbProblems->SetValue(35,NbProblems->Value(35)+1); break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -670,8 +682,9 @@ void StructuralDump(Draw_Interpretor& theCommands,
|
|||||||
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
|
||||||
for(i=1; i<=32; i++) NbProblems->SetValue(i,0);
|
TColStd_HArray1OfInteger(1,NumberOfStatus);
|
||||||
|
for(i=1; i<=NumberOfStatus; 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();
|
||||||
@@ -724,55 +737,64 @@ void StructuralDump(Draw_Interpretor& theCommands,
|
|||||||
theCommands<<" Invalid Range ............................ "<<NbProblems->Value(15)<<"\n";
|
theCommands<<" Invalid Range ............................ "<<NbProblems->Value(15)<<"\n";
|
||||||
//cout<<" Invalid Range ............................ "<<NbProblems->Value(15)<<endl;
|
//cout<<" Invalid Range ............................ "<<NbProblems->Value(15)<<endl;
|
||||||
if(NbProblems->Value(16)>0)
|
if(NbProblems->Value(16)>0)
|
||||||
theCommands<<" Empty Wire ............................... "<<NbProblems->Value(16)<<"\n";
|
theCommands<<" pcurve is out of domain face.............. "<<NbProblems->Value(16)<<"\n";
|
||||||
//cout<<" Empty Wire ............................... "<<NbProblems->Value(16)<<endl;
|
//cout<<" Invalid Range ............................ "<<NbProblems->Value(15)<<endl;
|
||||||
if(NbProblems->Value(17)>0)
|
if(NbProblems->Value(17)>0)
|
||||||
theCommands<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<"\n";
|
theCommands<<" Empty Wire ............................... "<<NbProblems->Value(17)<<"\n";
|
||||||
//cout<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<endl;
|
//cout<<" Empty Wire ............................... "<<NbProblems->Value(16)<<endl;
|
||||||
if(NbProblems->Value(18)>0)
|
if(NbProblems->Value(18)>0)
|
||||||
theCommands<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<"\n";
|
theCommands<<" Redundant Edge ........................... "<<NbProblems->Value(18)<<"\n";
|
||||||
//cout<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<endl;
|
//cout<<" Redundant Edge ........................... "<<NbProblems->Value(17)<<endl;
|
||||||
if(NbProblems->Value(19)>0)
|
if(NbProblems->Value(19)>0)
|
||||||
theCommands<<" No Surface ............................... "<<NbProblems->Value(19)<<"\n";
|
theCommands<<" Self Intersecting Wire ................... "<<NbProblems->Value(19)<<"\n";
|
||||||
//cout<<" No Surface ............................... "<<NbProblems->Value(19)<<endl;
|
//cout<<" Self Intersecting Wire ................... "<<NbProblems->Value(18)<<endl;
|
||||||
if(NbProblems->Value(20)>0)
|
if(NbProblems->Value(20)>0)
|
||||||
theCommands<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<"\n";
|
theCommands<<" No Surface ............................... "<<NbProblems->Value(20)<<"\n";
|
||||||
//cout<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<endl;
|
//cout<<" No Surface ............................... "<<NbProblems->Value(19)<<endl;
|
||||||
if(NbProblems->Value(21)>0)
|
if(NbProblems->Value(21)>0)
|
||||||
theCommands<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<"\n";
|
theCommands<<" Face is out of it surface boundary........ "<<NbProblems->Value(21)<<"\n";
|
||||||
//cout<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<endl;
|
//cout<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<endl;
|
||||||
if(NbProblems->Value(22)>0)
|
if(NbProblems->Value(22)>0)
|
||||||
theCommands<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<"\n";
|
theCommands<<" Invalid Wire ............................. "<<NbProblems->Value(22)<<"\n";
|
||||||
//cout<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<endl;
|
//cout<<" Invalid Wire ............................. "<<NbProblems->Value(20)<<endl;
|
||||||
if(NbProblems->Value(23)>0)
|
if(NbProblems->Value(23)>0)
|
||||||
theCommands<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<"\n";
|
theCommands<<" Redundant Wire ........................... "<<NbProblems->Value(23)<<"\n";
|
||||||
//cout<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<endl;
|
//cout<<" Redundant Wire ........................... "<<NbProblems->Value(21)<<endl;
|
||||||
if(NbProblems->Value(24)>0)
|
if(NbProblems->Value(24)>0)
|
||||||
theCommands<<" Empty Shell .............................. "<<NbProblems->Value(24)<<"\n";
|
theCommands<<" Intersecting Wires ....................... "<<NbProblems->Value(24)<<"\n";
|
||||||
//cout<<" Empty Shell .............................. "<<NbProblems->Value(24)<<endl;
|
//cout<<" Intersecting Wires ....................... "<<NbProblems->Value(22)<<endl;
|
||||||
if(NbProblems->Value(25)>0)
|
if(NbProblems->Value(25)>0)
|
||||||
theCommands<<" Redundant Face ........................... "<<NbProblems->Value(25)<<"\n";
|
theCommands<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(25)<<"\n";
|
||||||
//cout<<" Redundant Face ........................... "<<NbProblems->Value(25)<<endl;
|
//cout<<" Invalid Imbrication of Wires ............. "<<NbProblems->Value(23)<<endl;
|
||||||
if(NbProblems->Value(26)>0)
|
if(NbProblems->Value(26)>0)
|
||||||
theCommands<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<"\n";
|
theCommands<<" Empty Shell .............................. "<<NbProblems->Value(26)<<"\n";
|
||||||
//cout<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<endl;
|
//cout<<" Empty Shell .............................. "<<NbProblems->Value(24)<<endl;
|
||||||
if(NbProblems->Value(27)>0)
|
if(NbProblems->Value(27)>0)
|
||||||
theCommands<<" Not Closed ............................... "<<NbProblems->Value(27)<<"\n";
|
theCommands<<" Redundant Face ........................... "<<NbProblems->Value(27)<<"\n";
|
||||||
//cout<<" Not Closed ............................... "<<NbProblems->Value(27)<<endl;
|
//cout<<" Redundant Face ........................... "<<NbProblems->Value(25)<<endl;
|
||||||
if(NbProblems->Value(28)>0)
|
if(NbProblems->Value(28)>0)
|
||||||
theCommands<<" Not Connected ............................ "<<NbProblems->Value(28)<<"\n";
|
theCommands<<" Unorientable Shape ....................... "<<NbProblems->Value(28)<<"\n";
|
||||||
//cout<<" Not Connected ............................ "<<NbProblems->Value(28)<<endl;
|
//cout<<" Unorientable Shape ....................... "<<NbProblems->Value(26)<<endl;
|
||||||
if(NbProblems->Value(29)>0)
|
if(NbProblems->Value(29)>0)
|
||||||
theCommands<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<"\n";
|
theCommands<<" Not Closed ............................... "<<NbProblems->Value(29)<<"\n";
|
||||||
//cout<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<endl;
|
//cout<<" Not Closed ............................... "<<NbProblems->Value(27)<<endl;
|
||||||
if(NbProblems->Value(30)>0)
|
if(NbProblems->Value(30)>0)
|
||||||
theCommands<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<"\n";
|
theCommands<<" Not Connected ............................ "<<NbProblems->Value(30)<<"\n";
|
||||||
//cout<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<endl;
|
//cout<<" Not Connected ............................ "<<NbProblems->Value(28)<<endl;
|
||||||
if(NbProblems->Value(31)>0)
|
if(NbProblems->Value(31)>0)
|
||||||
theCommands<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<"\n";
|
theCommands<<" Subshape not in Shape .................... "<<NbProblems->Value(31)<<"\n";
|
||||||
//cout<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<endl;
|
//cout<<" Subshape not in Shape .................... "<<NbProblems->Value(29)<<endl;
|
||||||
if(NbProblems->Value(32)>0)
|
if(NbProblems->Value(32)>0)
|
||||||
theCommands<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<"\n";
|
theCommands<<" Bad Orientation .......................... "<<NbProblems->Value(32)<<"\n";
|
||||||
|
//cout<<" Bad Orientation .......................... "<<NbProblems->Value(30)<<endl;
|
||||||
|
if(NbProblems->Value(33)>0)
|
||||||
|
theCommands<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(33)<<"\n";
|
||||||
|
//cout<<" Bad Orientation of Subshape .............. "<<NbProblems->Value(31)<<endl;
|
||||||
|
if(NbProblems->Value(34)>0)
|
||||||
|
theCommands<<" Invalid tolerance......................... "<<NbProblems->Value(34)<<"\n";
|
||||||
|
//cout<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<endl;
|
||||||
|
if(NbProblems->Value(35)>0)
|
||||||
|
theCommands<<" checkshape failure........................ "<<NbProblems->Value(35)<<"\n";
|
||||||
//cout<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<endl;
|
//cout<<" checkshape failure......... .............. "<<NbProblems->Value(32)<<endl;
|
||||||
|
|
||||||
//cout<<" ------------------------------------------------"<<endl;
|
//cout<<" ------------------------------------------------"<<endl;
|
||||||
|
@@ -80,7 +80,30 @@ is
|
|||||||
|
|
||||||
raises ConstructionError;
|
raises ConstructionError;
|
||||||
|
|
||||||
|
Create (S : Surface from Geom;
|
||||||
|
isUTrim, isVTrim : Boolean;
|
||||||
|
U1, U2, V1, V2 : Real)
|
||||||
|
returns mutable RectangularTrimmedSurface
|
||||||
|
---Purpose :
|
||||||
|
-- The U parametric direction of the surface is oriented from U1
|
||||||
|
-- to U2. The V parametric direction of the surface is oriented
|
||||||
|
-- from V1 to V2.
|
||||||
|
-- These two directions define the orientation of the surface
|
||||||
|
-- (normal). By default in this case the surface has the same
|
||||||
|
-- orientation as the basis surface S.
|
||||||
|
-- isUTrim and isVTrim arguments determine, if it is necessary to
|
||||||
|
-- trim S surface along corresponding direction.
|
||||||
|
-- The returned surface is not closed and not periodic.
|
||||||
|
-- ConstructionError Raised if
|
||||||
|
-- S is not periodic in the UDirection and U1 or U2 are out of the
|
||||||
|
-- bounds of S.
|
||||||
|
-- S is not periodic in the VDirection and V1 or V2 are out of the
|
||||||
|
-- bounds of S.
|
||||||
|
-- U1 = U2 or V1 = V2
|
||||||
|
|
||||||
|
raises ConstructionError;
|
||||||
|
|
||||||
|
|
||||||
Create (S : Surface from Geom;
|
Create (S : Surface from Geom;
|
||||||
Param1, Param2 : Real;
|
Param1, Param2 : Real;
|
||||||
UTrim : Boolean;
|
UTrim : Boolean;
|
||||||
@@ -110,7 +133,37 @@ is
|
|||||||
-- Param1 or Param2 are out of the bounds of S.
|
-- Param1 or Param2 are out of the bounds of S.
|
||||||
-- Param1 = Param2
|
-- Param1 = Param2
|
||||||
|
|
||||||
|
SetUTrim (me : mutable; U1, U2 : Real)
|
||||||
|
---Purpose : Sets boundaries of basisSurf in U1 and U2
|
||||||
|
-- along U-direction.
|
||||||
|
-- For periodic surface boundary values can be changed
|
||||||
|
-- algorithmically.
|
||||||
|
raises ConstructionError;
|
||||||
|
---Purpose : Raised if
|
||||||
|
-- The BasisSurface is not periodic in the U-direction and U1 or U2
|
||||||
|
-- are out of the bounds of the BasisSurface.
|
||||||
|
-- U1 = U2
|
||||||
|
|
||||||
|
SetVTrim (me : mutable; V1, V2 : Real)
|
||||||
|
---Purpose : Sets boundaries of basisSurf in V1 and V2
|
||||||
|
-- along V-direction.
|
||||||
|
-- For periodic surface boundary values can be changed
|
||||||
|
-- algorithmically.
|
||||||
|
raises ConstructionError;
|
||||||
|
---Purpose : Raised if
|
||||||
|
-- The BasisSurface is not periodic in the V-direction and V1 or V2
|
||||||
|
-- are out of the bounds of the BasisSurface.
|
||||||
|
-- V1 = V2
|
||||||
|
|
||||||
|
ForceTrim(me : mutable;
|
||||||
|
U1, U2, V1, V2 : Real;
|
||||||
|
UTrim, VTrim : Boolean = Standard_True);
|
||||||
|
---Purpose : For periodic surface this method changes
|
||||||
|
-- (if it is necessary) U2 and V2, so that 0 < U2 - U1 < T and
|
||||||
|
-- 0 < V2 - V1 < T (where T is the period).
|
||||||
|
-- If surface is not periodic, boundaries do not chenge.
|
||||||
|
-- After that it trims basisSurf in new boundaries.
|
||||||
|
|
||||||
SetTrim (me : mutable;
|
SetTrim (me : mutable;
|
||||||
U1, U2, V1, V2 : Real;
|
U1, U2, V1, V2 : Real;
|
||||||
USense, VSense : Boolean = Standard_True)
|
USense, VSense : Boolean = Standard_True)
|
||||||
@@ -362,6 +415,10 @@ is
|
|||||||
|
|
||||||
Copy (me) returns mutable like me;
|
Copy (me) returns mutable like me;
|
||||||
---Purpose: Creates a new object which is a copy of this patch.
|
---Purpose: Creates a new object which is a copy of this patch.
|
||||||
|
|
||||||
|
GetTrimmedFlags(me; isUtrimmed,isVtrimmed : in out Boolean from Standard);
|
||||||
|
---Purpose: Allows to get <isutrimmed> and <isvtrimmed> members values.
|
||||||
|
|
||||||
fields
|
fields
|
||||||
|
|
||||||
basisSurf : Surface from Geom;
|
basisSurf : Surface from Geom;
|
||||||
|
@@ -83,6 +83,45 @@ Handle(Geom_Geometry) Geom_RectangularTrimmedSurface::Copy () const {
|
|||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : Geom_RectangularTrimmedSurface
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
Geom_RectangularTrimmedSurface::Geom_RectangularTrimmedSurface(
|
||||||
|
const Handle(Geom_Surface)& S,
|
||||||
|
const Standard_Boolean isUTrim,
|
||||||
|
const Standard_Boolean isVTrim,
|
||||||
|
const Standard_Real U1,
|
||||||
|
const Standard_Real U2,
|
||||||
|
const Standard_Real V1,
|
||||||
|
const Standard_Real V2): utrim1(U1),
|
||||||
|
vtrim1(V1),
|
||||||
|
utrim2(U2),
|
||||||
|
vtrim2(V2),
|
||||||
|
isutrimmed (isUTrim),
|
||||||
|
isvtrimmed (isVTrim)
|
||||||
|
{
|
||||||
|
// kill trimmed basis surfaces
|
||||||
|
Handle(Geom_RectangularTrimmedSurface) T =
|
||||||
|
Handle(Geom_RectangularTrimmedSurface)::DownCast(S);
|
||||||
|
if (!T.IsNull())
|
||||||
|
basisSurf = Handle(Surface)::DownCast(T->BasisSurface()->Copy());
|
||||||
|
else
|
||||||
|
basisSurf = Handle(Surface)::DownCast(S->Copy());
|
||||||
|
|
||||||
|
Handle(Geom_OffsetSurface) O =
|
||||||
|
Handle(Geom_OffsetSurface)::DownCast(basisSurf);
|
||||||
|
if (!O.IsNull())
|
||||||
|
{
|
||||||
|
Handle(Geom_RectangularTrimmedSurface) S2 =
|
||||||
|
new Geom_RectangularTrimmedSurface( O->BasisSurface(),U1,U2, V1, V2, isUTrim, isVTrim);
|
||||||
|
Handle(Geom_OffsetSurface) OS = new Geom_OffsetSurface(S2, O->Offset());
|
||||||
|
basisSurf = Handle(Surface)::DownCast(OS);
|
||||||
|
}
|
||||||
|
|
||||||
|
ForceTrim( U1, U2, V1, V2, isUTrim, isVTrim);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Geom_RectangularTrimmedSurface
|
//function : Geom_RectangularTrimmedSurface
|
||||||
@@ -164,6 +203,172 @@ Geom_RectangularTrimmedSurface::Geom_RectangularTrimmedSurface (
|
|||||||
SetTrim(Param1, Param2, UTrim, Sense);
|
SetTrim(Param1, Param2, UTrim, Sense);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetUTrim
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void Geom_RectangularTrimmedSurface::SetUTrim(const Standard_Real theU1,
|
||||||
|
const Standard_Real theU2)
|
||||||
|
{
|
||||||
|
const Standard_Real Udeb = utrim1, Ufin = utrim2;
|
||||||
|
|
||||||
|
utrim1 = theU1;
|
||||||
|
utrim2 = theU2;
|
||||||
|
|
||||||
|
if ( utrim1 == utrim2)
|
||||||
|
Standard_ConstructionError::Raise
|
||||||
|
("Geom_RectangularTrimmedSurface::U1==U2");
|
||||||
|
|
||||||
|
if (basisSurf->IsUPeriodic())
|
||||||
|
{
|
||||||
|
ElCLib::AdjustPeriodic(Udeb, Ufin,
|
||||||
|
Min(Abs(utrim2-utrim1)/2,Precision::PConfusion()), utrim1, utrim2);
|
||||||
|
}//if (basisSurf->IsUPeriodic())
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (utrim1 > utrim2)
|
||||||
|
{
|
||||||
|
//change some places of theUTrim1 and theUTrim2
|
||||||
|
Standard_Real ut = utrim1;
|
||||||
|
utrim1 = utrim2;
|
||||||
|
utrim2 = ut;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (Udeb-utrim1 > Precision::PConfusion()) ||
|
||||||
|
(utrim2-Ufin > Precision::PConfusion()))
|
||||||
|
{
|
||||||
|
Standard_ConstructionError::Raise
|
||||||
|
("Geom_RectangularTrimmedSurface::Uparameters out of range");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetVTrim
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void Geom_RectangularTrimmedSurface::SetVTrim(const Standard_Real theV1,
|
||||||
|
const Standard_Real theV2)
|
||||||
|
{
|
||||||
|
const Standard_Real Vdeb = vtrim1, Vfin = vtrim2;
|
||||||
|
|
||||||
|
vtrim1 = theV1;
|
||||||
|
vtrim2 = theV2;
|
||||||
|
|
||||||
|
if ( vtrim1 == vtrim2)
|
||||||
|
Standard_ConstructionError::Raise
|
||||||
|
("Geom_RectangularTrimmedSurface::V1==V2");
|
||||||
|
|
||||||
|
if (basisSurf->IsVPeriodic())
|
||||||
|
{
|
||||||
|
ElCLib::AdjustPeriodic(Vdeb, Vfin,
|
||||||
|
Min(Abs(vtrim2-vtrim1)/2,Precision::PConfusion()),vtrim1, vtrim2);
|
||||||
|
}//if (basisSurf->IsVPeriodic())
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (vtrim1 > vtrim2)
|
||||||
|
{
|
||||||
|
Standard_Real vt = vtrim1;
|
||||||
|
vtrim1 = vtrim2;
|
||||||
|
vtrim2 = vt;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (Vdeb-vtrim1 > Precision::PConfusion()) ||
|
||||||
|
(vtrim2-Vfin > Precision::PConfusion()))
|
||||||
|
{
|
||||||
|
Standard_ConstructionError::Raise
|
||||||
|
("Geom_RectangularTrimmedSurface::V parameters out of range");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ForceTrim
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void Geom_RectangularTrimmedSurface::ForceTrim(const Standard_Real theU1,
|
||||||
|
const Standard_Real theU2,
|
||||||
|
const Standard_Real theV1,
|
||||||
|
const Standard_Real theV2,
|
||||||
|
const Standard_Boolean isUTrim,
|
||||||
|
const Standard_Boolean isVTrim)
|
||||||
|
{
|
||||||
|
basisSurf->Bounds(utrim1, utrim2, vtrim1, vtrim2);
|
||||||
|
|
||||||
|
isutrimmed = isUTrim;
|
||||||
|
isvtrimmed = isVTrim;
|
||||||
|
|
||||||
|
// Trimming along U-Direction
|
||||||
|
if (isutrimmed)
|
||||||
|
{
|
||||||
|
utrim1 = theU1;
|
||||||
|
utrim2 = theU2;
|
||||||
|
|
||||||
|
if((utrim1 > utrim2) || !(basisSurf->IsUPeriodic()))
|
||||||
|
{
|
||||||
|
//Standard_ConstructionError::Raise
|
||||||
|
// ("Geom_RectangularTrimmedSurface::ForceTrim(...). "
|
||||||
|
// "utrim1 > utrim2");
|
||||||
|
|
||||||
|
SetUTrim(theU1,theU2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const Standard_Real aTolPeriodicFactor = 1.0e-7;
|
||||||
|
const Standard_Real aT = basisSurf->UPeriod();
|
||||||
|
const Standard_Real aTol = aTolPeriodicFactor * aT;
|
||||||
|
if(utrim2 - utrim1 - aT > 2.0*aTol)
|
||||||
|
{
|
||||||
|
Standard_Integer n = RealToInt((utrim2 - utrim1)/aT);
|
||||||
|
utrim2 -= (n * aT);
|
||||||
|
|
||||||
|
if(utrim2 - utrim1 < aTol)
|
||||||
|
utrim2 += aT;
|
||||||
|
}
|
||||||
|
|
||||||
|
//if(utrim2 - utrim1 < aTol)
|
||||||
|
// Standard_ConstructionError::Raise
|
||||||
|
// ("Geom_RectangularTrimmedSurface::SetTrim(...)."
|
||||||
|
// "ERROR in adjust U-parameter!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trimming along V-Direction
|
||||||
|
if (isvtrimmed)
|
||||||
|
{
|
||||||
|
vtrim1 = theV1;
|
||||||
|
vtrim2 = theV2;
|
||||||
|
|
||||||
|
if ((vtrim1 > vtrim2) || !(basisSurf->IsVPeriodic()))
|
||||||
|
{
|
||||||
|
//Standard_ConstructionError::Raise
|
||||||
|
// ("Geom_RectangularTrimmedSurface::ForceTrim(...). "
|
||||||
|
// "vtrim1 > vtrim2");
|
||||||
|
|
||||||
|
SetVTrim(theV1,theV2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const Standard_Real aTolPeriodicFactor = 1.0e-7;
|
||||||
|
const Standard_Real aT = basisSurf->VPeriod();
|
||||||
|
const Standard_Real aTol = aTolPeriodicFactor * aT;
|
||||||
|
|
||||||
|
if(vtrim2 - vtrim1 - aT > 2.0*aTol)
|
||||||
|
{
|
||||||
|
Standard_Integer n = RealToInt((vtrim2 - vtrim1)/aT);
|
||||||
|
vtrim2 -= (n * aT);
|
||||||
|
|
||||||
|
if(vtrim2 - vtrim1 < aTol)
|
||||||
|
vtrim2 += aT;
|
||||||
|
}
|
||||||
|
|
||||||
|
//if(vtrim2 - vtrim1 < aTol)
|
||||||
|
// Standard_ConstructionError::Raise
|
||||||
|
// ("Geom_RectangularTrimmedSurface::SetTrim(...)."
|
||||||
|
// "ERROR in adjust V-parameter!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetTrim
|
//function : SetTrim
|
||||||
@@ -217,107 +422,36 @@ void Geom_RectangularTrimmedSurface::SetTrim (const Standard_Real Param1,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void Geom_RectangularTrimmedSurface::SetTrim(const Standard_Real U1,
|
void Geom_RectangularTrimmedSurface::SetTrim(
|
||||||
const Standard_Real U2,
|
const Standard_Real theU1,
|
||||||
const Standard_Real V1,
|
const Standard_Real theU2,
|
||||||
const Standard_Real V2,
|
const Standard_Real theV1,
|
||||||
const Standard_Boolean UTrim,
|
const Standard_Real theV2,
|
||||||
const Standard_Boolean VTrim,
|
const Standard_Boolean isUTrim,
|
||||||
const Standard_Boolean USense,
|
const Standard_Boolean isVTrim,
|
||||||
const Standard_Boolean VSense) {
|
const Standard_Boolean isUSense,
|
||||||
|
const Standard_Boolean isVSense)
|
||||||
Standard_Boolean UsameSense = Standard_True;
|
{
|
||||||
Standard_Boolean VsameSense = Standard_True;
|
Standard_Boolean UsameSense = !(isUSense && (theU1 > theU2));
|
||||||
Standard_Real Udeb, Ufin, Vdeb, Vfin;
|
Standard_Boolean VsameSense = !(isVSense && (theV1 > theV2));
|
||||||
|
|
||||||
basisSurf->Bounds(Udeb, Ufin, Vdeb, Vfin);
|
basisSurf->Bounds(utrim1, utrim2, vtrim1, vtrim2);
|
||||||
|
|
||||||
|
isutrimmed = isUTrim;
|
||||||
|
isvtrimmed = isVTrim;
|
||||||
|
|
||||||
// Trimming the U-Direction
|
// Trimming the U-Direction
|
||||||
isutrimmed = UTrim;
|
if (isutrimmed)
|
||||||
if (!UTrim) {
|
SetUTrim(theU1,theU2);
|
||||||
utrim1 = Udeb;
|
|
||||||
utrim2 = Ufin;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ( U1 == U2)
|
|
||||||
Standard_ConstructionError::Raise
|
|
||||||
("Geom_RectangularTrimmedSurface::U1==U2");
|
|
||||||
|
|
||||||
if (basisSurf->IsUPeriodic()) {
|
|
||||||
UsameSense = USense;
|
|
||||||
|
|
||||||
// set uTrim1 in the range Udeb , Ufin
|
|
||||||
// set uTrim2 in the range uTrim1 , uTrim1 + Period()
|
|
||||||
utrim1 = U1;
|
|
||||||
utrim2 = U2;
|
|
||||||
ElCLib::AdjustPeriodic(Udeb, Ufin,
|
|
||||||
Min(Abs(utrim2-utrim1)/2,Precision::PConfusion()),
|
|
||||||
utrim1, utrim2);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (U1 < U2) {
|
|
||||||
UsameSense = USense;
|
|
||||||
utrim1 = U1;
|
|
||||||
utrim2 = U2;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
UsameSense = !USense;
|
|
||||||
utrim1 = U2;
|
|
||||||
utrim2 = U1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((Udeb-utrim1 > Precision::PConfusion()) ||
|
|
||||||
(utrim2-Ufin > Precision::PConfusion()))
|
|
||||||
Standard_ConstructionError::Raise
|
|
||||||
("Geom_RectangularTrimmedSurface::U parameters out of range");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Trimming the V-Direction
|
// Trimming the V-Direction
|
||||||
isvtrimmed = VTrim;
|
if (isvtrimmed)
|
||||||
if (!VTrim) {
|
SetVTrim(theV1,theV2);
|
||||||
vtrim1 = Vdeb;
|
|
||||||
vtrim2 = Vfin;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ( V1 == V2)
|
|
||||||
Standard_ConstructionError::Raise
|
|
||||||
("Geom_RectangularTrimmedSurface::V1==V2");
|
|
||||||
|
|
||||||
if (basisSurf->IsVPeriodic()) {
|
if (!UsameSense)
|
||||||
VsameSense = VSense;
|
UReverse();
|
||||||
|
if (!VsameSense)
|
||||||
// set vTrim1 in the range Vdeb , Vfin
|
VReverse();
|
||||||
// set vTrim2 in the range vTrim1 , vTrim1 + Period()
|
|
||||||
vtrim1 = V1;
|
|
||||||
vtrim2 = V2;
|
|
||||||
ElCLib::AdjustPeriodic(Vdeb, Vfin,
|
|
||||||
Min(Abs(vtrim2-vtrim1)/2,Precision::PConfusion()),
|
|
||||||
vtrim1, vtrim2);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (V1 < V2) {
|
|
||||||
VsameSense = VSense;
|
|
||||||
vtrim1 = V1;
|
|
||||||
vtrim2 = V2;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
VsameSense = !VSense;
|
|
||||||
vtrim1 = V2;
|
|
||||||
vtrim2 = V1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((Vdeb-vtrim1 > Precision::PConfusion()) ||
|
|
||||||
(vtrim2-Vfin > Precision::PConfusion()))
|
|
||||||
Standard_ConstructionError::Raise
|
|
||||||
("Geom_RectangularTrimmedSurface::V parameters out of range");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!UsameSense) UReverse();
|
|
||||||
if (!VsameSense) VReverse();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -662,3 +796,12 @@ gp_GTrsf2d Geom_RectangularTrimmedSurface::ParametricTransformation
|
|||||||
return basisSurf->ParametricTransformation(T);
|
return basisSurf->ParametricTransformation(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : GetTrimmedFlags
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void Geom_RectangularTrimmedSurface::GetTrimmedFlags(Standard_Boolean& isU, Standard_Boolean& isV) const
|
||||||
|
{
|
||||||
|
isU = isutrimmed;
|
||||||
|
isV = isvtrimmed;
|
||||||
|
}
|
||||||
|
@@ -523,7 +523,14 @@ static void Print(const Handle(Geom_RectangularTrimmedSurface)& S,
|
|||||||
if (compact)
|
if (compact)
|
||||||
OS << RECTANGULAR << " ";
|
OS << RECTANGULAR << " ";
|
||||||
else
|
else
|
||||||
|
{
|
||||||
OS << "RectangularTrimmedSurface";
|
OS << "RectangularTrimmedSurface";
|
||||||
|
|
||||||
|
Standard_Boolean isUtr, isVtr;
|
||||||
|
S->GetTrimmedFlags(isUtr, isVtr);
|
||||||
|
|
||||||
|
OS << " (uTrim = " << isUtr << ", vTrim = " << isVtr << ")";
|
||||||
|
}
|
||||||
|
|
||||||
Standard_Real U1,U2,V1,V2;
|
Standard_Real U1,U2,V1,V2;
|
||||||
S->Bounds(U1,U2,V1,V2);
|
S->Bounds(U1,U2,V1,V2);
|
||||||
|
@@ -16,55 +16,51 @@
|
|||||||
|
|
||||||
#include <SWDRAW_ShapeFix.ixx>
|
#include <SWDRAW_ShapeFix.ixx>
|
||||||
|
|
||||||
#include <Draw.hxx>
|
|
||||||
#include <DBRep.hxx>
|
|
||||||
#include <SWDRAW.hxx>
|
|
||||||
#include <gp_XYZ.hxx>
|
|
||||||
#include <gp_Pnt2d.hxx>
|
|
||||||
#include <TopoDS.hxx>
|
|
||||||
#include <TopoDS_Shape.hxx>
|
|
||||||
#include <TopoDS_Edge.hxx>
|
|
||||||
#include <TopoDS_Wire.hxx>
|
|
||||||
#include <TopoDS_Face.hxx>
|
|
||||||
#include <TopoDS_Iterator.hxx>
|
|
||||||
#include <TopExp_Explorer.hxx>
|
|
||||||
#include <BRep_Tool.hxx>
|
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
|
#include <BRep_Tool.hxx>
|
||||||
#include <BRepBuilderAPI.hxx>
|
#include <BRepBuilderAPI.hxx>
|
||||||
|
#include <BRepCheck_Analyzer.hxx>
|
||||||
|
#include <BRepCheck_ListIteratorOfListOfStatus.hxx>
|
||||||
|
#include <BRepCheck_Result.hxx>
|
||||||
|
#include <BRepTools.hxx>
|
||||||
#include <BRepTopAdaptor_FClass2d.hxx>
|
#include <BRepTopAdaptor_FClass2d.hxx>
|
||||||
|
#include <DBRep.hxx>
|
||||||
#include <ShapeBuild_ReShape.hxx>
|
#include <Draw.hxx>
|
||||||
#include <ShapeAnalysis_Edge.hxx>
|
#include <Draw_ProgressIndicator.hxx>
|
||||||
#include <ShapeAnalysis_WireOrder.hxx>
|
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||||
#include <ShapeAnalysis_WireVertex.hxx>
|
#include <Geom_Surface.hxx>
|
||||||
#include <ShapeAnalysis_Wire.hxx>
|
#include <gp_XYZ.hxx>
|
||||||
#include <ShapeExtend_WireData.hxx>
|
|
||||||
#include <ShapeFix.hxx>
|
|
||||||
#include <ShapeFix_ShapeTolerance.hxx>
|
|
||||||
#include <ShapeFix_Wire.hxx>
|
|
||||||
#include <ShapeFix_WireVertex.hxx>
|
|
||||||
#include <ShapeFix_Wireframe.hxx>
|
|
||||||
#include <ShapeFix_Face.hxx>
|
|
||||||
#include <ShapeFix_Shape.hxx>
|
|
||||||
#include <Precision.hxx>
|
|
||||||
#include <ShapeExtend_DataMapOfShapeListOfMsg.hxx>
|
|
||||||
#include <ShapeExtend_MsgRegistrator.hxx>
|
|
||||||
#include <ShapeExtend_DataMapIteratorOfDataMapOfShapeListOfMsg.hxx>
|
|
||||||
#include <Message_ListIteratorOfListOfMsg.hxx>
|
#include <Message_ListIteratorOfListOfMsg.hxx>
|
||||||
#include <Message_Msg.hxx>
|
#include <Message_Msg.hxx>
|
||||||
#include <TCollection_AsciiString.hxx>
|
#include <ShapeAnalysis_Edge.hxx>
|
||||||
|
#include <ShapeAnalysis_FreeBounds.hxx>
|
||||||
|
#include <ShapeAnalysis_Wire.hxx>
|
||||||
|
#include <ShapeAnalysis_WireOrder.hxx>
|
||||||
|
#include <ShapeAnalysis_WireVertex.hxx>
|
||||||
|
#include <ShapeBuild_ReShape.hxx>
|
||||||
|
#include <ShapeExtend_CompositeSurface.hxx>
|
||||||
|
#include <ShapeExtend_DataMapIteratorOfDataMapOfShapeListOfMsg.hxx>
|
||||||
|
#include <ShapeExtend_MsgRegistrator.hxx>
|
||||||
|
#include <ShapeFix.hxx>
|
||||||
|
#include <ShapeFix_ComposeShell.hxx>
|
||||||
|
#include <ShapeFix_Face.hxx>
|
||||||
|
#include <ShapeFix_Shape.hxx>
|
||||||
|
#include <ShapeFix_ShapeTolerance.hxx>
|
||||||
|
#include <ShapeFix_Wire.hxx>
|
||||||
|
#include <ShapeFix_Wireframe.hxx>
|
||||||
|
#include <ShapeFix_WireVertex.hxx>
|
||||||
|
#include <SWDRAW.hxx>
|
||||||
|
#include <TColGeom_HArray2OfSurface.hxx>
|
||||||
#include <TColStd_DataMapIteratorOfDataMapOfAsciiStringInteger.hxx>
|
#include <TColStd_DataMapIteratorOfDataMapOfAsciiStringInteger.hxx>
|
||||||
#include <TColStd_DataMapOfAsciiStringInteger.hxx>
|
#include <TColStd_DataMapOfAsciiStringInteger.hxx>
|
||||||
#include <TopTools_MapOfShape.hxx>
|
|
||||||
#include <TopTools_DataMapOfShapeListOfShape.hxx>
|
|
||||||
#include <TopAbs_State.hxx>
|
|
||||||
|
|
||||||
#include <Draw_ProgressIndicator.hxx>
|
|
||||||
#include <ShapeAnalysis_FreeBounds.hxx>
|
|
||||||
#include <TopTools_HSequenceOfShape.hxx>
|
|
||||||
#include <BRep_Builder.hxx>
|
|
||||||
#include <TopTools_IndexedMapOfShape.hxx>
|
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <TopoDS.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeListOfShape.hxx>
|
||||||
|
#include <TopTools_HSequenceOfShape.hxx>
|
||||||
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
|
||||||
#ifdef AIX
|
#ifdef AIX
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
@@ -753,6 +749,102 @@ static Standard_Integer connectedges(Draw_Interpretor& di, Standard_Integer n, c
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : FixPCurveOfFace
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
static Standard_Integer FixPCurveOfFace(Draw_Interpretor& theDI,
|
||||||
|
Standard_Integer theNArg,
|
||||||
|
const char** theArg)
|
||||||
|
{
|
||||||
|
if(theNArg < 2)
|
||||||
|
{
|
||||||
|
theDI << "use \"ffixpcu face\".\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopoDS_Shape aS=DBRep::Get(theArg[1]);
|
||||||
|
if (aS.IsNull()) {
|
||||||
|
theDI << "null shapes is not allowed here\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aS.ShapeType()!=TopAbs_FACE) {
|
||||||
|
char buff[256];
|
||||||
|
Sprintf ( buff, "shape %s must be a face\n", theArg[1]);
|
||||||
|
theDI << buff;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopoDS_Face aF=*((TopoDS_Face*)&aS);
|
||||||
|
|
||||||
|
BRepCheck_Analyzer anAna(aF);
|
||||||
|
|
||||||
|
if(anAna.IsValid())
|
||||||
|
{
|
||||||
|
theDI << "Face is valid!\n";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
BRepCheck_ListIteratorOfListOfStatus itl;
|
||||||
|
itl.Initialize(anAna.Result(aF)->Status());
|
||||||
|
|
||||||
|
if (itl.Value() != BRepCheck_OutOfSurfaceBoundary)
|
||||||
|
{
|
||||||
|
theDI << "Other Status!\n";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShapeFix::RefineFace(aF);
|
||||||
|
DBRep::Set(theArg[1], aF);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : FixPCurveOfShape
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
static Standard_Integer FixPCurveOfShape(Draw_Interpretor& theDI,
|
||||||
|
Standard_Integer theNArg,
|
||||||
|
const char** theArg)
|
||||||
|
{
|
||||||
|
if(theNArg < 3)
|
||||||
|
{
|
||||||
|
theDI << "use \"sfixpcu result shape\".\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopoDS_Shape aS=DBRep::Get(theArg[2]);
|
||||||
|
|
||||||
|
if (aS.IsNull()) {
|
||||||
|
theDI << "null shapes is not allowed here\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopExp_Explorer exp;
|
||||||
|
for (exp.Init(aS,TopAbs_FACE); exp.More();exp.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Shape& aS1 = exp.Current();
|
||||||
|
TopoDS_Face aF=*((TopoDS_Face*)&aS1);
|
||||||
|
|
||||||
|
BRepCheck_Analyzer anAna(aF);
|
||||||
|
if(anAna.IsValid())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
BRepCheck_ListIteratorOfListOfStatus itl;
|
||||||
|
itl.Initialize(anAna.Result(aF)->Status());
|
||||||
|
if (itl.Value() != BRepCheck_OutOfSurfaceBoundary)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
ShapeFix::RefineFace(aF);
|
||||||
|
}
|
||||||
|
|
||||||
|
DBRep::Set(theArg[1],aS);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : InitCommands
|
//function : InitCommands
|
||||||
//purpose :
|
//purpose :
|
||||||
@@ -789,6 +881,10 @@ static Standard_Integer connectedges(Draw_Interpretor& di, Standard_Integer n, c
|
|||||||
__FILE__,checkfclass2d,g);
|
__FILE__,checkfclass2d,g);
|
||||||
theCommands.Add ("connectedges","res shape [toler shared]",
|
theCommands.Add ("connectedges","res shape [toler shared]",
|
||||||
__FILE__,connectedges,g);
|
__FILE__,connectedges,g);
|
||||||
|
theCommands.Add ("ffixpcu"," ffixpcu face (to fix face with "
|
||||||
|
"\"BRepCheck_OutOfSurfaceBoundary\" status) ", __FILE__,FixPCurveOfFace,g);
|
||||||
|
|
||||||
|
theCommands.Add ("sfixpcu"," sfixpcu result shape (to fix shape, which contains face with "
|
||||||
|
"\"BRepCheck_OutOfSurfaceBoundary\" status) ", __FILE__,FixPCurveOfShape,g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,8 +29,9 @@ uses
|
|||||||
TopTools,
|
TopTools,
|
||||||
BRep,
|
BRep,
|
||||||
ShapeExtend,
|
ShapeExtend,
|
||||||
BRepTools
|
BRepTools,
|
||||||
|
GeomAbs
|
||||||
|
|
||||||
is
|
is
|
||||||
|
|
||||||
class Vertex;
|
class Vertex;
|
||||||
|
@@ -149,6 +149,15 @@ is
|
|||||||
|
|
||||||
LeastEdgeSize(theshape: in out Shape from TopoDS) returns Real;
|
LeastEdgeSize(theshape: in out Shape from TopoDS) returns Real;
|
||||||
---Purpose: Calculate size of least edge;
|
---Purpose: Calculate size of least edge;
|
||||||
|
|
||||||
|
|
||||||
|
RefineFace (theF : Face from TopoDS);
|
||||||
|
---Purpose: It is created for fixing faces with
|
||||||
|
-- BRepCheck_OutOfSurfaceBoundary status.
|
||||||
|
|
||||||
|
ReTrimmedFace(theF : in out Face from TopoDS;
|
||||||
|
theNewRTSurf: RectangularTrimmedSurface from Geom)
|
||||||
|
|
||||||
|
---Purpose: Replace the surface in theF with theNewRTSurf.
|
||||||
|
is private;
|
||||||
|
|
||||||
end ShapeFix;
|
end ShapeFix;
|
||||||
|
@@ -21,54 +21,50 @@
|
|||||||
//szv#9:S4244:19Aug99: Added method FixWireGaps
|
//szv#9:S4244:19Aug99: Added method FixWireGaps
|
||||||
//szv#10:S4244:23Aug99: Added method FixFaceGaps
|
//szv#10:S4244:23Aug99: Added method FixFaceGaps
|
||||||
|
|
||||||
|
#include <Adaptor3d_CurveOnSurface.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <BRepLib.hxx>
|
||||||
#include <Geom2d_Curve.hxx>
|
#include <BRepTools.hxx>
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
|
#include <Geom_Plane.hxx>
|
||||||
|
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||||
|
#include <Geom_Surface.hxx>
|
||||||
|
#include <Geom2d_Curve.hxx>
|
||||||
|
#include <Geom2dAdaptor_HCurve.hxx>
|
||||||
|
#include <GeomAdaptor_HSurface.hxx>
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
#include <Message_ProgressSentry.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
#include <ShapeAnalysis_Edge.hxx>
|
||||||
|
#include <ShapeAnalysis_Surface.hxx>
|
||||||
|
#include <ShapeBuild_Edge.hxx>
|
||||||
|
#include <ShapeBuild_ReShape.hxx>
|
||||||
|
#include <ShapeExtend_CompositeSurface.hxx>
|
||||||
|
#include <ShapeFix.hxx>
|
||||||
|
#include <ShapeFix_ComposeShell.hxx>
|
||||||
|
#include <ShapeFix_Edge.hxx>
|
||||||
|
#include <ShapeFix_Edge.hxx>
|
||||||
|
#include <ShapeFix_Face.hxx>
|
||||||
|
#include <ShapeFix_Shape.hxx>
|
||||||
|
#include <ShapeFix_Wire.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
|
#include <TColGeom_HArray2OfSurface.hxx>
|
||||||
|
#include <TColgp_SequenceOfPnt.hxx>
|
||||||
|
#include <TopExp.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <TopLoc_Location.hxx>
|
#include <TopLoc_Location.hxx>
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <TopoDS_Edge.hxx>
|
#include <TopoDS_Edge.hxx>
|
||||||
#include <TopoDS_Face.hxx>
|
#include <TopoDS_Face.hxx>
|
||||||
#include <Geom_Surface.hxx>
|
|
||||||
|
|
||||||
//:i2
|
|
||||||
#include <gp_Pnt.hxx>
|
|
||||||
#include <Geom_Plane.hxx>
|
|
||||||
#include <ShapeFix_Edge.hxx>
|
|
||||||
#include <Geom2dAdaptor_HCurve.hxx>
|
|
||||||
#include <Adaptor3d_CurveOnSurface.hxx>
|
|
||||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
|
||||||
#include <ShapeAnalysis_Surface.hxx>
|
|
||||||
|
|
||||||
#include <ShapeFix_Edge.hxx>
|
|
||||||
#include <ShapeFix_Shape.hxx>
|
|
||||||
#include <ShapeFix_Wire.hxx>
|
|
||||||
#include <ShapeFix_Face.hxx>
|
|
||||||
#include <TopoDS_Iterator.hxx>
|
#include <TopoDS_Iterator.hxx>
|
||||||
#include <GeomAdaptor_HSurface.hxx>
|
|
||||||
#include <TopTools_MapOfShape.hxx>
|
|
||||||
#include <BRepLib.hxx>
|
|
||||||
|
|
||||||
#include <ShapeAnalysis_Edge.hxx>
|
|
||||||
#include <ShapeBuild_Edge.hxx>
|
|
||||||
#include <TopoDS_Vertex.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <ShapeBuild_ReShape.hxx>
|
|
||||||
#include <TColgp_SequenceOfPnt.hxx>
|
|
||||||
#include <TopTools_ListOfShape.hxx>
|
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
|
||||||
#include <TopTools_SequenceOfShape.hxx>
|
|
||||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_ListOfShape.hxx>
|
||||||
#include <Message_ProgressSentry.hxx>
|
#include <TopTools_MapOfShape.hxx>
|
||||||
|
#include <TopTools_SequenceOfShape.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SameParameter
|
//function : SameParameter
|
||||||
@@ -712,3 +708,145 @@ Standard_Real ShapeFix::LeastEdgeSize(TopoDS_Shape& theShape)
|
|||||||
aRes = sqrt(aRes);
|
aRes = sqrt(aRes);
|
||||||
return aRes;
|
return aRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : RefineFace
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void ShapeFix::RefineFace(const TopoDS_Face& theF)
|
||||||
|
{
|
||||||
|
Standard_Real anUFf, anUFl, aVFf, aVFl;
|
||||||
|
|
||||||
|
Standard_Boolean isUtrim = Standard_True,
|
||||||
|
isVtrim = Standard_True;
|
||||||
|
|
||||||
|
TopoDS_Face aF = theF;
|
||||||
|
|
||||||
|
Handle(Geom_Surface) aS=BRep_Tool::Surface(aF);
|
||||||
|
Standard_Boolean isRectangularTrimmed = (aS->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface));
|
||||||
|
|
||||||
|
if (!isRectangularTrimmed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BRepTools::UVBounds(aF, anUFf, anUFl, aVFf, aVFl);
|
||||||
|
|
||||||
|
if(aS->IsUPeriodic())
|
||||||
|
{
|
||||||
|
const Standard_Real aT = aS->UPeriod();
|
||||||
|
|
||||||
|
#ifdef DEB
|
||||||
|
const Standard_Real dU = anUFl - anUFf;
|
||||||
|
if(dU > aT)
|
||||||
|
{
|
||||||
|
cout << "dU = " << dU << " > T = " << aT << ". Delta = " << dU - aT << endl;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
anUFl = anUFf + aT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(aS->IsVPeriodic())
|
||||||
|
{
|
||||||
|
const Standard_Real aT = aS->VPeriod();
|
||||||
|
|
||||||
|
#ifdef DEB
|
||||||
|
const Standard_Real dv = aVFl - aVFf;
|
||||||
|
if(dv > aT)
|
||||||
|
{
|
||||||
|
cout << "++dV = " << dv << " > T = " << aT << ". Delta = " << dv - aT << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
aVFl = aVFf + aT;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef DEB
|
||||||
|
if(isUtrim)
|
||||||
|
cout << "Trimming U: (" << anUFf << ")...(" << anUFl << ")" << endl;
|
||||||
|
|
||||||
|
if(isVtrim)
|
||||||
|
cout << "Trimming V: (" << aVFf << ")...(" << aVFl << ")" << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Handle(Geom_RectangularTrimmedSurface) aRTS=new Geom_RectangularTrimmedSurface(aS,isUtrim,
|
||||||
|
isVtrim, anUFf, anUFl, aVFf, aVFl);
|
||||||
|
|
||||||
|
ReTrimmedFace(aF, aRTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : ReTrimmedFace
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void ShapeFix::ReTrimmedFace(TopoDS_Face& theF,
|
||||||
|
const Handle(Geom_RectangularTrimmedSurface)& theNewRTSurf)
|
||||||
|
{
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
TopTools_MapOfShape aME;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
|
||||||
|
aExp.Init(theF, TopAbs_EDGE);
|
||||||
|
for (; aExp.More(); aExp.Next())
|
||||||
|
{
|
||||||
|
Standard_Real aT1, aT2;
|
||||||
|
const TopoDS_Edge& aE=*((TopoDS_Edge*)&aExp.Current());
|
||||||
|
if (!aME.Add(aE))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
TopLoc_Location aLocE;
|
||||||
|
Standard_Real aTolE=BRep_Tool::Tolerance(aE);
|
||||||
|
Handle(Geom2d_Curve) aC2D1=BRep_Tool::CurveOnSurface(aE, theF, aT1, aT2);
|
||||||
|
Standard_Boolean bIsClosed = BRep_Tool::IsClosed(aE, theF);
|
||||||
|
|
||||||
|
if (!bIsClosed)
|
||||||
|
{
|
||||||
|
aBB.UpdateEdge(aE, aC2D1, theNewRTSurf, aLocE, theF, aTolE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Standard_Boolean bIsLeft;
|
||||||
|
Standard_Real aScPr;
|
||||||
|
Handle(Geom2d_Curve) aC2D2;
|
||||||
|
TopoDS_Edge aE2;
|
||||||
|
aE2=aE;
|
||||||
|
aE2.Reverse();
|
||||||
|
aC2D2=BRep_Tool::CurveOnSurface(aE2, theF, aT1, aT2);
|
||||||
|
{
|
||||||
|
Standard_Real aT, aU1, aU2;
|
||||||
|
gp_Pnt2d aP2D1, aP2D2;
|
||||||
|
gp_Vec2d aV2D1, aV2D2;
|
||||||
|
|
||||||
|
const Standard_Real PAR_T = 0.43213918;
|
||||||
|
aT=(1.-PAR_T)*aT1 + PAR_T*aT2;
|
||||||
|
aC2D1->D1(aT, aP2D1, aV2D1);
|
||||||
|
aC2D2->D1(aT, aP2D2, aV2D2);
|
||||||
|
|
||||||
|
aU1=aP2D1.X();
|
||||||
|
aU2=aP2D2.X();
|
||||||
|
bIsLeft=(aU1<aU2);
|
||||||
|
|
||||||
|
gp_Vec2d aDOY(0.,1.);
|
||||||
|
aScPr=aV2D1*aDOY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bIsLeft)
|
||||||
|
{
|
||||||
|
if (aScPr<0.)
|
||||||
|
aBB.UpdateEdge(aE, aC2D2, aC2D1, theNewRTSurf, aLocE, theF, aTolE);
|
||||||
|
else
|
||||||
|
aBB.UpdateEdge(aE, aC2D1, aC2D2, theNewRTSurf, aLocE, theF, aTolE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (aScPr<0.)
|
||||||
|
aBB.UpdateEdge(aE, aC2D1, aC2D2, theNewRTSurf, aLocE, theF, aTolE);
|
||||||
|
else
|
||||||
|
aBB.UpdateEdge(aE, aC2D2, aC2D1, theNewRTSurf, aLocE, theF, aTolE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TopLoc_Location aLoc;
|
||||||
|
aBB.UpdateFace(theF, theNewRTSurf, aLoc, BRep_Tool::Tolerance(theF));
|
||||||
|
}
|
||||||
|
@@ -129,6 +129,20 @@ inline Standard_Integer Min (const Standard_Integer Val1,
|
|||||||
return Val1 <= Val2 ? Val1 : Val2;
|
return Val1 <= Val2 ? Val1 : Val2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// MinMax : Replaces theParMIN = MIN(theParMIN, theParMAX),
|
||||||
|
// theParMAX = MAX(theParMIN, theParMAX).
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
inline void MinMax(Standard_Integer& theParMIN, Standard_Integer& theParMAX)
|
||||||
|
{
|
||||||
|
if(theParMIN > theParMAX)
|
||||||
|
{
|
||||||
|
const Standard_Integer aux = theParMAX;
|
||||||
|
theParMAX = theParMIN;
|
||||||
|
theParMIN = aux;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// Modulus : Returns the remainder of division between two integers
|
// Modulus : Returns the remainder of division between two integers
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
@@ -299,3 +299,14 @@ Standard_Real Sqrt (const Standard_Real Value)
|
|||||||
return sqrt(Value);
|
return sqrt(Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : RealMod
|
||||||
|
//purpose : Returns the remainder of theDivident on theDivisor.
|
||||||
|
// Quotient is always integer number.
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Real RealMod(const Standard_Real theDivident,
|
||||||
|
const Standard_Real theDivisor)
|
||||||
|
{
|
||||||
|
const Standard_Integer n = RealToInt(theDivident/theDivisor);
|
||||||
|
return theDivident - n * theDivisor;
|
||||||
|
}
|
||||||
|
@@ -51,6 +51,8 @@ __Standard_API Standard_Real ATanh (const Standard_Real );
|
|||||||
__Standard_API Standard_Real ACosh (const Standard_Real );
|
__Standard_API Standard_Real ACosh (const Standard_Real );
|
||||||
__Standard_API Standard_Real Log (const Standard_Real );
|
__Standard_API Standard_Real Log (const Standard_Real );
|
||||||
__Standard_API Standard_Real Sqrt (const Standard_Real );
|
__Standard_API Standard_Real Sqrt (const Standard_Real );
|
||||||
|
__Standard_API Standard_Real RealMod (const Standard_Real theDivident,
|
||||||
|
const Standard_Real theDivisor);
|
||||||
|
|
||||||
//class Standard_OStream;
|
//class Standard_OStream;
|
||||||
//void ShallowDump(const Standard_Real, Standard_OStream& );
|
//void ShallowDump(const Standard_Real, Standard_OStream& );
|
||||||
@@ -253,6 +255,21 @@ inline Standard_Real Min (const Standard_Real Val1,
|
|||||||
return Val1 <= Val2 ? Val1 : Val2;
|
return Val1 <= Val2 ? Val1 : Val2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// MinMax : Replaces theParMIN = MIN(theParMIN, theParMAX),
|
||||||
|
// theParMAX = MAX(theParMIN, theParMAX).
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
inline void MinMax(Standard_Real& theParMIN, Standard_Real& theParMAX)
|
||||||
|
{
|
||||||
|
if(theParMIN > theParMAX)
|
||||||
|
{
|
||||||
|
const Standard_Real aux = theParMAX;
|
||||||
|
theParMAX = theParMIN;
|
||||||
|
theParMIN = aux;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Pow : Returns a real to a given power
|
// Pow : Returns a real to a given power
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
@@ -4,7 +4,14 @@
|
|||||||
## Comment : from fra60610
|
## Comment : from fra60610
|
||||||
## ====================================
|
## ====================================
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CFI_fra60610.rle] a
|
restore [locate_data_file CFI_fra60610.rle] a
|
||||||
|
|
||||||
|
sfixpcu a a
|
||||||
|
checkshape a
|
||||||
|
|
||||||
nexplode a e
|
nexplode a e
|
||||||
blend result a 2 a_69
|
blend result a 2 a_69
|
||||||
|
|
||||||
|
@@ -1,9 +1,16 @@
|
|||||||
# Original bug : ger60065
|
# Original bug : ger60065
|
||||||
# Date : 11mar98
|
# Date : 11mar98
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
|
||||||
restore [locate_data_file CTO900_ger60065-part.rle] part
|
restore [locate_data_file CTO900_ger60065-part.rle] part
|
||||||
restore [locate_data_file CTO900_ger60065-tool.rle] tool
|
restore [locate_data_file CTO900_ger60065-tool.rle] tool
|
||||||
|
|
||||||
|
sfixpcu part part
|
||||||
|
sfixpcu tool tool
|
||||||
|
|
||||||
bcut result part tool
|
bcut result part tool
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,9 +1,15 @@
|
|||||||
# Original bug : pro12663
|
# Original bug : pro12663
|
||||||
# Date : 24mar98
|
# Date : 24mar98
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CTO900_pro12663-part.rle] part
|
restore [locate_data_file CTO900_pro12663-part.rle] part
|
||||||
restore [locate_data_file CTO900_pro12663-tool.rle] tool
|
restore [locate_data_file CTO900_pro12663-tool.rle] tool
|
||||||
|
|
||||||
|
sfixpcu part part
|
||||||
|
sfixpcu tool tool
|
||||||
|
|
||||||
bcut result part tool
|
bcut result part tool
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,14 +1,27 @@
|
|||||||
# Original bug : cts20736
|
# Original bug : cts20736
|
||||||
# Date : 28Sept97
|
# Date : 28Sept97
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CTO900_cts20736a.rle] part
|
restore [locate_data_file CTO900_cts20736a.rle] part
|
||||||
restore [locate_data_file cts20736b.rle] aface
|
restore [locate_data_file cts20736b.rle] aface
|
||||||
|
|
||||||
|
sfixpcu part part
|
||||||
|
sfixpcu aface aface
|
||||||
|
|
||||||
|
checkshape aface
|
||||||
|
|
||||||
btolx part
|
btolx part
|
||||||
btolx aface
|
btolx aface
|
||||||
|
|
||||||
|
checkshape aface
|
||||||
|
|
||||||
prism tool aface 0 0 -12
|
prism tool aface 0 0 -12
|
||||||
|
|
||||||
|
checkshape part
|
||||||
|
checkshape tool
|
||||||
|
|
||||||
bcut result part tool
|
bcut result part tool
|
||||||
|
|
||||||
set square 36087.8
|
set square 36087.8
|
||||||
|
@@ -1,9 +1,16 @@
|
|||||||
# Original bug : fra61199
|
# Original bug : fra61199
|
||||||
# Date : 29June98
|
# Date : 29June98
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
cpulimit 3000
|
cpulimit 3000
|
||||||
restore [locate_data_file CTO904_fra61199a.rle] a
|
restore [locate_data_file CTO904_fra61199a.rle] a
|
||||||
restore [locate_data_file CTO904_fra61199b.rle] b
|
restore [locate_data_file CTO904_fra61199b.rle] b
|
||||||
|
|
||||||
|
sfixpcu a a
|
||||||
|
sfixpcu b b
|
||||||
|
|
||||||
bcut result a b
|
bcut result a b
|
||||||
|
|
||||||
set square 1.21952e+06
|
set square 1.21952e+06
|
||||||
|
@@ -1,9 +1,16 @@
|
|||||||
# Original bug : pro10505
|
# Original bug : pro10505
|
||||||
# Date : 20mar98
|
# Date : 20mar98
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
|
||||||
restore [locate_data_file CTO900_pro10505a.rle] a
|
restore [locate_data_file CTO900_pro10505a.rle] a
|
||||||
restore [locate_data_file CTO900_pro10505b.rle] b
|
restore [locate_data_file CTO900_pro10505b.rle] b
|
||||||
|
|
||||||
|
sfixpcu a a
|
||||||
|
sfixpcu b b
|
||||||
|
|
||||||
bfuse result a b
|
bfuse result a b
|
||||||
|
|
||||||
set square 302396
|
set square 302396
|
||||||
|
@@ -2,9 +2,15 @@ puts "PRO16769"
|
|||||||
puts "Fuse"
|
puts "Fuse"
|
||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CFE900_pro16gff.rle] base
|
restore [locate_data_file CFE900_pro16gff.rle] base
|
||||||
restore [locate_data_file pro16769b.rle] tool
|
restore [locate_data_file pro16769b.rle] tool
|
||||||
|
|
||||||
|
sfixpcu base base
|
||||||
|
sfixpcu tool tool
|
||||||
|
|
||||||
bfuse result base tool
|
bfuse result base tool
|
||||||
fsameparameter result
|
fsameparameter result
|
||||||
|
|
||||||
|
@@ -1,12 +1,18 @@
|
|||||||
puts "TODO OCC11111 ALL: Faulty OCC263: here is shading problem"
|
puts "TODO OCC11111 ALL: Faulty OCC263: here is shading problem"
|
||||||
puts "TODO OCC11111 ALL: Error : The square of result shape is"
|
puts "TODO OCC11111 ALL: Error : The square of result shape is"
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
|
||||||
puts "========"
|
puts "========"
|
||||||
puts "OCC263"
|
puts "OCC263"
|
||||||
puts "========"
|
puts "========"
|
||||||
|
|
||||||
restore [locate_data_file OCC263.brep] result
|
restore [locate_data_file OCC263.brep] result
|
||||||
|
|
||||||
|
sfixpcu result result
|
||||||
|
|
||||||
isos result 0
|
isos result 0
|
||||||
tclean result
|
tclean result
|
||||||
|
|
||||||
|
@@ -8,8 +8,14 @@ puts ""
|
|||||||
|
|
||||||
set BugNumber OCC6272
|
set BugNumber OCC6272
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
|
||||||
restore [locate_data_file OCC6272_bridge2.brep] a1
|
restore [locate_data_file OCC6272_bridge2.brep] a1
|
||||||
|
|
||||||
|
sfixpcu a1 a1
|
||||||
|
|
||||||
explode a1
|
explode a1
|
||||||
|
|
||||||
bop a1_1 a1_2
|
bop a1_1 a1_2
|
||||||
|
@@ -11,9 +11,16 @@ puts ""
|
|||||||
|
|
||||||
set BugNumber OCC6272
|
set BugNumber OCC6272
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
|
||||||
restore [locate_data_file OCC6272_bridge2.brep] a1
|
restore [locate_data_file OCC6272_bridge2.brep] a1
|
||||||
restore [locate_data_file OCC6272_revolution.brep] a2
|
restore [locate_data_file OCC6272_revolution.brep] a2
|
||||||
|
|
||||||
|
sfixpcu a1 a1
|
||||||
|
sfixpcu a2 a2
|
||||||
|
|
||||||
bop a1 a2
|
bop a1 a2
|
||||||
bopfuse result
|
bopfuse result
|
||||||
|
|
||||||
|
@@ -8,8 +8,14 @@ puts ""
|
|||||||
|
|
||||||
set BugNumber OCC6272
|
set BugNumber OCC6272
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
|
||||||
restore [locate_data_file OCC6272_bridge2.brep] a1
|
restore [locate_data_file OCC6272_bridge2.brep] a1
|
||||||
|
|
||||||
|
sfixpcu a1 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
|
||||||
#
|
#
|
||||||
|
@@ -8,8 +8,14 @@ puts ""
|
|||||||
|
|
||||||
set BugNumber OCC6272
|
set BugNumber OCC6272
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
|
||||||
restore [locate_data_file OCC6272_bridge2.brep] a1
|
restore [locate_data_file OCC6272_bridge2.brep] a1
|
||||||
|
|
||||||
|
sfixpcu a1 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
|
||||||
#
|
#
|
||||||
|
@@ -8,8 +8,14 @@ puts ""
|
|||||||
|
|
||||||
set BugNumber OCC6272
|
set BugNumber OCC6272
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
|
||||||
restore [locate_data_file OCC6272_bridge2.brep] a1
|
restore [locate_data_file OCC6272_bridge2.brep] a1
|
||||||
|
|
||||||
|
sfixpcu a1 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
|
||||||
#
|
#
|
||||||
|
@@ -8,8 +8,14 @@ puts ""
|
|||||||
|
|
||||||
set BugNumber OCC6272
|
set BugNumber OCC6272
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
|
||||||
restore [locate_data_file OCC6272_bridge2.brep] a1
|
restore [locate_data_file OCC6272_bridge2.brep] a1
|
||||||
|
|
||||||
|
sfixpcu a1 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
|
||||||
#
|
#
|
||||||
|
@@ -4,8 +4,11 @@ puts "OCC15"
|
|||||||
puts "================"
|
puts "================"
|
||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
restore [locate_data_file OCC15.brep] result
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
restore [locate_data_file OCC15.brep] result
|
||||||
|
sfixpcu result result
|
||||||
checkshape result
|
checkshape result
|
||||||
|
|
||||||
vinit
|
vinit
|
||||||
|
@@ -8,8 +8,13 @@ puts ""
|
|||||||
##possible regression in KAS:dev on checkshape. Fails on valid shape
|
##possible regression in KAS:dev on checkshape. Fails on valid shape
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
|
# for sfixpcu command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file OCC956_1.brep] result
|
restore [locate_data_file OCC956_1.brep] result
|
||||||
|
|
||||||
|
sfixpcu result result
|
||||||
|
|
||||||
decho off
|
decho off
|
||||||
set che [checkshape result]
|
set che [checkshape result]
|
||||||
decho on
|
decho on
|
||||||
|
@@ -1,9 +1,15 @@
|
|||||||
# Original bug : cts21832
|
# Original bug : cts21832
|
||||||
# Date : 26 Nov 98
|
# Date : 26 Nov 98
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file cts21832_base.brep] base
|
restore [locate_data_file cts21832_base.brep] base
|
||||||
restore [locate_data_file cts21832_cont.brep] cont
|
restore [locate_data_file cts21832_cont.brep] cont
|
||||||
|
|
||||||
|
sfixpcu base base
|
||||||
|
sfixpcu base base
|
||||||
|
|
||||||
explode cont wire
|
explode cont wire
|
||||||
copy cont_1 wire
|
copy cont_1 wire
|
||||||
plane plan 0 0 0 -1 0 0
|
plane plan 0 0 0 -1 0 0
|
||||||
|
@@ -1,10 +1,17 @@
|
|||||||
# Original bug : cts20722
|
# Original bug : cts20722
|
||||||
# Date : 21August98
|
# Date : 21August98
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CTO900_cts20722c.rle] base
|
restore [locate_data_file CTO900_cts20722c.rle] base
|
||||||
restore [locate_data_file cts20722b.rle] cont
|
restore [locate_data_file cts20722b.rle] cont
|
||||||
restore [locate_data_file cts20722c.rle] funtil
|
restore [locate_data_file cts20722c.rle] funtil
|
||||||
|
|
||||||
|
sfixpcu base base
|
||||||
|
sfixpcu cont cont
|
||||||
|
sfixpcu funtil funtil
|
||||||
|
|
||||||
explode cont face
|
explode cont face
|
||||||
#explode base face
|
#explode base face
|
||||||
#copy base_14 funtil
|
#copy base_14 funtil
|
||||||
|
@@ -1,9 +1,15 @@
|
|||||||
# Original bug : pro16769
|
# Original bug : pro16769
|
||||||
# Date : 02 Dec 98
|
# Date : 02 Dec 98
|
||||||
|
|
||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CFE900_pro16gff.rle] base
|
restore [locate_data_file CFE900_pro16gff.rle] base
|
||||||
restore [locate_data_file pro16769_face.brep] cont
|
restore [locate_data_file pro16769_face.brep] cont
|
||||||
|
|
||||||
|
sfixpcu base base
|
||||||
|
sfixpcu cont cont
|
||||||
|
|
||||||
explode base face
|
explode base face
|
||||||
|
|
||||||
mksurface p28 base_28
|
mksurface p28 base_28
|
||||||
|
@@ -1,2 +1,5 @@
|
|||||||
restore [locate_data_file CTO900_ger60065-part.rle] a
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
restore [locate_data_file CTO900_ger60065-part.rle] a
|
||||||
|
sfixpcu a a
|
||||||
|
@@ -1,2 +1,5 @@
|
|||||||
restore [locate_data_file CTO900_pro10505b.rle] a
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
restore [locate_data_file CTO900_pro10505b.rle] a
|
||||||
|
sfixpcu a a
|
||||||
|
@@ -1,2 +1,5 @@
|
|||||||
restore [locate_data_file CTO900_pro12663-part.rle] a
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
restore [locate_data_file CTO900_pro12663-part.rle] a
|
||||||
|
sfixpcu a a
|
||||||
|
@@ -1,2 +1,6 @@
|
|||||||
restore [locate_data_file CTO900_pro12663-tool.rle] a
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
restore [locate_data_file CTO900_pro12663-tool.rle] a
|
||||||
|
sfixpcu a a
|
||||||
|
checkshape a
|
@@ -1,2 +1,5 @@
|
|||||||
restore [locate_data_file CTO904_fra61199a.rle] a
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
restore [locate_data_file CTO904_fra61199a.rle] a
|
||||||
|
sfixpcu a a
|
||||||
|
@@ -1,3 +1,6 @@
|
|||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
if {[string compare $command "SplitAngle"] == 0 } {
|
if {[string compare $command "SplitAngle"] == 0 } {
|
||||||
set os "ALL"
|
set os "ALL"
|
||||||
if {[array get env os_type] != ""} {
|
if {[array get env os_type] != ""} {
|
||||||
@@ -13,3 +16,4 @@ if {[string compare $command "SplitAngle"] == 0 } {
|
|||||||
|
|
||||||
restore [locate_data_file cd.brep] a
|
restore [locate_data_file cd.brep] a
|
||||||
|
|
||||||
|
sfixpcu a a
|
||||||
|
@@ -1,3 +1,6 @@
|
|||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
if {[string compare $command "SplitAngle"] == 0 } {
|
if {[string compare $command "SplitAngle"] == 0 } {
|
||||||
set os "ALL"
|
set os "ALL"
|
||||||
if {[array get env os_type] != ""} {
|
if {[array get env os_type] != ""} {
|
||||||
@@ -13,3 +16,4 @@ if {[string compare $command "SplitAngle"] == 0 } {
|
|||||||
|
|
||||||
restore [locate_data_file cg.brep] a
|
restore [locate_data_file cg.brep] a
|
||||||
|
|
||||||
|
sfixpcu a a
|
||||||
|
@@ -1,2 +1,6 @@
|
|||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file pd.brep] a
|
restore [locate_data_file pd.brep] a
|
||||||
|
|
||||||
|
sfixpcu a a
|
||||||
|
@@ -1,2 +1,5 @@
|
|||||||
restore [locate_data_file pg.brep] a
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
restore [locate_data_file pg.brep] a
|
||||||
|
sfixpcu a a
|
||||||
|
@@ -1,2 +1,7 @@
|
|||||||
|
# for "sfixpcu" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CTO900_cts20736a.rle] a
|
restore [locate_data_file CTO900_cts20736a.rle] a
|
||||||
|
|
||||||
|
sfixpcu a a
|
||||||
|
checkshape a
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
puts [DT_ClosedSplit result a]
|
puts [DT_ClosedSplit result a]
|
||||||
|
sfixpcu result result
|
||||||
puts [checkshape result]
|
puts [checkshape result]
|
||||||
|
@@ -1,2 +1,7 @@
|
|||||||
|
# for "fixshape" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CFI_cfi90fjb.rle] a
|
restore [locate_data_file CFI_cfi90fjb.rle] a
|
||||||
|
|
||||||
|
fixshape a a
|
||||||
|
checkshape a
|
||||||
|
@@ -1,2 +1,7 @@
|
|||||||
|
# for "fixshape" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CFI_pro5807.rle] a
|
restore [locate_data_file CFI_pro5807.rle] a
|
||||||
|
|
||||||
|
fixshape a a
|
||||||
|
checkshape a
|
||||||
|
@@ -1,2 +1,7 @@
|
|||||||
|
# for "fixshape" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CHE_cc4.rle] a
|
restore [locate_data_file CHE_cc4.rle] a
|
||||||
|
|
||||||
|
fixshape a a
|
||||||
|
checkshape a
|
||||||
|
@@ -1,2 +1,7 @@
|
|||||||
|
# for "fixshape" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CTO900_ger60054a.rle] a
|
restore [locate_data_file CTO900_ger60054a.rle] a
|
||||||
|
|
||||||
|
fixshape a a
|
||||||
|
checkshape a
|
||||||
|
@@ -1,2 +1,7 @@
|
|||||||
|
# for "fixshape" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CTS18683.rle] a
|
restore [locate_data_file CTS18683.rle] a
|
||||||
|
|
||||||
|
fixshape a a
|
||||||
|
checkshape a
|
||||||
|
@@ -1,2 +1,7 @@
|
|||||||
|
# for "fixshape" command
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
restore [locate_data_file CTS18826.rle] a
|
restore [locate_data_file CTS18826.rle] a
|
||||||
|
|
||||||
|
fixshape a a
|
||||||
|
checkshape a
|
||||||
|
Reference in New Issue
Block a user