mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0023511: The function BRepTools::UVBounds provides icorrect result for a face
Range of changing of some analytic curves is computed by other methods. It allows computing face's boundaries with more precise. Tolerance was increased to provide successful work of some algorithms. Functions BRepOffsetAPI_MiddlePath::Build() and ApproxWithPCurves(...) (file IntTools_FaceFace.cxx) were changed according to new result of algorithm's work. It is possibly for "outboundaried faces" (see bug#23675) to compute incorrect UV-Bounds, when first parameter is more than last. To avoid it, extended control of computed bounds was added. Function for fail sameparameter fixing was added to HLRAppli_ReflectLines to avoid creation bad shapes after algorithm's work. In file ShapeFix_ComposeShell.cxx only text formatting was changed. Some test cases are changed according to their new behavior. Added test case bugs/moddata_3/bug23511
This commit is contained in:
parent
0734c53d68
commit
59495dbe8a
@ -1843,11 +1843,16 @@ Standard_Boolean FindPointInFace(const TopoDS_Edge& aE,
|
|||||||
GeomAPI_ProjectPointOnSurf& aProjPL)
|
GeomAPI_ProjectPointOnSurf& aProjPL)
|
||||||
{
|
{
|
||||||
Standard_Integer aNbItMax;
|
Standard_Integer aNbItMax;
|
||||||
Standard_Real aDt, aDtMin, aTolE, aTolF, aDist;
|
Standard_Real aDt, aDtMin, aTolE, aTolF, aDist, aDTol, aPM;
|
||||||
Standard_Boolean bRet;
|
Standard_Boolean bRet;
|
||||||
gp_Pnt aP1;
|
gp_Pnt aP1;
|
||||||
BRepAdaptor_Surface aBAS;
|
BRepAdaptor_Surface aBAS;
|
||||||
//
|
//
|
||||||
|
aDTol = Precision::Angular();
|
||||||
|
aPM = aP.XYZ().Modulus();
|
||||||
|
if (aPM > 1000.) {
|
||||||
|
aDTol = 5.e-16 * aPM;
|
||||||
|
}
|
||||||
bRet = Standard_False;
|
bRet = Standard_False;
|
||||||
aTolE = BRep_Tool::Tolerance(aE);
|
aTolE = BRep_Tool::Tolerance(aE);
|
||||||
aTolF = BRep_Tool::Tolerance(aF);
|
aTolF = BRep_Tool::Tolerance(aF);
|
||||||
@ -1910,9 +1915,9 @@ Standard_Boolean FindPointInFace(const TopoDS_Edge& aE,
|
|||||||
//
|
//
|
||||||
gp_Vec aV(aP, aPOut);
|
gp_Vec aV(aP, aPOut);
|
||||||
aDB.SetXYZ(aV.XYZ());
|
aDB.SetXYZ(aV.XYZ());
|
||||||
} while (aDist>Precision::Angular() && --aNbItMax);
|
} while (aDist > aDTol && --aNbItMax);
|
||||||
//
|
//
|
||||||
bRet = aDist < Precision::Angular();
|
bRet = aDist < aDTol;
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -533,6 +533,32 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
if (myPaths((j<=NbPaths)? j : 1)(i).ShapeType() == TopAbs_EDGE)
|
if (myPaths((j<=NbPaths)? j : 1)(i).ShapeType() == TopAbs_EDGE)
|
||||||
E2 = TopoDS::Edge(myPaths((j<=NbPaths)? j : 1)(i));
|
E2 = TopoDS::Edge(myPaths((j<=NbPaths)? j : 1)(i));
|
||||||
TopoDS_Edge E12 = TopoDS::Edge(SectionsEdges(i)(j-1));
|
TopoDS_Edge E12 = TopoDS::Edge(SectionsEdges(i)(j-1));
|
||||||
|
//Find the face on which (E1 or E2) and E12 lie
|
||||||
|
TopoDS_Shape E1orE2 = (E1.IsNull())? E2 : E1;
|
||||||
|
if (E1orE2.IsNull()) //both E1 and E2 are vertices =>
|
||||||
|
{
|
||||||
|
EdgeSeq(j-1) = E12; // => proper edge is the edge of previous section between them
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const TopTools_ListOfShape& LF = EFmap.FindFromKey(E1orE2);
|
||||||
|
TopoDS_Face theFace;
|
||||||
|
for (itl.Initialize(LF); itl.More(); itl.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Shape& aFace = itl.Value();
|
||||||
|
const TopTools_ListOfShape& LF2 = EFmap.FindFromKey(E12);
|
||||||
|
TopTools_ListIteratorOfListOfShape itl2(LF2);
|
||||||
|
for (; itl2.More(); itl2.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Shape& aFace2 = itl2.Value();
|
||||||
|
if (aFace.IsSame(aFace2))
|
||||||
|
{
|
||||||
|
theFace = TopoDS::Face(aFace);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!theFace.IsNull())
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
TopoDS_Vertex PrevVertex = (E1.IsNull())? TopoDS::Vertex(myPaths(j-1)(i))
|
TopoDS_Vertex PrevVertex = (E1.IsNull())? TopoDS::Vertex(myPaths(j-1)(i))
|
||||||
: TopExp::LastVertex(E1, Standard_True);
|
: TopExp::LastVertex(E1, Standard_True);
|
||||||
@ -541,14 +567,19 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
|
|
||||||
TopoDS_Edge ProperEdge;
|
TopoDS_Edge ProperEdge;
|
||||||
const TopTools_ListOfShape& LE = VEmap.FindFromKey(PrevVertex);
|
const TopTools_ListOfShape& LE = VEmap.FindFromKey(PrevVertex);
|
||||||
|
//Temporary
|
||||||
|
//Standard_Integer LenList = LE.Extent();
|
||||||
|
///////////
|
||||||
|
TopTools_IndexedMapOfShape EdgesOfTheFace;
|
||||||
|
TopExp::MapShapes(theFace, TopAbs_EDGE, EdgesOfTheFace);
|
||||||
for (itl.Initialize(LE); itl.More(); itl.Next())
|
for (itl.Initialize(LE); itl.More(); itl.Next())
|
||||||
{
|
{
|
||||||
anEdge = TopoDS::Edge(itl.Value());
|
anEdge = TopoDS::Edge(itl.Value());
|
||||||
TopExp::Vertices(anEdge, V1, V2);
|
TopExp::Vertices(anEdge, V1, V2);
|
||||||
if (((V1.IsSame(PrevVertex) && V2.IsSame(CurVertex)) ||
|
if (((V1.IsSame(PrevVertex) && V2.IsSame(CurVertex)) ||
|
||||||
(V1.IsSame(CurVertex) && V2.IsSame(PrevVertex))) &&
|
(V1.IsSame(CurVertex) && V2.IsSame(PrevVertex))) &&
|
||||||
!anEdge.IsSame(E1))
|
EdgesOfTheFace.Contains(anEdge) && //this condition is for a section of two edges
|
||||||
|
!anEdge.IsSame(E1)) //the last condition is for torus-like shape
|
||||||
{
|
{
|
||||||
ProperEdge = anEdge;
|
ProperEdge = anEdge;
|
||||||
break;
|
break;
|
||||||
@ -570,35 +601,6 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
{
|
{
|
||||||
//Find the face on which E1, E2 and E12 lie
|
//Find the face on which E1, E2 and E12 lie
|
||||||
//ToInsertVertex = Standard_False;
|
//ToInsertVertex = Standard_False;
|
||||||
const TopoDS_Shape& EE1 = (E1.IsNull())?
|
|
||||||
myPaths(j-1)(i-1) : E1;
|
|
||||||
const TopoDS_Shape& EE2 = (E2.IsNull())?
|
|
||||||
myPaths((j<=NbPaths)? j : 1)(i-1) : E2;
|
|
||||||
const TopTools_ListOfShape& LF = EFmap.FindFromKey(EE1);
|
|
||||||
TopoDS_Face theFace;
|
|
||||||
for (itl.Initialize(LF); itl.More(); itl.Next())
|
|
||||||
{
|
|
||||||
const TopoDS_Shape& aFace = itl.Value();
|
|
||||||
TopExp_Explorer Explo(aFace, TopAbs_EDGE);
|
|
||||||
for (; Explo.More(); Explo.Next())
|
|
||||||
{
|
|
||||||
if (EE2.IsSame(Explo.Current()))
|
|
||||||
{
|
|
||||||
const TopTools_ListOfShape& LFsec = EFmap.FindFromKey(E12);
|
|
||||||
TopTools_ListIteratorOfListOfShape itlsec(LFsec);
|
|
||||||
for (; itlsec.More(); itlsec.Next())
|
|
||||||
if (aFace.IsSame(itlsec.Value()))
|
|
||||||
{
|
|
||||||
theFace = TopoDS::Face(aFace);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!theFace.IsNull())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!theFace.IsNull())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
TopTools_ListOfShape ListOneFace;
|
TopTools_ListOfShape ListOneFace;
|
||||||
ListOneFace.Append(theFace);
|
ListOneFace.Append(theFace);
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
#include <gp_Vec2d.hxx>
|
#include <gp_Vec2d.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
|
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@ -132,7 +133,6 @@ void BRepTools::AddUVBounds(const TopoDS_Face& FF, Bnd_Box2d& B)
|
|||||||
//function : AddUVBounds
|
//function : AddUVBounds
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void BRepTools::AddUVBounds(const TopoDS_Face& F,
|
void BRepTools::AddUVBounds(const TopoDS_Face& F,
|
||||||
const TopoDS_Wire& W,
|
const TopoDS_Wire& W,
|
||||||
Bnd_Box2d& B)
|
Bnd_Box2d& B)
|
||||||
@ -148,117 +148,62 @@ void BRepTools::AddUVBounds(const TopoDS_Face& F,
|
|||||||
//function : AddUVBounds
|
//function : AddUVBounds
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
void BRepTools::AddUVBounds(const TopoDS_Face& aF,
|
||||||
void BRepTools::AddUVBounds(const TopoDS_Face& F,
|
const TopoDS_Edge& aE,
|
||||||
const TopoDS_Edge& E,
|
Bnd_Box2d& aB)
|
||||||
Bnd_Box2d& B)
|
|
||||||
{
|
{
|
||||||
Standard_Real pf,pl;
|
Standard_Real aT1, aT2, aXmin, aYmin, aXmax, aYmax;
|
||||||
Bnd_Box2d Baux;
|
Standard_Real aUmin, aUmax, aVmin, aVmax;
|
||||||
const Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(E,F,pf,pl);
|
Bnd_Box2d aBoxC, aBoxS;
|
||||||
if (C.IsNull()) return;
|
TopLoc_Location aLoc;
|
||||||
if (pl < pf) { // Petit Blindage
|
//
|
||||||
Standard_Real aux;
|
const Handle(Geom2d_Curve) aC2D = BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2);
|
||||||
aux = pf; pf = pl; pl = aux;
|
if (aC2D.IsNull()) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
Geom2dAdaptor_Curve PC(C,pf,pl);
|
//
|
||||||
if (Precision::IsNegativeInfinite(pf) ||
|
BndLib_Add2dCurve::Add(aC2D, aT1, aT2, 0., aBoxC);
|
||||||
Precision::IsPositiveInfinite(pf)) {
|
aBoxC.Get(aXmin, aYmin, aXmax, aYmax);
|
||||||
Geom2dAdaptor_Curve GC(PC);
|
//
|
||||||
BndLib_Add2dCurve::Add(GC,0.,B);
|
Handle(Geom_Surface) aS = BRep_Tool::Surface(aF, aLoc);
|
||||||
}
|
aS->Bounds(aUmin, aUmax, aVmin, aVmax);
|
||||||
else {
|
|
||||||
|
|
||||||
// just compute points to get a close box.
|
if(aS->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface))
|
||||||
TopLoc_Location L;
|
|
||||||
Standard_Real Umin,Umax,Vmin,Vmax;
|
|
||||||
const Handle(Geom_Surface)& Surf=BRep_Tool::Surface(F,L);
|
|
||||||
Surf->Bounds(Umin,Umax,Vmin,Vmax);
|
|
||||||
gp_Pnt2d Pa,Pb,Pc;
|
|
||||||
|
|
||||||
|
|
||||||
Standard_Integer i, j, k, nbp = 20;
|
|
||||||
if (PC.GetType() == GeomAbs_Line) nbp = 2;
|
|
||||||
Standard_Integer NbIntC1 = PC.NbIntervals(GeomAbs_C1);
|
|
||||||
if (NbIntC1 > 1)
|
|
||||||
nbp = 10;
|
|
||||||
TColStd_Array1OfReal SharpPoints(1, NbIntC1+1);
|
|
||||||
PC.Intervals(SharpPoints, GeomAbs_C1);
|
|
||||||
TColStd_Array1OfReal Parameters(1, nbp*NbIntC1+1);
|
|
||||||
k = 1;
|
|
||||||
for (i = 1; i <= NbIntC1; i++)
|
|
||||||
{
|
{
|
||||||
Standard_Real delta = (SharpPoints(i+1) - SharpPoints(i))/nbp;
|
const Handle(Geom_RectangularTrimmedSurface) aSt =
|
||||||
for (j = 0; j < nbp; j++)
|
Handle(Geom_RectangularTrimmedSurface)::DownCast(aS);
|
||||||
Parameters(k++) = SharpPoints(i) + j*delta;
|
aS = aSt->BasisSurface();
|
||||||
}
|
}
|
||||||
Parameters(nbp*NbIntC1+1) = SharpPoints(NbIntC1+1);
|
|
||||||
|
|
||||||
gp_Pnt2d P;
|
//
|
||||||
PC.D0(pf,P);
|
if(!aS->IsUPeriodic())
|
||||||
Baux.Add(P);
|
{
|
||||||
|
if((aXmin<aUmin) && (aUmin < aXmax))
|
||||||
Standard_Real du=0.0;
|
{
|
||||||
Standard_Real dv=0.0;
|
aXmin=aUmin;
|
||||||
|
}
|
||||||
Pc=P;
|
if((aXmin < aUmax) && (aUmax < aXmax))
|
||||||
for (i = 2; i < Parameters.Upper(); i++) {
|
{
|
||||||
pf = Parameters(i);
|
aXmax=aUmax;
|
||||||
PC.D0(pf,P);
|
|
||||||
Baux.Add(P);
|
|
||||||
if(i==2) { Pb=Pc; Pc=P; }
|
|
||||||
else {
|
|
||||||
//-- Calcul de la fleche
|
|
||||||
Pa=Pb; Pb=Pc; Pc=P;
|
|
||||||
gp_Vec2d PaPc(Pa,Pc);
|
|
||||||
// gp_Lin2d L2d(Pa,PaPc);
|
|
||||||
// Standard_Real up = ElCLib::Parameter(L2d,Pb);
|
|
||||||
// gp_Pnt2d PProj = ElCLib::Value(up,L2d);
|
|
||||||
gp_Pnt2d PProj(Pa.Coord()+(PaPc.XY()/2.));
|
|
||||||
Standard_Real ddu=Abs(Pb.X()-PProj.X());
|
|
||||||
Standard_Real ddv=Abs(Pb.Y()-PProj.Y());
|
|
||||||
if(ddv>dv) dv=ddv;
|
|
||||||
if(ddu>du) du=ddu;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PC.D0(pl,P);
|
|
||||||
Baux.Add(P);
|
|
||||||
|
|
||||||
//-- cout<<" du="<<du<<" dv="<<dv<<endl;
|
if(!aS->IsVPeriodic())
|
||||||
Standard_Real u0,u1,v0,v1;
|
{
|
||||||
Baux.Get(u0,v0,u1,v1);
|
if((aYmin<aVmin) && (aVmin < aYmax))
|
||||||
du*=1.5;
|
{
|
||||||
dv*=1.5;
|
aYmin=aVmin;
|
||||||
u0-=du; v0-=dv; u1+=du; v1+=dv;
|
|
||||||
if(Surf->IsUPeriodic()) { }
|
|
||||||
else {
|
|
||||||
if(u0<=Umin) { u0=Umin; }
|
|
||||||
if(u1>=Umax) { u1=Umax; }
|
|
||||||
}
|
}
|
||||||
if(Surf->IsVPeriodic()) { }
|
|
||||||
else {
|
|
||||||
if(v0<=Vmin) { v0=Vmin; }
|
|
||||||
if(v1>=Vmax) { v1=Vmax; }
|
|
||||||
}
|
|
||||||
P.SetCoord(u0,v0) ; Baux.Add(P);
|
|
||||||
P.SetCoord(u1,v1) ; Baux.Add(P);
|
|
||||||
|
|
||||||
Bnd_Box2d FinalBox;
|
if((aYmin < aVmax) && (aVmax < aYmax))
|
||||||
Standard_Real aXmin, aYmin, aXmax, aYmax;
|
{
|
||||||
Baux.Get(aXmin, aYmin, aXmax, aYmax);
|
aYmax=aVmax;
|
||||||
Standard_Real Tol2d = Precision::PConfusion();
|
|
||||||
if (Abs(aXmin - Umin) <= Tol2d)
|
|
||||||
aXmin = Umin;
|
|
||||||
if (Abs(aYmin - Vmin) <= Tol2d)
|
|
||||||
aYmin = Vmin;
|
|
||||||
if (Abs(aXmax - Umax) <= Tol2d)
|
|
||||||
aXmax = Umax;
|
|
||||||
if (Abs(aYmax - Vmax) <= Tol2d)
|
|
||||||
aYmax = Vmax;
|
|
||||||
FinalBox.Update(aXmin, aYmin, aXmax, aYmax);
|
|
||||||
|
|
||||||
B.Add(FinalBox);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
aBoxS.Update(aXmin, aYmin, aXmax, aYmax);
|
||||||
|
|
||||||
|
aB.Add(aBoxS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -20,7 +20,8 @@ class Add2dCurve from BndLib
|
|||||||
-- The 2D curve is defined from a Geom2d curve.
|
-- The 2D curve is defined from a Geom2d curve.
|
||||||
|
|
||||||
uses Box2d from Bnd,
|
uses Box2d from Bnd,
|
||||||
Curve2d from Adaptor2d
|
Curve2d from Adaptor2d,
|
||||||
|
Curve from Geom2d
|
||||||
|
|
||||||
|
|
||||||
is
|
is
|
||||||
@ -89,5 +90,33 @@ is
|
|||||||
-- and P1 and P2 are either two negative infinite real
|
-- and P1 and P2 are either two negative infinite real
|
||||||
-- numbers, or two positive infinite real numbers.
|
-- numbers, or two positive infinite real numbers.
|
||||||
|
|
||||||
|
Add(myclass;
|
||||||
|
C : Curve from Geom2d;
|
||||||
|
Tol: Real from Standard;
|
||||||
|
Box: out Box2d from Bnd);
|
||||||
|
|
||||||
|
---Purpose: Adds to the bounding box B the curve C
|
||||||
|
-- B is then enlarged by the tolerance value Tol.
|
||||||
|
-- Note: depending on the type of curve, one of the following
|
||||||
|
-- representations of the curve C is used to include it in the bounding box B:
|
||||||
|
-- - an exact representation if C is built from a line, a circle or a conic curve,
|
||||||
|
-- - the poles of the curve if C is built from a Bezier curve or a BSpline curve,
|
||||||
|
-- - if not, the points of an approximation of the curve C.
|
||||||
|
|
||||||
|
Add(myclass;
|
||||||
|
C : Curve from Geom2d;
|
||||||
|
U1 : Real from Standard;
|
||||||
|
U2 : Real from Standard;
|
||||||
|
Tol: Real from Standard;
|
||||||
|
B: out Box2d from Bnd);
|
||||||
|
|
||||||
|
---Purpose: Adds to the bounding box B the part of curve C
|
||||||
|
-- B is then enlarged by the tolerance value Tol.
|
||||||
|
-- U1, U2 - the parametric range to comute the bounding box;
|
||||||
|
-- Note: depending on the type of curve, one of the following
|
||||||
|
-- representations of the curve C is used to include it in the bounding box B:
|
||||||
|
-- - an exact representation if C is built from a line, a circle or a conic curve,
|
||||||
|
-- - the poles of the curve if C is built from a Bezier curve or a BSpline curve,
|
||||||
|
-- - if not, the points of an approximation of the curve C.
|
||||||
|
|
||||||
end Add2dCurve;
|
end Add2dCurve;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -19,6 +19,8 @@
|
|||||||
#include <HLRBRep_HLRToShape.hxx>
|
#include <HLRBRep_HLRToShape.hxx>
|
||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
#include <gp_Ax3.hxx>
|
#include <gp_Ax3.hxx>
|
||||||
|
#include <BRepLib.hxx>
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : HLRAppli_ReflectLines
|
//function : HLRAppli_ReflectLines
|
||||||
@ -76,6 +78,8 @@ void HLRAppli_ReflectLines::Perform()
|
|||||||
HLRBRep_HLRToShape aHLRToShape( aHLRAlgo );
|
HLRBRep_HLRToShape aHLRToShape( aHLRAlgo );
|
||||||
|
|
||||||
myCompound = aHLRToShape.OutLineVCompound3d();
|
myCompound = aHLRToShape.OutLineVCompound3d();
|
||||||
|
|
||||||
|
BRepLib::SameParameter(myCompound,Precision::PConfusion(),Standard_False);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -516,7 +516,7 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1,
|
|||||||
//function : Perform
|
//function : Perform
|
||||||
//purpose : intersect surfaces of the faces
|
//purpose : intersect surfaces of the faces
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
||||||
const TopoDS_Face& aF2)
|
const TopoDS_Face& aF2)
|
||||||
{
|
{
|
||||||
Standard_Boolean RestrictLine = Standard_False, hasCone = Standard_False;
|
Standard_Boolean RestrictLine = Standard_False, hasCone = Standard_False;
|
||||||
@ -1144,7 +1144,7 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
|||||||
//
|
//
|
||||||
if (aC3D.IsNull()) {
|
if (aC3D.IsNull()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const Handle(Geom_BSplineCurve)& aBC=
|
const Handle(Geom_BSplineCurve)& aBC=
|
||||||
Handle(Geom_BSplineCurve)::DownCast(aC3D);
|
Handle(Geom_BSplineCurve)::DownCast(aC3D);
|
||||||
if (aBC.IsNull()) {
|
if (aBC.IsNull()) {
|
||||||
@ -1195,7 +1195,7 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
|
|||||||
//
|
//
|
||||||
bPCurvesOk = Standard_True;
|
bPCurvesOk = Standard_True;
|
||||||
|
|
||||||
reapprox:;
|
reapprox:;
|
||||||
|
|
||||||
Tolpc = myTolApprox;
|
Tolpc = myTolApprox;
|
||||||
bAvoidLineConstructor = Standard_False;
|
bAvoidLineConstructor = Standard_False;
|
||||||
@ -1525,7 +1525,7 @@ reapprox:;
|
|||||||
// on regarde si on garde
|
// on regarde si on garde
|
||||||
//
|
//
|
||||||
if (aNbParts==1) {
|
if (aNbParts==1) {
|
||||||
// if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*M_PI) < RealEpsilon()) {
|
// if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*M_PI) < RealEpsilon()) {
|
||||||
if (Abs(fprm) <= aRealEpsilon && Abs(lprm-2.*M_PI) <= aRealEpsilon) {
|
if (Abs(fprm) <= aRealEpsilon && Abs(lprm-2.*M_PI) <= aRealEpsilon) {
|
||||||
IntTools_Curve aCurve;
|
IntTools_Curve aCurve;
|
||||||
Handle(Geom_TrimmedCurve) aTC3D=new Geom_TrimmedCurve(newc,fprm,lprm);
|
Handle(Geom_TrimmedCurve) aTC3D=new Geom_TrimmedCurve(newc,fprm,lprm);
|
||||||
@ -1811,7 +1811,7 @@ reapprox:;
|
|||||||
}// case IntPatch_Analytic:
|
}// case IntPatch_Analytic:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IntPatch_Walking: {
|
case IntPatch_Walking:{
|
||||||
Handle(IntPatch_WLine) WL =
|
Handle(IntPatch_WLine) WL =
|
||||||
Handle(IntPatch_WLine)::DownCast(L);
|
Handle(IntPatch_WLine)::DownCast(L);
|
||||||
//
|
//
|
||||||
@ -2339,20 +2339,23 @@ reapprox:;
|
|||||||
Standard_Real umin,umax,vmin,vmax;
|
Standard_Real umin,umax,vmin,vmax;
|
||||||
//
|
//
|
||||||
|
|
||||||
if (C2d.IsNull()) {
|
if (C2d.IsNull())
|
||||||
|
{
|
||||||
// in class ProjLib_Function the range of parameters is shrank by 1.e-09
|
// in class ProjLib_Function the range of parameters is shrank by 1.e-09
|
||||||
if((l - f) > 2.e-09) {
|
if((l - f) > 2.e-09)
|
||||||
|
{
|
||||||
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
|
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
|
||||||
//
|
//
|
||||||
if (C2d.IsNull()) {
|
if (C2d.IsNull()) {
|
||||||
// proj. a circle that goes through the pole on a sphere to the sphere
|
// proj. a circle that goes through the pole on a sphere to the sphere
|
||||||
Tol=Tol+1.e-7;
|
Tol += Precision::Confusion();
|
||||||
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
|
C2d = GeomProjLib::Curve2d(C,f,l,S,Tol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if((l - f) > Epsilon(Abs(f))) {
|
{
|
||||||
|
if((l - f) > Epsilon(Abs(f)))
|
||||||
|
{
|
||||||
GeomAPI_ProjectPointOnSurf aProjector1, aProjector2;
|
GeomAPI_ProjectPointOnSurf aProjector1, aProjector2;
|
||||||
gp_Pnt P1 = C->Value(f);
|
gp_Pnt P1 = C->Value(f);
|
||||||
gp_Pnt P2 = C->Value(l);
|
gp_Pnt P2 = C->Value(l);
|
||||||
@ -2398,7 +2401,8 @@ reapprox:;
|
|||||||
//
|
//
|
||||||
S->Bounds(umin, umax, vmin, vmax);
|
S->Bounds(umin, umax, vmin, vmax);
|
||||||
|
|
||||||
if (S->IsUPeriodic() && !C2d.IsNull()) {
|
if (S->IsUPeriodic() && !C2d.IsNull())
|
||||||
|
{
|
||||||
// Recadre dans le domaine UV de la face
|
// Recadre dans le domaine UV de la face
|
||||||
Standard_Real period, U0, du, aEps;
|
Standard_Real period, U0, du, aEps;
|
||||||
|
|
||||||
@ -2411,7 +2415,7 @@ reapprox:;
|
|||||||
gp_Pnt2d Pl = C2d->Value(l);
|
gp_Pnt2d Pl = C2d->Value(l);
|
||||||
|
|
||||||
U0 = Min(Pl.X(), U0);
|
U0 = Min(Pl.X(), U0);
|
||||||
// while(U0-umin<aEps) {
|
// while(U0-umin<aEps) {
|
||||||
while(U0-umin<-aEps) {
|
while(U0-umin<-aEps) {
|
||||||
U0+=period;
|
U0+=period;
|
||||||
du+=period;
|
du+=period;
|
||||||
@ -2621,7 +2625,7 @@ Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine
|
|||||||
//function : CorrectSurfaceBoundaries
|
//function : CorrectSurfaceBoundaries
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void CorrectSurfaceBoundaries(const TopoDS_Face& theFace,
|
void CorrectSurfaceBoundaries(const TopoDS_Face& theFace,
|
||||||
const Standard_Real theTolerance,
|
const Standard_Real theTolerance,
|
||||||
Standard_Real& theumin,
|
Standard_Real& theumin,
|
||||||
Standard_Real& theumax,
|
Standard_Real& theumax,
|
||||||
@ -4445,9 +4449,38 @@ Standard_Boolean ApproxWithPCurves(const gp_Cylinder& theCyl,
|
|||||||
{
|
{
|
||||||
Standard_Boolean bRes = Standard_True;
|
Standard_Boolean bRes = Standard_True;
|
||||||
Standard_Real R1 = theCyl.Radius(), R2 = theSph.Radius();
|
Standard_Real R1 = theCyl.Radius(), R2 = theSph.Radius();
|
||||||
|
//
|
||||||
|
{
|
||||||
|
Standard_Real aD2, aRc2, aEps;
|
||||||
|
gp_Pnt aApexSph;
|
||||||
|
//
|
||||||
|
aEps=1.E-7;
|
||||||
|
aRc2=R1*R1;
|
||||||
|
//
|
||||||
|
const gp_Ax3& aAx3Sph=theSph.Position();
|
||||||
|
const gp_Pnt& aLocSph=aAx3Sph.Location();
|
||||||
|
const gp_Dir& aDirSph=aAx3Sph.Direction();
|
||||||
|
//
|
||||||
|
const gp_Ax1& aAx1Cyl=theCyl.Axis();
|
||||||
|
gp_Lin aLinCyl(aAx1Cyl);
|
||||||
|
//
|
||||||
|
aApexSph.SetXYZ(aLocSph.XYZ()+R2*aDirSph.XYZ());
|
||||||
|
aD2=aLinCyl.SquareDistance(aApexSph);
|
||||||
|
if (fabs(aD2-aRc2)<aEps) {
|
||||||
|
return !bRes;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aApexSph.SetXYZ(aLocSph.XYZ()-R2*aDirSph.XYZ());
|
||||||
|
aD2=aLinCyl.SquareDistance(aApexSph);
|
||||||
|
if (fabs(aD2-aRc2)<aEps) {
|
||||||
|
return !bRes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
|
||||||
if(R1 < 2.*R2) return bRes;
|
if(R1 < 2.*R2) {
|
||||||
|
return bRes;
|
||||||
|
}
|
||||||
gp_Lin anCylAx(theCyl.Axis());
|
gp_Lin anCylAx(theCyl.Axis());
|
||||||
|
|
||||||
Standard_Real aDist = anCylAx.Distance(theSph.Location());
|
Standard_Real aDist = anCylAx.Distance(theSph.Location());
|
||||||
@ -5037,7 +5070,7 @@ Standard_Real MaxSquareDistance (const Standard_Real aT,
|
|||||||
//function : CheckPCurve
|
//function : CheckPCurve
|
||||||
//purpose : Checks if points of the pcurve are out of the face bounds.
|
//purpose : Checks if points of the pcurve are out of the face bounds.
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
Standard_Boolean CheckPCurve(const Handle(Geom2d_Curve)& aPC,
|
Standard_Boolean CheckPCurve(const Handle(Geom2d_Curve)& aPC,
|
||||||
const TopoDS_Face& aFace)
|
const TopoDS_Face& aFace)
|
||||||
{
|
{
|
||||||
const Standard_Integer NPoints = 23;
|
const Standard_Integer NPoints = 23;
|
||||||
@ -5102,7 +5135,7 @@ Standard_Boolean CheckPCurve(const Handle(Geom2d_Curve)& aPC,
|
|||||||
vmin-v > tolV || v-vmax > tolV) {
|
vmin-v > tolV || v-vmax > tolV) {
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return !bRet;
|
return !bRet;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ void ProjLib_Sphere::Project(const gp_Circ& C)
|
|||||||
Zs = mySphere.Position().Direction();
|
Zs = mySphere.Position().Direction();
|
||||||
|
|
||||||
Standard_Boolean isIsoU, isIsoV;
|
Standard_Boolean isIsoU, isIsoV;
|
||||||
Standard_Real Tol = 1.e-8;
|
Standard_Real Tol = Precision::Confusion();
|
||||||
|
|
||||||
isIsoU = Zc.IsNormal(Zs,Tol) && O.IsEqual(C.Location(),Tol);
|
isIsoU = Zc.IsNormal(Zs,Tol) && O.IsEqual(C.Location(),Tol);
|
||||||
isIsoV = Xc.IsNormal(Zs,Tol) && Yc.IsNormal(Zs,Tol);
|
isIsoV = Xc.IsNormal(Zs,Tol) && Yc.IsNormal(Zs,Tol);
|
||||||
|
@ -460,67 +460,74 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
|||||||
seqw.Clear();
|
seqw.Clear();
|
||||||
|
|
||||||
// Init seqw by initial set of wires (with corresponding orientation)
|
// Init seqw by initial set of wires (with corresponding orientation)
|
||||||
for ( TopoDS_Iterator iw(myFace,Standard_False); iw.More(); iw.Next() ) {
|
for ( TopoDS_Iterator iw(myFace,Standard_False); iw.More(); iw.Next() )
|
||||||
//smh#8
|
{
|
||||||
TopoDS_Shape tmpW = Context()->Apply ( iw.Value() ) ;
|
TopoDS_Shape tmpW = Context()->Apply ( iw.Value() ) ;
|
||||||
if(tmpW.ShapeType() != TopAbs_WIRE) {
|
if(tmpW.ShapeType() != TopAbs_WIRE)
|
||||||
if(tmpW.ShapeType() == TopAbs_VERTEX) {
|
{
|
||||||
|
if(tmpW.ShapeType() == TopAbs_VERTEX)
|
||||||
|
{
|
||||||
ShapeFix_WireSegment seg; //(( isOuter ? TopAbs_REVERSED : TopAbs_FORWARD ) );
|
ShapeFix_WireSegment seg; //(( isOuter ? TopAbs_REVERSED : TopAbs_FORWARD ) );
|
||||||
seg.SetVertex(TopoDS::Vertex(tmpW));
|
seg.SetVertex(TopoDS::Vertex(tmpW));
|
||||||
seg.Orientation(tmpW.Orientation());
|
seg.Orientation(tmpW.Orientation());
|
||||||
seqw.Append ( seg );
|
seqw.Append ( seg );
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
TopoDS_Wire wire = TopoDS::Wire ( tmpW );
|
TopoDS_Wire wire = TopoDS::Wire ( tmpW );
|
||||||
|
|
||||||
Standard_Boolean isNonManifold = ( wire.Orientation() != TopAbs_REVERSED &&
|
Standard_Boolean isNonManifold = ( wire.Orientation() != TopAbs_REVERSED &&
|
||||||
wire.Orientation() != TopAbs_FORWARD );
|
wire.Orientation() != TopAbs_FORWARD );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// protect against INTERNAL/EXTERNAL wires
|
// protect against INTERNAL/EXTERNAL wires
|
||||||
// if ( wire.Orientation() != TopAbs_REVERSED &&
|
// if ( wire.Orientation() != TopAbs_REVERSED &&
|
||||||
// wire.Orientation() != TopAbs_FORWARD ) continue;
|
// wire.Orientation() != TopAbs_FORWARD ) continue;
|
||||||
|
|
||||||
// determine orientation of the wire
|
// determine orientation of the wire
|
||||||
// TopoDS_Face face = TopoDS::Face ( myFace.EmptyCopied() );
|
// TopoDS_Face face = TopoDS::Face ( myFace.EmptyCopied() );
|
||||||
// B.Add ( face, wire );
|
// B.Add ( face, wire );
|
||||||
// Standard_Boolean isOuter = ShapeAnalysis::IsOuterBound ( face );
|
// Standard_Boolean isOuter = ShapeAnalysis::IsOuterBound ( face );
|
||||||
|
|
||||||
if(isNonManifold) {
|
|
||||||
|
|
||||||
|
if(isNonManifold)
|
||||||
|
{
|
||||||
Handle(ShapeExtend_WireData) sbwd = new ShapeExtend_WireData ( wire ,Standard_True,Standard_False);
|
Handle(ShapeExtend_WireData) sbwd = new ShapeExtend_WireData ( wire ,Standard_True,Standard_False);
|
||||||
//pdn protection againts of wires w/o edges
|
//pdn protection againts of wires w/o edges
|
||||||
Standard_Integer nbEdges = sbwd->NbEdges();
|
Standard_Integer nbEdges = sbwd->NbEdges();
|
||||||
if(nbEdges) {
|
if(nbEdges)
|
||||||
|
{
|
||||||
//wire segments for non-manifold topology should have INTERNAL orientation
|
//wire segments for non-manifold topology should have INTERNAL orientation
|
||||||
ShapeFix_WireSegment seg ( sbwd, TopAbs_INTERNAL);
|
ShapeFix_WireSegment seg ( sbwd, TopAbs_INTERNAL);
|
||||||
seqw.Append ( seg );
|
seqw.Append ( seg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
//splitting wires containing manifold and non-manifold parts on a separate
|
//splitting wires containing manifold and non-manifold parts on a separate
|
||||||
//wire segment
|
//wire segment
|
||||||
|
|
||||||
Handle(ShapeExtend_WireData) sbwdM = new ShapeExtend_WireData();
|
Handle(ShapeExtend_WireData) sbwdM = new ShapeExtend_WireData();
|
||||||
Handle(ShapeExtend_WireData) sbwdNM = new ShapeExtend_WireData();
|
Handle(ShapeExtend_WireData) sbwdNM = new ShapeExtend_WireData();
|
||||||
sbwdNM->ManifoldMode() = Standard_False;
|
sbwdNM->ManifoldMode() = Standard_False;
|
||||||
TopoDS_Iterator aIt(wire);
|
TopoDS_Iterator aIt(wire);
|
||||||
for( ; aIt.More(); aIt.Next()) {
|
for( ; aIt.More(); aIt.Next())
|
||||||
|
{
|
||||||
TopoDS_Edge E = TopoDS::Edge ( aIt.Value() );
|
TopoDS_Edge E = TopoDS::Edge ( aIt.Value() );
|
||||||
if(E.Orientation() == TopAbs_FORWARD || E.Orientation() == TopAbs_REVERSED)
|
if(E.Orientation() == TopAbs_FORWARD || E.Orientation() == TopAbs_REVERSED)
|
||||||
sbwdM->Add(E);
|
sbwdM->Add(E);
|
||||||
else
|
else
|
||||||
sbwdNM->Add(E);
|
sbwdNM->Add(E);
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer nbMEdges = sbwdM->NbEdges();
|
Standard_Integer nbMEdges = sbwdM->NbEdges();
|
||||||
Standard_Integer nbNMEdges = sbwdNM->NbEdges();
|
Standard_Integer nbNMEdges = sbwdNM->NbEdges();
|
||||||
if(nbNMEdges) {
|
|
||||||
|
if(nbNMEdges)
|
||||||
|
{
|
||||||
ShapeFix_WireSegment seg ( sbwdNM, TopAbs_INTERNAL); //(( isOuter ? TopAbs_REVERSED : TopAbs_FORWARD ) );
|
ShapeFix_WireSegment seg ( sbwdNM, TopAbs_INTERNAL); //(( isOuter ? TopAbs_REVERSED : TopAbs_FORWARD ) );
|
||||||
seqw.Append ( seg );
|
seqw.Append ( seg );
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nbMEdges) {
|
if(nbMEdges) {
|
||||||
// Orientation is set so as to allow the segment to be traversed in only one direction
|
// Orientation is set so as to allow the segment to be traversed in only one direction
|
||||||
// skl 01.04.2002
|
// skl 01.04.2002
|
||||||
@ -528,7 +535,8 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
|||||||
sfw->Load ( sbwdM );
|
sfw->Load ( sbwdM );
|
||||||
Standard_Integer stat=0;
|
Standard_Integer stat=0;
|
||||||
Handle(Geom_Surface) gs = BRep_Tool::Surface(myFace);
|
Handle(Geom_Surface) gs = BRep_Tool::Surface(myFace);
|
||||||
if( gs->IsUPeriodic() && gs->IsVPeriodic() ) {
|
if( gs->IsUPeriodic() && gs->IsVPeriodic() )
|
||||||
|
{
|
||||||
// For torus-like shapes, first reorder in 2d since reorder is indifferent in 3d
|
// For torus-like shapes, first reorder in 2d since reorder is indifferent in 3d
|
||||||
ShapeAnalysis_WireOrder sawo(Standard_False, 0);
|
ShapeAnalysis_WireOrder sawo(Standard_False, 0);
|
||||||
ShapeAnalysis_Edge sae;
|
ShapeAnalysis_Edge sae;
|
||||||
@ -541,6 +549,7 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
|||||||
continue;
|
continue;
|
||||||
sawo.Add(c2d->Value(f).XY(),c2d->Value(l).XY());
|
sawo.Add(c2d->Value(f).XY(),c2d->Value(l).XY());
|
||||||
}
|
}
|
||||||
|
|
||||||
sawo.Perform();
|
sawo.Perform();
|
||||||
stat = (sawo.Status() < 0 ? -1 : 1);
|
stat = (sawo.Status() < 0 ? -1 : 1);
|
||||||
sfw->FixReorder(sawo);
|
sfw->FixReorder(sawo);
|
||||||
@ -550,7 +559,8 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
|||||||
if (sfw->StatusReorder(ShapeExtend_DONE3))
|
if (sfw->StatusReorder(ShapeExtend_DONE3))
|
||||||
stat=-1;
|
stat=-1;
|
||||||
|
|
||||||
if( stat < 0 ) {
|
if(stat < 0)
|
||||||
|
{
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
TopoDS_Shape dummy = myFace.EmptyCopied();
|
TopoDS_Shape dummy = myFace.EmptyCopied();
|
||||||
TopoDS_Face face = TopoDS::Face ( dummy );
|
TopoDS_Face face = TopoDS::Face ( dummy );
|
||||||
@ -569,7 +579,6 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
|
|||||||
seqw.Append ( seg );
|
seqw.Append ( seg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1417,6 +1417,8 @@ static Standard_Boolean CheckWire (const TopoDS_Wire &wire,
|
|||||||
vec.SetX(0);
|
vec.SetX(0);
|
||||||
vec.SetY(0);
|
vec.SetY(0);
|
||||||
ShapeAnalysis_Edge sae;
|
ShapeAnalysis_Edge sae;
|
||||||
|
|
||||||
|
isuopen = isvopen = 0;
|
||||||
isDeg = Standard_True;
|
isDeg = Standard_True;
|
||||||
for ( TopoDS_Iterator ed(wire); ed.More(); ed.Next() ) {
|
for ( TopoDS_Iterator ed(wire); ed.More(); ed.Next() ) {
|
||||||
TopoDS_Edge edge = TopoDS::Edge ( ed.Value() );
|
TopoDS_Edge edge = TopoDS::Edge ( ed.Value() );
|
||||||
@ -1427,17 +1429,48 @@ static Standard_Boolean CheckWire (const TopoDS_Wire &wire,
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
vec += c2d->Value(l).XY() - c2d->Value(f).XY();
|
vec += c2d->Value(l).XY() - c2d->Value(f).XY();
|
||||||
}
|
}
|
||||||
isuopen = ( Abs ( Abs ( vec.X() ) - dU ) < 0.1 * dU ? ( vec.X() >0 ? 1 : -1 ) : 0 );
|
|
||||||
isvopen = ( Abs ( Abs ( vec.Y() ) - dV ) < 0.1 * dV ? ( vec.Y() >0 ? 1 : -1 ) : 0 );
|
Standard_Real aDelta = Abs(vec.X())-dU;
|
||||||
|
if(Abs(aDelta) < 0.1*dU)
|
||||||
|
{
|
||||||
|
if(vec.X() > 0.0)
|
||||||
|
{
|
||||||
|
isuopen = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isuopen = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isuopen = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
aDelta = Abs(vec.Y())-dV;
|
||||||
|
if(Abs(aDelta) < 0.1*dV)
|
||||||
|
{
|
||||||
|
if(vec.Y() > 0.0)
|
||||||
|
{
|
||||||
|
isvopen = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isvopen = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isvopen = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return isuopen || isvopen;
|
return isuopen || isvopen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FixMissingSeam
|
//function : FixMissingSeam
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
Standard_Boolean ShapeFix_Face::FixMissingSeam()
|
Standard_Boolean ShapeFix_Face::FixMissingSeam()
|
||||||
{
|
{
|
||||||
Standard_Boolean uclosed = mySurf->IsUClosed();
|
Standard_Boolean uclosed = mySurf->IsUClosed();
|
||||||
@ -1480,8 +1513,8 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
URange = Abs ( SUL - SUF );
|
URange = Min(Abs (SUL - SUF), Precision::Infinite());
|
||||||
VRange = Abs ( SVL - SVF );
|
VRange = Min(Abs(SVL - SVF), Precision::Infinite());
|
||||||
// Standard_Real UTol = 0.2 * URange, VTol = 0.2 * VRange;
|
// Standard_Real UTol = 0.2 * URange, VTol = 0.2 * VRange;
|
||||||
Standard_Integer ismodeu = 0, ismodev = 0; //szv#4:S4163:12Mar99 was Boolean
|
Standard_Integer ismodeu = 0, ismodev = 0; //szv#4:S4163:12Mar99 was Boolean
|
||||||
Standard_Integer isdeg1=0, isdeg2=0;
|
Standard_Integer isdeg1=0, isdeg2=0;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
## cts20461
|
## cts20461
|
||||||
puts "TODO #22911 ALL: Error : The area of the resulting shape is"
|
|
||||||
|
|
||||||
restore [locate_data_file cts20461.rle] a
|
restore [locate_data_file cts20461.rle] a
|
||||||
nexplode a f
|
nexplode a f
|
||||||
@ -43,4 +42,4 @@ bcut r4 r3 p4
|
|||||||
bcut r5 r4 p5
|
bcut r5 r4 p5
|
||||||
bcut result r5 p6
|
bcut result r5 p6
|
||||||
|
|
||||||
set square 0
|
set square 55910.6
|
||||||
|
@ -5,4 +5,4 @@ restore [locate_data_file Plan.rle] b
|
|||||||
|
|
||||||
bsection result a b
|
bsection result a b
|
||||||
|
|
||||||
set length 1686.09
|
set length 1908.63
|
||||||
|
@ -66,5 +66,5 @@ if { $MaxFaceTolerance > 1 || $MaxEdgeTolerance > 1 || $MaxVertexTolerance > 1 }
|
|||||||
} else {
|
} else {
|
||||||
puts "Tolerance of shape is less then 1.0"
|
puts "Tolerance of shape is less then 1.0"
|
||||||
}
|
}
|
||||||
set square 2.22138e+07
|
set square 2.34799e+007
|
||||||
set 2dviewer 0
|
set 2dviewer 0
|
||||||
|
@ -40,7 +40,7 @@ set CPU_user_time [expr ${CPU_user_time} / ${NbTests}]
|
|||||||
puts "CPU_user_time=${CPU_user_time}"
|
puts "CPU_user_time=${CPU_user_time}"
|
||||||
|
|
||||||
#CR24317 set square 782201
|
#CR24317 set square 782201
|
||||||
set square 766474
|
set square 784833
|
||||||
|
|
||||||
# Analysis of "nbshapes res"
|
# Analysis of "nbshapes res"
|
||||||
set nb_v_good 53
|
set nb_v_good 53
|
||||||
|
@ -30,7 +30,7 @@ set distance -0.1
|
|||||||
catch { OFFSETSHAPE $distance {} $calcul $type }
|
catch { OFFSETSHAPE $distance {} $calcul $type }
|
||||||
|
|
||||||
|
|
||||||
set square 236.013
|
set square 253.552
|
||||||
|
|
||||||
set nb_v_good 2
|
set nb_v_good 2
|
||||||
set nb_e_good 3
|
set nb_e_good 3
|
||||||
|
@ -30,7 +30,7 @@ set distance -0.1
|
|||||||
catch { OFFSETSHAPE $distance {s_3} $calcul $type }
|
catch { OFFSETSHAPE $distance {s_3} $calcul $type }
|
||||||
|
|
||||||
|
|
||||||
set square 484.846
|
set square 502.411
|
||||||
|
|
||||||
set nb_v_good 3
|
set nb_v_good 3
|
||||||
set nb_e_good 5
|
set nb_e_good 5
|
||||||
|
@ -30,7 +30,7 @@ set distance -0.1
|
|||||||
catch { OFFSETSHAPE $distance {s_2} $calcul $type }
|
catch { OFFSETSHAPE $distance {s_2} $calcul $type }
|
||||||
|
|
||||||
|
|
||||||
set square 484.846
|
set square 502.411
|
||||||
|
|
||||||
set nb_v_good 3
|
set nb_v_good 3
|
||||||
set nb_e_good 5
|
set nb_e_good 5
|
||||||
|
@ -30,7 +30,7 @@ set distance -0.1
|
|||||||
catch { OFFSETSHAPE $distance {s_3 s_2} $calcul $type }
|
catch { OFFSETSHAPE $distance {s_3 s_2} $calcul $type }
|
||||||
|
|
||||||
|
|
||||||
set square 472.222
|
set square 489.812
|
||||||
|
|
||||||
set nb_v_good 3
|
set nb_v_good 3
|
||||||
set nb_e_good 5
|
set nb_e_good 5
|
||||||
|
@ -30,7 +30,7 @@ set distance -0.1
|
|||||||
catch { OFFSETSHAPE $distance {} $calcul $type }
|
catch { OFFSETSHAPE $distance {} $calcul $type }
|
||||||
|
|
||||||
|
|
||||||
set square 754.039
|
set square 767.63
|
||||||
|
|
||||||
set nb_v_good 2
|
set nb_v_good 2
|
||||||
set nb_e_good 3
|
set nb_e_good 3
|
||||||
|
@ -30,7 +30,7 @@ set distance -0.1
|
|||||||
catch { OFFSETSHAPE $distance {s_2} $calcul $type }
|
catch { OFFSETSHAPE $distance {s_2} $calcul $type }
|
||||||
|
|
||||||
|
|
||||||
set square 1511.4
|
set square 1530.96
|
||||||
|
|
||||||
set nb_v_good 4
|
set nb_v_good 4
|
||||||
set nb_e_good 6
|
set nb_e_good 6
|
||||||
|
@ -30,7 +30,7 @@ set distance -0.1
|
|||||||
catch { OFFSETSHAPE $distance {s_3 s_2} $calcul $type }
|
catch { OFFSETSHAPE $distance {s_3 s_2} $calcul $type }
|
||||||
|
|
||||||
|
|
||||||
set square 1451.05
|
set square 1471.48
|
||||||
|
|
||||||
set nb_v_good 4
|
set nb_v_good 4
|
||||||
set nb_e_good 6
|
set nb_e_good 6
|
||||||
|
@ -15,6 +15,6 @@ fit
|
|||||||
|
|
||||||
reflectlines result a 0 1 0
|
reflectlines result a 0 1 0
|
||||||
|
|
||||||
set length 3877.8
|
set length 3730.32
|
||||||
|
|
||||||
set only_screen_axo 1
|
set only_screen_axo 1
|
||||||
|
@ -21,7 +21,7 @@ for {set i 0} {$i < $nbObjs} {incr i} {
|
|||||||
bfillds
|
bfillds
|
||||||
bbuild result
|
bbuild result
|
||||||
|
|
||||||
set square 77849.3
|
set square 80532.3
|
||||||
|
|
||||||
# Analysis of "nbshapes result"
|
# Analysis of "nbshapes result"
|
||||||
set nb_v_good 54
|
set nb_v_good 54
|
||||||
|
@ -21,7 +21,7 @@ for {set i 0} {$i < $nbObjs} {incr i} {
|
|||||||
bfillds
|
bfillds
|
||||||
bbuild result
|
bbuild result
|
||||||
|
|
||||||
set square 82726.4
|
set square 81730.6
|
||||||
|
|
||||||
# Analysis of "nbshapes result"
|
# Analysis of "nbshapes result"
|
||||||
set nb_v_good 121
|
set nb_v_good 121
|
||||||
|
@ -21,7 +21,7 @@ for {set i 0} {$i < $nbObjs} {incr i} {
|
|||||||
bfillds
|
bfillds
|
||||||
bbuild result
|
bbuild result
|
||||||
|
|
||||||
set square 117639
|
set square 126161
|
||||||
|
|
||||||
# Analysis of "nbshapes result"
|
# Analysis of "nbshapes result"
|
||||||
set nb_v_good 16
|
set nb_v_good 16
|
||||||
|
@ -21,7 +21,7 @@ for {set i 0} {$i < $nbObjs} {incr i} {
|
|||||||
bfillds
|
bfillds
|
||||||
bbuild result
|
bbuild result
|
||||||
|
|
||||||
set square 77849.3
|
set square 80532.3
|
||||||
|
|
||||||
# Analysis of "nbshapes result"
|
# Analysis of "nbshapes result"
|
||||||
set nb_v_good 54
|
set nb_v_good 54
|
||||||
|
@ -21,7 +21,7 @@ for {set i 0} {$i < $nbObjs} {incr i} {
|
|||||||
bfillds
|
bfillds
|
||||||
bbuild result
|
bbuild result
|
||||||
|
|
||||||
set square 82726.4
|
set square 81730.6
|
||||||
|
|
||||||
# Analysis of "nbshapes result"
|
# Analysis of "nbshapes result"
|
||||||
set nb_v_good 121
|
set nb_v_good 121
|
||||||
|
@ -21,7 +21,7 @@ for {set i 0} {$i < $nbObjs} {incr i} {
|
|||||||
bfillds
|
bfillds
|
||||||
bbuild result
|
bbuild result
|
||||||
|
|
||||||
set square 117639
|
set square 126161
|
||||||
|
|
||||||
# Analysis of "nbshapes result"
|
# Analysis of "nbshapes result"
|
||||||
set nb_v_good 16
|
set nb_v_good 16
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
puts "TODO OCC12345 ALL: Error : Volume of OCC76-1.brep is calculated wrongly becuase 3020.94 value must be but 3050.41 is"
|
|
||||||
puts "TODO OCC12345 ALL: Error : Volume of OCC76-2.brep is calculated wrongly because 9871.39 value must be but 10153.6 is"
|
|
||||||
|
|
||||||
puts "================"
|
puts "================"
|
||||||
puts "OCC76"
|
puts "OCC76"
|
||||||
puts "================"
|
puts "================"
|
||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
|
set vol1_exp 3050.42
|
||||||
|
set vol2_exp 10195.3
|
||||||
|
|
||||||
restore [locate_data_file shading_177.brep] sh1
|
restore [locate_data_file shading_177.brep] sh1
|
||||||
checkshape sh1
|
checkshape sh1
|
||||||
regexp {Mass +: +([-0-9.+eE]+)} [vprops sh1] full l1
|
regexp {Mass +: +([-0-9.+eE]+)} [vprops sh1] full l1
|
||||||
@ -14,14 +14,14 @@ restore [locate_data_file OCC76-2.brep] sh2
|
|||||||
checkshape sh2
|
checkshape sh2
|
||||||
regexp {Mass +: +([-0-9.+eE]+)} [vprops sh2] full l2
|
regexp {Mass +: +([-0-9.+eE]+)} [vprops sh2] full l2
|
||||||
|
|
||||||
if { [expr abs([expr $l1 - 3020.94])] > 0.00999} {
|
if { [expr abs([expr $l1 - $vol1_exp])] > 0.00999} {
|
||||||
puts "Error : Volume of OCC76-1.brep is calculated wrongly becuase 3020.94 value must be but $l1 is"
|
puts "Error : Volume of OCC76-1.brep is calculated wrongly becuase $vol1_exp value must be but $l1 is"
|
||||||
} else {
|
} else {
|
||||||
puts " Volume of OCC76-1.brep is right calculated"
|
puts " Volume of OCC76-1.brep is right calculated"
|
||||||
}
|
}
|
||||||
|
|
||||||
if { [expr abs([expr $l2 - 9871.39 ])] > 0.00999} {
|
if { [expr abs([expr $l2 - $vol2_exp])] > 0.00999} {
|
||||||
puts "Error : Volume of OCC76-2.brep is calculated wrongly because 9871.39 value must be but $l2 is"
|
puts "Error : Volume of OCC76-2.brep is calculated wrongly because $vol2_exp value must be but $l2 is"
|
||||||
} else {
|
} else {
|
||||||
puts " Volume of OCC76-2.brep is right calculated"
|
puts " Volume of OCC76-2.brep is right calculated"
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,10 @@ puts ""
|
|||||||
## strings of code. BRepTools.cxx line 213 (in dev version)
|
## strings of code. BRepTools.cxx line 213 (in dev version)
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
set good_u1 -0.157166
|
set good_u1 -0.14353846357954067
|
||||||
set good_u2 4.88216
|
set good_u2 4.8658600889104724
|
||||||
set good_v1 -1.65583
|
set good_v1 -1.386764846506505
|
||||||
set good_v2 7.93778
|
set good_v2 7.6699722758333735
|
||||||
|
|
||||||
set percent_max 0.1
|
set percent_max 0.1
|
||||||
|
|
||||||
|
21
tests/bugs/moddata_3/bug23511
Normal file
21
tests/bugs/moddata_3/bug23511
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "OCC23511"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
#########################################################################
|
||||||
|
# The function BRepTools::UVBounds provides incorrect result for a face
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23511_f1] result
|
||||||
|
|
||||||
|
set info [xbounds result]
|
||||||
|
|
||||||
|
set 2PI [expr 2 * 3.142]
|
||||||
|
foreach bound ${info} {
|
||||||
|
puts "bound = ${bound}"
|
||||||
|
if { ${bound} < 0 || ${bound} > ${2PI} } {
|
||||||
|
puts "Error : bad bound ${bound}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set 2dviewer 1
|
@ -8,8 +8,8 @@ set ref_data {
|
|||||||
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 1 ) Summary = 0 ( 1 )
|
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 1 ) Summary = 0 ( 1 )
|
||||||
TPSTAT : Faulties = 0 ( 28 ) Warnings = 115 ( 7 ) Summary = 115 ( 35 )
|
TPSTAT : Faulties = 0 ( 28 ) Warnings = 115 ( 7 ) Summary = 115 ( 35 )
|
||||||
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 1 ) Solids = 0 ( 1 )
|
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 1 ) Solids = 0 ( 1 )
|
||||||
NBSHAPES : Solid = 0 ( 18 ) Shell = 0 ( 18 ) Face = 1190 ( 1190 ) Summary = 15073 ( 7693 )
|
NBSHAPES : Solid = 0 ( 18 ) Shell = 0 ( 18 ) Face = 1190 ( 1190 ) Summary = 15075 ( 7693 )
|
||||||
STATSHAPE : Solid = 0 ( 18 ) Shell = 0 ( 18 ) Face = 1190 ( 1190 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 6283 ( 3134 )
|
STATSHAPE : Solid = 0 ( 18 ) Shell = 0 ( 18 ) Face = 1190 ( 1190 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 6284 ( 3134 )
|
||||||
TOLERANCE : MaxTol = 0.2496383637 ( 0.2496258832 ) AvgTol = 0.002193043247 ( 0.004111699336 )
|
TOLERANCE : MaxTol = 0.2496383637 ( 0.2496258832 ) AvgTol = 0.002193043247 ( 0.004111699336 )
|
||||||
LABELS : N0Labels = 27 ( 27 ) N1Labels = 0 ( 0 ) N2Labels = 0 ( 0 ) TotalLabels = 27 ( 27 ) NameLabels = 27 ( 27 ) ColorLabels = 0 ( 0 ) LayerLabels = 0 ( 0 )
|
LABELS : N0Labels = 27 ( 27 ) N1Labels = 0 ( 0 ) N2Labels = 0 ( 0 ) TotalLabels = 27 ( 27 ) NameLabels = 27 ( 27 ) ColorLabels = 0 ( 0 ) LayerLabels = 0 ( 0 )
|
||||||
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
|
||||||
|
@ -10,4 +10,4 @@ bfuse f pt pr
|
|||||||
nexplode f f
|
nexplode f f
|
||||||
depouille result f 0 0 1 f_4 5 0 0 40 0 0 1
|
depouille result f 0 0 1 f_4 5 0 0 40 0 0 1
|
||||||
|
|
||||||
set square 11348.9
|
set square 10850.6
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# Date : 02 Dec 98
|
# Date : 02 Dec 98
|
||||||
|
|
||||||
puts "TODO OCC22803 All:Error: The tolerance of the resulting shape is too big"
|
puts "TODO OCC22803 All:Error: The tolerance of the resulting shape is too big"
|
||||||
|
puts "TODO OCC23511 Debian60-64: The area of the resulting shape is 186543"
|
||||||
|
|
||||||
restore [locate_data_file CFE903_pro12ggx.rle] base
|
restore [locate_data_file CFE903_pro12ggx.rle] base
|
||||||
|
|
||||||
@ -11,4 +12,4 @@ depouille result base 0 -1 0 base_13 3 110 0 96.5000000000001 0 -1 0 base_24 3
|
|||||||
|
|
||||||
fsameparameter result
|
fsameparameter result
|
||||||
|
|
||||||
set square 186544
|
set square 200050
|
||||||
|
Loading…
x
Reference in New Issue
Block a user