1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0024255: Regressions in test cases on OCCT vc9 win64 Release

Updated test-cases from branch CR24255_3

0024255: Regressions in test cases on OCCT vc9 win64 Release

Small refactoring.

Fix for CASE bugs modalg_5 bug25298_09: FAILED (error)

Test-cases correction (bugs modalg_5 bugs25804_1, bug25704_2)
This commit is contained in:
ifv 2015-02-12 14:38:39 +03:00 committed by bugmaster
parent 48e653b689
commit 873c119ff1
102 changed files with 4301 additions and 3440 deletions

View File

@ -742,7 +742,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
Handle(IntTools_Context)& theContext) Handle(IntTools_Context)& theContext)
{ {
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint; Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
Standard_Integer iErr, aIx, aNbDomains; Standard_Integer iErr, aIx = 0, aNbDomains = 0;
Standard_Real aUMin, aUMax, aVMin, aVMax; Standard_Real aUMin, aUMax, aVMin, aVMax;
Standard_Real aVx = 0., aUx, aV1, aV2; Standard_Real aVx = 0., aUx, aV1, aV2;
gp_Dir2d aD2D (0., 1.); gp_Dir2d aD2D (0., 1.);
@ -764,24 +764,36 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax); BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
// //
aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax); aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax);
aP2D.SetCoord(aUx, 0.); Standard_Integer i;
aL2D=new Geom2d_Line (aP2D, aD2D); for(i = 1; i <= 2; ++i)
Geom2dAdaptor_Curve aHCur(aL2D); {
// aP2D.SetCoord(aUx, 0.);
aIx=aHatcher.AddHatching(aHCur) ; aL2D=new Geom2d_Line (aP2D, aD2D);
// Geom2dAdaptor_Curve aHCur(aL2D);
aHatcher.Trim(); //
bIsDone=aHatcher.TrimDone(aIx); aIx=aHatcher.AddHatching(aHCur) ;
if (!bIsDone) { //
iErr=1; aHatcher.Trim(aIx);
return iErr; bIsDone=aHatcher.TrimDone(aIx);
} if (!bIsDone) {
// iErr=1;
aHatcher.ComputeDomains(aIx); return iErr;
bIsDone=aHatcher.IsDone(aIx); }
if (!bIsDone) { //
iErr=2; if(aHatcher.NbPoints(aIx) > 1)
return iErr; {
aHatcher.ComputeDomains(aIx);
bIsDone=aHatcher.IsDone(aIx);
if (!bIsDone) {
iErr=2;
return iErr;
}
break;
}
else
{
aUx = aUMax - (aUx - aUMin);
}
} }
// //
aNbDomains=aHatcher.NbDomains(aIx); aNbDomains=aHatcher.NbDomains(aIx);

File diff suppressed because it is too large Load Diff

View File

@ -31,13 +31,17 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <IntRes2d_IntersectionPoint.hxx> #include <IntRes2d_IntersectionPoint.hxx>
#include <IntRes2d_IntersectionSegment.hxx> #include <IntRes2d_IntersectionSegment.hxx>
#include <ElCLib.hxx>
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#ifdef OCCT_DEBUG
//#define DRAW
#ifdef DRAW #ifdef DRAW
#include <DrawTrSurf.hxx> #include <DrawTrSurf.hxx>
#include <DBRep.hxx> #include <DBRep.hxx>
static Standard_Boolean Affich = Standard_False; static Standard_Boolean Affich = Standard_False;
static Standard_Boolean AffichInt = Standard_False;
static Standard_Integer intind = 0;
#endif
#endif #endif
@ -47,7 +51,7 @@ static Standard_Boolean Affich = Standard_False;
//======================================================================= //=======================================================================
static void SimpleExpression (const Bisector_Bisec& B, static void SimpleExpression (const Bisector_Bisec& B,
Handle(Geom2d_Curve)& Bis) Handle(Geom2d_Curve)& Bis)
{ {
Bis = B.Value(); Bis = B.Value();
@ -60,8 +64,8 @@ static void SimpleExpression (const Bisector_Bisec& B,
if (BT == STANDARD_TYPE(Bisector_BisecAna)) { if (BT == STANDARD_TYPE(Bisector_BisecAna)) {
Bis = Handle(Bisector_BisecAna)::DownCast(BasBis)->Geom2dCurve(); Bis = Handle(Bisector_BisecAna)::DownCast(BasBis)->Geom2dCurve();
Bis = new Geom2d_TrimmedCurve (Bis, Bis = new Geom2d_TrimmedCurve (Bis,
TrBis->FirstParameter(), TrBis->FirstParameter(),
TrBis->LastParameter()); TrBis->LastParameter());
} }
} }
} }
@ -83,18 +87,18 @@ BRepFill_TrimEdgeTool::BRepFill_TrimEdgeTool()
//======================================================================= //=======================================================================
BRepFill_TrimEdgeTool::BRepFill_TrimEdgeTool BRepFill_TrimEdgeTool::BRepFill_TrimEdgeTool
(const Bisector_Bisec& Bisec, (const Bisector_Bisec& Bisec,
const Handle(Geom2d_Geometry)& S1, const Handle(Geom2d_Geometry)& S1,
const Handle(Geom2d_Geometry)& S2, const Handle(Geom2d_Geometry)& S2,
const Standard_Real Offset) : const Standard_Real Offset) :
myOffset(Offset), myOffset(Offset),
myBisec(Bisec) myBisec(Bisec)
{ {
isPoint1 = (S1->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint)); isPoint1 = (S1->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint));
isPoint2 = (S2->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint)); isPoint2 = (S2->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint));
// return geometries of shapes. // return geometries of shapes.
// Standard_Real f,l; // Standard_Real f,l;
if (isPoint1) { if (isPoint1) {
myP1 = Handle(Geom2d_Point)::DownCast(S1)->Pnt2d(); myP1 = Handle(Geom2d_Point)::DownCast(S1)->Pnt2d();
} }
@ -102,10 +106,10 @@ myBisec(Bisec)
myC1 = Handle(Geom2d_Curve)::DownCast(S1); myC1 = Handle(Geom2d_Curve)::DownCast(S1);
#ifdef DRAW #ifdef DRAW
if ( Affich) { if ( Affich) {
//POP pour NT //POP pour NT
char* myC1name = "myC1"; char* myC1name = "myC1";
DrawTrSurf::Set(myC1name,myC1); DrawTrSurf::Set(myC1name,myC1);
// DrawTrSurf::Set("myC1",myC1); // DrawTrSurf::Set("myC1",myC1);
} }
#endif #endif
} }
@ -118,7 +122,7 @@ myBisec(Bisec)
if ( Affich) { if ( Affich) {
char* myC2name = "myC2"; char* myC2name = "myC2";
DrawTrSurf::Set(myC2name,myC2); DrawTrSurf::Set(myC2name,myC2);
// DrawTrSurf::Set("myC2",myC2); // DrawTrSurf::Set("myC2",myC2);
} }
#endif #endif
} }
@ -128,8 +132,8 @@ myBisec(Bisec)
myBis = Geom2dAdaptor_Curve(Bis); myBis = Geom2dAdaptor_Curve(Bis);
#ifdef DRAW #ifdef DRAW
if ( Affich) { if ( Affich) {
char* myBisname = "myBis"; char* myBisname = "myBis";
DrawTrSurf::Set(myBisname,Bis); DrawTrSurf::Set(myBisname,Bis);
} }
#endif #endif
@ -150,8 +154,8 @@ static void Bubble(TColgp_SequenceOfPnt& Seq)
gp_Pnt P1 = Seq.Value(i); gp_Pnt P1 = Seq.Value(i);
gp_Pnt P2 = Seq.Value(i+1); gp_Pnt P2 = Seq.Value(i+1);
if (P2.X()<P1.X()) { if (P2.X()<P1.X()) {
Seq.Exchange(i,i+1); Seq.Exchange(i,i+1);
Invert = Standard_True; Invert = Standard_True;
} }
} }
} }
@ -164,12 +168,12 @@ static void Bubble(TColgp_SequenceOfPnt& Seq)
//======================================================================= //=======================================================================
static void EvalParameters(const Geom2dAdaptor_Curve& Bis, static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
const Geom2dAdaptor_Curve& AC, const Geom2dAdaptor_Curve& AC,
TColgp_SequenceOfPnt& Params) TColgp_SequenceOfPnt& Params)
{ {
Geom2dInt_GInter Intersector; Geom2dInt_GInter Intersector;
Standard_Real Tol = Precision::Confusion(); Standard_Real Tol = Precision::Confusion();
// Standard_Real TolC = 1.e-9; // Standard_Real TolC = 1.e-9;
Geom2dAdaptor_Curve CBis(Bis); Geom2dAdaptor_Curve CBis(Bis);
Geom2dAdaptor_Curve CAC (AC); Geom2dAdaptor_Curve CAC (AC);
@ -206,20 +210,20 @@ static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
U1 = Seg.FirstPoint().ParamOnSecond(); U1 = Seg.FirstPoint().ParamOnSecond();
Standard_Real Ulast = Seg.LastPoint().ParamOnSecond(); Standard_Real Ulast = Seg.LastPoint().ParamOnSecond();
if ( Abs(U1 - CBis.FirstParameter()) <= Tol && if ( Abs(U1 - CBis.FirstParameter()) <= Tol &&
Abs(Ulast - CBis.LastParameter()) <= Tol ) { Abs(Ulast - CBis.LastParameter()) <= Tol ) {
P = gp_Pnt(U1,Seg.FirstPoint().ParamOnFirst(),0.); P = gp_Pnt(U1,Seg.FirstPoint().ParamOnFirst(),0.);
Params.Append(P); Params.Append(P);
P = gp_Pnt(Ulast,Seg.LastPoint().ParamOnFirst(),0.); P = gp_Pnt(Ulast,Seg.LastPoint().ParamOnFirst(),0.);
Params.Append(P); Params.Append(P);
} }
else { else {
U1 += Seg.LastPoint().ParamOnSecond(); U1 += Seg.LastPoint().ParamOnSecond();
U1 /= 2.; U1 /= 2.;
U2 = Seg.FirstPoint().ParamOnFirst(); U2 = Seg.FirstPoint().ParamOnFirst();
U2 += Seg.LastPoint().ParamOnFirst(); U2 += Seg.LastPoint().ParamOnFirst();
U2 /= 2.; U2 /= 2.;
P = gp_Pnt(U1,U2,0.); P = gp_Pnt(U1,U2,0.);
Params.Append(P); Params.Append(P);
} }
} }
} }
@ -229,9 +233,9 @@ static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
} }
static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis, static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis,
const Geom2dAdaptor_Curve& AC, const Geom2dAdaptor_Curve& AC,
TColgp_SequenceOfPnt& Params, TColgp_SequenceOfPnt& Params,
const Standard_Real Tol) const Standard_Real Tol)
{ {
Geom2dInt_GInter Intersector; Geom2dInt_GInter Intersector;
Standard_Real TolC = Tol; Standard_Real TolC = Tol;
@ -270,20 +274,20 @@ static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis,
U1 = Seg.FirstPoint().ParamOnSecond(); U1 = Seg.FirstPoint().ParamOnSecond();
Standard_Real Ulast = Seg.LastPoint().ParamOnSecond(); Standard_Real Ulast = Seg.LastPoint().ParamOnSecond();
if ( Abs(U1 - CBis.FirstParameter()) <= Tol && if ( Abs(U1 - CBis.FirstParameter()) <= Tol &&
Abs(Ulast - CBis.LastParameter()) <= Tol ) { Abs(Ulast - CBis.LastParameter()) <= Tol ) {
P = gp_Pnt(U1,Seg.FirstPoint().ParamOnFirst(),0.); P = gp_Pnt(U1,Seg.FirstPoint().ParamOnFirst(),0.);
Params.Append(P); Params.Append(P);
P = gp_Pnt(Ulast,Seg.LastPoint().ParamOnFirst(),0.); P = gp_Pnt(Ulast,Seg.LastPoint().ParamOnFirst(),0.);
Params.Append(P); Params.Append(P);
} }
else { else {
U1 += Seg.LastPoint().ParamOnSecond(); U1 += Seg.LastPoint().ParamOnSecond();
U1 /= 2.; U1 /= 2.;
U2 = Seg.FirstPoint().ParamOnFirst(); U2 = Seg.FirstPoint().ParamOnFirst();
U2 += Seg.LastPoint().ParamOnFirst(); U2 += Seg.LastPoint().ParamOnFirst();
U2 /= 2.; U2 /= 2.;
P = gp_Pnt(U1,U2,0.); P = gp_Pnt(U1,U2,0.);
Params.Append(P); Params.Append(P);
} }
} }
} }
@ -299,8 +303,8 @@ static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis,
//======================================================================= //=======================================================================
void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1, void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
const TopoDS_Edge& Edge2, const TopoDS_Edge& Edge2,
TColgp_SequenceOfPnt& Params) TColgp_SequenceOfPnt& Params)
{ {
Params.Clear(); Params.Clear();
@ -318,23 +322,24 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
Geom2dAdaptor_Curve AC2(C2,f,l); Geom2dAdaptor_Curve AC2(C2,f,l);
#ifdef DRAW #ifdef DRAW
if ( Affich) { if ( AffichInt) {
f = AC1.FirstParameter(); f = AC1.FirstParameter();
l = AC1.LastParameter(); l = AC1.LastParameter();
char* CURVE1name = "CURVE1"; char name[32];
DrawTrSurf::Set(CURVE1name, new Geom2d_TrimmedCurve(C1,f,l)); sprintf(name,"C1_%d", ++intind);
DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(C1,f,l));
f = AC2.FirstParameter(); f = AC2.FirstParameter();
l = AC2.LastParameter(); l = AC2.LastParameter();
char* CURVE2name = "CURVE2"; sprintf(name,"C2_%d", intind);
DrawTrSurf::Set(CURVE2name, new Geom2d_TrimmedCurve(C2,f,l)); DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(C2,f,l));
f = myBis.FirstParameter(); f = myBis.FirstParameter();
l = myBis.LastParameter(); l = myBis.LastParameter();
char* bisname = "BIS"; sprintf(name,"BIS%d", intind);
DrawTrSurf::Set(bisname, new Geom2d_TrimmedCurve(myBis.Curve(),f,l)); DrawTrSurf::Set(name, new Geom2d_TrimmedCurve(myBis.Curve(),f,l));
char* Edge1name = "E1"; sprintf(name,"E1_%d", intind);
DBRep::Set(Edge1name, Edge1); DBRep::Set(name, Edge1);
char* Edge2name = "E2"; sprintf(name,"E2_%d", intind);
DBRep::Set(Edge2name, Edge2); DBRep::Set(name, Edge2);
} }
#endif #endif
@ -347,33 +352,91 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
EvalParameters (myBis,AC2,Points2); EvalParameters (myBis,AC2,Points2);
Standard_Integer SeanceDeRattrapage=0; Standard_Integer SeanceDeRattrapage=0;
Standard_Real TolInit= 1.e-9; Standard_Real TolInit= 1.e-9;
Standard_Integer nn = 7; Standard_Integer nn = 7;
if((AC1.GetType() != GeomAbs_Circle && AC1.GetType() != GeomAbs_Line) || if((AC1.GetType() != GeomAbs_Circle && AC1.GetType() != GeomAbs_Line) ||
(AC2.GetType() != GeomAbs_Circle && AC2.GetType() != GeomAbs_Line)) { (AC2.GetType() != GeomAbs_Circle && AC2.GetType() != GeomAbs_Line)) {
TolInit = 1.e-8; TolInit = 1.e-8;
nn = 6; nn = 6;
}
if(Params.IsEmpty() && Points2.IsEmpty())
{
//Check, may be there are no intersections at all
// for case myBis == Line
if(myBis.GetType() == GeomAbs_Line)
{
Standard_Real dmax = TolInit;
Standard_Integer n = 0;
while(n < nn)
{
dmax *= 10.0;
++n;
}
dmax *= dmax;
//
gp_Lin2d anL = myBis.Line();
Standard_Boolean isFar1 = Standard_True;
Standard_Boolean isFar2 = Standard_True;
gp_Pnt2d aP;
//
Standard_Real d = RealLast();
AC1.D0(AC1.FirstParameter(), aP);
Standard_Real par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
{
d = anL.SquareDistance(aP);
}
AC1.D0(AC1.LastParameter(), aP);
par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
{
d = Min(anL.SquareDistance(aP), d);
}
isFar1 = d > dmax;
//
d = RealLast();
AC2.D0(AC2.FirstParameter(), aP);
par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
{
d = anL.SquareDistance(aP);
}
AC2.D0(AC2.LastParameter(), aP);
par = ElCLib::Parameter(anL, aP);
if(par >= myBis.FirstParameter() && par <= myBis.LastParameter())
{
d = Min(anL.SquareDistance(aP), d);
}
isFar2 = d > dmax;
//
if(isFar1 && isFar2)
{
return;
}
}
} }
while ( SeanceDeRattrapage < nn // TolInit <= 0.01 while ( SeanceDeRattrapage < nn // TolInit <= 0.01
&& ( Points2.Length() != Params.Length() || && ( Points2.Length() != Params.Length() ||
(Points2.Length() == 0 && Params.Length() == 0) ) ) { (Points2.Length() == 0 && Params.Length() == 0) ) ) {
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
cout << "BRepFill_TrimEdgeTool: incoherent intersection. Try with a greater tolerance" << endl; cout << "BRepFill_TrimEdgeTool: incoherent intersection. Try with a greater tolerance" << endl;
#endif #endif
Params.Clear(); Params.Clear();
Points2.Clear(); Points2.Clear();
TolInit*=10.0; TolInit*=10.0;
EvalParametersBis(myBis,AC1,Params,TolInit); EvalParametersBis(myBis,AC1,Params,TolInit);
EvalParametersBis(myBis,AC2,Points2,TolInit); EvalParametersBis(myBis,AC2,Points2,TolInit);
SeanceDeRattrapage++; SeanceDeRattrapage++;
} }
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
@ -387,7 +450,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
if(Params.Length() == 0 && Points2.Length() == 1) { if(Params.Length() == 0 && Points2.Length() == 1) {
//cout << "Params.Length() == 0 && Points2.Length() == 1" << endl; //cout << "Params.Length() == 0 && Points2.Length() == 1" << endl;
Standard_Real dmin; Standard_Real dmin, dmax = 0.25*myOffset*myOffset;
Standard_Real tBis = Points2(1).X(); Standard_Real tBis = Points2(1).X();
gp_Pnt2d PBis = myBis.Value(tBis); gp_Pnt2d PBis = myBis.Value(tBis);
@ -395,19 +458,26 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
gp_Pnt2d PC = AC1.Value(t); gp_Pnt2d PC = AC1.Value(t);
dmin = PC.SquareDistance(PBis); dmin = PC.SquareDistance(PBis);
gp_Pnt P(tBis, t, 0.); gp_Pnt P(tBis, t, 0.);
Params.Append(P); if(dmin < dmax)
{
Params.Append(P);
}
t = AC1.LastParameter(); t = AC1.LastParameter();
PC = AC1.Value(t); PC = AC1.Value(t);
if(dmin > PC.SquareDistance(PBis)) { Standard_Real dmin1 = PC.SquareDistance(PBis);
if(dmin > dmin1 && dmin1 < dmax ) {
P.SetY(t); P.SetY(t);
Params.SetValue(1,P); if(Params.IsEmpty())
Params.Append(P);
else
Params.SetValue(1,P);
} }
} }
else if(Params.Length() == 1 && Points2.Length() == 0) { else if(Params.Length() == 1 && Points2.Length() == 0) {
//cout << "Params.Length() == 1 && Points2.Length() == 0" << endl; //cout << "Params.Length() == 1 && Points2.Length() == 0" << endl;
Standard_Real dmin; Standard_Real dmin, dmax = 0.25*myOffset*myOffset;
Standard_Real tBis = Params(1).X(); Standard_Real tBis = Params(1).X();
gp_Pnt2d PBis = myBis.Value(tBis); gp_Pnt2d PBis = myBis.Value(tBis);
@ -415,13 +485,20 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
gp_Pnt2d PC = AC2.Value(t); gp_Pnt2d PC = AC2.Value(t);
dmin = PC.SquareDistance(PBis); dmin = PC.SquareDistance(PBis);
gp_Pnt P(tBis, t, 0.); gp_Pnt P(tBis, t, 0.);
Points2.Append(P); if(dmin < dmax)
{
Points2.Append(P);
}
t = AC2.LastParameter(); t = AC2.LastParameter();
PC = AC2.Value(t); PC = AC2.Value(t);
if(dmin > PC.SquareDistance(PBis)) { Standard_Real dmin1 = PC.SquareDistance(PBis);
if(dmin > dmin1 && dmin1 < dmax ) {
P.SetY(t); P.SetY(t);
Points2.SetValue(1,P); if(Points2.IsEmpty())
Points2.Append(P);
else
Points2.SetValue(1,P);
} }
} }
@ -457,13 +534,13 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
#endif #endif
if(P1xP2x>TolInit) { if(P1xP2x>TolInit) {
#ifdef OCCT_DEBUG #ifdef OCCT_DEBUG
cout << "BRepFill_TrimEdgeTool: Continue somehow" << endl; cout << "BRepFill_TrimEdgeTool: Continue somehow" << endl;
#endif #endif
i++; i++;
} }
else { else {
if ( P1.X() < P2.X()) Params.Remove(i); if ( P1.X() < P2.X()) Params.Remove(i);
else Points2.Remove(i); else Points2.Remove(i);
} }
} }
else i++; else i++;
@ -492,10 +569,10 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
//======================================================================= //=======================================================================
void BRepFill_TrimEdgeTool::AddOrConfuse(const Standard_Boolean Start, void BRepFill_TrimEdgeTool::AddOrConfuse(const Standard_Boolean Start,
const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge1,
const TopoDS_Edge& Edge2, const TopoDS_Edge& Edge2,
TColgp_SequenceOfPnt& Params) TColgp_SequenceOfPnt& Params)
const const
{ {
Standard_Boolean ToProj = Standard_True; Standard_Boolean ToProj = Standard_True;
gp_Pnt2d PBis; gp_Pnt2d PBis;
@ -561,8 +638,8 @@ const
return; return;
} }
gp_Pnt PInt (0, gp_Pnt PInt (0,
Projector1.LowerDistanceParameter(), Projector1.LowerDistanceParameter(),
Projector2.LowerDistanceParameter()); Projector2.LowerDistanceParameter());
if (Start) { if (Start) {
PInt.SetX (myBis.FirstParameter()); PInt.SetX (myBis.FirstParameter());
Params.Prepend(PInt); Params.Prepend(PInt);
@ -581,10 +658,10 @@ const
Standard_Boolean BRepFill_TrimEdgeTool::IsInside(const gp_Pnt2d& P) const Standard_Boolean BRepFill_TrimEdgeTool::IsInside(const gp_Pnt2d& P) const
{ {
// Modified by Sergey KHROMOV - Fri Sep 27 11:43:12 2002 Begin // Modified by Sergey KHROMOV - Fri Sep 27 11:43:12 2002 Begin
// Standard_Real Dist; // Standard_Real Dist;
Standard_Real Dist = RealLast(); Standard_Real Dist = RealLast();
// Modified by Sergey KHROMOV - Fri Sep 27 11:43:12 2002 End // Modified by Sergey KHROMOV - Fri Sep 27 11:43:12 2002 End
if (isPoint1) if (isPoint1)
Dist = P.Distance(myP1); Dist = P.Distance(myP1);
else if (isPoint2) else if (isPoint2)
@ -594,26 +671,26 @@ Standard_Boolean BRepFill_TrimEdgeTool::IsInside(const gp_Pnt2d& P) const
if (Projector.NbPoints() > 0) { if (Projector.NbPoints() > 0) {
Dist = Projector.LowerDistance(); Dist = Projector.LowerDistance();
} }
// Modified by Sergey KHROMOV - Fri Sep 27 11:43:43 2002 Begin // Modified by Sergey KHROMOV - Fri Sep 27 11:43:43 2002 Begin
// else { // else {
// gp_Pnt2d PF = myC1->Value(myC1->FirstParameter()); // gp_Pnt2d PF = myC1->Value(myC1->FirstParameter());
// gp_Pnt2d PL = myC1->Value(myC1->LastParameter()); // gp_Pnt2d PL = myC1->Value(myC1->LastParameter());
// Dist = Min (P.Distance(PF),P.Distance(PL)); // Dist = Min (P.Distance(PF),P.Distance(PL));
// } // }
// Check of distances between P and first and last point of the first curve // Check of distances between P and first and last point of the first curve
// should be performed in any case, despite of the results of projection. // should be performed in any case, despite of the results of projection.
gp_Pnt2d PF = myC1->Value(myC1->FirstParameter()); gp_Pnt2d PF = myC1->Value(myC1->FirstParameter());
gp_Pnt2d PL = myC1->Value(myC1->LastParameter()); gp_Pnt2d PL = myC1->Value(myC1->LastParameter());
Standard_Real aDistMin = Min (P.Distance(PF),P.Distance(PL)); Standard_Real aDistMin = Min (P.Distance(PF),P.Distance(PL));
if (Dist > aDistMin) if (Dist > aDistMin)
Dist = aDistMin; Dist = aDistMin;
// Modified by Sergey KHROMOV - Fri Sep 27 11:43:44 2002 End // Modified by Sergey KHROMOV - Fri Sep 27 11:43:44 2002 End
} }
// return (Dist < Abs(myOffset); // return (Dist < Abs(myOffset);
// return (Dist < Abs(myOffset) + Precision::Confusion()); // return (Dist < Abs(myOffset) + Precision::Confusion());
return (Dist < Abs(myOffset) - Precision::Confusion()); return (Dist < Abs(myOffset) - Precision::Confusion());
} }

View File

@ -780,7 +780,13 @@ static void SetEdgeTol(const TopoDS_Edge& E,
gp_Pnt Pc3d = HC->Value(u); gp_Pnt Pc3d = HC->Value(u);
gp_Pnt2d p2d = pc->Value(u); gp_Pnt2d p2d = pc->Value(u);
gp_Pnt Pcons = ElSLib::Value(p2d.X(),p2d.Y(),pln); gp_Pnt Pcons = ElSLib::Value(p2d.X(),p2d.Y(),pln);
Standard_Real eps = Max(Pc3d.XYZ().SquareModulus(), Pcons.XYZ().SquareModulus());
eps = Epsilon(eps);
Standard_Real temp = Pc3d.SquareDistance(Pcons); Standard_Real temp = Pc3d.SquareDistance(Pcons);
if(temp <= eps)
{
temp = 0.;
}
if(temp > d2) d2 = temp; if(temp > d2) d2 = temp;
} }
d2 = 1.5*sqrt(d2); d2 = 1.5*sqrt(d2);

View File

@ -19,7 +19,7 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <math_Matrix.hxx> #include <math_Matrix.hxx>
#include <math_Vector.hxx> #include <math_Vector.hxx>
#include <math_Gauss.hxx> #include <math_Jacobi.hxx>
#include <gp_Lin.hxx> #include <gp_Lin.hxx>
#include <gp_Circ.hxx> #include <gp_Circ.hxx>
@ -45,6 +45,8 @@
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx> #include <TopoDS_Wire.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <BRep_Builder.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <GeomLib.hxx> #include <GeomLib.hxx>
#include <Geom2d_Curve.hxx> #include <Geom2d_Curve.hxx>
@ -58,7 +60,7 @@
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Real Controle(const TColgp_SequenceOfPnt& thePoints, static Standard_Real Controle(const TColgp_SequenceOfPnt& thePoints,
const Handle(Geom_Plane)& thePlane) const Handle(Geom_Plane)& thePlane)
{ {
Standard_Real dfMaxDist=0.; Standard_Real dfMaxDist=0.;
Standard_Real a,b,c,d, dist; Standard_Real a,b,c,d, dist;
@ -79,9 +81,9 @@ static Standard_Real Controle(const TColgp_SequenceOfPnt& thePoints,
// the first vertex of theEdge2 in parametric space of theFace // the first vertex of theEdge2 in parametric space of theFace
//======================================================================= //=======================================================================
inline static Standard_Boolean Is2DConnected(const TopoDS_Edge& theEdge1, inline static Standard_Boolean Is2DConnected(const TopoDS_Edge& theEdge1,
const TopoDS_Edge& theEdge2, const TopoDS_Edge& theEdge2,
const Handle(Geom_Surface)& theSurface, const Handle(Geom_Surface)& theSurface,
const TopLoc_Location& theLocation) const TopLoc_Location& theLocation)
{ {
Standard_Real f,l; Standard_Real f,l;
//TopLoc_Location aLoc; //TopLoc_Location aLoc;
@ -110,8 +112,8 @@ inline static Standard_Boolean Is2DConnected(const TopoDS_Edge& theEdge1,
//======================================================================= //=======================================================================
static Standard_Boolean Is2DClosed(const TopoDS_Shape& theShape, static Standard_Boolean Is2DClosed(const TopoDS_Shape& theShape,
const Handle(Geom_Surface)& theSurface, const Handle(Geom_Surface)& theSurface,
const TopLoc_Location& theLocation) const TopLoc_Location& theLocation)
{ {
try try
{ {
@ -164,9 +166,9 @@ BRepLib_FindSurface::BRepLib_FindSurface()
//purpose : //purpose :
//======================================================================= //=======================================================================
BRepLib_FindSurface::BRepLib_FindSurface(const TopoDS_Shape& S, BRepLib_FindSurface::BRepLib_FindSurface(const TopoDS_Shape& S,
const Standard_Real Tol, const Standard_Real Tol,
const Standard_Boolean OnlyPlane, const Standard_Boolean OnlyPlane,
const Standard_Boolean OnlyClosed) const Standard_Boolean OnlyClosed)
{ {
Init(S,Tol,OnlyPlane,OnlyClosed); Init(S,Tol,OnlyPlane,OnlyClosed);
} }
@ -175,9 +177,9 @@ BRepLib_FindSurface::BRepLib_FindSurface(const TopoDS_Shape& S,
//purpose : //purpose :
//======================================================================= //=======================================================================
void BRepLib_FindSurface::Init(const TopoDS_Shape& S, void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
const Standard_Real Tol, const Standard_Real Tol,
const Standard_Boolean OnlyPlane, const Standard_Boolean OnlyPlane,
const Standard_Boolean OnlyClosed) const Standard_Boolean OnlyClosed)
{ {
myTolerance = Tol; myTolerance = Tol;
myTolReached = 0.; myTolReached = 0.;
@ -331,27 +333,15 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
continue; continue;
else else
{ {
const Standard_Integer aNbPolMax = 200;
Standard_Integer incr = 1;
if(iNbPol > aNbPolMax)
{
Standard_Integer nb = iNbPol;
while(nb > aNbPolMax)
{
incr++;
nb = (iNbPol-1) / incr;
}
}
Handle(TColgp_HArray1OfPnt) aPoles = new (TColgp_HArray1OfPnt) (1, iNbPol); Handle(TColgp_HArray1OfPnt) aPoles = new (TColgp_HArray1OfPnt) (1, iNbPol);
GC->Poles(aPoles->ChangeArray1()); GC->Poles(aPoles->ChangeArray1());
gp_Pnt aPolePrev = aPoles->Value(1), aPoleNext; gp_Pnt aPolePrev = aPoles->Value(1), aPoleNext;
Standard_Real dfDistPrev = 0., dfDistNext; Standard_Real dfDistPrev = 0., dfDistNext;
Standard_Integer iPol; for (Standard_Integer iPol=1; iPol<=iNbPol; iPol++)
for (iPol = 1; iPol <= iNbPol; iPol += incr)
{ {
if (iPol <= iNbPol - incr) if (iPol<iNbPol)
{ {
aPoleNext = aPoles->Value(iPol+incr); aPoleNext = aPoles->Value(iPol+1);
dfDistNext = aPolePrev.Distance(aPoleNext); dfDistNext = aPolePrev.Distance(aPoleNext);
} }
else else
@ -436,50 +426,115 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
aMat(1,1)+=w*p.X()*p.X(); aMat(1,1)+=w*p.X()*p.X();
aMat(1,2)+=w*p.X()*p.Y(); aMat(1,2)+=w*p.X()*p.Y();
aMat(1,3)+=w*p.X()*p.Z(); aMat(1,3)+=w*p.X()*p.Z();
aMat(2,1)+=w*p.Y()*p.X(); //
aMat(2,2)+=w*p.Y()*p.Y(); aMat(2,2)+=w*p.Y()*p.Y();
aMat(2,3)+=w*p.Y()*p.Z(); aMat(2,3)+=w*p.Y()*p.Z();
aMat(3,1)+=w*p.Z()*p.X(); //
aMat(3,2)+=w*p.Z()*p.Y();
aMat(3,3)+=w*p.Z()*p.Z(); aMat(3,3)+=w*p.Z()*p.Z();
aVec(1) -= w*p.X(); }
aVec(2) -= w*p.Y(); aMat(2,1) = aMat(1,2);
aVec(3) -= w*p.Z(); aMat(3,1) = aMat(1,3);
aMat(3,2) = aMat(2,3);
//
math_Jacobi anEignval(aMat);
math_Vector anEVals(1,3);
Standard_Boolean isSolved = anEignval.IsDone();
Standard_Integer isol = 0;
if(isSolved)
{
anEVals = anEignval.Values();
//We need vector with eigenvalue ~ 0.
Standard_Real anEMin = RealLast();
Standard_Real anEMax = -anEMin;
for(i = 1; i <= 3; ++i)
{
Standard_Real anE = Abs(anEVals(i));
if(anEMin > anE)
{
anEMin = anE;
isol = i;
}
if(anEMax < anE)
{
anEMax = anE;
}
}
if(isol == 0)
{
isSolved = Standard_False;
}
else
{
Standard_Real eps = Epsilon(anEMax);
if(anEMin <= eps)
{
anEignval.Vector(isol, aVec);
}
else
{
//try using vector product of other axes
Standard_Integer ind[2] = {0,0};
for(i = 1; i <= 3; ++i)
{
if(i == isol)
{
continue;
}
if(ind[0] == 0)
{
ind[0] = i;
continue;
}
if(ind[1] == 0)
{
ind[1] = i;
continue;
}
}
math_Vector aVec1(1, 3, 0.), aVec2(1, 3, 0.);
anEignval.Vector(ind[0], aVec1);
anEignval.Vector(ind[1], aVec2);
gp_Vec aV1(aVec1(1), aVec1(2), aVec1(3));
gp_Vec aV2(aVec2(1), aVec2(2), aVec2(3));
gp_Vec aN = aV1^ aV2;
aVec(1) = aN.X();
aVec(2) = aN.Y();
aVec(3) = aN.Z();
}
if (aVec.Norm2() < gp::Resolution()) {
isSolved = Standard_False;
}
}
} }
// Solve the system of equations to get plane coefficients
math_Gauss aSolver(aMat);
Standard_Boolean isSolved = aSolver.IsDone();
// //
// let us be more tolerant (occ415) // let us be more tolerant (occ415)
Standard_Real dfDist = RealLast(); Standard_Real dfDist = RealLast();
Handle(Geom_Plane) aPlane; Handle(Geom_Plane) aPlane;
// //
if (isSolved) { if (isSolved) {
aSolver.Solve(aVec); //Plane normal can have two directions, direction is chosen
if (aVec.Norm2()<gp::Resolution()) { //according to direction of eigenvector
isSolved = Standard_False; gp_Vec anN(aVec(1), aVec(2), aVec(3));
} aPlane = new Geom_Plane(aBaryCenter,anN);
}
//
if (isSolved) {
aPlane = new Geom_Plane(aBaryCenter,gp_Dir(aVec(1),aVec(2),aVec(3)));
dfDist = Controle (aPoints, aPlane); dfDist = Controle (aPoints, aPlane);
} }
// //
if (!isSolved || myTolerance < dfDist) { if (!isSolved || myTolerance < dfDist) {
gp_Pnt aFirstPnt=aPoints(1); gp_Pnt aFirstPnt=aPoints(1);
for (iPoint=2; iPoint<=aPoints.Length(); iPoint++) { for (iPoint=2; iPoint<=aPoints.Length(); iPoint++) {
const gp_Pnt& aNextPnt = aPoints(iPoint); gp_Vec aDir(aFirstPnt,aPoints(iPoint));
gp_Vec aDir(aFirstPnt, aNextPnt);
Standard_Real dfSide=aDir.Magnitude(); Standard_Real dfSide=aDir.Magnitude();
if (dfSide<myTolerance) { if (dfSide<myTolerance) {
continue; // degeneration continue; // degeneration
} }
for (Standard_Integer iP1=iPoint+1; iP1<=aPoints.Length(); iP1++) { for (Standard_Integer iP1=iPoint+1; iP1<=aPoints.Length(); iP1++) {
gp_Vec aCross = gp_Vec(aFirstPnt,aPoints(iP1)) ^ aDir ;
gp_Vec aCross = gp_Vec(aFirstPnt,aPoints(iP1)) ^ aDir ;
if (aCross.Magnitude() > dfSide*myTolerance) { if (aCross.Magnitude() > dfSide*myTolerance) {
Handle(Geom_Plane) aPlane2 = new Geom_Plane(aFirstPnt, aCross); Handle(Geom_Plane) aPlane2 = new Geom_Plane(aBaryCenter, aCross);
Standard_Real dfDist2 = Controle (aPoints, aPlane2); Standard_Real dfDist2 = Controle (aPoints, aPlane2);
if (dfDist2 < myTolerance) { if (dfDist2 < myTolerance) {
myTolReached = dfDist2; myTolReached = dfDist2;
@ -504,6 +559,23 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S,
//myTolReached = dfDist; //myTolReached = dfDist;
//XXt //XXt
mySurface = aPlane; mySurface = aPlane;
//If S is wire, try to orient surface according to orientation of wire.
if(S.ShapeType() == TopAbs_WIRE && S.Closed())
{
//
TopoDS_Wire aW = TopoDS::Wire(S);
TopoDS_Face aTmpFace = BRepLib_MakeFace(mySurface, Precision::Confusion());
BRep_Builder BB;
BB.Add(aTmpFace, aW);
BRepTopAdaptor_FClass2d FClass(aTmpFace, 0.);
if ( FClass.PerformInfinitePoint() == TopAbs_IN )
{
gp_Dir aN = aPlane->Position().Direction();
aN.Reverse();
mySurface = new Geom_Plane(aPlane->Position().Location(), aN);
}
}
} }
//XXf //XXf
myTolReached = dfDist; myTolReached = dfDist;

View File

@ -39,14 +39,27 @@
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <BRepLib.hxx> #include <BRepLib.hxx>
#include <TopTools_IndexedDataMapOfShapeShape.hxx> #include <TopTools_IndexedDataMapOfShapeShape.hxx>
#include <GeomAbs_CurveType.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_Ellipse.hxx>
#include <Geom2d_Parabola.hxx>
#include <Geom2d_Hyperbola.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <GCE2d_MakeArcOfCircle.hxx>
#include <GCE2d_MakeSegment.hxx>
//
// Modified by Sergey KHROMOV - Thu Dec 5 10:38:14 2002 Begin // Modified by Sergey KHROMOV - Thu Dec 5 10:38:14 2002 Begin
static TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve, static TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve,
const TopoDS_Face &theFace, const TopoDS_Face &theFace,
const TopoDS_Vertex &theVFirst, const TopoDS_Vertex &theVFirst,
const TopoDS_Vertex &theVLast); const TopoDS_Vertex &theVLast);
// Modified by Sergey KHROMOV - Thu Dec 5 10:38:16 2002 End // Modified by Sergey KHROMOV - Thu Dec 5 10:38:16 2002 End
//
static GeomAbs_CurveType GetCurveType(const Handle(Geom2d_Curve)& theC2d);
static void AdjustCurveEnd(Handle(Geom2d_BoundedCurve)& theC2d, const gp_Pnt2d theP,
const Standard_Boolean isFirst);
//
//======================================================================= //=======================================================================
//function : BRepMAT2d_Explorer //function : BRepMAT2d_Explorer
//purpose : //purpose :
@ -79,7 +92,7 @@ void BRepMAT2d_Explorer::Perform(const TopoDS_Face& aFace)
TopoDS_Face F = TopoDS::Face(aFace); TopoDS_Face F = TopoDS::Face(aFace);
F.Orientation(TopAbs_FORWARD); F.Orientation(TopAbs_FORWARD);
TopExp_Explorer Exp (F,TopAbs_WIRE); TopExp_Explorer Exp (F,TopAbs_WIRE);
// Modified by Sergey KHROMOV - Tue Nov 26 16:10:37 2002 Begin // Modified by Sergey KHROMOV - Tue Nov 26 16:10:37 2002 Begin
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F); Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F);
TopoDS_Face aNewF = BRepBuilderAPI_MakeFace(aSurf, Precision::Confusion()); TopoDS_Face aNewF = BRepBuilderAPI_MakeFace(aSurf, Precision::Confusion());
@ -91,8 +104,8 @@ void BRepMAT2d_Explorer::Perform(const TopoDS_Face& aFace)
BRepLib::BuildCurves3d(aNewF); BRepLib::BuildCurves3d(aNewF);
myModifShapes.Add(aFace, aNewF); myModifShapes.Add(aFace, aNewF);
// CheckConnection(); // CheckConnection();
// Modified by Sergey KHROMOV - Tue Nov 26 16:10:38 2002 End // Modified by Sergey KHROMOV - Tue Nov 26 16:10:38 2002 End
} }
//======================================================================= //=======================================================================
@ -101,43 +114,43 @@ void BRepMAT2d_Explorer::Perform(const TopoDS_Face& aFace)
//======================================================================= //=======================================================================
void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine, void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
const TopoDS_Face& aFace, const TopoDS_Face& aFace,
TopoDS_Face& aNewFace) TopoDS_Face& aNewFace)
{ {
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin // Modified by Sergey KHROMOV - Tue Nov 26 14:25:46 2002 Begin
// This method is totally rewroted to include check // This method is totally rewroted to include check
// of connection and creation of a new spine. // of connection and creation of a new spine.
NewContour(); NewContour();
myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False; myIsClosed(currentContour) = (Spine.Closed()) ? Standard_True : Standard_False;
// Modified by skv - Wed Jun 23 12:23:01 2004 Integration Begin // Modified by skv - Wed Jun 23 12:23:01 2004 Integration Begin
// Taking into account side of bisecting loci construction. // Taking into account side of bisecting loci construction.
// TopoDS_Wire aWFwd = TopoDS::Wire(Spine.Oriented(TopAbs_FORWARD)); // TopoDS_Wire aWFwd = TopoDS::Wire(Spine.Oriented(TopAbs_FORWARD));
// BRepTools_WireExplorer anExp(aWFwd, aFace); // BRepTools_WireExplorer anExp(aWFwd, aFace);
BRepTools_WireExplorer anExp(Spine, aFace); BRepTools_WireExplorer anExp(Spine, aFace);
// Modified by skv - Wed Jun 23 12:23:02 2004 Integration End // Modified by skv - Wed Jun 23 12:23:02 2004 Integration End
TopTools_IndexedDataMapOfShapeShape anOldNewE; TopTools_IndexedDataMapOfShapeShape anOldNewE;
if (!anExp.More()) if (!anExp.More())
return; return;
TopoDS_Edge aFirstEdge = anExp.Current(); TopoDS_Edge aFirstEdge = anExp.Current();
TopoDS_Edge aPrevEdge = aFirstEdge;
Standard_Real UFirst,ULast, aD; Standard_Real UFirst,ULast, aD;
Handle(Geom2d_BSplineCurve) BCurve;
Handle(Geom2d_Curve) C2d; Handle(Geom2d_Curve) C2d;
Handle(Geom2d_TrimmedCurve) CT2d; Handle(Geom2d_TrimmedCurve) CT2d;
Handle(Geom2d_TrimmedCurve) aFirstCurve; Handle(Geom2d_TrimmedCurve) aFirstCurve;
gp_Pnt2d aPFirst; gp_Pnt2d aPFirst;
gp_Pnt2d aPLast; gp_Pnt2d aPLast;
gp_Pnt2d aPCurFirst; gp_Pnt2d aPCurFirst;
// Modified by skv - Mon Jul 11 19:00:25 2005 Integration Begin // Modified by skv - Mon Jul 11 19:00:25 2005 Integration Begin
// Set the confusion tolerance in accordance with the further algo // Set the confusion tolerance in accordance with the further algo
// Standard_Real aTolConf = Precision::Confusion(); // Standard_Real aTolConf = Precision::Confusion();
Standard_Real aTolConf = 1.e-8; Standard_Real aTolConf = 1.e-8;
// Modified by skv - Mon Jul 11 19:00:25 2005 Integration End // Modified by skv - Mon Jul 11 19:00:25 2005 Integration End
Standard_Boolean isModif = Standard_False; Standard_Boolean isModif = Standard_False;
// Treatment of the first edge of a wire. // Treatment of the first edge of a wire.
anOldNewE.Add(aFirstEdge, aFirstEdge); anOldNewE.Add(aFirstEdge, aFirstEdge);
C2d = BRep_Tool::CurveOnSurface (aFirstEdge, aFace, UFirst, ULast); C2d = BRep_Tool::CurveOnSurface (aFirstEdge, aFace, UFirst, ULast);
CT2d = new Geom2d_TrimmedCurve(C2d,UFirst,ULast); CT2d = new Geom2d_TrimmedCurve(C2d,UFirst,ULast);
@ -152,7 +165,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
aFirstCurve = CT2d; aFirstCurve = CT2d;
anExp.Next(); anExp.Next();
// Treatment of the next edges: // Treatment of the next edges:
for (; anExp.More(); anExp.Next()) { for (; anExp.More(); anExp.Next()) {
TopoDS_Edge anEdge = anExp.Current(); TopoDS_Edge anEdge = anExp.Current();
@ -175,64 +188,111 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
// code should be rewritten. // code should be rewritten.
isModif = Standard_True; isModif = Standard_True;
// //
//modified by NIZNHY-PKV Tue Aug 7 09:14:03 2007f Standard_Integer aNbC = theCurves.Value(currentContour).Length();
//BCurve = Geom2dConvert::CurveToBSplineCurve(CT2d); Handle(Geom2d_BoundedCurve) CPrev =
BCurve=Geom2dConvert::CurveToBSplineCurve(CT2d, Convert_QuasiAngular); Handle(Geom2d_BoundedCurve)::DownCast(theCurves.ChangeValue(currentContour).ChangeValue(aNbC));
//modified by NIZNHY-PKV Tue Aug 7 09:14:07 2007t //
GeomAbs_CurveType TCPrev = GetCurveType(CPrev);
GeomAbs_CurveType TCCurr = GetCurveType(CT2d);
//
if(TCCurr <= TCPrev)
{
AdjustCurveEnd(CT2d, aPLast, Standard_True);
// Creation of new edge.
TopoDS_Edge aNewEdge;
TopoDS_Vertex aVf = TopExp::FirstVertex(anEdge);
TopoDS_Vertex aVl = TopExp::LastVertex(anEdge);
BCurve->SetPole(1, aPLast); if (anEdge.Orientation() == TopAbs_FORWARD)
CT2d = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(), aNewEdge = MakeEdge(CT2d, aNewFace, aVf, aVl);
BCurve->LastParameter()); else
aNewEdge = MakeEdge(CT2d->Reversed(), aNewFace, aVf, aVl);
// Creation of new edge. aNewEdge.Orientation(anEdge.Orientation());
TopoDS_Edge aNewEdge;
TopoDS_Vertex aVf = TopExp::FirstVertex(anEdge);
TopoDS_Vertex aVl = TopExp::LastVertex(anEdge);
if (anEdge.Orientation() == TopAbs_FORWARD) anOldNewE.ChangeFromKey(anEdge) = aNewEdge;
aNewEdge = MakeEdge(CT2d, aNewFace, aVf, aVl); }
else else
aNewEdge = MakeEdge(CT2d->Reversed(), aNewFace, aVf, aVl); {
gp_Pnt2d aP = CT2d->Value(CT2d->FirstParameter());
AdjustCurveEnd(CPrev, aP, Standard_False);
theCurves.ChangeValue(currentContour).ChangeValue(aNbC) = CPrev;
//Change previous edge
TopoDS_Edge aNewEdge;
TopoDS_Vertex aVf = TopExp::FirstVertex(aPrevEdge);
TopoDS_Vertex aVl = TopExp::LastVertex(aPrevEdge);
aNewEdge.Orientation(anEdge.Orientation()); if (aPrevEdge.Orientation() == TopAbs_FORWARD)
aNewEdge = MakeEdge(CPrev, aNewFace, aVf, aVl);
else
aNewEdge = MakeEdge(CPrev->Reversed(), aNewFace, aVf, aVl);
aNewEdge.Orientation(aPrevEdge.Orientation());
anOldNewE.ChangeFromKey(aPrevEdge) = aNewEdge;
}
anOldNewE.ChangeFromKey(anEdge) = aNewEdge;
} }
aPLast = CT2d->Value(CT2d->LastParameter()); aPLast = CT2d->Value(CT2d->LastParameter());
Add(CT2d); Add(CT2d);
aPrevEdge = anEdge;
} }
// Check of the distance between the first and the last point of wire // Check of the distance between the first and the last point of wire
// if the wire is closed. // if the wire is closed.
if (myIsClosed(currentContour) && aPLast.Distance(aPFirst) > aTolConf) { if (myIsClosed(currentContour) && aPLast.Distance(aPFirst) > aTolConf) {
isModif = Standard_True; isModif = Standard_True;
//
//modified by NIZNHY-PKV Tue Aug 7 09:20:08 2007f Standard_Integer aNbC = theCurves.Value(currentContour).Length();
//Handle(Geom2d_BSplineCurve) Handle(Geom2d_BoundedCurve) CPrev =
//BCurve = Geom2dConvert::CurveToBSplineCurve(aFirstCurve); Handle(Geom2d_BoundedCurve)::DownCast(theCurves.ChangeValue(currentContour).ChangeValue(aNbC));
BCurve = Geom2dConvert::CurveToBSplineCurve(aFirstCurve, Convert_QuasiAngular); //
//modified by NIZNHY-PKV Tue Aug 7 09:20:11 2007t GeomAbs_CurveType TCPrev = GetCurveType(CPrev);
GeomAbs_CurveType TCCurr = GetCurveType(aFirstCurve);
BCurve->SetPole(1, aPLast); //
aFirstCurve = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(), if(TCCurr <= TCPrev)
BCurve->LastParameter()); {
AdjustCurveEnd(aFirstCurve, aPLast, Standard_True);
theCurves.ChangeValue(currentContour).ChangeValue(1) = aFirstCurve; theCurves.ChangeValue(currentContour).ChangeValue(1) = aFirstCurve;
// Creation of new edge.
// Creation of new first edge.
TopoDS_Edge aNewEdge; TopoDS_Edge aNewEdge;
TopoDS_Vertex aVf = TopExp::FirstVertex(aFirstEdge); TopoDS_Vertex aVf = TopExp::FirstVertex(aFirstEdge);
TopoDS_Vertex aVl = TopExp::LastVertex(aFirstEdge); TopoDS_Vertex aVl = TopExp::LastVertex(aFirstEdge);
if (aFirstEdge.Orientation() == TopAbs_FORWARD) if (aFirstEdge.Orientation() == TopAbs_FORWARD)
aNewEdge = MakeEdge(aFirstCurve, aNewFace, aVf, aVl); aNewEdge = MakeEdge(aFirstCurve, aNewFace, aVf, aVl);
else else
aNewEdge = MakeEdge(aFirstCurve->Reversed(), aNewFace, aVf, aVl); aNewEdge = MakeEdge(aFirstCurve->Reversed(), aNewFace, aVf, aVl);
aNewEdge.Orientation(aFirstEdge.Orientation()); aNewEdge.Orientation(aFirstEdge.Orientation());
anOldNewE.ChangeFromKey(aFirstEdge) = aNewEdge; anOldNewE.ChangeFromKey(aFirstEdge) = aNewEdge;
} }
else
{
gp_Pnt2d aP = aFirstCurve->Value(aFirstCurve->FirstParameter());
AdjustCurveEnd(CPrev, aP, Standard_False);
theCurves.ChangeValue(currentContour).ChangeValue(aNbC) = CPrev;
//Change previous edge
TopoDS_Edge aNewEdge;
TopoDS_Vertex aVf = TopExp::FirstVertex(aPrevEdge);
TopoDS_Vertex aVl = TopExp::LastVertex(aPrevEdge);
if (aPrevEdge.Orientation() == TopAbs_FORWARD)
aNewEdge = MakeEdge(CPrev, aNewFace, aVf, aVl);
else
aNewEdge = MakeEdge(CPrev->Reversed(), aNewFace, aVf, aVl);
aNewEdge.Orientation(aPrevEdge.Orientation());
anOldNewE.ChangeFromKey(aPrevEdge) = aNewEdge;
}
}
TopoDS_Wire aNewWire; TopoDS_Wire aNewWire;
BRep_Builder aBuilder; BRep_Builder aBuilder;
@ -263,7 +323,7 @@ void BRepMAT2d_Explorer::Add(const TopoDS_Wire& Spine,
aNewWire = Spine; aNewWire = Spine;
aBuilder.Add(aNewFace, aNewWire); aBuilder.Add(aNewFace, aNewWire);
// Modified by Sergey KHROMOV - Tue Nov 26 14:25:53 2002 End // Modified by Sergey KHROMOV - Tue Nov 26 14:25:53 2002 End
} }
//======================================================================= //=======================================================================
@ -302,10 +362,10 @@ void BRepMAT2d_Explorer::Clear()
{ {
theCurves.Clear() ; theCurves.Clear() ;
currentContour = 0; currentContour = 0;
// Modified by Sergey KHROMOV - Wed Mar 6 16:07:55 2002 Begin // Modified by Sergey KHROMOV - Wed Mar 6 16:07:55 2002 Begin
myIsClosed.Clear(); myIsClosed.Clear();
myModifShapes.Clear(); myModifShapes.Clear();
// Modified by Sergey KHROMOV - Wed Mar 6 16:07:55 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 16:07:55 2002 End
} }
@ -318,9 +378,9 @@ void BRepMAT2d_Explorer::NewContour()
{ {
TColGeom2d_SequenceOfCurve Contour; TColGeom2d_SequenceOfCurve Contour;
theCurves.Append(Contour); theCurves.Append(Contour);
// Modified by Sergey KHROMOV - Wed Mar 6 16:12:05 2002 Begin // Modified by Sergey KHROMOV - Wed Mar 6 16:12:05 2002 Begin
myIsClosed.Append(Standard_False); myIsClosed.Append(Standard_False);
// Modified by Sergey KHROMOV - Wed Mar 6 16:12:05 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 16:12:05 2002 End
currentContour ++ ; currentContour ++ ;
} }
@ -353,7 +413,7 @@ Standard_Integer BRepMAT2d_Explorer::NumberOfContours() const
Standard_Integer BRepMAT2d_Explorer::NumberOfCurves Standard_Integer BRepMAT2d_Explorer::NumberOfCurves
(const Standard_Integer IndexContour) (const Standard_Integer IndexContour)
const const
{ {
return theCurves.Value(IndexContour).Length(); return theCurves.Value(IndexContour).Length();
} }
@ -421,7 +481,7 @@ TopoDS_Shape BRepMAT2d_Explorer::Shape() const
const TColGeom2d_SequenceOfCurve& BRepMAT2d_Explorer::Contour const TColGeom2d_SequenceOfCurve& BRepMAT2d_Explorer::Contour
(const Standard_Integer IC) (const Standard_Integer IC)
const const
{ {
return theCurves.Value(IC); return theCurves.Value(IC);
} }
@ -434,7 +494,7 @@ const
//======================================================================= //=======================================================================
Standard_Boolean BRepMAT2d_Explorer::IsModified Standard_Boolean BRepMAT2d_Explorer::IsModified
(const TopoDS_Shape &aShape) const (const TopoDS_Shape &aShape) const
{ {
if (myModifShapes.Contains(aShape)) { if (myModifShapes.Contains(aShape)) {
const TopoDS_Shape &aNewShape = myModifShapes.FindFromKey(aShape); const TopoDS_Shape &aNewShape = myModifShapes.FindFromKey(aShape);
@ -452,7 +512,7 @@ Standard_Boolean BRepMAT2d_Explorer::IsModified
//======================================================================= //=======================================================================
TopoDS_Shape BRepMAT2d_Explorer::ModifiedShape TopoDS_Shape BRepMAT2d_Explorer::ModifiedShape
(const TopoDS_Shape &aShape) const (const TopoDS_Shape &aShape) const
{ {
if (myModifShapes.Contains(aShape)) { if (myModifShapes.Contains(aShape)) {
const TopoDS_Shape &aNewShape = myModifShapes.FindFromKey(aShape); const TopoDS_Shape &aNewShape = myModifShapes.FindFromKey(aShape);
@ -479,9 +539,9 @@ const TColStd_SequenceOfBoolean &BRepMAT2d_Explorer::GetIsClosed() const
//======================================================================= //=======================================================================
TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve, TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve,
const TopoDS_Face &theFace, const TopoDS_Face &theFace,
const TopoDS_Vertex &theVFirst, const TopoDS_Vertex &theVFirst,
const TopoDS_Vertex &theVLast) const TopoDS_Vertex &theVLast)
{ {
TopoDS_Edge aNewEdge; TopoDS_Edge aNewEdge;
BRep_Builder aBuilder; BRep_Builder aBuilder;
@ -498,3 +558,85 @@ TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve,
return aNewEdge; return aNewEdge;
} }
// Modified by Sergey KHROMOV - Wed Mar 6 17:40:14 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 17:40:14 2002 End
//
//=======================================================================
//function : GetCurveType
//purpose : Get curve type.
//=======================================================================
GeomAbs_CurveType GetCurveType(const Handle(Geom2d_Curve)& theC2d)
{
GeomAbs_CurveType aTypeCurve = GeomAbs_OtherCurve;
Handle(Standard_Type) TheType = theC2d->DynamicType();
if ( TheType == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
TheType = (*((Handle(Geom2d_TrimmedCurve)*)&theC2d))->BasisCurve()->DynamicType();
}
if ( TheType == STANDARD_TYPE(Geom2d_Circle)) {
aTypeCurve = GeomAbs_Circle;
}
else if ( TheType ==STANDARD_TYPE(Geom2d_Line)) {
aTypeCurve = GeomAbs_Line;
}
else if ( TheType == STANDARD_TYPE(Geom2d_Ellipse)) {
aTypeCurve = GeomAbs_Ellipse;
}
else if ( TheType == STANDARD_TYPE(Geom2d_Parabola)) {
aTypeCurve = GeomAbs_Parabola;
}
else if ( TheType == STANDARD_TYPE(Geom2d_Hyperbola)) {
aTypeCurve = GeomAbs_Hyperbola;
}
else if ( TheType == STANDARD_TYPE(Geom2d_BezierCurve)) {
aTypeCurve = GeomAbs_BezierCurve;
}
else if ( TheType == STANDARD_TYPE(Geom2d_BSplineCurve)) {
aTypeCurve = GeomAbs_BSplineCurve;
}
else {
aTypeCurve = GeomAbs_OtherCurve;
}
return aTypeCurve;
}
//=======================================================================
//function : AdjustCurveEnd
//purpose :
//=======================================================================
void AdjustCurveEnd(Handle(Geom2d_BoundedCurve)& theC2d, const gp_Pnt2d theP,
const Standard_Boolean isFirst)
{
GeomAbs_CurveType aType = GetCurveType(theC2d);
if(aType == GeomAbs_Line)
{
//create new line
if(isFirst)
{
gp_Pnt2d aP = theC2d->Value(theC2d->LastParameter());
theC2d = GCE2d_MakeSegment(theP, aP);
}
else
{
gp_Pnt2d aP = theC2d->Value(theC2d->FirstParameter());
theC2d = GCE2d_MakeSegment(aP, theP);
}
}
else
{
//Convert to BSpline and adjust first pole
Handle(Geom2d_BSplineCurve) BCurve =
Geom2dConvert::CurveToBSplineCurve(theC2d, Convert_QuasiAngular);
if(isFirst)
{
BCurve->SetPole(1, theP);
theC2d = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(),
BCurve->LastParameter());
}
else
{
BCurve->SetPole(BCurve->NbPoles(), theP);
theC2d = new Geom2d_TrimmedCurve(BCurve, BCurve->FirstParameter(),
BCurve->LastParameter());
}
}
}

View File

@ -36,6 +36,10 @@
#include <TopoDS_Wire.hxx> #include <TopoDS_Wire.hxx>
#include <StdFail_NotDone.hxx> #include <StdFail_NotDone.hxx>
#ifdef OCCT_DEBUG
#include <BRepTools.hxx>
static Standard_Boolean AffichSpine = Standard_False;
#endif
//======================================================================= //=======================================================================
//function : BRepOffsetAPI_MakeOffset //function : BRepOffsetAPI_MakeOffset
@ -183,8 +187,20 @@ static void BuildDomains(TopoDS_Face& myFace,
StdFail_NotDone::Raise ("BRepOffsetAPI_MakeOffset : Build Domains"); StdFail_NotDone::Raise ("BRepOffsetAPI_MakeOffset : Build Domains");
} }
TopTools_ListOfShape Faces; TopTools_ListOfShape Faces;
#ifdef OCCT_DEBUG
Standard_Integer ns = 0;
#endif
for (; FR.More(); FR.Next()) { for (; FR.More(); FR.Next()) {
Faces.Append(FR.Current()); Faces.Append(FR.Current());
#ifdef OCCT_DEBUG
if(AffichSpine)
{
char name[32];
ns++;
sprintf(name, "FR%d",ns);
BRepTools::Write(FR.Current(), name);
}
#endif
} }
//=========================================== //===========================================

View File

@ -21,6 +21,7 @@
#include <Geom2d_Point.hxx> #include <Geom2d_Point.hxx>
#include <Geom2d_CartesianPoint.hxx> #include <Geom2d_CartesianPoint.hxx>
#include <Geom2d_TrimmedCurve.hxx> #include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <gp.hxx> #include <gp.hxx>
#include <gp_Pnt2d.hxx> #include <gp_Pnt2d.hxx>
#include <gp_Vec2d.hxx> #include <gp_Vec2d.hxx>
@ -31,21 +32,27 @@
#include <Bisector_BisecAna.hxx> #include <Bisector_BisecAna.hxx>
#include <Bisector_BisecPC.hxx> #include <Bisector_BisecPC.hxx>
#include <Bisector_BisecCC.hxx> #include <Bisector_BisecCC.hxx>
#include <GCE2d_MakeSegment.hxx>
/* #ifdef OCCT_DEBUG
//#define DRAW
#ifdef DRAW
#include <DrawTrSurf.hxx> #include <DrawTrSurf.hxx>
static char tname[100]; #pragma comment(lib, "TKDraw.lib")
static Standard_CString name = tname ; static char name[100];
static Standard_Integer nbb = 0; static Standard_Integer nbb = 0;
*/ static Standard_Boolean Affich = Standard_False;
#endif
#endif
static Standard_Boolean IsMaxRC (const Handle(Geom2d_Curve)& C, static Standard_Boolean IsMaxRC (const Handle(Geom2d_Curve)& C,
Standard_Real U, Standard_Real U,
Standard_Real& R); Standard_Real& R);
static void ReplaceByLineIfIsToSmall (Handle(Geom2d_Curve)& Bis, static void ReplaceByLineIfIsToSmall (Handle(Geom2d_Curve)& Bis,
Standard_Real& UFirst, Standard_Real& UFirst,
Standard_Real& ULast); Standard_Real& ULast);
//============================================================================= //=============================================================================
//function : Empty Constructor //function : Empty Constructor
//============================================================================= //=============================================================================
@ -66,13 +73,13 @@ Bisector_Bisec::Bisector_Bisec()
//=========================================================================== //===========================================================================
void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve , void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
const Handle(Geom2d_Curve)& asecondcurve , const Handle(Geom2d_Curve)& asecondcurve ,
const gp_Pnt2d& apoint , const gp_Pnt2d& apoint ,
const gp_Vec2d& afirstvector , const gp_Vec2d& afirstvector ,
const gp_Vec2d& asecondvector , const gp_Vec2d& asecondvector ,
const Standard_Real adirection , const Standard_Real adirection ,
const Standard_Real tolerance , const Standard_Real tolerance ,
const Standard_Boolean oncurve ) const Standard_Boolean oncurve )
{ {
Handle(Standard_Type) Type1 = afirstcurve ->DynamicType(); Handle(Standard_Type) Type1 = afirstcurve ->DynamicType();
Handle(Standard_Type) Type2 = asecondcurve->DynamicType(); Handle(Standard_Type) Type2 = asecondcurve->DynamicType();
@ -81,33 +88,82 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
if (Type1 == STANDARD_TYPE(Geom2d_TrimmedCurve)) { if (Type1 == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
Type1 = Handle(Geom2d_TrimmedCurve)::DownCast(afirstcurve) Type1 = Handle(Geom2d_TrimmedCurve)::DownCast(afirstcurve)
->BasisCurve()->DynamicType(); ->BasisCurve()->DynamicType();
} }
if (Type2 == STANDARD_TYPE(Geom2d_TrimmedCurve)) { if (Type2 == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
Type2 = Handle(Geom2d_TrimmedCurve)::DownCast(asecondcurve) Type2 = Handle(Geom2d_TrimmedCurve)::DownCast(asecondcurve)
->BasisCurve()->DynamicType(); ->BasisCurve()->DynamicType();
}
Handle(Geom2d_Curve) afirstcurve1 = afirstcurve;
Handle(Geom2d_Curve) asecondcurve1 = asecondcurve;
if(Type1 == STANDARD_TYPE(Geom2d_BSplineCurve))
{
Handle(Geom2d_BSplineCurve) aBS;
if(afirstcurve->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
aBS = Handle(Geom2d_BSplineCurve)::DownCast(Handle(Geom2d_TrimmedCurve)::DownCast(afirstcurve)
->BasisCurve());
}
else
{
aBS = Handle(Geom2d_BSplineCurve)::DownCast(afirstcurve);
}
if(aBS->Degree() == 1 && aBS->NbPoles() == 2)
{
if(aBS->Pole(1).Distance(aBS->Pole(2)) < 1.e-4)
{
afirstcurve1 = GCE2d_MakeSegment(aBS->Pole(1), aBS->Pole(2));
Type1 = STANDARD_TYPE(Geom2d_Line);
}
}
}
if(Type2 == STANDARD_TYPE(Geom2d_BSplineCurve))
{
Handle(Geom2d_BSplineCurve) aBS;
if(asecondcurve->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
aBS = Handle(Geom2d_BSplineCurve)::DownCast(Handle(Geom2d_TrimmedCurve)::DownCast(asecondcurve)
->BasisCurve());
}
else
{
aBS = Handle(Geom2d_BSplineCurve)::DownCast(asecondcurve);
}
if(aBS->Degree() == 1 && aBS->NbPoles() == 2)
{
if(aBS->Pole(1).Distance(aBS->Pole(2)) < 1.e-4)
{
asecondcurve1 = GCE2d_MakeSegment(aBS->Pole(1), aBS->Pole(2));
Type2 = STANDARD_TYPE(Geom2d_Line);
}
}
} }
if ( (Type1 == STANDARD_TYPE(Geom2d_Circle) || Type1 == STANDARD_TYPE(Geom2d_Line)) && if ( (Type1 == STANDARD_TYPE(Geom2d_Circle) || Type1 == STANDARD_TYPE(Geom2d_Line)) &&
(Type2 == STANDARD_TYPE(Geom2d_Circle) || Type2 == STANDARD_TYPE(Geom2d_Line)) ) { (Type2 == STANDARD_TYPE(Geom2d_Circle) || Type2 == STANDARD_TYPE(Geom2d_Line)) )
{
//------------------------------------------------------------------ //------------------------------------------------------------------
// Analytic Bissectrice. // Analytic Bissectrice.
//------------------------------------------------------------------ //------------------------------------------------------------------
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna(); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna();
BisAna->Perform(afirstcurve , BisAna->Perform(afirstcurve1 ,
asecondcurve , asecondcurve1 ,
apoint , apoint ,
afirstvector , afirstvector ,
asecondvector , asecondvector ,
adirection , adirection ,
tolerance , tolerance ,
oncurve ); oncurve );
UFirst = BisAna->ParameterOfStartPoint(); UFirst = BisAna->ParameterOfStartPoint();
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
} }
else { else {
Standard_Boolean IsLine = Standard_False; Standard_Boolean IsLine = Standard_False;
if (oncurve) { if (oncurve) {
gp_Dir2d Fd(afirstvector); gp_Dir2d Fd(afirstvector);
@ -115,7 +171,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
//if (Fd.Dot(Sd) < Precision::Angular() - 1.) { //if (Fd.Dot(Sd) < Precision::Angular() - 1.) {
//if (Fd.Dot(Sd) < 10*Precision::Angular() - 1.) //patch //if (Fd.Dot(Sd) < 10*Precision::Angular() - 1.) //patch
if (Fd.Dot(Sd) < Sqrt(2.*Precision::Angular()) - 1.) if (Fd.Dot(Sd) < Sqrt(2.*Precision::Angular()) - 1.)
IsLine = Standard_True; IsLine = Standard_True;
} }
if (IsLine) { if (IsLine) {
//------------------------------------------------------------------ //------------------------------------------------------------------
@ -125,7 +181,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
Handle (Geom2d_CartesianPoint) PG = new Geom2d_CartesianPoint(apoint); Handle (Geom2d_CartesianPoint) PG = new Geom2d_CartesianPoint(apoint);
Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N); Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N);
Handle (Geom2d_TrimmedCurve) Handle (Geom2d_TrimmedCurve)
BisL = new Geom2d_TrimmedCurve (L,0,Precision::Infinite()); BisL = new Geom2d_TrimmedCurve (L,0,Precision::Infinite());
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna (); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna ();
BisAna->Init(BisL); BisAna->Init(BisL);
UFirst = BisAna->ParameterOfStartPoint(); UFirst = BisAna->ParameterOfStartPoint();
@ -137,58 +193,78 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
// Bissectrice algo // Bissectrice algo
//------------------------------------------------------------------- //-------------------------------------------------------------------
Handle(Bisector_BisecCC) BisCC = new Bisector_BisecCC(); Handle(Bisector_BisecCC) BisCC = new Bisector_BisecCC();
BisCC -> Perform(asecondcurve, BisCC -> Perform(asecondcurve1,
afirstcurve , afirstcurve1 ,
adirection , adirection ,
adirection , adirection ,
apoint); apoint);
if (BisCC -> IsEmpty()) { if (BisCC -> IsEmpty()) {
// bissectrice is empty. a point is projected at the end of the guide curve. // bissectrice is empty. a point is projected at the end of the guide curve.
// Construction of a false bissectrice. // Construction of a false bissectrice.
// modified by NIZHNY-EAP Mon Feb 21 12:00:13 2000 ___BEGIN___ // modified by NIZHNY-EAP Mon Feb 21 12:00:13 2000 ___BEGIN___
gp_Dir2d dir1(afirstvector), dir2(asecondvector); gp_Pnt2d aP1 = afirstcurve1->Value(afirstcurve1->LastParameter());
Standard_Real gp_Pnt2d aP2 = asecondcurve1->Value(asecondcurve1->FirstParameter());
Nx = - dir1.X() - dir2.X(), gp_Pnt2d aPm(.5*(aP1.XY()+aP2.XY()));
Ny = - dir1.Y() - dir2.Y(); Standard_Real Nx, Ny;
if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) { if(aPm.Distance(apoint) > 10.*Precision::Confusion())
Nx = - afirstvector.Y(); {
Ny = afirstvector.X(); Nx = apoint.X() - aPm.X();
} Ny = apoint.Y() - aPm.Y();
//gp_Dir2d N ( - adirection*afirstvector.Y(), adirection*afirstvector.X()); if(adirection < 0)
gp_Dir2d N ( adirection*Nx, adirection*Ny); {
// modified by NIZHNY-EAP Mon Feb 21 12:00:19 2000 ___END___ Nx = -Nx;
Ny = -Ny;
}
}
else
{
gp_Dir2d dir1(afirstvector), dir2(asecondvector);
Nx = - dir1.X() - dir2.X(),
Ny = - dir1.Y() - dir2.Y();
if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) {
Nx = -afirstvector.Y();
Ny = afirstvector.X();
}
}
gp_Dir2d N ( adirection*Nx, adirection*Ny);
// modified by NIZHNY-EAP Mon Feb 21 12:00:19 2000 ___END___
Handle (Geom2d_CartesianPoint) PG = new Geom2d_CartesianPoint(apoint); Handle (Geom2d_CartesianPoint) PG = new Geom2d_CartesianPoint(apoint);
Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N); Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N);
Handle (Geom2d_TrimmedCurve) Handle (Geom2d_TrimmedCurve)
BisL = new Geom2d_TrimmedCurve (L,0,Precision::Infinite()); BisL = new Geom2d_TrimmedCurve (L,0,Precision::Infinite());
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna (); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna ();
BisAna->Init(BisL); BisAna->Init(BisL);
UFirst = BisAna->ParameterOfStartPoint(); UFirst = BisAna->ParameterOfStartPoint();
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
} }
else { else {
UFirst = BisCC->FirstParameter(); UFirst = BisCC->FirstParameter();
ULast = BisCC->LastParameter (); ULast = BisCC->LastParameter ();
Bis = BisCC; Bis = BisCC;
ReplaceByLineIfIsToSmall(Bis,UFirst,ULast); ReplaceByLineIfIsToSmall(Bis,UFirst,ULast);
} }
} }
} }
UFirst = Max(UFirst, Bis->FirstParameter());
ULast = Min(ULast, Bis->LastParameter());
thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast); thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast);
#ifdef DRAW
if(Affich)
{
sprintf( name, "c1_%d", ++nbb );
DrawTrSurf::Set( name, afirstcurve );
sprintf( name, "c2_%d", nbb );
DrawTrSurf::Set( name, asecondcurve );
sprintf( name, "p%d", nbb );
DrawTrSurf::Set( name, apoint );
sprintf( name, "b%d", nbb );
DrawTrSurf::Set( name, thebisector );
}
#endif
/*
sprintf( name, "c1_%d", ++nbb );
DrawTrSurf::Set( name, afirstcurve );
sprintf( name, "c2_%d", nbb );
DrawTrSurf::Set( name, asecondcurve );
sprintf( name, "p%d", nbb );
DrawTrSurf::Set( name, apoint );
sprintf( name, "b%d", nbb );
DrawTrSurf::Set( name, thebisector );
*/
} }
//=========================================================================== //===========================================================================
@ -204,13 +280,13 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
//=========================================================================== //===========================================================================
void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve , void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
const Handle(Geom2d_Point)& asecondpoint , const Handle(Geom2d_Point)& asecondpoint ,
const gp_Pnt2d& apoint , const gp_Pnt2d& apoint ,
const gp_Vec2d& afirstvector , const gp_Vec2d& afirstvector ,
const gp_Vec2d& asecondvector, const gp_Vec2d& asecondvector,
const Standard_Real adirection , const Standard_Real adirection ,
const Standard_Real tolerance , const Standard_Real tolerance ,
const Standard_Boolean oncurve ) const Standard_Boolean oncurve )
{ {
//gp_Pnt2d SecondPnt = asecondpoint->Pnt2d(); //gp_Pnt2d SecondPnt = asecondpoint->Pnt2d();
@ -220,7 +296,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
if (Type1 == STANDARD_TYPE(Geom2d_TrimmedCurve)) { if (Type1 == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
Type1 = Handle(Geom2d_TrimmedCurve)::DownCast(afirstcurve) Type1 = Handle(Geom2d_TrimmedCurve)::DownCast(afirstcurve)
->BasisCurve()->DynamicType(); ->BasisCurve()->DynamicType();
} }
if ( Type1 == STANDARD_TYPE(Geom2d_Circle) || Type1 == STANDARD_TYPE(Geom2d_Line)) { if ( Type1 == STANDARD_TYPE(Geom2d_Circle) || Type1 == STANDARD_TYPE(Geom2d_Line)) {
@ -229,13 +305,13 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
//------------------------------------------------------------------ //------------------------------------------------------------------
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna(); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna();
BisAna -> Perform (afirstcurve , BisAna -> Perform (afirstcurve ,
asecondpoint , asecondpoint ,
apoint , apoint ,
afirstvector , afirstvector ,
asecondvector , asecondvector ,
adirection , adirection ,
tolerance , tolerance ,
oncurve ); oncurve );
UFirst = BisAna->ParameterOfStartPoint(); UFirst = BisAna->ParameterOfStartPoint();
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
@ -246,8 +322,8 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
if (oncurve) { if (oncurve) {
if (Bisector::IsConvex(afirstcurve,adirection) || if (Bisector::IsConvex(afirstcurve,adirection) ||
IsMaxRC(afirstcurve,afirstcurve->LastParameter(),RC)) { IsMaxRC(afirstcurve,afirstcurve->LastParameter(),RC)) {
IsLine = Standard_True; IsLine = Standard_True;
} }
} }
if (IsLine) { if (IsLine) {
@ -271,64 +347,71 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
Handle(Geom2d_Curve) afirstcurvereverse = afirstcurve->Reversed(); Handle(Geom2d_Curve) afirstcurvereverse = afirstcurve->Reversed();
BisPC -> Perform(afirstcurvereverse , BisPC -> Perform(afirstcurvereverse ,
asecondpoint->Pnt2d(), asecondpoint->Pnt2d(),
- adirection ); - adirection );
// Modified by Sergey KHROMOV - Thu Feb 21 16:49:54 2002 Begin // Modified by Sergey KHROMOV - Thu Feb 21 16:49:54 2002 Begin
if (BisPC -> IsEmpty()) { if (BisPC -> IsEmpty()) {
gp_Dir2d dir1(afirstvector), dir2(asecondvector); gp_Dir2d dir1(afirstvector), dir2(asecondvector);
Standard_Real Standard_Real
Nx = - dir1.X() - dir2.X(), Nx = - dir1.X() - dir2.X(),
Ny = - dir1.Y() - dir2.Y(); Ny = - dir1.Y() - dir2.Y();
if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) { if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) {
Nx = - afirstvector.Y(); Nx = - afirstvector.Y();
Ny = afirstvector.X(); Ny = afirstvector.X();
} }
// gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X()); // gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X());
gp_Dir2d N ( adirection*Nx, adirection*Ny); gp_Dir2d N ( adirection*Nx, adirection*Ny);
Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N); Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N);
Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve(L,0,RC); Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve(L,0,RC);
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna (); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna ();
BisAna->Init(BisL); BisAna->Init(BisL);
UFirst = BisAna->ParameterOfStartPoint(); UFirst = BisAna->ParameterOfStartPoint();
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
} else { } else {
// Modified by Sergey KHROMOV - Wed Mar 6 17:01:08 2002 End // Modified by Sergey KHROMOV - Wed Mar 6 17:01:08 2002 End
UFirst = BisPC->Parameter(apoint); UFirst = BisPC->Parameter(apoint);
ULast = BisPC->LastParameter(); ULast = BisPC->LastParameter();
if(UFirst >= ULast) if(UFirst >= ULast)
{ {
//Standard_Real t = .9; //Standard_Real t = .9;
//UFirst = (1. - t) * BisPC->FirstParameter() + t * ULast; //UFirst = (1. - t) * BisPC->FirstParameter() + t * ULast;
//Extrapolate by line //Extrapolate by line
//gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X()); //gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X());
gp_Vec2d V( BisPC->Value(BisPC->FirstParameter()), BisPC->Value(ULast) ); gp_Vec2d V( BisPC->Value(BisPC->FirstParameter()), BisPC->Value(ULast) );
gp_Dir2d N( V ); gp_Dir2d N( V );
Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N); Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N);
Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve (L,0,RC); Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve (L,0,RC);
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna (); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna ();
BisAna->Init(BisL); BisAna->Init(BisL);
UFirst = BisAna->ParameterOfStartPoint(); UFirst = BisAna->ParameterOfStartPoint();
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
} }
else else
Bis = BisPC; Bis = BisPC;
} }
} }
} }
if(UFirst < Bis->FirstParameter())
UFirst = Bis->FirstParameter();
if(ULast > Bis->LastParameter())
ULast = Bis->LastParameter();
thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast); thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast);
/* #ifdef DRAW
if(Affich)
{
sprintf( name, "c1_%d", ++nbb ); sprintf( name, "c1_%d", ++nbb );
DrawTrSurf::Set( name, afirstcurve ); DrawTrSurf::Set( name, afirstcurve );
sprintf( name, "c2_%d", nbb ); sprintf( name, "c2_%d", nbb );
DrawTrSurf::Set( name, SecondPnt ); DrawTrSurf::Set( name, asecondpoint->Pnt2d() );
sprintf( name, "p%d", nbb ); sprintf( name, "p%d", nbb );
DrawTrSurf::Set( name, apoint ); DrawTrSurf::Set( name, apoint );
sprintf( name, "b%d", nbb ); sprintf( name, "b%d", nbb );
DrawTrSurf::Set( name, thebisector ); DrawTrSurf::Set( name, thebisector );
*/ }
#endif
} }
//=========================================================================== //===========================================================================
@ -344,13 +427,13 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
//=========================================================================== //===========================================================================
void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint , void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
const Handle(Geom2d_Curve)& asecondcurve , const Handle(Geom2d_Curve)& asecondcurve ,
const gp_Pnt2d& apoint , const gp_Pnt2d& apoint ,
const gp_Vec2d& afirstvector , const gp_Vec2d& afirstvector ,
const gp_Vec2d& asecondvector, const gp_Vec2d& asecondvector,
const Standard_Real adirection , const Standard_Real adirection ,
const Standard_Real tolerance , const Standard_Real tolerance ,
const Standard_Boolean oncurve ) const Standard_Boolean oncurve )
{ {
//gp_Pnt2d FirstPnt = afirstpoint->Pnt2d(); //gp_Pnt2d FirstPnt = afirstpoint->Pnt2d();
@ -361,7 +444,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
if (Type1 == STANDARD_TYPE(Geom2d_TrimmedCurve)) { if (Type1 == STANDARD_TYPE(Geom2d_TrimmedCurve)) {
Type1 = Handle(Geom2d_TrimmedCurve)::DownCast(asecondcurve) Type1 = Handle(Geom2d_TrimmedCurve)::DownCast(asecondcurve)
->BasisCurve()->DynamicType(); ->BasisCurve()->DynamicType();
} }
if ( Type1 == STANDARD_TYPE(Geom2d_Circle) || Type1 == STANDARD_TYPE(Geom2d_Line)) { if ( Type1 == STANDARD_TYPE(Geom2d_Circle) || Type1 == STANDARD_TYPE(Geom2d_Line)) {
@ -370,26 +453,26 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
//------------------------------------------------------------------ //------------------------------------------------------------------
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna(); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna();
BisAna -> Perform (afirstpoint , BisAna -> Perform (afirstpoint ,
asecondcurve , asecondcurve ,
apoint , apoint ,
afirstvector , afirstvector ,
asecondvector , asecondvector ,
adirection , adirection ,
tolerance , tolerance ,
oncurve ); oncurve );
UFirst = BisAna->ParameterOfStartPoint(); UFirst = BisAna->ParameterOfStartPoint();
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
} }
else { else {
// Standard_Real UPoint = 0.; // Standard_Real UPoint = 0.;
Standard_Boolean IsLine = Standard_False; Standard_Boolean IsLine = Standard_False;
Standard_Real RC = Precision::Infinite(); Standard_Real RC = Precision::Infinite();
if (oncurve) { if (oncurve) {
if (Bisector::IsConvex(asecondcurve, adirection) || if (Bisector::IsConvex(asecondcurve, adirection) ||
IsMaxRC(asecondcurve,asecondcurve->FirstParameter(),RC)) { IsMaxRC(asecondcurve,asecondcurve->FirstParameter(),RC)) {
IsLine = Standard_True; IsLine = Standard_True;
} }
} }
if (IsLine) { if (IsLine) {
@ -411,62 +494,69 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
//------------------------------------------------------------------- //-------------------------------------------------------------------
Handle(Bisector_BisecPC) BisPC = new Bisector_BisecPC(); Handle(Bisector_BisecPC) BisPC = new Bisector_BisecPC();
BisPC -> Perform(asecondcurve , BisPC -> Perform(asecondcurve ,
afirstpoint->Pnt2d(), afirstpoint->Pnt2d(),
adirection ); adirection );
// Modified by Sergey KHROMOV - Thu Feb 21 16:49:54 2002 Begin // Modified by Sergey KHROMOV - Thu Feb 21 16:49:54 2002 Begin
if (BisPC -> IsEmpty()) { if (BisPC -> IsEmpty()) {
gp_Dir2d dir1(afirstvector), dir2(asecondvector); gp_Dir2d dir1(afirstvector), dir2(asecondvector);
Standard_Real Standard_Real
Nx = - dir1.X() - dir2.X(), Nx = - dir1.X() - dir2.X(),
Ny = - dir1.Y() - dir2.Y(); Ny = - dir1.Y() - dir2.Y();
if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) { if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) {
Nx = - afirstvector.Y(); Nx = - afirstvector.Y();
Ny = afirstvector.X(); Ny = afirstvector.X();
} }
// gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X()); // gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X());
gp_Dir2d N ( adirection*Nx, adirection*Ny); gp_Dir2d N ( adirection*Nx, adirection*Ny);
Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N); Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N);
Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve(L,0,RC); Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve(L,0,RC);
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna (); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna ();
BisAna->Init(BisL); BisAna->Init(BisL);
UFirst = BisAna->ParameterOfStartPoint(); UFirst = BisAna->ParameterOfStartPoint();
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
} else { } else {
// Modified by Sergey KHROMOV - Thu Feb 21 16:49:58 2002 End // Modified by Sergey KHROMOV - Thu Feb 21 16:49:58 2002 End
UFirst = BisPC->Parameter(apoint); UFirst = BisPC->Parameter(apoint);
ULast = BisPC->LastParameter(); ULast = BisPC->LastParameter();
if(UFirst >= ULast) if(UFirst >= ULast)
{ {
//Extrapolate by line //Extrapolate by line
//gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X()); //gp_Dir2d N ( -adirection*afirstvector.Y(), adirection*afirstvector.X());
gp_Vec2d V( BisPC->Value(BisPC->FirstParameter()), BisPC->Value(ULast) ); gp_Vec2d V( BisPC->Value(BisPC->FirstParameter()), BisPC->Value(ULast) );
gp_Dir2d N( V ); gp_Dir2d N( V );
Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N); Handle (Geom2d_Line) L = new Geom2d_Line (apoint,N);
Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve (L,0,RC); Handle (Geom2d_TrimmedCurve) BisL = new Geom2d_TrimmedCurve (L,0,RC);
Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna (); Handle(Bisector_BisecAna) BisAna = new Bisector_BisecAna ();
BisAna->Init(BisL); BisAna->Init(BisL);
UFirst = BisAna->ParameterOfStartPoint(); UFirst = BisAna->ParameterOfStartPoint();
ULast = BisAna->ParameterOfEndPoint(); ULast = BisAna->ParameterOfEndPoint();
Bis = BisAna; Bis = BisAna;
} }
else else
Bis = BisPC; Bis = BisPC;
} }
} }
} }
UFirst = Max(UFirst, Bis->FirstParameter());
ULast = Min(ULast, Bis->LastParameter());
thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast); thebisector = new Geom2d_TrimmedCurve(Bis,UFirst,ULast);
/* #ifdef DRAW
if(Affich)
{
sprintf( name, "c1_%d", ++nbb ); sprintf( name, "c1_%d", ++nbb );
DrawTrSurf::Set( name, FirstPnt ); DrawTrSurf::Set( name, afirstpoint->Pnt2d() );
sprintf( name, "c2_%d", nbb ); sprintf( name, "c2_%d", nbb );
DrawTrSurf::Set( name, asecondcurve ); DrawTrSurf::Set( name, asecondcurve );
sprintf( name, "p%d", nbb ); sprintf( name, "p%d", nbb );
DrawTrSurf::Set( name, apoint ); DrawTrSurf::Set( name, apoint );
sprintf( name, "b%d", nbb ); sprintf( name, "b%d", nbb );
DrawTrSurf::Set( name, thebisector ); DrawTrSurf::Set( name, thebisector );
*/ }
#endif
} }
//=========================================================================== //===========================================================================
@ -481,29 +571,31 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
//=========================================================================== //===========================================================================
void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint , void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
const Handle(Geom2d_Point)& asecondpoint , const Handle(Geom2d_Point)& asecondpoint ,
const gp_Pnt2d& apoint , const gp_Pnt2d& apoint ,
const gp_Vec2d& afirstvector , const gp_Vec2d& afirstvector ,
const gp_Vec2d& asecondvector, const gp_Vec2d& asecondvector,
const Standard_Real adirection , const Standard_Real adirection ,
const Standard_Real tolerance , const Standard_Real tolerance ,
const Standard_Boolean oncurve ) const Standard_Boolean oncurve )
{ {
Handle(Bisector_BisecAna) Bis = new Bisector_BisecAna(); Handle(Bisector_BisecAna) Bis = new Bisector_BisecAna();
Bis -> Perform (afirstpoint , Bis -> Perform (afirstpoint ,
asecondpoint , asecondpoint ,
apoint , apoint ,
afirstvector , afirstvector ,
asecondvector , asecondvector ,
adirection , adirection ,
tolerance , tolerance ,
oncurve ); oncurve );
thebisector = new Geom2d_TrimmedCurve(Bis, thebisector = new Geom2d_TrimmedCurve(Bis,
Bis->ParameterOfStartPoint(), Bis->ParameterOfStartPoint(),
Bis->ParameterOfEndPoint()); Bis->ParameterOfEndPoint());
/* #ifdef DRAW
if(Affich)
{
sprintf( name, "c1_%d", ++nbb ); sprintf( name, "c1_%d", ++nbb );
DrawTrSurf::Set( name, afirstpoint->Pnt2d() ); DrawTrSurf::Set( name, afirstpoint->Pnt2d() );
sprintf( name, "c2_%d", nbb ); sprintf( name, "c2_%d", nbb );
@ -512,7 +604,8 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint ,
DrawTrSurf::Set( name, apoint ); DrawTrSurf::Set( name, apoint );
sprintf( name, "b%d", nbb ); sprintf( name, "b%d", nbb );
DrawTrSurf::Set( name, thebisector ); DrawTrSurf::Set( name, thebisector );
*/ }
#endif
} }
//============================================================================= //=============================================================================
@ -539,8 +632,8 @@ const Handle(Geom2d_TrimmedCurve)& Bisector_Bisec::ChangeValue()
// replaced by a half-straight. // replaced by a half-straight.
//============================================================================= //=============================================================================
static void ReplaceByLineIfIsToSmall (Handle(Geom2d_Curve)& Bis, static void ReplaceByLineIfIsToSmall (Handle(Geom2d_Curve)& Bis,
Standard_Real& UFirst, Standard_Real& UFirst,
Standard_Real& ULast ) Standard_Real& ULast )
{ {
if (Abs(ULast - UFirst) > 2.*Precision::PConfusion()*10.) return; //patch if (Abs(ULast - UFirst) > 2.*Precision::PConfusion()*10.) return; //patch
@ -568,8 +661,8 @@ static void ReplaceByLineIfIsToSmall (Handle(Geom2d_Curve)& Bis,
//purpose : //purpose :
//============================================================================= //=============================================================================
static Standard_Boolean IsMaxRC (const Handle(Geom2d_Curve)& C, static Standard_Boolean IsMaxRC (const Handle(Geom2d_Curve)& C,
Standard_Real U, Standard_Real U,
Standard_Real& R) Standard_Real& R)
{ {
Standard_Real KF,KL; Standard_Real KF,KL;
Standard_Real US = C->FirstParameter(); Standard_Real US = C->FirstParameter();

View File

@ -46,24 +46,24 @@
static Standard_Boolean ProjOnCurve (const gp_Pnt2d& P, static Standard_Boolean ProjOnCurve (const gp_Pnt2d& P,
const Handle(Geom2d_Curve)& C, const Handle(Geom2d_Curve)& C,
Standard_Real& theParam); Standard_Real& theParam);
static Standard_Real Curvature (const Handle(Geom2d_Curve)& C, static Standard_Real Curvature (const Handle(Geom2d_Curve)& C,
Standard_Real U, Standard_Real U,
Standard_Real Tol) ; Standard_Real Tol) ;
static Standard_Boolean TestExtension (const Handle(Geom2d_Curve)& C1, static Standard_Boolean TestExtension (const Handle(Geom2d_Curve)& C1,
const Handle(Geom2d_Curve)& C2, const Handle(Geom2d_Curve)& C2,
const Standard_Integer Start_End); const Standard_Integer Start_End);
static Standard_Boolean DiscretPar(const Standard_Real DU, static Standard_Boolean DiscretPar(const Standard_Real DU,
const Standard_Real EpsMin, const Standard_Real EpsMin,
const Standard_Real EpsMax, const Standard_Real EpsMax,
const Standard_Integer NbMin, const Standard_Integer NbMin,
const Standard_Integer NbMax, const Standard_Integer NbMax,
Standard_Real& Eps, Standard_Real& Eps,
Standard_Integer& Nb); Standard_Integer& Nb);
//============================================================================= //=============================================================================
//function : //function :
@ -80,11 +80,11 @@ Bisector_BisecCC::Bisector_BisecCC()
//purpose : //purpose :
//============================================================================= //=============================================================================
Bisector_BisecCC::Bisector_BisecCC(const Handle(Geom2d_Curve)& Cu1, Bisector_BisecCC::Bisector_BisecCC(const Handle(Geom2d_Curve)& Cu1,
const Handle(Geom2d_Curve)& Cu2, const Handle(Geom2d_Curve)& Cu2,
const Standard_Real Side1, const Standard_Real Side1,
const Standard_Real Side2, const Standard_Real Side2,
const gp_Pnt2d& Origin, const gp_Pnt2d& Origin,
const Standard_Real DistMax) const Standard_Real DistMax)
{ {
Perform (Cu1,Cu2,Side1,Side2,Origin,DistMax); Perform (Cu1,Cu2,Side1,Side2,Origin,DistMax);
} }
@ -94,11 +94,11 @@ Bisector_BisecCC::Bisector_BisecCC(const Handle(Geom2d_Curve)& Cu1,
//purpose : //purpose :
//============================================================================= //=============================================================================
void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1, void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1,
const Handle(Geom2d_Curve)& Cu2, const Handle(Geom2d_Curve)& Cu2,
const Standard_Real Side1, const Standard_Real Side1,
const Standard_Real Side2, const Standard_Real Side2,
const gp_Pnt2d& Origin, const gp_Pnt2d& Origin,
const Standard_Real DistMax) const Standard_Real DistMax)
{ {
isEmpty = Standard_False; isEmpty = Standard_False;
distMax = DistMax; distMax = DistMax;
@ -122,7 +122,6 @@ void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1,
// Calculate first point of the polygon. // Calculate first point of the polygon.
//--------------------------------------------- //---------------------------------------------
Standard_Boolean isProjDone = ProjOnCurve (Origin,curve1, U); Standard_Boolean isProjDone = ProjOnCurve (Origin,curve1, U);
P = ValueByInt (U,UC1,UC2,Dist);
if(!isProjDone) if(!isProjDone)
{ {
@ -130,6 +129,20 @@ void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1,
return; return;
} }
P = ValueByInt (U,UC1,UC2,Dist);
if(Dist < Precision::Confusion())
{
gp_Pnt2d aP1 = curve1->Value(UC1);
gp_Pnt2d aP2 = curve2->Value(UC2);
Standard_Real dp = (aP1.Distance(P)+aP2.Distance(P));
Standard_Real dorig = (aP1.Distance(Origin)+aP2.Distance(Origin));
if(dp < dorig)
{
isEmpty = Standard_True;
return;
}
}
if (Dist < Precision::Infinite()) { if (Dist < Precision::Infinite()) {
//---------------------------------------------------- //----------------------------------------------------
// the parameter of the origin point gives a point // the parameter of the origin point gives a point
@ -380,8 +393,8 @@ Handle(Bisector_BisecCC) Bisector_BisecCC::ChangeGuide() const
for (Standard_Integer i = myPolygon.Length(); i >=1; i--) { for (Standard_Integer i = myPolygon.Length(); i >=1; i--) {
Bisector_PointOnBis P = myPolygon.Value(i); Bisector_PointOnBis P = myPolygon.Value(i);
Bisector_PointOnBis NewP (P.ParamOnC2(), P.ParamOnC1(), Bisector_PointOnBis NewP (P.ParamOnC2(), P.ParamOnC1(),
P.ParamOnC2(), P.Distance (), P.ParamOnC2(), P.Distance (),
P.Point()); P.Point());
Poly.Append (NewP); Poly.Append (NewP);
} }
} }
@ -389,8 +402,8 @@ Handle(Bisector_BisecCC) Bisector_BisecCC::ChangeGuide() const
for (Standard_Integer i = 1; i <= myPolygon.Length(); i ++) { for (Standard_Integer i = 1; i <= myPolygon.Length(); i ++) {
Bisector_PointOnBis P = myPolygon.Value(i); Bisector_PointOnBis P = myPolygon.Value(i);
Bisector_PointOnBis NewP (P.ParamOnC2(), P.ParamOnC1(), Bisector_PointOnBis NewP (P.ParamOnC2(), P.ParamOnC1(),
P.ParamOnC2(), P.Distance (), P.ParamOnC2(), P.Distance (),
P.Point()); P.Point());
Poly.Append (NewP); Poly.Append (NewP);
} }
} }
@ -429,7 +442,7 @@ Standard_Boolean Bisector_BisecCC::IsCN (const Standard_Integer N) const
//============================================================================= //=============================================================================
Standard_Real Bisector_BisecCC::FirstParameter() const Standard_Real Bisector_BisecCC::FirstParameter() const
{ {
return startIntervals.First(); return startIntervals.First();
} }
//============================================================================= //=============================================================================
@ -438,7 +451,7 @@ Standard_Real Bisector_BisecCC::FirstParameter() const
//============================================================================= //=============================================================================
Standard_Real Bisector_BisecCC::LastParameter() const Standard_Real Bisector_BisecCC::LastParameter() const
{ {
return endIntervals.Last(); return endIntervals.Last();
} }
//============================================================================= //=============================================================================
@ -510,7 +523,7 @@ Standard_Boolean Bisector_BisecCC::IsClosed() const
{ {
if (curve1->IsClosed()) { if (curve1->IsClosed()) {
if (startIntervals.First() == curve1->FirstParameter() && if (startIntervals.First() == curve1->FirstParameter() &&
endIntervals .Last () == curve1->LastParameter () ) endIntervals .Last () == curve1->LastParameter () )
return Standard_True; return Standard_True;
} }
return Standard_False; return Standard_False;
@ -531,8 +544,8 @@ Standard_Boolean Bisector_BisecCC::IsPeriodic() const
//purpose : //purpose :
//============================================================================= //=============================================================================
static Standard_Real Curvature (const Handle(Geom2d_Curve)& C, static Standard_Real Curvature (const Handle(Geom2d_Curve)& C,
Standard_Real U, Standard_Real U,
Standard_Real Tol) Standard_Real Tol)
{ {
Standard_Real K1; Standard_Real K1;
gp_Vec2d D1,D2; gp_Vec2d D1,D2;
@ -569,9 +582,9 @@ static Standard_Real Curvature (const Handle(Geom2d_Curve)& C,
// //
//============================================================================= //=============================================================================
gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U, gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U,
Standard_Real& U1, Standard_Real& U1,
Standard_Real& U2, Standard_Real& U2,
Standard_Real& Dist) const Standard_Real& Dist) const
{ {
gp_Vec2d T; gp_Vec2d T;
@ -619,8 +632,8 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U,
//--------------------------------------------------------------- //---------------------------------------------------------------
gp_Pnt2d P1; gp_Pnt2d P1;
gp_Vec2d T1; gp_Vec2d T1;
Standard_Real EpsH = 1.E-8; Standard_Real EpsH = 1.E-9;
Standard_Real EpsH100 = 1.E-6; Standard_Real EpsH100 = 1.E-7;
curve1->D1 (U1,P1,T1); curve1->D1 (U1,P1,T1);
gp_Vec2d N1(T1.Y(), - T1.X()); gp_Vec2d N1(T1.Y(), - T1.X());
@ -637,14 +650,14 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U,
else { else {
math_BissecNewton SolNew (H,VMin - EpsH100,VMax + EpsH100,EpsH,10); math_BissecNewton SolNew (H,VMin - EpsH100,VMax + EpsH100,EpsH,10);
if (SolNew.IsDone()) { if (SolNew.IsDone()) {
U2 = SolNew.Root(); U2 = SolNew.Root();
} }
else { else {
math_FunctionRoot SolRoot (H,VInit,EpsH,VMin - EpsH100,VMax + EpsH100); math_FunctionRoot SolRoot (H,VInit,EpsH,VMin - EpsH100,VMax + EpsH100);
if (SolRoot.IsDone()) { if (SolRoot.IsDone()) {
U2 = SolRoot.Root(); U2 = SolRoot.Root();
} }
else { Valid = Standard_False;} else { Valid = Standard_False;}
} }
} }
} }
@ -667,8 +680,8 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U,
Valid = Standard_False; Valid = Standard_False;
} }
else { else {
PBis = P1.Translated(- (0.5*SquareP2P1/N1P2P1)*N1); PBis = P1.Translated(- (0.5*SquareP2P1/N1P2P1)*N1);
Dist = P1.SquareDistance(PBis); Dist = P1.SquareDistance(PBis);
} }
} }
@ -691,20 +704,20 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U,
Geom2dAdaptor_Curve ANorLi(NorLi); Geom2dAdaptor_Curve ANorLi(NorLi);
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
Geom2dInt_GInter Intersect(ABisPC,ANorLi, Geom2dInt_GInter Intersect(ABisPC,ANorLi,
Precision::Confusion(),Precision::Confusion()); Precision::Confusion(),Precision::Confusion());
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
if (Intersect.IsDone() && !Intersect.IsEmpty()) { if (Intersect.IsDone() && !Intersect.IsEmpty()) {
for (Standard_Integer i = 1; i <= Intersect.NbPoints(); i++) { for (Standard_Integer i = 1; i <= Intersect.NbPoints(); i++) {
if (Intersect.Point(i).ParamOnSecond()*sign1 < Precision::PConfusion()) { if (Intersect.Point(i).ParamOnSecond()*sign1 < Precision::PConfusion()) {
P = Intersect.Point(i).Value(); P = Intersect.Point(i).Value();
if (P.SquareDistance(P1) < DMin) { if (P.SquareDistance(P1) < DMin) {
DMin = P.SquareDistance(P1); DMin = P.SquareDistance(P1);
PBis = P; PBis = P;
U2 = BisPC->LinkBisCurve(Intersect.Point(i).ParamOnFirst()); U2 = BisPC->LinkBisCurve(Intersect.Point(i).ParamOnFirst());
Dist = DMin; Dist = DMin;
} }
} }
} }
} }
} }
@ -725,9 +738,9 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist (const Standard_Real U,
// normal at this point. // normal at this point.
//============================================================================= //=============================================================================
gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U, gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U,
Standard_Real& U1, Standard_Real& U1,
Standard_Real& U2, Standard_Real& U2,
Standard_Real& Dist) const Standard_Real& Dist) const
{ {
//------------------------------------------------------------------ //------------------------------------------------------------------
// Return point, tangent, normal on C1 at parameter U. // Return point, tangent, normal on C1 at parameter U.
@ -792,10 +805,10 @@ gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U,
Bisector_FunctionH H (curve2,P1,sign1*sign2*Tan1); Bisector_FunctionH H (curve2,P1,sign1*sign2*Tan1);
math_FunctionRoots SolRoot (H, math_FunctionRoots SolRoot (H,
UFirstOnC2, UFirstOnC2,
ULastOnC2 , ULastOnC2 ,
NbSamples, NbSamples,
EpsX,EpsH,EpsH); EpsX,EpsH,EpsH);
if (SolRoot.IsDone()) { if (SolRoot.IsDone()) {
for (Standard_Integer j = 1; j <= SolRoot.NbSolutions(); j++) { for (Standard_Integer j = 1; j <= SolRoot.NbSolutions(); j++) {
USol = SolRoot.Value(j); USol = SolRoot.Value(j);
@ -806,60 +819,60 @@ gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U,
// Test if the solution is at the proper side of the curves. // Test if the solution is at the proper side of the curves.
if (N1P2P1*sign1 > 0 ) { if (N1P2P1*sign1 > 0 ) {
P = P1.Translated(- (0.5*SquareP2P1/N1P2P1)*N1); P = P1.Translated(- (0.5*SquareP2P1/N1P2P1)*N1);
DistPP1 = P1.SquareDistance(P); DistPP1 = P1.SquareDistance(P);
if (DistPP1 < DMin) { if (DistPP1 < DMin) {
DMin = DistPP1; DMin = DistPP1;
PSol = P; PSol = P;
U2 = USol; U2 = USol;
YaSol = Standard_True; YaSol = Standard_True;
} }
} }
} }
} }
/* /*
if (!YaSol) { if (!YaSol) {
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Construction de la bisectrice point courbe et de la droite passant // Construction de la bisectrice point courbe et de la droite passant
// par P1 et portee par la normale. // par P1 et portee par la normale.
//-------------------------------------------------------------------- //--------------------------------------------------------------------
Handle(Bisector_BisecPC) BisPC Handle(Bisector_BisecPC) BisPC
= new Bisector_BisecPC(curve2,P1,sign2,2*distMax); = new Bisector_BisecPC(curve2,P1,sign2,2*distMax);
//------------------------------- //-------------------------------
// Test si la bissectrice existe. // Test si la bissectrice existe.
//------------------------------- //-------------------------------
if (BisPC->IsEmpty()) { if (BisPC->IsEmpty()) {
Dist = Precision::Infinite(); Dist = Precision::Infinite();
PSol = P1; PSol = P1;
return PSol; return PSol;
}
Handle(Geom2d_Line) NorLi = new Geom2d_Line (P1,N1);
Geom2dAdaptor_Curve NorLiAd;
if (sign1 < 0.) {NorLiAd.Load(NorLi,0. ,distMax);}
else {NorLiAd.Load(NorLi,- distMax,0. );}
//-------------------------------------------------------------------------
Geom2dInt_GInter Intersect(BisPC,NorLiAd,
Precision::Confusion(),Precision::Confusion());
//-------------------------------------------------------------------------
if (Intersect.IsDone() && !Intersect.IsEmpty()) {
for (Standard_Integer i = 1; i <= Intersect.NbPoints(); i++) {
if (Intersect.Point(i).ParamOnSecond()*sign1< Precision::PConfusion()) {
P = Intersect.Point(i).Value();
DistPP1 = P.SquareDistance(P1);
if (DistPP1 < DMin) {
DMin = DistPP1;
PSol = P;
U2 = Intersect.Point(i).ParamOnFirst();
YaSol = Standard_True;
}
}
}
}
} }
*/
Handle(Geom2d_Line) NorLi = new Geom2d_Line (P1,N1);
Geom2dAdaptor_Curve NorLiAd;
if (sign1 < 0.) {NorLiAd.Load(NorLi,0. ,distMax);}
else {NorLiAd.Load(NorLi,- distMax,0. );}
//-------------------------------------------------------------------------
Geom2dInt_GInter Intersect(BisPC,NorLiAd,
Precision::Confusion(),Precision::Confusion());
//-------------------------------------------------------------------------
if (Intersect.IsDone() && !Intersect.IsEmpty()) {
for (Standard_Integer i = 1; i <= Intersect.NbPoints(); i++) {
if (Intersect.Point(i).ParamOnSecond()*sign1< Precision::PConfusion()) {
P = Intersect.Point(i).Value();
DistPP1 = P.SquareDistance(P1);
if (DistPP1 < DMin) {
DMin = DistPP1;
PSol = P;
U2 = Intersect.Point(i).ParamOnFirst();
YaSol = Standard_True;
}
}
}
}
}
*/
if (YaSol) { if (YaSol) {
Dist = DMin; Dist = DMin;
@ -878,18 +891,18 @@ gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U,
} }
else { else {
if ( !isConvex1 ) { if ( !isConvex1 ) {
Standard_Real K1 = Curvature(curve1,U1,Precision::Confusion()); Standard_Real K1 = Curvature(curve1,U1,Precision::Confusion());
if (K1 != 0.) { if (K1 != 0.) {
if (Dist > 1/(K1*K1)) YaSol = Standard_False; if (Dist > 1/(K1*K1)) YaSol = Standard_False;
} }
} }
if (YaSol) { if (YaSol) {
if ( !isConvex2 ) { if ( !isConvex2 ) {
Standard_Real K2 = Curvature(curve2,U2,Precision::Confusion()); Standard_Real K2 = Curvature(curve2,U2,Precision::Confusion());
if (K2 != 0.) { if (K2 != 0.) {
if (Dist > 1/(K2*K2)) YaSol = Standard_False; if (Dist > 1/(K2*K2)) YaSol = Standard_False;
} }
} }
} }
} }
} }
@ -905,7 +918,7 @@ gp_Pnt2d Bisector_BisecCC::ValueByInt (const Standard_Real U,
//purpose : //purpose :
//============================================================================= //=============================================================================
void Bisector_BisecCC::D0(const Standard_Real U, void Bisector_BisecCC::D0(const Standard_Real U,
gp_Pnt2d& P) const gp_Pnt2d& P) const
{ {
Standard_Real U1,U2,Dist; Standard_Real U1,U2,Dist;
@ -917,8 +930,8 @@ void Bisector_BisecCC::D0(const Standard_Real U,
//purpose : //purpose :
//============================================================================= //=============================================================================
void Bisector_BisecCC::D1(const Standard_Real U, void Bisector_BisecCC::D1(const Standard_Real U,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& V ) const gp_Vec2d& V ) const
{ {
V.SetCoord(0.,0.); V.SetCoord(0.,0.);
gp_Vec2d V2,V3; gp_Vec2d V2,V3;
@ -930,9 +943,9 @@ void Bisector_BisecCC::D1(const Standard_Real U,
//purpose : //purpose :
//============================================================================= //=============================================================================
void Bisector_BisecCC::D2(const Standard_Real U, void Bisector_BisecCC::D2(const Standard_Real U,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& V1, gp_Vec2d& V1,
gp_Vec2d& V2) const gp_Vec2d& V2) const
{ {
V1.SetCoord(0.,0.); V1.SetCoord(0.,0.);
V2.SetCoord(0.,0.); V2.SetCoord(0.,0.);
@ -945,10 +958,10 @@ void Bisector_BisecCC::D2(const Standard_Real U,
//purpose : //purpose :
//============================================================================= //=============================================================================
void Bisector_BisecCC::D3(const Standard_Real U, void Bisector_BisecCC::D3(const Standard_Real U,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& V1, gp_Vec2d& V1,
gp_Vec2d& V2, gp_Vec2d& V2,
gp_Vec2d& V3) const gp_Vec2d& V3) const
{ {
V1.SetCoord(0.,0.); V1.SetCoord(0.,0.);
V2.SetCoord(0.,0.); V2.SetCoord(0.,0.);
@ -961,7 +974,7 @@ void Bisector_BisecCC::D3(const Standard_Real U,
//purpose : //purpose :
//============================================================================= //=============================================================================
gp_Vec2d Bisector_BisecCC::DN(const Standard_Real U, gp_Vec2d Bisector_BisecCC::DN(const Standard_Real U,
const Standard_Integer N) const const Standard_Integer N) const
{ {
gp_Pnt2d P; gp_Pnt2d P;
gp_Vec2d V1(0.,0.); gp_Vec2d V1(0.,0.);
@ -969,12 +982,12 @@ gp_Vec2d Bisector_BisecCC::DN(const Standard_Real U,
gp_Vec2d V3(0.,0.); gp_Vec2d V3(0.,0.);
Values (U,N,P,V1,V2,V3); Values (U,N,P,V1,V2,V3);
switch (N) { switch (N) {
case 1 : return V1; case 1 : return V1;
case 2 : return V2; case 2 : return V2;
case 3 : return V3; case 3 : return V3;
default: { default: {
Standard_NotImplemented::Raise(); Standard_NotImplemented::Raise();
} }
} }
return V1; return V1;
} }
@ -1000,11 +1013,11 @@ gp_Vec2d Bisector_BisecCC::DN(const Standard_Real U,
// //
//============================================================================= //=============================================================================
void Bisector_BisecCC::Values (const Standard_Real U, void Bisector_BisecCC::Values (const Standard_Real U,
const Standard_Integer N, const Standard_Integer N,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& V1, gp_Vec2d& V1,
gp_Vec2d& V2, gp_Vec2d& V2,
gp_Vec2d& V3) const gp_Vec2d& V3) const
{ {
V1 = gp_Vec2d(0.,0.); V1 = gp_Vec2d(0.,0.);
V2 = gp_Vec2d(0.,0.); V2 = gp_Vec2d(0.,0.);
@ -1066,9 +1079,9 @@ void Bisector_BisecCC::Values (const Standard_Real U,
TvvPuPv = Tvv.Dot(PuPv) ; TvTvv = Tv.Dot(Tvv) ; TvvPuPv = Tvv.Dot(PuPv) ; TvTvv = Tv.Dot(Tvv) ;
Standard_Real dHdu = 2*(TuPuPv*(TuuPuPv - TuTu)*TvTv + Standard_Real dHdu = 2*(TuPuPv*(TuuPuPv - TuTu)*TvTv +
TvPuPv*TuTv*TuTu -TuTuu*TvPuPv*TvPuPv); TvPuPv*TuTv*TuTu -TuTuu*TvPuPv*TvPuPv);
Standard_Real dHdv = 2*(TuPuPv*TuTv*TvTv + TvTvv*TuPuPv*TuPuPv - Standard_Real dHdv = 2*(TuPuPv*TuTv*TvTv + TvTvv*TuPuPv*TuPuPv -
TvPuPv*(TvvPuPv + TvTv)*TuTu); TvPuPv*(TvvPuPv + TvTv)*TuTu);
//----------------------------- //-----------------------------
// Calculate dF/du and dF/dv. // Calculate dF/du and dF/dv.
@ -1115,10 +1128,10 @@ void Bisector_BisecCC::Values (const Standard_Real U,
// by tangence of the curve. // by tangence of the curve.
//============================================================================ //============================================================================
gp_Pnt2d Bisector_BisecCC::Extension (const Standard_Real U, gp_Pnt2d Bisector_BisecCC::Extension (const Standard_Real U,
Standard_Real& U1, Standard_Real& U1,
Standard_Real& U2, Standard_Real& U2,
Standard_Real& Dist, Standard_Real& Dist,
gp_Vec2d& T ) const gp_Vec2d& T ) const
{ {
Bisector_PointOnBis PRef; Bisector_PointOnBis PRef;
gp_Pnt2d P,P1,P2,PBis; gp_Pnt2d P,P1,P2,PBis;
@ -1201,12 +1214,12 @@ gp_Pnt2d Bisector_BisecCC::Extension (const Standard_Real U,
// purpose : // purpose :
//============================================================================= //=============================================================================
static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA, static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA,
const Handle(Geom2d_Curve)& CB, const Handle(Geom2d_Curve)& CB,
const Standard_Real SignA, const Standard_Real SignA,
const Standard_Real SignB, const Standard_Real SignB,
const Standard_Real UOnA, const Standard_Real UOnA,
Standard_Real& UOnB, Standard_Real& UOnB,
Standard_Real& Dist) Standard_Real& Dist)
{ {
//------------------------------------------------------------------ //------------------------------------------------------------------
// Return point,tangent, normal on CA with parameter UOnA. // Return point,tangent, normal on CA with parameter UOnA.
@ -1250,7 +1263,7 @@ static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA,
Standard_Real DMin = Precision::Infinite(); Standard_Real DMin = Precision::Infinite();
Standard_Real UPC; Standard_Real UPC;
Standard_Boolean YaSol = Standard_False; Standard_Boolean YaSol = Standard_False;
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Construction of the bisectrice point curve and of the straight line passing // Construction of the bisectrice point curve and of the straight line passing
// through P1 and carried by the normal. // through P1 and carried by the normal.
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1271,21 +1284,21 @@ static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA,
Geom2dAdaptor_Curve ANorLi(NorLi); Geom2dAdaptor_Curve ANorLi(NorLi);
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
Geom2dInt_GInter Intersect(ABisPC,ANorLi, Geom2dInt_GInter Intersect(ABisPC,ANorLi,
Precision::Confusion(),Precision::Confusion()); Precision::Confusion(),Precision::Confusion());
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
if (Intersect.IsDone() && !Intersect.IsEmpty()) { if (Intersect.IsDone() && !Intersect.IsEmpty()) {
for (Standard_Integer i = 1; i <= Intersect.NbPoints(); i++) { for (Standard_Integer i = 1; i <= Intersect.NbPoints(); i++) {
if (Intersect.Point(i).ParamOnSecond()*SignA < Precision::PConfusion()) { if (Intersect.Point(i).ParamOnSecond()*SignA < Precision::PConfusion()) {
P = Intersect.Point(i).Value(); P = Intersect.Point(i).Value();
if (P.SquareDistance(P1) < DMin) { if (P.SquareDistance(P1) < DMin) {
DMin = P.SquareDistance(P1); DMin = P.SquareDistance(P1);
PSol = P; PSol = P;
UPC = Intersect.Point(i).ParamOnFirst(); UPC = Intersect.Point(i).ParamOnFirst();
UOnB = BisPC->LinkBisCurve(UPC); UOnB = BisPC->LinkBisCurve(UPC);
Dist = DMin; Dist = DMin;
YaSol = Standard_True; YaSol = Standard_True;
} }
} }
} }
} }
@ -1294,6 +1307,17 @@ static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA,
// Point found => Test distance curvature + Angular test // Point found => Test distance curvature + Angular test
//--------------------------------------------------------------- //---------------------------------------------------------------
P2 = CB->Value(UOnB); P2 = CB->Value(UOnB);
if(P1.SquareDistance(PSol) < 1.e-32)
{
YaSol = Standard_False;
return YaSol;
}
if(P2.SquareDistance(PSol) < 1.e-32)
{
YaSol = Standard_False;
return YaSol;
}
gp_Dir2d PP1Unit(P1.X() - PSol.X(),P1.Y() - PSol.Y()); gp_Dir2d PP1Unit(P1.X() - PSol.X(),P1.Y() - PSol.Y());
gp_Dir2d PP2Unit(P2.X() - PSol.X(),P2.Y() - PSol.Y()); gp_Dir2d PP2Unit(P2.X() - PSol.X(),P2.Y() - PSol.Y());
@ -1303,18 +1327,18 @@ static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA,
else { else {
Dist = sqrt(Dist); Dist = sqrt(Dist);
if ( !IsConvexA ) { if ( !IsConvexA ) {
Standard_Real K1 = Curvature(CA,UOnA,Precision::Confusion()); Standard_Real K1 = Curvature(CA,UOnA,Precision::Confusion());
if (K1 != 0.) { if (K1 != 0.) {
if (Dist > Abs(1/K1)) YaSol = Standard_False; if (Dist > Abs(1/K1)) YaSol = Standard_False;
} }
} }
if (YaSol) { if (YaSol) {
if ( !IsConvexB ) { if ( !IsConvexB ) {
Standard_Real K2 = Curvature(CB,UOnB,Precision::Confusion()); Standard_Real K2 = Curvature(CB,UOnB,Precision::Confusion());
if (K2 != 0.) { if (K2 != 0.) {
if (Dist > Abs(1/K2)) YaSol = Standard_False; if (Dist > Abs(1/K2)) YaSol = Standard_False;
} }
} }
} }
} }
} }
@ -1426,20 +1450,20 @@ Standard_Real Bisector_BisecCC::Parameter(const gp_Pnt2d& P) const
//============================================================================= //=============================================================================
//void Bisector_BisecCC::Dump(const Standard_Integer Deep, //void Bisector_BisecCC::Dump(const Standard_Integer Deep,
void Bisector_BisecCC::Dump(const Standard_Integer , void Bisector_BisecCC::Dump(const Standard_Integer ,
const Standard_Integer Offset) const const Standard_Integer Offset) const
{ {
Indent (Offset); Indent (Offset);
cout <<"Bisector_BisecCC :"<<endl; cout <<"Bisector_BisecCC :"<<endl;
Indent (Offset); Indent (Offset);
// cout <<"Curve1 :"<<curve1<<endl; // cout <<"Curve1 :"<<curve1<<endl;
// cout <<"Curve2 :"<<curve2<<endl; // cout <<"Curve2 :"<<curve2<<endl;
cout <<"Sign1 :"<<sign1<<endl; cout <<"Sign1 :"<<sign1<<endl;
cout <<"Sign2 :"<<sign2<<endl; cout <<"Sign2 :"<<sign2<<endl;
cout <<"Number Of Intervals :"<<startIntervals.Length()<<endl; cout <<"Number Of Intervals :"<<startIntervals.Length()<<endl;
for (Standard_Integer i = 1; i <= startIntervals.Length(); i++) { for (Standard_Integer i = 1; i <= startIntervals.Length(); i++) {
cout <<"Interval number :"<<i<<"Start :"<<startIntervals.Value(i) cout <<"Interval number :"<<i<<"Start :"<<startIntervals.Value(i)
<<" end :"<< endIntervals.Value(i)<<endl ; <<" end :"<< endIntervals.Value(i)<<endl ;
} }
cout <<"Index Current Interval :"<<currentInterval<<endl; cout <<"Index Current Interval :"<<currentInterval<<endl;
} }
@ -1449,7 +1473,7 @@ void Bisector_BisecCC::Dump(const Standard_Integer ,
// purpose : // purpose :
//============================================================================= //=============================================================================
void Bisector_BisecCC::Curve(const Standard_Integer I, void Bisector_BisecCC::Curve(const Standard_Integer I,
const Handle(Geom2d_Curve)& C) const Handle(Geom2d_Curve)& C)
{ {
if (I == 1) curve1 = C; if (I == 1) curve1 = C;
else if (I == 2) curve2 = C; else if (I == 2) curve2 = C;
@ -1461,7 +1485,7 @@ void Bisector_BisecCC::Curve(const Standard_Integer I,
// purpose : // purpose :
//============================================================================= //=============================================================================
void Bisector_BisecCC::Sign(const Standard_Integer I, void Bisector_BisecCC::Sign(const Standard_Integer I,
const Standard_Real S) const Standard_Real S)
{ {
if (I == 1) sign1 = S; if (I == 1) sign1 = S;
else if (I == 2) sign2 = S; else if (I == 2) sign2 = S;
@ -1491,7 +1515,7 @@ void Bisector_BisecCC::DistMax(const Standard_Real D)
// purpose : // purpose :
//============================================================================= //=============================================================================
void Bisector_BisecCC::IsConvex(const Standard_Integer I, void Bisector_BisecCC::IsConvex(const Standard_Integer I,
const Standard_Boolean IsConvex) const Standard_Boolean IsConvex)
{ {
if (I == 1) isConvex1 = IsConvex; if (I == 1) isConvex1 = IsConvex;
else if (I == 2) isConvex2 = IsConvex; else if (I == 2) isConvex2 = IsConvex;
@ -1586,7 +1610,7 @@ void Bisector_BisecCC::LastParameter (const Standard_Real U)
// purpose : // purpose :
//============================================================================= //=============================================================================
Standard_Real Bisector_BisecCC::SearchBound (const Standard_Real U1, Standard_Real Bisector_BisecCC::SearchBound (const Standard_Real U1,
const Standard_Real U2) const const Standard_Real U2) const
{ {
Standard_Real UMid,Dist1,Dist2,DistMid,U11,U22; Standard_Real UMid,Dist1,Dist2,DistMid,U11,U22;
Standard_Real UC1,UC2; Standard_Real UC1,UC2;
@ -1598,20 +1622,20 @@ Standard_Real Bisector_BisecCC::SearchBound (const Standard_Real U1,
PBis = ValueByInt(U22,UC1,UC2,Dist2); PBis = ValueByInt(U22,UC1,UC2,Dist2);
while ((U22 - U11) > TolPar || while ((U22 - U11) > TolPar ||
((Dist1 < Precision::Infinite() && ((Dist1 < Precision::Infinite() &&
Dist2 < Precision::Infinite() && Dist2 < Precision::Infinite() &&
!PBis.IsEqual(PBisPrec,TolPnt)))) { !PBis.IsEqual(PBisPrec,TolPnt)))) {
PBisPrec = PBis; PBisPrec = PBis;
UMid = 0.5*( U22 + U11); UMid = 0.5*( U22 + U11);
PBis = ValueByInt(UMid,UC1,UC2,DistMid); PBis = ValueByInt(UMid,UC1,UC2,DistMid);
if ((Dist1 < Precision::Infinite()) == (DistMid < Precision::Infinite())) { if ((Dist1 < Precision::Infinite()) == (DistMid < Precision::Infinite())) {
U11 = UMid; U11 = UMid;
Dist1 = DistMid; Dist1 = DistMid;
} }
else { else {
U22 = UMid; U22 = UMid;
Dist2 = DistMid; Dist2 = DistMid;
} }
} }
PBis = ValueByInt(U11,UC1,UC2,Dist1); PBis = ValueByInt(U11,UC1,UC2,Dist1);
if (Dist1 < Precision::Infinite()) { if (Dist1 < Precision::Infinite()) {
@ -1628,8 +1652,8 @@ Standard_Real Bisector_BisecCC::SearchBound (const Standard_Real U1,
// purpose : // purpose :
//============================================================================= //=============================================================================
static Standard_Boolean ProjOnCurve (const gp_Pnt2d& P, static Standard_Boolean ProjOnCurve (const gp_Pnt2d& P,
const Handle(Geom2d_Curve)& C, const Handle(Geom2d_Curve)& C,
Standard_Real& theParam) Standard_Real& theParam)
{ {
//Standard_Real UOnCurve =0.; //Standard_Real UOnCurve =0.;
theParam = 0.0; theParam = 0.0;
@ -1667,8 +1691,8 @@ static Standard_Boolean ProjOnCurve (const gp_Pnt2d& P,
return Standard_True; return Standard_True;
} }
Geom2dAPI_ProjectPointOnCurve Proj(P,C, Geom2dAPI_ProjectPointOnCurve Proj(P,C,
C->FirstParameter(), C->FirstParameter(),
C->LastParameter()); C->LastParameter());
if (Proj.NbPoints() > 0) { if (Proj.NbPoints() > 0) {
theParam = Proj.LowerDistanceParameter(); theParam = Proj.LowerDistanceParameter();
} }
@ -1684,8 +1708,8 @@ static Standard_Boolean ProjOnCurve (const gp_Pnt2d& P,
// purpose : // purpose :
//============================================================================= //=============================================================================
static Standard_Boolean TestExtension (const Handle(Geom2d_Curve)& C1, static Standard_Boolean TestExtension (const Handle(Geom2d_Curve)& C1,
const Handle(Geom2d_Curve)& C2, const Handle(Geom2d_Curve)& C2,
const Standard_Integer Start_End) const Standard_Integer Start_End)
{ {
gp_Pnt2d P1,P2; gp_Pnt2d P1,P2;
gp_Vec2d T1,T2; gp_Vec2d T1,T2;
@ -1708,7 +1732,7 @@ static Standard_Boolean TestExtension (const Handle(Geom2d_Curve)& C1,
if (P1.IsEqual(P2,Precision::Confusion())) { if (P1.IsEqual(P2,Precision::Confusion())) {
T2.Normalize(); T2.Normalize();
if (T1.Dot(T2) > 1.0 - Precision::Confusion()) { if (T1.Dot(T2) > 1.0 - Precision::Confusion()) {
Test = Standard_True; Test = Standard_True;
} }
} }
} }
@ -1753,12 +1777,12 @@ void Bisector_BisecCC::ComputePointEnd ()
// purpose : // purpose :
//============================================================================= //=============================================================================
static Standard_Boolean DiscretPar(const Standard_Real DU, static Standard_Boolean DiscretPar(const Standard_Real DU,
const Standard_Real EpsMin, const Standard_Real EpsMin,
const Standard_Real EpsMax, const Standard_Real EpsMax,
const Standard_Integer NbMin, const Standard_Integer NbMin,
const Standard_Integer NbMax, const Standard_Integer NbMax,
Standard_Real& Eps, Standard_Real& Eps,
Standard_Integer& Nb) Standard_Integer& Nb)
{ {
if (DU <= NbMin*EpsMin) { if (DU <= NbMin*EpsMin) {
Eps = DU/(NbMin + 1) ; Eps = DU/(NbMin + 1) ;

View File

@ -33,12 +33,14 @@
#include <Precision.hxx> #include <Precision.hxx>
#include <math_BissecNewton.hxx> #include <math_BissecNewton.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
#ifdef OCCT_DEBUG
//#define DRAW
#ifdef DRAW #ifdef DRAW
#include <Draw_Appli.hxx> #include <DrawTrSurf.hxx>
#include <DrawTrSurf_Curve2d.hxx> static char name[100];
#include <Draw_Marker2D.hxx>
static Standard_Boolean Affich = Standard_False; static Standard_Boolean Affich = Standard_False;
static Standard_Integer nbint = 0;
#endif
#endif #endif
//=================================================================================== //===================================================================================
@ -172,14 +174,14 @@ void Bisector_Inter::Perform(const Bisector_Bisec& C1,
PMax,UMax,D2.LastTolerance()); PMax,UMax,D2.LastTolerance());
if ((IB2 == 1 && Bis2->IsExtendAtStart()) || if ((IB2 == 1 && Bis2->IsExtendAtStart()) ||
(IB2 == Bis1->NbIntervals() && Bis2->IsExtendAtEnd()) ){ (IB2 == Bis1->NbIntervals() && Bis2->IsExtendAtEnd()) ){
//-------------------------------------------------------- //--------------------------------------------------------
// Part corresponding to an extension is a segment. // Part corresponding to an extension is a segment.
//-------------------------------------------------------- //--------------------------------------------------------
SBis2 [IB2] = ConstructSegment (PMin,PMax,UMin,UMax); SBis2 [IB2] = ConstructSegment (PMin,PMax,UMin,UMax);
} }
else { else {
SBis2 [IB2] = Bis2; SBis2 [IB2] = Bis2;
} }
NB2++; NB2++;
} }
@ -269,11 +271,11 @@ void Bisector_Inter::SinglePerform(const Handle(Geom2d_Curve)& CBis1,
if (Type1 == STANDARD_TYPE(Geom2d_Line) && Type2 != STANDARD_TYPE(Geom2d_Line)) { if (Type1 == STANDARD_TYPE(Geom2d_Line) && Type2 != STANDARD_TYPE(Geom2d_Line)) {
TestBound(Handle(Geom2d_Line)::DownCast(Bis1), TestBound(Handle(Geom2d_Line)::DownCast(Bis1),
D1,Bis2,D2,TolConf,Standard_False); D1,Bis2,D2,TolConf,Standard_False);
} }
else if (Type2 == STANDARD_TYPE(Geom2d_Line)&& Type1 != STANDARD_TYPE(Geom2d_Line)) { else if (Type2 == STANDARD_TYPE(Geom2d_Line)&& Type1 != STANDARD_TYPE(Geom2d_Line)) {
TestBound(Handle(Geom2d_Line)::DownCast(Bis2), TestBound(Handle(Geom2d_Line)::DownCast(Bis2),
D2,Bis1,D1,TolConf,Standard_True); D2,Bis1,D1,TolConf,Standard_True);
} }
Geom2dInt_GInter Intersect; Geom2dInt_GInter Intersect;
Geom2dAdaptor_Curve ABis1(Bis1); Geom2dAdaptor_Curve ABis1(Bis1);
@ -285,21 +287,17 @@ void Bisector_Inter::SinglePerform(const Handle(Geom2d_Curve)& CBis1,
#ifdef DRAW #ifdef DRAW
if (Affich) { if (Affich) {
Handle(DrawTrSurf_Curve2d) dr; sprintf( name, "i1_%d", ++nbint);
Draw_Color Couleur = Draw_bleu; DrawTrSurf::Set(name, Bis1);
sprintf( name, "i2_%d", nbint);
dr = new DrawTrSurf_Curve2d(Bis1,Couleur,100); DrawTrSurf::Set(name, Bis2);
dout << dr; if (IsDone() && !IsEmpty()) {
dr = new DrawTrSurf_Curve2d(Bis2,Couleur,100);
dout << dr;
if (IsDone() && !IsEmpty()) {
for (Standard_Integer k = 1; k <= NbPoints(); k++) { for (Standard_Integer k = 1; k <= NbPoints(); k++) {
gp_Pnt2d P = Point(k).Value(); gp_Pnt2d P = Point(k).Value();
Handle(Draw_Marker2D) drp = new Draw_Marker2D(P,Draw_Plus,Draw_vert); sprintf( name, "ip_%d_%d", nbint, k);
dout << drp; DrawTrSurf::Set(name, P);
} }
} }
dout.Flush();
} }
#endif #endif
} }

File diff suppressed because it is too large Load Diff

View File

@ -203,13 +203,14 @@ void IntCurve_ExactIntersectionPoint::MathPerform(void)
,ToleranceVector ,ToleranceVector
,BInfVector ,BInfVector
,BSupVector ,BSupVector
,50); ,60);
if(Fct.IsDone()) { if(Fct.IsDone()) {
Fct.Root(Root); nbroots = 1; Fct.Root(Root); nbroots = 1;
math_Vector XY(1,2); math_Vector XY(1,2);
FctDist.Value(Root,XY); FctDist.Value(Root,XY);
Standard_Real dist2 = ((XY(1)*XY(1)+XY(2)*XY(2))); Standard_Real dist2 = ((XY(1)*XY(1)+XY(2)*XY(2)));
if(dist2 > myTol) if(dist2 > myTol)
{ {
nbroots = 0; nbroots = 0;

View File

@ -45,6 +45,8 @@
#include <math_FunctionSetRoot.hxx> #include <math_FunctionSetRoot.hxx>
#include <math_NewtonFunctionSetRoot.hxx> #include <math_NewtonFunctionSetRoot.hxx>
#include <NCollection_Handle.hxx> #include <NCollection_Handle.hxx>
#include <Bnd_Box2d.hxx>
#include <Precision.hxx>
//====================================================================== //======================================================================
@ -58,7 +60,12 @@
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void GetIntersection(const TheCurve& theC1, const Standard_Real theT1f, const Standard_Real theT1l,
const TheCurve& theC2, const Standard_Real theT2f, const Standard_Real theT2l,
const Standard_Real theTolConf,
const Standard_Integer theMaxCount,
IntRes2d_IntersectionPoint& thePInt, Standard_Real& theDist,
Standard_Integer& theCount);
Standard_Boolean HeadOrEndPoint( const IntRes2d_Domain& D1 Standard_Boolean HeadOrEndPoint( const IntRes2d_Domain& D1
@ -787,10 +794,30 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(
//-------------------------------------------------------------------- //--------------------------------------------------------------------
//-- On verifie que le point trouve est bien une racine //-- On verifie que le point trouve est bien une racine
//-------------------------------------------------------------------- //--------------------------------------------------------------------
EIP.Roots(U,V); EIP.Roots(U,V);
TheCurveTool::D1(C1,U,P1,Tan1); TheCurveTool::D1(C1,U,P1,Tan1);
TheCurveTool::D1(C2,V,P2,Tan2); TheCurveTool::D1(C2,V,P2,Tan2);
Standard_Real Dist = P1.Distance(P2); Standard_Real Dist = P1.Distance(P2);
if(EIP.NbRoots() == 0 && Dist > TolConf)
{
IntRes2d_Transition aTrans;
IntRes2d_IntersectionPoint aPInt(P1, U, V, aTrans, aTrans, Standard_False);
Standard_Real aT1f, aT1l, aT2f, aT2l;
aT1f= thePoly1.ApproxParamOnCurve(SegIndex1, 0.0);
aT1l= thePoly1.ApproxParamOnCurve(SegIndex1, 1.0);
aT2f= thePoly2.ApproxParamOnCurve(SegIndex2, 0.0);
aT2l= thePoly2.ApproxParamOnCurve(SegIndex2, 1.0);
//
Standard_Integer aMaxCount = 16, aCount = 0;
GetIntersection(C1, aT1f, aT1l, C2, aT2f, aT2l, TolConf, aMaxCount,
aPInt, Dist, aCount);
U = aPInt.ParamOnFirst();
V = aPInt.ParamOnSecond();
TheCurveTool::D1(C1,U,P1,Tan1);
TheCurveTool::D1(C2,V,P2,Tan2);
Dist = P1.Distance(P2);
}
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- On verifie que le point (u,v) n existe pas deja //-- On verifie que le point (u,v) n existe pas deja
//-- //--
@ -1031,3 +1058,130 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(
return Standard_True; return Standard_True;
} }
//======================================================================
// GetIntersection
//======================================================================
void GetIntersection(const TheCurve& theC1, const Standard_Real theT1f, const Standard_Real theT1l,
const TheCurve& theC2, const Standard_Real theT2f, const Standard_Real theT2l,
const Standard_Real theTolConf,
const Standard_Integer theMaxCount,
IntRes2d_IntersectionPoint& thePInt, Standard_Real& theDist,
Standard_Integer& theCount)
{
theCount++;
//
Standard_Real aTol2 = theTolConf*theTolConf;
Standard_Real aPTol1 = Max(100.*Epsilon(Max(Abs(theT1f), Abs(theT1l))), Precision::PConfusion());
Standard_Real aPTol2 = Max(100.*Epsilon(Max(Abs(theT2f), Abs(theT2l))), Precision::PConfusion());
gp_Pnt2d aP1f, aP1l, aP2f, aP2l;
Bnd_Box2d aB1, aB2;
//
TheCurveTool::D0(theC1, theT1f, aP1f);
TheCurveTool::D0(theC1, theT1l, aP1l);
aB1.Add(aP1f);
aB1.Add(aP1l);
aB1.Enlarge(theTolConf);
//
TheCurveTool::D0(theC2, theT2f, aP2f);
TheCurveTool::D0(theC2, theT2l, aP2l);
aB2.Add(aP2f);
aB2.Add(aP2l);
aB2.Enlarge(theTolConf);
//
if(aB1.IsOut(aB2))
{
theCount--;
return;
}
//
Standard_Boolean isSmall1 = (theT1l - theT1f) <= aPTol1 || aP1f.SquareDistance(aP1l) / 4. <= aTol2;
Standard_Boolean isSmall2 = (theT2l - theT2f) <= aPTol2 || aP2f.SquareDistance(aP2l) / 4. <= aTol2;
if((isSmall1 && isSmall2) || (theCount > theMaxCount))
{
//Seems to be intersection
//Simple treatment of segment intersection
gp_XY aPnts1[3] = {aP1f.XY(), (aP1f.XY() + aP1l.XY()) / 2., aP1l.XY()};
gp_XY aPnts2[3] = {aP2f.XY(), (aP2f.XY() + aP2l.XY()) / 2., aP2l.XY()};
Standard_Integer i, j, imin = -1, jmin = -1;
Standard_Real dmin = RealLast(), d;
for(i = 0; i < 3; i++)
{
for(j = 0; j < 3; j++)
{
d = (aPnts1[i] - aPnts2[j]).SquareModulus();
if(d < dmin)
{
dmin=d;
imin = i;
jmin = j;
}
}
}
//
dmin = Sqrt(dmin);
if(theDist > dmin)
{
theDist = dmin;
//
Standard_Real t1;
if(imin == 0)
{
t1 = theT1f;
}
else if(imin == 1)
{
t1 = (theT1f + theT1l) / 2.;
}
else
{
t1 = theT1l;
}
//
Standard_Real t2;
if(jmin == 0)
{
t2 = theT2f;
}
else if(jmin == 1)
{
t2 = (theT2f + theT2l) / 2.;
}
else
{
t2 = theT2l;
}
//
gp_Pnt2d aPint((aPnts1[imin] + aPnts2[jmin])/2.);
//
IntRes2d_Transition aTrans1, aTrans2;
thePInt.SetValues(aPint, t1, t2, aTrans1, aTrans2, Standard_False);
}
theCount--;
return;
}
if(isSmall1)
{
Standard_Real aT2m = (theT2l + theT2f) / 2.;
GetIntersection(theC1, theT1f, theT1l, theC2, theT2f, aT2m, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, theT1f, theT1l, theC2, aT2m, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
}
else if(isSmall2)
{
Standard_Real aT1m = (theT1l + theT1f) / 2.;
GetIntersection(theC1, theT1f, aT1m, theC2, theT2f, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, aT1m, theT1l, theC2, theT2f, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
}
else
{
Standard_Real aT1m = (theT1l + theT1f) / 2.;
Standard_Real aT2m = (theT2l + theT2f) / 2.;
GetIntersection(theC1, theT1f, aT1m, theC2, theT2f, aT2m, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, theT1f, aT1m, theC2, aT2m, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, aT1m, theT1l, theC2, theT2f, aT2m, theTolConf, theMaxCount, thePInt, theDist, theCount);
GetIntersection(theC1, aT1m, theT1l, theC2, aT2m, theT2l, theTolConf, theMaxCount, thePInt, theDist, theCount);
}
}

View File

@ -830,10 +830,14 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
Standard_Integer parama[2]; Standard_Integer parama[2];
Standard_Integer paramb[2]; Standard_Integer paramb[2];
//
Standard_Integer aNbOfNarea1 = 0, aPrefNarea = 0, aNbMaxNarea1 = 10;
Standard_Integer aNbElts[2] = {0, 0}, aCountElts[2] = {0, 0};
Standard_Boolean isBreak = Standard_False;
// ----------------------------------------- // -----------------------------------------
// Initialisation et remise a zero des maps. // Initialisation et remise a zero des maps.
// ----------------------------------------- // -----------------------------------------
bisectoronetoremove.Clear(); bisectoronetoremove.Clear();
bisectortwotoremove.Clear(); bisectortwotoremove.Clear();
typeofbisectortoremove.Clear(); typeofbisectortoremove.Clear();
@ -843,10 +847,10 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
noofbisectors = noofedges; noofbisectors = noofedges;
beginbisector = 0; beginbisector = 0;
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// Construction de <theedgelist> un edge correspond a un element simple // Construction de <theedgelist> un edge correspond a un element simple
// du contour. // du contour.
// -------------------------------------------------------------------- // --------------------------------------------------------------------
theedgelist = new MAT_ListOfEdge(); theedgelist = new MAT_ListOfEdge();
for(i=0; i<noofedges; i++) { for(i=0; i<noofedges; i++) {
@ -858,9 +862,9 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
theedgelist->Loop(); theedgelist->Loop();
//--------------------------------------------------- //---------------------------------------------------
// Initialisation des bissectrices issues du contour. // Initialisation des bissectrices issues du contour.
//--------------------------------------------------- //---------------------------------------------------
Standard_Real Dist; Standard_Real Dist;
theedgelist->First(); theedgelist->First();
@ -879,9 +883,9 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
(atool.TangentAfter(theedgelist->Current()->EdgeNumber(), myIsOpenResult)); (atool.TangentAfter(theedgelist->Current()->EdgeNumber(), myIsOpenResult));
} }
//---------------------------------------------------- //----------------------------------------------------
// Affectation a chaque edge de ses deux bissectrices. // Affectation a chaque edge de ses deux bissectrices.
//---------------------------------------------------- //----------------------------------------------------
theedgelist->First(); theedgelist->First();
for(i=0; i<theedgelist->Number(); i++) { for(i=0; i<theedgelist->Number(); i++) {
@ -892,9 +896,9 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
theedgelist->Next(); theedgelist->Next();
} }
//=========================================================================== //===========================================================================
// Boucle Principale (etape 2) // Boucle Principale (etape 2)
//=========================================================================== //===========================================================================
Standard_Integer NumberOfIte = 0; Standard_Integer NumberOfIte = 0;
while(theedgelist->Number()>1) { while(theedgelist->Number()>1) {
@ -903,7 +907,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Creation des geometries des bissectrices via le tool. (etape 2.1) // Creation des geometries des bissectrices via le tool. (etape 2.1)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
Standard_Integer aNbBis = noofbisectors - beginbisector;
for(i=beginbisector; i<noofbisectors; i++) { for(i=beginbisector; i<noofbisectors; i++) {
atool.CreateBisector(bisectormap(i)); atool.CreateBisector(bisectormap(i));
@ -917,14 +921,54 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
#endif #endif
} }
//Patch to prevent infinit loop because of
//bad geometry
if(aNbBis == 1)
{
if(aPrefNarea == 1)
{
aNbOfNarea1++;
Standard_Integer edge1number = bisectormap(beginbisector)->FirstEdge()->EdgeNumber();
Standard_Integer edge2number = bisectormap(beginbisector)->SecondEdge()->EdgeNumber();
if(aNbElts[0] == edge1number)
{
aCountElts[0]++;
}
else
{
aCountElts[0] = 0;
aNbElts[0] = edge1number;
}
if(aNbElts[1] == edge2number)
{
aCountElts[1]++;
}
else
{
aCountElts[1] = 0;
aNbElts[1] = edge2number;
}
if(aNbOfNarea1 >= aNbMaxNarea1 && (aCountElts[0] >= aNbMaxNarea1 || aCountElts[1] >= aNbMaxNarea1))
{
isBreak = Standard_True;
}
}
else
{
aNbOfNarea1 = 0;
aCountElts[0] = 0;
aCountElts[1] = 0;
}
}
aPrefNarea = aNbBis;
// --------------------------------------------- // ---------------------------------------------
// Condition de sortie de la boucle principale. // Condition de sortie de la boucle principale.
// --------------------------------------------- // ---------------------------------------------
// Modified by Sergey KHROMOV - Fri Nov 17 10:28:28 2000 Begin // Modified by Sergey KHROMOV - Fri Nov 17 10:28:28 2000 Begin
if (theedgelist->Number() < 3) if (theedgelist->Number() < 3)
break; break;
// Modified by Sergey KHROMOV - Fri Nov 17 10:28:37 2000 End // Modified by Sergey KHROMOV - Fri Nov 17 10:28:37 2000 End
//--------------------------------------------------- //---------------------------------------------------
// boucle 2 Tant qu il y a des bisectrices a effacer. // boucle 2 Tant qu il y a des bisectrices a effacer.
@ -940,43 +984,43 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
//-------------------------------------------------------------- //--------------------------------------------------------------
if (NbIterBis <= EvenNbIterBis+1) if (NbIterBis <= EvenNbIterBis+1)
EdgeNumbers(NbIterBis) = theedgelist->Number(); EdgeNumbers(NbIterBis) = theedgelist->Number();
else else
{ {
for (k = 1; k <= EvenNbIterBis; k++) for (k = 1; k <= EvenNbIterBis; k++)
EdgeNumbers(k) = EdgeNumbers(k+1); EdgeNumbers(k) = EdgeNumbers(k+1);
EdgeNumbers(EvenNbIterBis+1) = theedgelist->Number(); EdgeNumbers(EvenNbIterBis+1) = theedgelist->Number();
} }
if (EdgeNumbers(EvenNbIterBis+1) == EdgeNumbers(1)) if (EdgeNumbers(EvenNbIterBis+1) == EdgeNumbers(1))
ToNullifyNoofbisectorstoremove = Standard_True; ToNullifyNoofbisectorstoremove = Standard_True;
for(i=0; i<theedgelist->Number(); i++) { for(i=0; i<theedgelist->Number(); i++) {
edge = theedgelist->Current(); edge = theedgelist->Current();
if(edge->Distance() == -1.) { if(edge->Distance() == -1.) {
firstbisector = edge->FirstBisector(); firstbisector = edge->FirstBisector();
secondbisector = edge->SecondBisector(); secondbisector = edge->SecondBisector();
edge->Distance(atool.IntersectBisector edge->Distance(atool.IntersectBisector
(firstbisector,secondbisector,intersectionpoint)); (firstbisector,secondbisector,intersectionpoint));
edge->IntersectionPoint(intersectionpoint); edge->IntersectionPoint(intersectionpoint);
if(edge->Distance() == Precision::Infinite()) { if(edge->Distance() == Precision::Infinite()) {
if(firstbisector->IndexNumber() >= beginbisector || if(firstbisector->IndexNumber() >= beginbisector ||
secondbisector->IndexNumber() >= beginbisector) secondbisector->IndexNumber() >= beginbisector)
Intersect(atool,0,noofbisectorstoremove, Intersect(atool,0,noofbisectorstoremove,
firstbisector,secondbisector ); firstbisector,secondbisector );
} }
else { else {
if(firstbisector->IndexNumber() >= beginbisector) { if(firstbisector->IndexNumber() >= beginbisector) {
Intersect(atool,1,noofbisectorstoremove, Intersect(atool,1,noofbisectorstoremove,
firstbisector,secondbisector ); firstbisector,secondbisector );
} }
if(secondbisector->IndexNumber() >= beginbisector) { if(secondbisector->IndexNumber() >= beginbisector) {
Intersect(atool,2,noofbisectorstoremove, Intersect(atool,2,noofbisectorstoremove,
firstbisector,secondbisector ); firstbisector,secondbisector );
} }
} }
} }
theedgelist->Next(); theedgelist->Next();
} }
//------------------------------- //-------------------------------
@ -984,7 +1028,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
//------------------------------- //-------------------------------
if (ToNullifyNoofbisectorstoremove) if (ToNullifyNoofbisectorstoremove)
noofbisectorstoremove = 0; noofbisectorstoremove = 0;
if(noofbisectorstoremove == 0) break; if(noofbisectorstoremove == 0) break;
//--------------------------------------------------- //---------------------------------------------------
@ -993,106 +1037,106 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
for(i=0; i<noofbisectorstoremove; i++) { for(i=0; i<noofbisectorstoremove; i++) {
bisectortoremove = bisectoronetoremove(i); bisectortoremove = bisectoronetoremove(i);
//--------------------------------------------------------------- //---------------------------------------------------------------
// Destruction des bisectrices descendantes de <bisectortoremove> // Destruction des bisectrices descendantes de <bisectortoremove>
// On descend dans l arbre jusqu a ce qu on atteigne // On descend dans l arbre jusqu a ce qu on atteigne
// <bisectortwotoremove(i). // <bisectortwotoremove(i).
//--------------------------------------------------------------- //---------------------------------------------------------------
for(;;){ for(;;){
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
atool.Dump(bisectortoremove->BisectorNumber(),0); atool.Dump(bisectortoremove->BisectorNumber(),0);
#endif #endif
// ---------------------------------- // ----------------------------------
// Annulation de <bisectortoremove>. // Annulation de <bisectortoremove>.
// ---------------------------------- // ----------------------------------
thenumberofbisectors--; thenumberofbisectors--;
currentbisectorlist = bisectortoremove->List(); currentbisectorlist = bisectortoremove->List();
currentbisectorlist->First(); currentbisectorlist->First();
currentbisector = currentbisectorlist->FirstItem(); currentbisector = currentbisectorlist->FirstItem();
previousedge = currentbisector->FirstEdge(); previousedge = currentbisector->FirstEdge();
theedgelist->Init(previousedge); theedgelist->Init(previousedge);
previousedge->Distance(-1.); previousedge->Distance(-1.);
previousedge->FirstBisector()->SecondParameter(Precision::Infinite()); previousedge->FirstBisector()->SecondParameter(Precision::Infinite());
previousedge->SecondBisector()->FirstParameter(Precision::Infinite()); previousedge->SecondBisector()->FirstParameter(Precision::Infinite());
//------------------------------------------ //------------------------------------------
// Annulation des fils de <currentbisector>. // Annulation des fils de <currentbisector>.
//------------------------------------------ //------------------------------------------
while(currentbisectorlist->More()) { while(currentbisectorlist->More()) {
currentbisector = currentbisectorlist->Current(); currentbisector = currentbisectorlist->Current();
currentedge = currentbisector->SecondEdge(); currentedge = currentbisector->SecondEdge();
//--------------------------------------- //---------------------------------------
// Reinsertion de l edge dans le contour. // Reinsertion de l edge dans le contour.
//--------------------------------------- //---------------------------------------
theedgelist->LinkAfter(currentedge); theedgelist->LinkAfter(currentedge);
theedgelist->Next(); theedgelist->Next();
currentedge->FirstBisector(currentbisector); currentedge->FirstBisector(currentbisector);
previousedge->SecondBisector(currentbisector); previousedge->SecondBisector(currentbisector);
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
atool.Dump(currentbisector->BisectorNumber(),0); atool.Dump(currentbisector->BisectorNumber(),0);
#endif #endif
//------------------------------------------------------ //------------------------------------------------------
// Annulation de l intersection ie les fils qui // Annulation de l intersection ie les fils qui
// ont generes l intersection sont prolonges a l infini. // ont generes l intersection sont prolonges a l infini.
//------------------------------------------------------ //------------------------------------------------------
currentbisector->FirstParameter (Precision::Infinite()); currentbisector->FirstParameter (Precision::Infinite());
currentbisector->SecondParameter(Precision::Infinite()); currentbisector->SecondParameter(Precision::Infinite());
atool.TrimBisector(currentbisector); atool.TrimBisector(currentbisector);
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
atool.Dump(currentbisector->BisectorNumber(),1); atool.Dump(currentbisector->BisectorNumber(),1);
#endif #endif
currentedge->Distance(-1.); currentedge->Distance(-1.);
currentedge->FirstBisector()->SecondParameter(Precision::Infinite()); currentedge->FirstBisector()->SecondParameter(Precision::Infinite());
currentedge->SecondBisector()->FirstParameter(Precision::Infinite()); currentedge->SecondBisector()->FirstParameter(Precision::Infinite());
previousedge = currentedge; previousedge = currentedge;
currentbisectorlist->Next(); currentbisectorlist->Next();
} }
theedgelist->Unlink(); theedgelist->Unlink();
//----------------------------------------------------------- //-----------------------------------------------------------
// Test de sortie de la boucle d annulation des bissectrices. // Test de sortie de la boucle d annulation des bissectrices.
//----------------------------------------------------------- //-----------------------------------------------------------
if(bisectortoremove->BisectorNumber() == if(bisectortoremove->BisectorNumber() ==
bisectortwotoremove(i)->BisectorNumber()) break; bisectortwotoremove(i)->BisectorNumber()) break;
//----------------------- //-----------------------
// Descente dans l arbre. // Descente dans l arbre.
//----------------------- //-----------------------
if(typeofbisectortoremove(i) == 1) if(typeofbisectortoremove(i) == 1)
bisectortoremove = bisectortoremove->FirstBisector(); bisectortoremove = bisectortoremove->FirstBisector();
else else
bisectortoremove = bisectortoremove->LastBisector(); bisectortoremove = bisectortoremove->LastBisector();
} //---------------------------------------------------- } //----------------------------------------------------
// Fin boucle d annulation des bissectrices issue de // Fin boucle d annulation des bissectrices issue de
// <bisectoronetoremove(i)>. // <bisectoronetoremove(i)>.
//---------------------------------------------------- //----------------------------------------------------
} //------------------------------------------ } //------------------------------------------
// Fin boucle d annulation des bissectrices. // Fin boucle d annulation des bissectrices.
//------------------------------------------- //-------------------------------------------
#ifdef ICONTINUE #ifdef ICONTINUE
cin>>Icontinue; cin>>Icontinue;
#endif #endif
} //-------------- } //--------------
// Fin Boucle 2. // Fin Boucle 2.
//-------------- //--------------
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Analyse des parametres des intersections sur les bisectrices de chaque // Analyse des parametres des intersections sur les bisectrices de chaque
@ -1103,9 +1147,9 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
currentbisector = theedgelist->Current()->FirstBisector(); currentbisector = theedgelist->Current()->FirstBisector();
if (currentbisector->FirstParameter() == Precision::Infinite() && if (currentbisector->FirstParameter() == Precision::Infinite() &&
currentbisector->SecondParameter() == Precision::Infinite()) { currentbisector->SecondParameter() == Precision::Infinite()) {
parama[0] = -1; parama[0] = -1;
paramb[0] = -1; paramb[0] = -1;
} }
else if(currentbisector->FirstParameter() == Precision::Infinite()) { else if(currentbisector->FirstParameter() == Precision::Infinite()) {
parama[0] = -1; parama[0] = -1;
@ -1116,19 +1160,19 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
parama[0] = 1; parama[0] = 1;
} }
else if (atool.Distance(currentbisector, else if (atool.Distance(currentbisector,
currentbisector->FirstParameter(), currentbisector->FirstParameter(),
currentbisector->SecondParameter()) currentbisector->SecondParameter())
> toleranceofconfusion) { > toleranceofconfusion) {
if((currentbisector->FirstParameter() - if((currentbisector->FirstParameter() -
currentbisector->SecondParameter()) currentbisector->SecondParameter())
*currentbisector->Sense() > 0.) { *currentbisector->Sense() > 0.) {
parama[0] = -1; parama[0] = -1;
paramb[0] = 1; paramb[0] = 1;
} }
else { else {
paramb[0] = -1; paramb[0] = -1;
parama[0] = 1; parama[0] = 1;
} }
} }
else { else {
parama[0] = 1; parama[0] = 1;
@ -1140,36 +1184,36 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
for(i=0; i<theedgelist->Number(); i++) { for(i=0; i<theedgelist->Number(); i++) {
currentbisector = theedgelist->Current()->SecondBisector(); currentbisector = theedgelist->Current()->SecondBisector();
if (currentbisector->FirstParameter() == Precision::Infinite() && if (currentbisector->FirstParameter() == Precision::Infinite() &&
currentbisector->SecondParameter() == Precision::Infinite()) { currentbisector->SecondParameter() == Precision::Infinite()) {
parama[1] = -1; parama[1] = -1;
paramb[1] = -1; paramb[1] = -1;
} }
else if(currentbisector->FirstParameter() == Precision::Infinite()) { else if(currentbisector->FirstParameter() == Precision::Infinite()) {
parama[1] = -1; parama[1] = -1;
paramb[1] = 1; paramb[1] = 1;
} }
else if(currentbisector->SecondParameter() == Precision::Infinite()) { else if(currentbisector->SecondParameter() == Precision::Infinite()) {
paramb[1] = -1; paramb[1] = -1;
parama[1] = 1; parama[1] = 1;
} }
else if (atool.Distance(currentbisector, else if (atool.Distance(currentbisector,
currentbisector->FirstParameter(), currentbisector->FirstParameter(),
currentbisector->SecondParameter()) currentbisector->SecondParameter())
> toleranceofconfusion) { > toleranceofconfusion) {
if((currentbisector->FirstParameter() - if((currentbisector->FirstParameter() -
currentbisector->SecondParameter()) currentbisector->SecondParameter())
*currentbisector->Sense() > 0.) { *currentbisector->Sense() > 0.) {
parama[1] = -1; parama[1] = -1;
paramb[1] = 1; paramb[1] = 1;
}
else {
paramb[1] = -1;
parama[1] = 1;
}
} }
else { else {
parama[1] = 1; paramb[1] = -1;
paramb[1] = 1; parama[1] = 1;
}
}
else {
parama[1] = 1;
paramb[1] = 1;
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------
@ -1189,24 +1233,24 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
if(paramb[0] > 0 && parama[1] > 0) { if(paramb[0] > 0 && parama[1] > 0) {
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
cout <<" A ELIMINER "<<endl; cout <<" A ELIMINER "<<endl;
#endif #endif
if(narea < 0) { if(narea < 0) {
firstarea(++narea) = theedgelist->Index(); firstarea(++narea) = theedgelist->Index();
lastarea(narea) = firstarea(narea); lastarea(narea) = firstarea(narea);
noofarea(narea) = 1; noofarea(narea) = 1;
} }
else { else {
if(theedgelist->Index() == lastarea(narea)+1) { if(theedgelist->Index() == lastarea(narea)+1) {
lastarea(narea)++; lastarea(narea)++;
noofarea(narea)++; noofarea(narea)++;
} }
else { else {
firstarea(++narea) = theedgelist->Index(); firstarea(++narea) = theedgelist->Index();
lastarea(narea) = firstarea(narea); lastarea(narea) = firstarea(narea);
noofarea(narea) = 1; noofarea(narea) = 1;
} }
} }
} }
parama[0] = parama[1]; parama[0] = parama[1];
paramb[0] = paramb[1]; paramb[0] = paramb[1];
@ -1217,10 +1261,10 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
compact = 0; compact = 0;
if(narea > 0) { if(narea > 0) {
if(lastarea(narea) == theedgelist->Number() && firstarea(0) == 1) { if(lastarea(narea) == theedgelist->Number() && firstarea(0) == 1) {
firstarea(0) = firstarea(narea); firstarea(0) = firstarea(narea);
noofarea(0) = noofarea(0)+noofarea(narea); noofarea(0) = noofarea(0)+noofarea(narea);
compact = noofarea(narea); compact = noofarea(narea);
narea--; narea--;
} }
} }
@ -1230,6 +1274,13 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
// Sortie de la boucle principale si il n y a pas d edge a eliminer. // Sortie de la boucle principale si il n y a pas d edge a eliminer.
// (etape 2.6) // (etape 2.6)
//------------------------------------------------------------------ //------------------------------------------------------------------
//
//Patch to break infinite loop.
if(narea == 1 && isBreak)
{
narea = 0;
}
//
if(narea == 0) { if(narea == 0) {
interrupt = Standard_True; interrupt = Standard_True;
break; break;
@ -1253,18 +1304,18 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
edgetoremove = theedgelist->Brackets(firstarea(i)-shift); edgetoremove = theedgelist->Brackets(firstarea(i)-shift);
edgetoremove->FirstBisector()->EndPoint(edgetoremove edgetoremove->FirstBisector()->EndPoint(edgetoremove
->IntersectionPoint()); ->IntersectionPoint());
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
atool.Dump(edgetoremove->FirstBisector()->BisectorNumber(),0); atool.Dump(edgetoremove->FirstBisector()->BisectorNumber(),0);
#endif #endif
edgetoremove->FirstBisector()->FirstParameter edgetoremove->FirstBisector()->FirstParameter
(edgetoremove->FirstBisector()->SecondParameter()); (edgetoremove->FirstBisector()->SecondParameter());
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
if(atool.TrimBisector(edgetoremove->FirstBisector())) if(atool.TrimBisector(edgetoremove->FirstBisector()))
atool.Dump(edgetoremove->FirstBisector()->BisectorNumber(),1); atool.Dump(edgetoremove->FirstBisector()->BisectorNumber(),1);
#else #else
atool.TrimBisector(edgetoremove->FirstBisector()); atool.TrimBisector(edgetoremove->FirstBisector());
#endif #endif
@ -1273,56 +1324,56 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
bisectormap(noofbisectors)->IndexNumber(noofbisectors); bisectormap(noofbisectors)->IndexNumber(noofbisectors);
bisectormap(noofbisectors)->DistIssuePoint(edgetoremove->Distance()); bisectormap(noofbisectors)->DistIssuePoint(edgetoremove->Distance());
bisectormap(noofbisectors)->IssuePoint(edgetoremove bisectormap(noofbisectors)->IssuePoint(edgetoremove
->IntersectionPoint()); ->IntersectionPoint());
bisectormap(noofbisectors)->FirstEdge(theedgelist->PreviousItem()); bisectormap(noofbisectors)->FirstEdge(theedgelist->PreviousItem());
bisectormap(noofbisectors)->AddBisector(edgetoremove bisectormap(noofbisectors)->AddBisector(edgetoremove
->FirstBisector()); ->FirstBisector());
for(j=0; j<noofarea(i); j++) { for(j=0; j<noofarea(i); j++) {
theedgelist->Unlink(); theedgelist->Unlink();
theedgelist->Next(); theedgelist->Next();
shift++; shift++;
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
cout<<" Suppression de l'arete : "<<edgetoremove->EdgeNumber()<<endl; cout<<" Suppression de l'arete : "<<edgetoremove->EdgeNumber()<<endl;
#endif #endif
if(all == 0 || j+1 != noofarea(i)) { if(all == 0 || j+1 != noofarea(i)) {
bisectormap(noofbisectors)->AddBisector(edgetoremove bisectormap(noofbisectors)->AddBisector(edgetoremove
->SecondBisector()); ->SecondBisector());
} }
edgetoremove->SecondBisector()->EndPoint(edgetoremove edgetoremove->SecondBisector()->EndPoint(edgetoremove
->IntersectionPoint()); ->IntersectionPoint());
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
atool.Dump(edgetoremove->SecondBisector()->BisectorNumber(),0); atool.Dump(edgetoremove->SecondBisector()->BisectorNumber(),0);
#endif #endif
edgetoremove->SecondBisector()->SecondParameter edgetoremove->SecondBisector()->SecondParameter
(edgetoremove->SecondBisector()->FirstParameter()); (edgetoremove->SecondBisector()->FirstParameter());
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
if(atool.TrimBisector(edgetoremove->SecondBisector())) if(atool.TrimBisector(edgetoremove->SecondBisector()))
atool.Dump(edgetoremove->SecondBisector()->BisectorNumber(),1); atool.Dump(edgetoremove->SecondBisector()->BisectorNumber(),1);
#else #else
atool.TrimBisector(edgetoremove->SecondBisector()); atool.TrimBisector(edgetoremove->SecondBisector());
#endif #endif
edgetoremove = theedgelist->Current(); edgetoremove = theedgelist->Current();
} }
bisectormap(noofbisectors)->SecondEdge(theedgelist->Current()); bisectormap(noofbisectors)->SecondEdge(theedgelist->Current());
theedgelist->PreviousItem() theedgelist->PreviousItem()
->SecondBisector(bisectormap(noofbisectors)); ->SecondBisector(bisectormap(noofbisectors));
theedgelist->Current()->FirstBisector(bisectormap(noofbisectors)); theedgelist->Current()->FirstBisector(bisectormap(noofbisectors));
bisectormap(noofbisectors)->FirstVector bisectormap(noofbisectors)->FirstVector
(atool.Tangent (atool.Tangent
(bisectormap(noofbisectors)->FirstBisector() (bisectormap(noofbisectors)->FirstBisector()
->BisectorNumber())); ->BisectorNumber()));
bisectormap(noofbisectors)->SecondVector bisectormap(noofbisectors)->SecondVector
(atool.Tangent (atool.Tangent
(bisectormap(noofbisectors)->LastBisector() (bisectormap(noofbisectors)->LastBisector()
->BisectorNumber())); ->BisectorNumber()));
noofbisectors++; noofbisectors++;
@ -1330,7 +1381,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
theedgelist->Current()->Distance(-1); theedgelist->Current()->Distance(-1);
theedgelist->PreviousItem()->FirstBisector() theedgelist->PreviousItem()->FirstBisector()
->SecondParameter(Precision::Infinite()); ->SecondParameter(Precision::Infinite());
theedgelist->Current()->SecondBisector()->FirstParameter(Precision::Infinite()); theedgelist->Current()->SecondBisector()->FirstParameter(Precision::Infinite());
} }
@ -1348,8 +1399,8 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
NumberOfIte++; NumberOfIte++;
} //=============================================== } //===============================================
// Fin Boucle Principale. // Fin Boucle Principale.
//=============================================== //===============================================
//---------- //----------
// etape 3. // etape 3.
@ -1375,35 +1426,35 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
//------------------------------------------------------------------ //------------------------------------------------------------------
if(theedgelist->Number() > 1) { //Now this branch is never reachable if(theedgelist->Number() > 1) { //Now this branch is never reachable
//because the case edgenumber = 2 is processed in the main loop //because the case edgenumber = 2 is processed in the main loop
theedgelist->First(); theedgelist->First();
edge = theedgelist->Current(); edge = theedgelist->Current();
if(edge->FirstBisector()->IndexNumber() == noofbisectors-1) { if(edge->FirstBisector()->IndexNumber() == noofbisectors-1) {
// Modified by skv - Tue Sep 13 12:13:28 2005 IDEM Begin // Modified by skv - Tue Sep 13 12:13:28 2005 IDEM Begin
if (atool.TrimBisector(edge->SecondBisector(), if (atool.TrimBisector(edge->SecondBisector(),
edge->FirstBisector()->IssuePoint())) { edge->FirstBisector()->IssuePoint())) {
if (edge->SecondBisector()->EndPoint() == 0) if (edge->SecondBisector()->EndPoint() == 0)
edge->SecondBisector()->EndPoint(edge->FirstBisector()->IssuePoint()); edge->SecondBisector()->EndPoint(edge->FirstBisector()->IssuePoint());
bisectormap(noofbisectors-1)->AddBisector(edge->SecondBisector()); bisectormap(noofbisectors-1)->AddBisector(edge->SecondBisector());
} else } else
semiInfinite = Standard_True; semiInfinite = Standard_True;
// Modified by skv - Tue Sep 13 12:13:28 2005 IDEM End // Modified by skv - Tue Sep 13 12:13:28 2005 IDEM End
} }
else { else {
// Modified by skv - Tue Sep 13 12:13:28 2005 IDEM Begin // Modified by skv - Tue Sep 13 12:13:28 2005 IDEM Begin
if (atool.TrimBisector(edge->FirstBisector(), if (atool.TrimBisector(edge->FirstBisector(),
edge->SecondBisector()->IssuePoint())) { edge->SecondBisector()->IssuePoint())) {
if (edge->FirstBisector()->EndPoint() == 0) if (edge->FirstBisector()->EndPoint() == 0)
edge->FirstBisector()->EndPoint(edge->SecondBisector()->IssuePoint()); edge->FirstBisector()->EndPoint(edge->SecondBisector()->IssuePoint());
bisectormap(noofbisectors-1)->AddBisector(edge->FirstBisector()); bisectormap(noofbisectors-1)->AddBisector(edge->FirstBisector());
} else } else
semiInfinite = Standard_True; semiInfinite = Standard_True;
// Modified by skv - Tue Sep 13 12:13:28 2005 IDEM End // Modified by skv - Tue Sep 13 12:13:28 2005 IDEM End
} }
if (!semiInfinite) { if (!semiInfinite) {
thenumberofbisectors--; thenumberofbisectors--;
bisectormap(noofbisectors-1)->SecondEdge(edge); bisectormap(noofbisectors-1)->SecondEdge(edge);
bisectormap(noofbisectors-1)->BisectorNumber(-1); bisectormap(noofbisectors-1)->BisectorNumber(-1);
} }
} }
} }
@ -1445,12 +1496,12 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool)
//======================================================================== //========================================================================
void MAT2d_Mat2d::LoadBisectorsToRemove void MAT2d_Mat2d::LoadBisectorsToRemove
( Standard_Integer& noofbisectorstoremove, ( Standard_Integer& noofbisectorstoremove,
const Standard_Real distance1, const Standard_Real distance1,
const Standard_Real distance2, const Standard_Real distance2,
const Handle(MAT_Bisector)& firstbisectortoremove1, const Handle(MAT_Bisector)& firstbisectortoremove1,
const Handle(MAT_Bisector)& firstbisectortoremove2, const Handle(MAT_Bisector)& firstbisectortoremove2,
const Handle(MAT_Bisector)& lastbisectortoremove1, const Handle(MAT_Bisector)& lastbisectortoremove1,
const Handle(MAT_Bisector)& lastbisectortoremove2 ) const Handle(MAT_Bisector)& lastbisectortoremove2 )
{ {
Standard_Integer found,index; Standard_Integer found,index;
@ -1463,28 +1514,28 @@ void MAT2d_Mat2d::LoadBisectorsToRemove
lastbisectortoremove[1] = lastbisectortoremove2; lastbisectortoremove[1] = lastbisectortoremove2;
if (distance1 < Precision::Infinite() && if (distance1 < Precision::Infinite() &&
distance2 == Precision::Infinite() ) index = 0; distance2 == Precision::Infinite() ) index = 0;
else if(distance2 < Precision::Infinite() && else if(distance2 < Precision::Infinite() &&
distance1 == Precision::Infinite() ) index = 1; distance1 == Precision::Infinite() ) index = 1;
else index = -1; else index = -1;
if(index != -1) { if(index != -1) {
found = noofbisectorstoremove; found = noofbisectorstoremove;
for(int j=0; j<noofbisectorstoremove; j++) { for(int j=0; j<noofbisectorstoremove; j++) {
if(bisectoronetoremove(j)->BisectorNumber() == if(bisectoronetoremove(j)->BisectorNumber() ==
firstbisectortoremove[index]->BisectorNumber()) { firstbisectortoremove[index]->BisectorNumber()) {
found = j; found = j;
if(bisectortwotoremove(j)->BisectorNumber() < if(bisectortwotoremove(j)->BisectorNumber() <
lastbisectortoremove[index]->BisectorNumber())found = -1; lastbisectortoremove[index]->BisectorNumber())found = -1;
break; break;
} }
} }
if(found != -1) { if(found != -1) {
#ifdef OCCT_DEBUG_Mat #ifdef OCCT_DEBUG_Mat
cout<<" first last bisector to remove :"<< cout<<" first last bisector to remove :"<<
firstbisectortoremove[index]->BisectorNumber()<<" "<< firstbisectortoremove[index]->BisectorNumber()<<" "<<
lastbisectortoremove[index]->BisectorNumber()<<endl; lastbisectortoremove[index]->BisectorNumber()<<endl;
#endif #endif
bisectoronetoremove.Bind(found,firstbisectortoremove[index]); bisectoronetoremove.Bind(found,firstbisectortoremove[index]);
bisectortwotoremove.Bind(found,lastbisectortoremove[index]); bisectortwotoremove.Bind(found,lastbisectortoremove[index]);
@ -1511,10 +1562,10 @@ void MAT2d_Mat2d::LoadBisectorsToRemove
// descendants les plus a gauche et les plus a droite. // descendants les plus a gauche et les plus a droite.
//========================================================================v //========================================================================v
void MAT2d_Mat2d::Intersect( MAT2d_Tool2d& atool, void MAT2d_Mat2d::Intersect( MAT2d_Tool2d& atool,
const Standard_Integer aside, const Standard_Integer aside,
Standard_Integer& noofbisectortoremove, Standard_Integer& noofbisectortoremove,
const Handle(MAT_Bisector)& firstbisector, const Handle(MAT_Bisector)& firstbisector,
const Handle(MAT_Bisector)& secondbisector) const Handle(MAT_Bisector)& secondbisector)
{ {
Standard_Integer bisectornumber; Standard_Integer bisectornumber;
Standard_Real distant,saveparameter; Standard_Real distant,saveparameter;
@ -1530,9 +1581,9 @@ void MAT2d_Mat2d::Intersect( MAT2d_Tool2d& atool,
for(bisectornumber = 0; bisectornumber<2; bisectornumber++) { for(bisectornumber = 0; bisectornumber<2; bisectornumber++) {
if(aside == 0) { if(aside == 0) {
if(bisectornumber == 0) if(bisectornumber == 0)
firstbisectortoremove[bisectornumber] = secondbisector; firstbisectortoremove[bisectornumber] = secondbisector;
else else
firstbisectortoremove[bisectornumber] = firstbisector; firstbisectortoremove[bisectornumber] = firstbisector;
} }
else if(aside == 1) { else if(aside == 1) {
firstbisectortoremove[bisectornumber] = firstbisector; firstbisectortoremove[bisectornumber] = firstbisector;
@ -1550,37 +1601,37 @@ void MAT2d_Mat2d::Intersect( MAT2d_Tool2d& atool,
if(firstbisectortoremove[bisectornumber]->List()->IsEmpty())continue; if(firstbisectortoremove[bisectornumber]->List()->IsEmpty())continue;
if(bisectornumber == 0) if(bisectornumber == 0)
previousbisector = firstbisectortoremove[bisectornumber] previousbisector = firstbisectortoremove[bisectornumber]
->FirstBisector(); ->FirstBisector();
else else
previousbisector = firstbisectortoremove[bisectornumber] previousbisector = firstbisectortoremove[bisectornumber]
->LastBisector(); ->LastBisector();
} }
distant = distance[bisectornumber]; distant = distance[bisectornumber];
while(!previousbisector->List()->IsEmpty()) { while(!previousbisector->List()->IsEmpty()) {
if(bisectornumber == 0) if(bisectornumber == 0)
previousbisector = previousbisector->FirstBisector(); previousbisector = previousbisector->FirstBisector();
else else
previousbisector = previousbisector->LastBisector(); previousbisector = previousbisector->LastBisector();
if(aside == 1 || (aside == 0 && bisectornumber == 0)) { if(aside == 1 || (aside == 0 && bisectornumber == 0)) {
saveparameter = previousbisector->FirstParameter(); saveparameter = previousbisector->FirstParameter();
distant = atool.IntersectBisector distant = atool.IntersectBisector
(firstbisector,previousbisector,intersectionpoint); (firstbisector,previousbisector,intersectionpoint);
previousbisector->FirstParameter(saveparameter); previousbisector->FirstParameter(saveparameter);
} }
else { else {
saveparameter = previousbisector->SecondParameter(); saveparameter = previousbisector->SecondParameter();
distant = atool.IntersectBisector distant = atool.IntersectBisector
(previousbisector,secondbisector,intersectionpoint); (previousbisector,secondbisector,intersectionpoint);
previousbisector->SecondParameter(saveparameter); previousbisector->SecondParameter(saveparameter);
} }
if(distant < Precision::Infinite()) { if(distant < Precision::Infinite()) {
distance[bisectornumber] = distant; distance[bisectornumber] = distant;
lastbisectortoremove[bisectornumber] = lastbisector; lastbisectortoremove[bisectornumber] = lastbisector;
} }
lastbisector = previousbisector; lastbisector = previousbisector;
@ -1592,9 +1643,9 @@ void MAT2d_Mat2d::Intersect( MAT2d_Tool2d& atool,
//--------------------------------------- //---------------------------------------
LoadBisectorsToRemove(noofbisectortoremove, LoadBisectorsToRemove(noofbisectortoremove,
distance[0],distance[1], distance[0],distance[1],
firstbisectortoremove[0],firstbisectortoremove[1], firstbisectortoremove[0],firstbisectortoremove[1],
lastbisectortoremove[0] ,lastbisectortoremove[1]); lastbisectortoremove[0] ,lastbisectortoremove[1]);
} }
//======================================================================== //========================================================================

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
mkevol result s mkevol result s
updatevol s_5 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1 updatevol s_4 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1
buildevol buildevol
set square 87027.5 set square 87027.5

View File

@ -8,7 +8,7 @@ tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
mkevol result s mkevol result s
updatevol s_5 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1 updatevol s_6 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1
buildevol buildevol
set square 81492.8 set square 81492.8

View File

@ -8,7 +8,7 @@ tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
mkevol result s mkevol result s
updatevol s_6 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1 updatevol s_5 0 1*SCALE1 1 2*SCALE1 2 1*SCALE1
buildevol buildevol
set square 81299.7 set square 81299.7

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_5 blend result s 1*SCALE1 s_4
set square 91635.9 set square 91635.9

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_5 1*SCALE1 s_2 1*SCALE1 s_1 blend result s 1*SCALE1 s_4 1*SCALE1 s_2 1*SCALE1 s_1
set square 90904.5 set square 90904.5

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_6 1*SCALE1 s_8 1*SCALE1 s_5 blend result s 1*SCALE1 s_6 1*SCALE1 s_9 1*SCALE1 s_4
set square 90939.5 set square 90939.5

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_5 blend result s 1*SCALE1 s_6
set square 81863.7 set square 81863.7

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_5 1*SCALE1 s_8 1*SCALE1 s_6 blend result s 1*SCALE1 s_5 1*SCALE1 s_10 1*SCALE1 s_6
set square 80209.3 set square 80209.3

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_6 blend result s 1*SCALE1 s_5
set square 81743.8 set square 81743.8

View File

@ -7,6 +7,6 @@ pipe s w profile
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1
fsameparameter s SCALE1*1.e-7 fsameparameter s SCALE1*1.e-7
explode s E explode s E
blend result s 1*SCALE1 s_6 1*SCALE1 s_10 1*SCALE1 s_7 blend result s 1*SCALE1 s_5 1*SCALE1 s_8 1*SCALE1 s_7
set square 80586.1 set square 80586.1

View File

@ -4,6 +4,7 @@
#ttranslate s1 s2 5 5 0 #ttranslate s1 s2 5 5 0
#cut s s1 s2 #cut s s1 s2
#save s CFI_i1234fis.rle #save s CFI_i1234fis.rle
puts "TODO ?OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file CFI_i1234fis.rle] s restore [locate_data_file CFI_i1234fis.rle] s
tscale s 0 0 0 SCALE1 tscale s 0 0 0 SCALE1

View File

@ -1,4 +1,5 @@
## buc60289 ## buc60289
puts "TODO ?OCC24255 ALL: Error : The length of the resulting shape is"
restore [locate_data_file heal-Face1.rle] a restore [locate_data_file heal-Face1.rle] a
restore [locate_data_file Plan.rle] b restore [locate_data_file Plan.rle] b

View File

@ -31,7 +31,7 @@ GetShape D $Lin2:1:2 L1
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr

View File

@ -31,9 +31,10 @@ if { [regexp {OK} $che ] != 1} {
renamevar a result renamevar a result
} else { } else {
puts "OK BUC60782: offset is created" puts "OK BUC60782: offset is created"
tpcompound result compound result_1 a result
} }
} }
set square 0 set square 4.24716e+006
set 2dviewer 0 set 2dviewer 0

View File

@ -15,7 +15,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
if [catch {featperformval dprism result 55 cyl_3 } catch_result] { if [catch {featperformval dprism result 55 cyl_3 } catch_result] {
puts "Faulty OCC423 (case 1): function FEATPERFORMVAL works wrongly" puts "Faulty OCC423 (case 1): function FEATPERFORMVAL works wrongly"

View File

@ -20,5 +20,5 @@ if { [regexp {WIRE} $list] == 0 } {
renamevar result_1 result renamevar result_1 result
set length 320.442 set length 307.876
set 2dviewer 1 set 2dviewer 1

View File

@ -42,6 +42,6 @@ if { [catch { mkoffset result a_1 1 5 } status] } {
} }
} }
} }
set length 0 set length 8577.24
set 2dviewer 0 set 2dviewer 0
} }

View File

@ -18,9 +18,9 @@ explode p f
mksurface ss1 p_1 mksurface ss1 p_1
mksurface ss2 p_2 mksurface ss2 p_2
mksurface ss3 p_3 mksurface ss3 p_3
offset o1 ss1 0.1 offset o1 ss1 -0.1
offset o2 ss2 0.1 offset o2 ss2 -0.1
offset o3 ss3 0.1 offset o3 ss3 -0.1
mkface res o2 mkface res o2
set info [sprops res] set info [sprops res]

View File

@ -3,6 +3,7 @@ puts "TODO ?OCC24156 MacOS: An exception was caught"
puts "TODO OCC24156 MacOS: TEST INCOMPLETE" puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
puts "TODO OCC24156 MacOS: \\*\\*\\* Abort" puts "TODO OCC24156 MacOS: \\*\\*\\* Abort"
puts "TODO OCC24156 MacOS: ... The exception is" puts "TODO OCC24156 MacOS: ... The exception is"
puts "TODO ?OCC24255 ALL: An exception"
puts "================" puts "================"
puts "OCC23952" puts "OCC23952"

View File

@ -17,17 +17,17 @@ if [catch { mkoffset resoffset pp 1 -1. i } ] {
} else { } else {
renamevar resoffset_1 result renamevar resoffset_1 result
set length 32 set length 42
set nb_v_good 5 set nb_v_good 6
set nb_e_good 5 set nb_e_good 7
set nb_w_good 1 set nb_w_good 1
set nb_f_good 0 set nb_f_good 0
set nb_sh_good 0 set nb_sh_good 0
set nb_sol_good 0 set nb_sol_good 0
set nb_compsol_good 0 set nb_compsol_good 0
set nb_compound_good 0 set nb_compound_good 0
set nb_shape_good 11 set nb_shape_good 14
display result display result
fit fit

View File

@ -15,7 +15,7 @@ if [catch { mkoffset resoffset a 1 2. } ] {
} else { } else {
renamevar resoffset_1 result renamevar resoffset_1 result
set length 50.2655 set length 75.3982
set nb_v_good 1 set nb_v_good 1
set nb_e_good 1 set nb_e_good 1

View File

@ -15,7 +15,7 @@ if [catch { mkoffset resoffset a 1 -3. } ] {
} else { } else {
renamevar resoffset_1 result renamevar resoffset_1 result
set length 81.6814 set length 43.9823
set nb_v_good 1 set nb_v_good 1
set nb_e_good 1 set nb_e_good 1

View File

@ -33,7 +33,7 @@ GetShape D $Lin2:1:2 L1;
#4 Prism (after step #1) #4 Prism (after step #1)
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr
GetReference D $Prism; ## check is reference set GetReference D $Prism; ## check is reference set

View File

@ -33,7 +33,7 @@ GetShape D $Lin2:1:2 L1;
#4 Prism (after step #1) #4 Prism (after step #1)
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr
GetReference D $Prism; ## check is reference set GetReference D $Prism; ## check is reference set

View File

@ -56,7 +56,7 @@ GetShape D $Lin2:1:2 L1;
#3 Prism #3 Prism
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr
GetReference D $Prism; ## check is reference set GetReference D $Prism; ## check is reference set

View File

@ -54,7 +54,7 @@ GetShape D $Lin2:1:2 L1;
#3 Prism #3 Prism
NewCommand D NewCommand D
AddDriver D Prism Box PTxyz AddDriver D Prism Box PTxyz
set Prism [AddPrism D $Lin2 300 0] set Prism [AddPrism D $Lin2 300 1]
ComputeFun D $Prism:1 ComputeFun D $Prism:1
GetShape D $Prism:1:2 Pr GetShape D $Prism:1:2 Pr
GetReference D $Prism; ## check is reference set GetReference D $Prism; ## check is reference set

View File

@ -1,7 +1,7 @@
# Original bug : pro12877 # Original bug : pro12877
# 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" #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

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperform dprism result featperform dprism result
set square 93872.9 set square 93872.9

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperformval dprism result -100 featperformval dprism result -100
set square 78539.8 set square 87985.1

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperformval dprism result 100 cyl_3 featperformval dprism result 100 cyl_3
set square 87914.5 set square 87914.5

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperform dprism result cyl_3 featperform dprism result cyl_3
set square 93058.7 set square 93058.7

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperformval dprism result 100 featperformval dprism result 100
set square 108523 set square 93058.7

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperformval dprism result 55 cyl_3 featperformval dprism result 55 cyl_3
set square 94944.4 set square 94944.4

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperform dprism result cyl_3 featperform dprism result cyl_3
set square 93872.9 set square 93872.9

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 0 -100 ttranslate cont 0 0 -100
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperformval dprism result -100 featperformval dprism result -100
set square 78539.8 set square 81634.8

View File

@ -4,7 +4,7 @@ mkplane cont cont
nexplode cyl F nexplode cyl F
ttranslate cont 0 0 -100 ttranslate cont 0 0 -100
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperform dprism result featperform dprism result
set square 83382.4 set square 83382.4

View File

@ -9,7 +9,7 @@ ttranslate cont 0 0 -100
# #
mksurface surf cyl_3 mksurface surf cyl_3
mkface face surf mkface face surf
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperformval dprism result 100 face featperformval dprism result 100 face
set square 81610.6 set square 81610.6

View File

@ -3,7 +3,7 @@ restore [locate_data_file contour.rle] cont
mkplane cont cont mkplane cont cont
nexplode cyl F nexplode cyl F
featdprism cyl cont cont 10 0 1 featdprism cyl cont cont -10 0 1
featperform dprism result cyl_3 cyl_3 featperform dprism result cyl_3 cyl_3
set square 93872.9 set square 93872.9

View File

@ -5,7 +5,7 @@ nexplode cyl F
ttranslate cont 0 0 -100 ttranslate cont 0 0 -100
ttranslate cont 0 200 0 ttranslate cont 0 200 0
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperformval dprism result 100 featperformval dprism result 100
set square 108523 set square 103687

View File

@ -10,7 +10,7 @@ ttranslate cont 0 200 0
# #
mksurface surf cyl_3 mksurface surf cyl_3
mkface face surf mkface face surf
featdprism cyl cont cont 10 1 1 featdprism cyl cont cont -10 1 1
featperformval dprism result 55 face featperformval dprism result 55 face
set square 99444.8 set square 99444.8

View File

@ -7,6 +7,6 @@ polyline profile 0 0 0 10 0 0 5 0 5 0 0 0
mkplane profile profile mkplane profile profile
pipe s w profile pipe s w profile
OFFSETSHAPE -1 {s_2 s_3} $calcul $type OFFSETSHAPE -1 {s_2 s_4} $calcul $type
set volume 259.68 set volume 259.68

View File

@ -5,6 +5,6 @@ polyline profile 0 0 0 10 0 0 5 0 5 0 0 0
mkplane profile profile mkplane profile profile
pipe s w profile pipe s w profile
OFFSETSHAPE -1 {s_4 s_5} $calcul $type OFFSETSHAPE -1 {s_3 s_5} $calcul $type
set volume 445.962 set volume 445.962

View File

@ -1,3 +1,5 @@
puts "TODO OCC24255 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_019.brep] s restore [locate_data_file offset_wire_019.brep] s
set length 1030.64 set length 1030.64

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ?OCC23068 ALL: Error : The offset cannot be built." puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO OCC24255 ALL: Faulty shapes in variables"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 322.054
set nbsh_v 0 set nbsh_v 551
set nbsh_e 0 set nbsh_e 551
set nbsh_w 0 set nbsh_w 1

View File

@ -1,7 +1,7 @@
restore [locate_data_file offset_wire_081.brep] s restore [locate_data_file offset_wire_081.brep] s
set length 376.906 set length 376.906
set nbsh_v 66 set nbsh_v 65
set nbsh_e 66 set nbsh_e 65
set nbsh_w 1 set nbsh_w 1

View File

@ -1,7 +1,7 @@
restore [locate_data_file offset_wire_089.brep] s restore [locate_data_file offset_wire_089.brep] s
set length 896.364 set length 896.364
set nbsh_v 18 set nbsh_v 19
set nbsh_e 18 set nbsh_e 19
set nbsh_w 1 set nbsh_w 1

View File

@ -1,12 +1,12 @@
puts "TODO ?OCC23068 ALL: An exception was caught" #puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" #puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." #puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ?OCC23068 ALL: Error : The offset cannot be built." #puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
restore [locate_data_file offset_wire_003.brep] s restore [locate_data_file offset_wire_003.brep] s
set length 0 set length 787.515
set nbsh_v 0 set nbsh_v 78
set nbsh_e 0 set nbsh_e 78
set nbsh_w 0 set nbsh_w 1

View File

@ -5,8 +5,8 @@ puts "TODO ?OCC23748 ALL: Error: Offset is not done."
restore [locate_data_file offset_wire_015.brep] s restore [locate_data_file offset_wire_015.brep] s
set length 0 set length 549.222
set nbsh_v 0 set nbsh_v 55
set nbsh_e 0 set nbsh_e 55
set nbsh_w 0 set nbsh_w 1

View File

@ -1,6 +1,7 @@
cpulimit 2400 cpulimit 2400
puts "TODO OCC23068 ALL: Error : The offset cannot be built." puts "TODO OCC23068 ALL: Error : The offset cannot be built."
puts "TODO OCC23748 ALL: Error: Offset is not done." puts "TODO OCC23748 ALL: Error: Offset is not done."
#puts "TODO OCC24255 ALL: An exception was caught"
restore [locate_data_file offset_wire_041.brep] s restore [locate_data_file offset_wire_041.brep] s

View File

@ -3,11 +3,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 282.776
set nbsh_v 0 set nbsh_v 524
set nbsh_e 0 set nbsh_e 524
set nbsh_w 0 set nbsh_w 1

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_067.brep] s restore [locate_data_file offset_wire_067.brep] s
set length 0 set length 17.5164
set nbsh_v 0 set nbsh_v 40
set nbsh_e 0 set nbsh_e 40
set nbsh_w 0 set nbsh_w 2

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_2 "
restore [locate_data_file offset_wire_081.brep] s restore [locate_data_file offset_wire_081.brep] s
set length 0 set length 291.991
set nbsh_v 0 set nbsh_v 20
set nbsh_e 0 set nbsh_e 20
set nbsh_w 0 set nbsh_w 1

View File

@ -1,8 +1,7 @@
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_089.brep] s restore [locate_data_file offset_wire_089.brep] s
set length 953.42 set length 746.196
set nbsh_v 20 set nbsh_v 17
set nbsh_e 20 set nbsh_e 17
set nbsh_w 1 set nbsh_w 1

View File

@ -8,5 +8,5 @@ restore [locate_data_file offset_wire_012.brep] s
set length 0 set length 0
set nbsh_v 0 set nbsh_v 0
set nbsh_e 0 set nbsh_e 0
set nbsh_w 0 set nbsh_w 1

View File

@ -1,7 +1,3 @@
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_4"
puts "TODO OCC23068 ALL: Error : The length of the resulting shape is"
puts "TODO OCC23068 ALL: Error : The resulting shape is WRONG because it must contain"
restore [locate_data_file offset_wire_038.brep] s restore [locate_data_file offset_wire_038.brep] s
set length 223.954 set length 223.954

View File

@ -3,11 +3,13 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ?OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_4"
puts "TODO ?OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_17"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 240.01
set nbsh_v 0 set nbsh_v 434
set nbsh_e 0 set nbsh_e 434
set nbsh_w 0 set nbsh_w 2

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
#puts "TODO ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_066.brep] s restore [locate_data_file offset_wire_066.brep] s
set length 0 set length 45.4428
set nbsh_v 0 set nbsh_v 52
set nbsh_e 0 set nbsh_e 52
set nbsh_w 0 set nbsh_w 1

View File

@ -5,8 +5,8 @@ puts "TODO ?OCC23748 ALL: Error: Offset is not done."
restore [locate_data_file offset_wire_081.brep] s restore [locate_data_file offset_wire_081.brep] s
set length 0 set length 428.734
set nbsh_v 0 set nbsh_v 18
set nbsh_e 0 set nbsh_e 18
set nbsh_w 0 set nbsh_w 2

View File

@ -1,8 +1,7 @@
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_089.brep] s restore [locate_data_file offset_wire_089.brep] s
set length 1110.06 set length 383.716
set nbsh_v 17 set nbsh_v 4
set nbsh_e 17 set nbsh_e 4
set nbsh_w 1 set nbsh_w 1

View File

@ -1,17 +1,20 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result" #puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
#puts "TODO OCC24255 ALL: An exception was caught"
puts "TODO OCC24255 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Error : The offset cannot be built."
set os "ALL" set os "ALL"
if {[array get env os_type] != ""} { if {[array get env os_type] != ""} {
set os $env(os_type) set os $env(os_type)
} }
if { #if {
[string compare $os "Mandriva2010" ] != 0 # [string compare $os "Mandriva2010" ] != 0
&& [string compare $os "Debian40" ] != 0 # && [string compare $os "Debian40" ] != 0
&& [string compare $os "Mandriva2008" ] != 0 # && [string compare $os "Mandriva2008" ] != 0
} { # } {
puts "TODO OCC23068 $os: Error : The resulting shape is WRONG" # puts "TODO OCC23068 $os: Error : The resulting shape is WRONG"
} #}
restore [locate_data_file offset_wire_041.brep] s restore [locate_data_file offset_wire_041.brep] s

View File

@ -8,7 +8,7 @@ puts "TODO ?OCC23748 ALL: Error: Offset is not done."
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 347.204 set length 347.204
set nbsh_v 584 set nbsh_v 583
set nbsh_e 584 set nbsh_e 583
set nbsh_w 1 set nbsh_w 1

View File

@ -1,7 +1,7 @@
restore [locate_data_file offset_wire_078.brep] s restore [locate_data_file offset_wire_078.brep] s
set length 488.408 set length 488.408
set nbsh_v 72 set nbsh_v 73
set nbsh_e 72 set nbsh_e 73
set nbsh_w 1 set nbsh_w 1

View File

@ -1,9 +1,9 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result_1" #puts "TODO OCC23068 ALL: Error : big tolerance of shape result_1"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_021.brep] s restore [locate_data_file offset_wire_021.brep] s
set length 175.927 set length 164.679
set nbsh_v 31 set nbsh_v 30
set nbsh_e 31 set nbsh_e 30
set nbsh_w 2 set nbsh_w 2

View File

@ -3,11 +3,11 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 406.425
set nbsh_v 0 set nbsh_v 579
set nbsh_e 0 set nbsh_e 579
set nbsh_w 0 set nbsh_w 1

View File

@ -3,11 +3,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty"
restore [locate_data_file offset_wire_067.brep] s restore [locate_data_file offset_wire_067.brep] s
set length 0 set length 32.4572
set nbsh_v 0 set nbsh_v 105
set nbsh_e 0 set nbsh_e 105
set nbsh_w 0 set nbsh_w 1

View File

@ -1,8 +1,8 @@
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_068.brep] s restore [locate_data_file offset_wire_068.brep] s
set length 1589.9 set length 1589.9
set nbsh_v 49 set nbsh_v 48
set nbsh_e 49 set nbsh_e 48
set nbsh_w 1 set nbsh_w 1

View File

@ -2,11 +2,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_003.brep] s restore [locate_data_file offset_wire_003.brep] s
set length 0 set length 1613.94
set nbsh_v 0 set nbsh_v 98
set nbsh_e 0 set nbsh_e 98
set nbsh_w 0 set nbsh_w 1

View File

@ -1,9 +1,9 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result" #puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_021.brep] s restore [locate_data_file offset_wire_021.brep] s
set length 238.72 set length 200.958
set nbsh_v 27 set nbsh_v 26
set nbsh_e 27 set nbsh_e 26
set nbsh_w 1 set nbsh_w 1

View File

@ -3,11 +3,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_059.brep] s restore [locate_data_file offset_wire_059.brep] s
set length 0 set length 555.502
set nbsh_v 0 set nbsh_v 573
set nbsh_e 0 set nbsh_e 573
set nbsh_w 0 set nbsh_w 1

View File

@ -3,11 +3,13 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes"
puts "TODO OCC24255 ALL: Error : big tolerance"
restore [locate_data_file offset_wire_067.brep] s restore [locate_data_file offset_wire_067.brep] s
set length 0 set length 51.8506
set nbsh_v 0 set nbsh_v 61
set nbsh_e 0 set nbsh_e 61
set nbsh_w 0 set nbsh_w 1

View File

@ -3,11 +3,12 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO ALL: Faulty shapes in variables faulty_1 to faulty_10"
restore [locate_data_file offset_wire_089.brep] s restore [locate_data_file offset_wire_089.brep] s
set length 0 set length 1367.49
set nbsh_v 0 set nbsh_v 20
set nbsh_e 0 set nbsh_e 20
set nbsh_w 0 set nbsh_w 1

View File

@ -2,7 +2,7 @@ puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_024.brep] s restore [locate_data_file offset_wire_024.brep] s
set length 40.4005 set length 40.4005
set nbsh_v 40 set nbsh_v 44
set nbsh_e 40 set nbsh_e 44
set nbsh_w 1 set nbsh_w 1

View File

@ -3,7 +3,7 @@ puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_071.brep] s restore [locate_data_file offset_wire_071.brep] s
set length 83216 set length 83216
set nbsh_v 205 set nbsh_v 215
set nbsh_e 205 set nbsh_e 215
set nbsh_w 1 set nbsh_w 1

View File

@ -1,5 +1,10 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result" #puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2" #puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
#puts "TODO OCC24255 ALL: An exception was caught"
puts "TODO OCC24255 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Error : The offset cannot be built."
restore [locate_data_file offset_wire_072.brep] s restore [locate_data_file offset_wire_072.brep] s
set length 116267 set length 116267

View File

@ -3,7 +3,7 @@ puts "TODO OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_2"
restore [locate_data_file offset_wire_073.brep] s restore [locate_data_file offset_wire_073.brep] s
set length 80332.8 set length 80332.8
set nbsh_v 214 set nbsh_v 212
set nbsh_e 214 set nbsh_e 212
set nbsh_w 1 set nbsh_w 1

View File

@ -2,7 +2,7 @@
restore [locate_data_file offset_wire_075.brep] s restore [locate_data_file offset_wire_075.brep] s
set length 308.604 set length 308.604
set nbsh_v 88 set nbsh_v 84
set nbsh_e 88 set nbsh_e 84
set nbsh_w 1 set nbsh_w 1

View File

@ -5,8 +5,8 @@ puts "TODO ?OCC23748 ALL: Error: Offset is not done."
restore [locate_data_file offset_wire_001.brep] s restore [locate_data_file offset_wire_001.brep] s
set length 0 set length 9.26702
set nbsh_v 0 set nbsh_v 24
set nbsh_e 0 set nbsh_e 24
set nbsh_w 0 set nbsh_w 1

View File

@ -1,9 +1,7 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result_2"
puts "TODO OCC23068 ALL: Error : The resulting shape is WRONG"
restore [locate_data_file offset_wire_022.brep] s restore [locate_data_file offset_wire_022.brep] s
set length 230.726 set length 224.208
set nbsh_v 50 set nbsh_v 49
set nbsh_e 50 set nbsh_e 49
set nbsh_w 2 set nbsh_w 2

View File

@ -2,7 +2,7 @@ puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_024.brep] s restore [locate_data_file offset_wire_024.brep] s
set length 42.8997 set length 42.8997
set nbsh_v 40 set nbsh_v 44
set nbsh_e 40 set nbsh_e 44
set nbsh_w 1 set nbsh_w 1

View File

@ -2,11 +2,13 @@ puts "TODO ?OCC23068 ALL: Error : The offset cannot be built."
puts "TODO ?OCC23068 ALL: An exception was caught" puts "TODO ?OCC23068 ALL: An exception was caught"
puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*" puts "TODO ?OCC23068 ALL: \\*\\* Exception \\*\\*.*"
puts "TODO ?OCC23748 ALL: Error: Offset is not done." puts "TODO ?OCC23748 ALL: Error: Offset is not done."
puts "TODO OCC24255 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC24255 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_071.brep] s restore [locate_data_file offset_wire_071.brep] s
set length 0 set length 121794
set nbsh_v 0 set nbsh_v 205
set nbsh_e 0 set nbsh_e 205
set nbsh_w 0 set nbsh_w 1

View File

@ -2,7 +2,7 @@
restore [locate_data_file offset_wire_075.brep] s restore [locate_data_file offset_wire_075.brep] s
set length 326.251 set length 326.251
set nbsh_v 104 set nbsh_v 100
set nbsh_e 104 set nbsh_e 100
set nbsh_w 1 set nbsh_w 1

View File

@ -7,8 +7,8 @@ puts "TODO OCC24156 MacOS: Error : The length of the resulting shape is"
puts "TODO OCC24156 MacOS: Error : The resulting shape is WRONG" puts "TODO OCC24156 MacOS: Error : The resulting shape is WRONG"
restore [locate_data_file offset_wire_001.brep] s restore [locate_data_file offset_wire_001.brep] s
set length 0 set length 11.6898
set nbsh_v 0 set nbsh_v 23
set nbsh_e 0 set nbsh_e 23
set nbsh_w 0 set nbsh_w 1

View File

@ -1,11 +1,8 @@
puts "TODO OCC23068 ALL: Error : big tolerance of shape result_2"
puts "TODO OCC23068 ALL: Error : The length of the resulting shape is"
puts "TODO OCC23068 ALL: Error : The resulting shape is WRONG"
restore [locate_data_file offset_wire_022.brep] s restore [locate_data_file offset_wire_022.brep] s
set length 238.448 set length 215.745
set nbsh_v 40 set nbsh_v 39
set nbsh_e 40 set nbsh_e 39
set nbsh_w 2 set nbsh_w 2

View File

@ -2,7 +2,7 @@ puts "TODO OCC23068 ALL: Error : big tolerance of shape result"
restore [locate_data_file offset_wire_024.brep] s restore [locate_data_file offset_wire_024.brep] s
set length 49.1476 set length 49.1476
set nbsh_v 40 set nbsh_v 44
set nbsh_e 40 set nbsh_e 44
set nbsh_w 1 set nbsh_w 1

View File

@ -4,6 +4,6 @@ puts "TODO ?OCC23068 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file offset_wire_026.brep] s restore [locate_data_file offset_wire_026.brep] s
set length 25688.3 set length 25688.3
set nbsh_v 319 set nbsh_v 315
set nbsh_e 319 set nbsh_e 315
set nbsh_w 1 set nbsh_w 1

Some files were not shown because too many files have changed in this diff Show More