mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
Compare commits
3 Commits
V7_8_1
...
CR0_700_Fi
Author | SHA1 | Date | |
---|---|---|---|
|
c1f535e074 | ||
|
f0f645efe2 | ||
|
53dd57f0c4 |
@@ -932,65 +932,88 @@ void Adaptor3d_TopolTool::SamplePnts(const Standard_Real theDefl,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
const Standard_Integer theNUmin,
|
||||
const Standard_Integer theNVmin)
|
||||
{
|
||||
void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
const Standard_Integer theNUmin,
|
||||
const Standard_Integer theNVmin)
|
||||
{
|
||||
const Handle(Geom_BSplineSurface)& aBS = myS->BSpline();
|
||||
Standard_Real uinf,usup,vinf,vsup;
|
||||
Standard_Real uinf, usup, vinf, vsup;
|
||||
uinf = myS->FirstUParameter(); usup = myS->LastUParameter();
|
||||
vinf = myS->FirstVParameter(); vsup = myS->LastVParameter();
|
||||
|
||||
Standard_Integer i, k, j = 1;
|
||||
Standard_Real t1, t2, dt;
|
||||
Standard_Integer ui1 = aBS->FirstUKnotIndex();
|
||||
Standard_Integer ui2 = aBS->LastUKnotIndex();
|
||||
Standard_Integer vi1 = aBS->FirstVKnotIndex();
|
||||
Standard_Integer vi2 = aBS->LastVKnotIndex();
|
||||
|
||||
for(i = ui1; i < ui2; ++i) {
|
||||
if(uinf >= aBS->UKnot(i) && uinf < aBS->UKnot(i+1)) {
|
||||
const Standard_Integer aNbUi = myS->NbUIntervals(GeomAbs_C2),
|
||||
aNbVi = myS->NbVIntervals(GeomAbs_C2);
|
||||
|
||||
TColStd_Array1OfReal aUKnots(1, aNbUi + 1);
|
||||
TColStd_Array1OfReal aVKnots(1, aNbVi + 1);
|
||||
|
||||
myS->UIntervals(aUKnots, GeomAbs_C2);
|
||||
|
||||
myS->VIntervals(aVKnots, GeomAbs_C2);
|
||||
|
||||
Standard_Integer ui1 = aUKnots.Lower();
|
||||
Standard_Integer ui2 = aUKnots.Upper();
|
||||
Standard_Integer vi1 = aVKnots.Lower();
|
||||
Standard_Integer vi2 = aVKnots.Upper();
|
||||
|
||||
for(i = ui1; i < ui2; ++i)
|
||||
{
|
||||
if(uinf >= aUKnots.Value(i) && uinf < aUKnots.Value(i + 1))
|
||||
{
|
||||
ui1 = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for(i = ui2; i > ui1; --i) {
|
||||
if(usup <= aBS->UKnot(i) && usup > aBS->UKnot(i-1)) {
|
||||
for(i = ui2; i > ui1; --i)
|
||||
{
|
||||
if(usup <= aUKnots.Value(i) && usup > aUKnots.Value(i - 1))
|
||||
{
|
||||
ui2 = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for(i = vi1; i < vi2; ++i) {
|
||||
if(vinf >= aBS->VKnot(i) && vinf < aBS->VKnot(i+1)) {
|
||||
for(i = vi1; i < vi2; ++i)
|
||||
{
|
||||
if(vinf >= aVKnots.Value(i) && vinf < aVKnots.Value(i + 1))
|
||||
{
|
||||
vi1 = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for(i = vi2; i > vi1; --i) {
|
||||
if(vsup <= aBS->VKnot(i) && vsup > aBS->VKnot(i-1)) {
|
||||
for(i = vi2; i > vi1; --i)
|
||||
{
|
||||
if(vsup <= aVKnots.Value(i) && vsup > aVKnots.Value(i - 1))
|
||||
{
|
||||
vi2 = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Integer nbsu = ui2-ui1+1; nbsu += (nbsu - 1) * (aBS->UDegree()-1);
|
||||
Standard_Integer nbsv = vi2-vi1+1; nbsv += (nbsv - 1) * (aBS->VDegree()-1);
|
||||
Standard_Integer nbsu = ui2 - ui1 + 1; nbsu += (nbsu - 1) * (aBS->UDegree() - 1);
|
||||
Standard_Integer nbsv = vi2 - vi1 + 1; nbsv += (nbsv - 1) * (aBS->VDegree() - 1);
|
||||
Standard_Boolean bUuniform = Standard_False;
|
||||
Standard_Boolean bVuniform = Standard_False;
|
||||
|
||||
//modified by NIZHNY-EMV Mon Jun 10 14:19:04 2013
|
||||
if (nbsu < theNUmin || nbsv < theNVmin) {
|
||||
if(nbsu < theNUmin || nbsv < theNVmin)
|
||||
{
|
||||
Standard_Integer aNb;
|
||||
if (nbsu < nbsv) {
|
||||
aNb = (Standard_Integer)(nbsv * ((Standard_Real)theNUmin)/((Standard_Real)nbsu));
|
||||
if(nbsu < nbsv)
|
||||
{
|
||||
aNb = (Standard_Integer) (nbsv * ((Standard_Real) theNUmin) / ((Standard_Real) nbsu));
|
||||
aNb = Min(aNb, 30);
|
||||
bVuniform = (aNb > nbsv) ? Standard_True : bVuniform;
|
||||
nbsv = bVuniform ? aNb : nbsv;
|
||||
} else {
|
||||
aNb = (Standard_Integer)(nbsu * ((Standard_Real)theNVmin)/((Standard_Real)nbsv));
|
||||
}
|
||||
else
|
||||
{
|
||||
aNb = (Standard_Integer) (nbsu * ((Standard_Real) theNVmin) / ((Standard_Real) nbsv));
|
||||
aNb = Min(aNb, 30);
|
||||
bUuniform = (aNb > nbsu) ? Standard_True : bUuniform;
|
||||
nbsu = bUuniform ? aNb : nbsu;
|
||||
@@ -998,12 +1021,14 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
}
|
||||
//modified by NIZHNY-EMV Mon Jun 10 14:19:05 2013
|
||||
|
||||
if(nbsu < theNUmin) {
|
||||
if(nbsu < theNUmin)
|
||||
{
|
||||
nbsu = theNUmin;
|
||||
bUuniform = Standard_True;
|
||||
}
|
||||
|
||||
if(nbsv < theNVmin) {
|
||||
if(nbsv < theNVmin)
|
||||
{
|
||||
nbsv = theNVmin;
|
||||
bVuniform = Standard_True;
|
||||
}
|
||||
@@ -1014,81 +1039,90 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
TColStd_Array1OfBoolean aVFlg(1, nbsv);
|
||||
|
||||
//Filling of sample parameters
|
||||
if(bUuniform) {
|
||||
if(bUuniform)
|
||||
{
|
||||
t1 = uinf;
|
||||
t2 = usup;
|
||||
dt = (t2 - t1)/(nbsu - 1);
|
||||
dt = (t2 - t1) / (nbsu - 1);
|
||||
anUPars(1) = t1;
|
||||
anUFlg(1) = Standard_False;
|
||||
anUPars(nbsu) = t2;
|
||||
anUFlg(nbsu) = Standard_False;
|
||||
for(i = 2, t1 += dt; i < nbsu; ++i, t1 += dt) {
|
||||
for(i = 2, t1 += dt; i < nbsu; ++i, t1 += dt)
|
||||
{
|
||||
anUPars(i) = t1;
|
||||
anUFlg(i) = Standard_False;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
Standard_Integer nbi = aBS->UDegree();
|
||||
k = 0;
|
||||
t1 = uinf;
|
||||
for(i = ui1+1; i <= ui2; ++i) {
|
||||
for(i = ui1 + 1; i <= ui2; ++i)
|
||||
{
|
||||
if(i == ui2) t2 = usup;
|
||||
else t2 = aBS->UKnot(i);
|
||||
dt = (t2 - t1)/nbi;
|
||||
else t2 = aUKnots.Value(i);
|
||||
dt = (t2 - t1) / nbi;
|
||||
j = 1;
|
||||
do {
|
||||
++k;
|
||||
anUPars(k) = t1;
|
||||
anUFlg(k) = Standard_False;
|
||||
t1 += dt;
|
||||
do
|
||||
{
|
||||
++k;
|
||||
anUPars(k) = t1;
|
||||
anUFlg(k) = Standard_False;
|
||||
t1 += dt;
|
||||
}
|
||||
while (++j <= nbi);
|
||||
while(++j <= nbi);
|
||||
t1 = t2;
|
||||
}
|
||||
++k;
|
||||
anUPars(k) = t1;
|
||||
}
|
||||
|
||||
if(bVuniform) {
|
||||
if(bVuniform)
|
||||
{
|
||||
t1 = vinf;
|
||||
t2 = vsup;
|
||||
dt = (t2 - t1)/(nbsv - 1);
|
||||
dt = (t2 - t1) / (nbsv - 1);
|
||||
aVPars(1) = t1;
|
||||
aVFlg(1) = Standard_False;
|
||||
aVPars(nbsv) = t2;
|
||||
aVFlg(nbsv) = Standard_False;
|
||||
for(i = 2, t1 += dt; i < nbsv; ++i, t1 += dt) {
|
||||
for(i = 2, t1 += dt; i < nbsv; ++i, t1 += dt)
|
||||
{
|
||||
aVPars(i) = t1;
|
||||
aVFlg(i) = Standard_False;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
Standard_Integer nbi = aBS->VDegree();
|
||||
k = 0;
|
||||
t1 = vinf;
|
||||
for(i = vi1+1; i <= vi2; ++i) {
|
||||
for(i = vi1 + 1; i <= vi2; ++i)
|
||||
{
|
||||
if(i == vi2) t2 = vsup;
|
||||
else t2 = aBS->VKnot(i);
|
||||
dt = (t2 - t1)/nbi;
|
||||
else t2 = aVKnots.Value(i);
|
||||
dt = (t2 - t1) / nbi;
|
||||
j = 1;
|
||||
do {
|
||||
++k;
|
||||
aVPars(k) = t1;
|
||||
aVFlg(k) = Standard_False;
|
||||
t1 += dt;
|
||||
do
|
||||
{
|
||||
++k;
|
||||
aVPars(k) = t1;
|
||||
aVFlg(k) = Standard_False;
|
||||
t1 += dt;
|
||||
}
|
||||
while (++j <= nbi);
|
||||
while(++j <= nbi);
|
||||
t1 = t2;
|
||||
}
|
||||
++k;
|
||||
aVPars(k) = t1;
|
||||
}
|
||||
|
||||
|
||||
//Analysis of deflection
|
||||
|
||||
Standard_Real aDefl2 = Max(theDefl*theDefl, 1.e-9);
|
||||
Standard_Real tol = Max(0.01*aDefl2, 1.e-9);
|
||||
Standard_Integer l;
|
||||
|
||||
// Calculations of B-spline values will be made using adaptor,
|
||||
// because it caches the data for performance
|
||||
@@ -1097,60 +1131,68 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
anUFlg(1) = Standard_True;
|
||||
anUFlg(nbsu) = Standard_True;
|
||||
//myNbSamplesU = 2;
|
||||
for(i = 1; i <= nbsv; ++i) {
|
||||
for(i = 1; i <= nbsv; ++i)
|
||||
{
|
||||
t1 = aVPars(i);
|
||||
j = 1;
|
||||
Standard_Boolean bCont = Standard_True;
|
||||
while (j < nbsu-1 && bCont) {
|
||||
while(j < nbsu - 1 && bCont)
|
||||
{
|
||||
|
||||
if(anUFlg(j+1)) {
|
||||
++j;
|
||||
continue;
|
||||
if(anUFlg(j + 1))
|
||||
{
|
||||
++j;
|
||||
continue;
|
||||
}
|
||||
|
||||
t2 = anUPars(j);
|
||||
// gp_Pnt p1 = aBS->Value(t2, t1);
|
||||
// gp_Pnt p1 = aBS->Value(t2, t1);
|
||||
gp_Pnt p1 = aBSplAdaptor.Value(t2, t1);
|
||||
for(k = j+2; k <= nbsu; ++k) {
|
||||
t2 = anUPars(k);
|
||||
// gp_Pnt p2 = aBS->Value(t2, t1);
|
||||
gp_Pnt p2 = aBSplAdaptor.Value(t2, t1);
|
||||
//gce_MakeLin MkLin(p1, p2);
|
||||
//const gp_Lin& lin = MkLin.Value();
|
||||
for(k = j + 2; k <= nbsu; ++k)
|
||||
{
|
||||
t2 = anUPars(k);
|
||||
// gp_Pnt p2 = aBS->Value(t2, t1);
|
||||
gp_Pnt p2 = aBSplAdaptor.Value(t2, t1);
|
||||
//gce_MakeLin MkLin(p1, p2);
|
||||
//const gp_Lin& lin = MkLin.Value();
|
||||
|
||||
if(p1.SquareDistance(p2) <= tol) continue;
|
||||
if(p1.SquareDistance(p2) <= tol) continue;
|
||||
|
||||
gp_Lin lin(p1, gp_Dir(gp_Vec(p1, p2)));
|
||||
Standard_Boolean ok = Standard_True;
|
||||
for(l = j+1; l < k; ++l) {
|
||||
gp_Lin lin(p1, gp_Dir(gp_Vec(p1, p2)));
|
||||
Standard_Boolean ok = Standard_True;
|
||||
for(Standard_Integer l = j + 1; l < k; ++l)
|
||||
{
|
||||
|
||||
if(anUFlg(l)) {
|
||||
ok = Standard_False;
|
||||
break;
|
||||
}
|
||||
if(anUFlg(l))
|
||||
{
|
||||
ok = Standard_False;
|
||||
break;
|
||||
}
|
||||
|
||||
// gp_Pnt pp = aBS->Value(anUPars(l), t1);
|
||||
gp_Pnt pp = aBSplAdaptor.Value(anUPars(l), t1);
|
||||
Standard_Real d = lin.SquareDistance(pp);
|
||||
|
||||
if(d <= aDefl2) continue;
|
||||
// gp_Pnt pp = aBS->Value(anUPars(l), t1);
|
||||
gp_Pnt pp = aBSplAdaptor.Value(anUPars(l), t1);
|
||||
Standard_Real d = lin.SquareDistance(pp);
|
||||
|
||||
ok = Standard_False;
|
||||
break;
|
||||
}
|
||||
if(d <= aDefl2) continue;
|
||||
|
||||
ok = Standard_False;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!ok)
|
||||
{
|
||||
j = k - 1;
|
||||
anUFlg(j) = Standard_True;
|
||||
//++myNbSamplesU;
|
||||
break;
|
||||
}
|
||||
|
||||
if(anUFlg(k))
|
||||
{
|
||||
j = k;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!ok) {
|
||||
j = k - 1;
|
||||
anUFlg(j) = Standard_True;
|
||||
//++myNbSamplesU;
|
||||
break;
|
||||
}
|
||||
|
||||
if(anUFlg(k)) {
|
||||
j = k;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1160,84 +1202,95 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
}
|
||||
|
||||
myNbSamplesU = 0;
|
||||
for (i = 1; i <= nbsu; i++)
|
||||
if (anUFlg(i) == Standard_True)
|
||||
for(i = 1; i <= nbsu; i++)
|
||||
if(anUFlg(i) == Standard_True)
|
||||
myNbSamplesU++;
|
||||
|
||||
if(myNbSamplesU < myMinPnts) {
|
||||
if(myNbSamplesU == 2) {
|
||||
|
||||
if(myNbSamplesU < myMinPnts)
|
||||
{
|
||||
if(myNbSamplesU == 2)
|
||||
{
|
||||
//"uniform" distribution;
|
||||
Standard_Integer nn = nbsu/myMinPnts;
|
||||
anUFlg(1+nn) = Standard_True;
|
||||
anUFlg(nbsu-nn) = Standard_True;
|
||||
Standard_Integer nn = nbsu / myMinPnts;
|
||||
anUFlg(1 + nn) = Standard_True;
|
||||
anUFlg(nbsu - nn) = Standard_True;
|
||||
}
|
||||
else { //myNbSamplesU == 3
|
||||
else
|
||||
{ //myNbSamplesU == 3
|
||||
//insert in bigger segment
|
||||
i = 2;
|
||||
while(!anUFlg(i++));
|
||||
if(i < nbsu/2) j = Min(i+(nbsu-i)/2, nbsu-1);
|
||||
else j = Max(i/2, 2);
|
||||
if(i < nbsu / 2) j = Min(i + (nbsu - i) / 2, nbsu - 1);
|
||||
else j = Max(i / 2, 2);
|
||||
}
|
||||
anUFlg(j) = Standard_True;
|
||||
myNbSamplesU = myMinPnts;
|
||||
}
|
||||
|
||||
|
||||
aVFlg(1) = Standard_True;
|
||||
aVFlg(nbsv) = Standard_True;
|
||||
//myNbSamplesV = 2;
|
||||
for(i = 1; i <= nbsu; ++i) {
|
||||
for(i = 1; i <= nbsu; ++i)
|
||||
{
|
||||
t1 = anUPars(i);
|
||||
j = 1;
|
||||
Standard_Boolean bCont = Standard_True;
|
||||
while (j < nbsv-1 && bCont) {
|
||||
while(j < nbsv - 1 && bCont)
|
||||
{
|
||||
|
||||
if(aVFlg(j+1)) {
|
||||
++j;
|
||||
continue;
|
||||
if(aVFlg(j + 1))
|
||||
{
|
||||
++j;
|
||||
continue;
|
||||
}
|
||||
|
||||
t2 = aVPars(j);
|
||||
// gp_Pnt p1 = aBS->Value(t1, t2);
|
||||
// gp_Pnt p1 = aBS->Value(t1, t2);
|
||||
gp_Pnt p1 = aBSplAdaptor.Value(t1, t2);
|
||||
for(k = j+2; k <= nbsv; ++k) {
|
||||
t2 = aVPars(k);
|
||||
// gp_Pnt p2 = aBS->Value(t1, t2);
|
||||
gp_Pnt p2 = aBSplAdaptor.Value(t1, t2);
|
||||
for(k = j + 2; k <= nbsv; ++k)
|
||||
{
|
||||
t2 = aVPars(k);
|
||||
// gp_Pnt p2 = aBS->Value(t1, t2);
|
||||
gp_Pnt p2 = aBSplAdaptor.Value(t1, t2);
|
||||
|
||||
if(p1.SquareDistance(p2) <= tol) continue;
|
||||
//gce_MakeLin MkLin(p1, p2);
|
||||
//const gp_Lin& lin = MkLin.Value();
|
||||
gp_Lin lin(p1, gp_Dir(gp_Vec(p1, p2)));
|
||||
Standard_Boolean ok = Standard_True;
|
||||
for(l = j+1; l < k; ++l) {
|
||||
if(p1.SquareDistance(p2) <= tol) continue;
|
||||
//gce_MakeLin MkLin(p1, p2);
|
||||
//const gp_Lin& lin = MkLin.Value();
|
||||
gp_Lin lin(p1, gp_Dir(gp_Vec(p1, p2)));
|
||||
Standard_Boolean ok = Standard_True;
|
||||
for(Standard_Integer l = j + 1; l < k; ++l)
|
||||
{
|
||||
|
||||
if(aVFlg(l)) {
|
||||
ok = Standard_False;
|
||||
break;
|
||||
}
|
||||
if(aVFlg(l))
|
||||
{
|
||||
ok = Standard_False;
|
||||
break;
|
||||
}
|
||||
|
||||
// gp_Pnt pp = aBS->Value(t1, aVPars(l));
|
||||
gp_Pnt pp = aBSplAdaptor.Value(t1, aVPars(l));
|
||||
Standard_Real d = lin.SquareDistance(pp);
|
||||
|
||||
if(d <= aDefl2) continue;
|
||||
// gp_Pnt pp = aBS->Value(t1, aVPars(l));
|
||||
gp_Pnt pp = aBSplAdaptor.Value(t1, aVPars(l));
|
||||
Standard_Real d = lin.SquareDistance(pp);
|
||||
|
||||
ok = Standard_False;
|
||||
break;
|
||||
}
|
||||
if(d <= aDefl2) continue;
|
||||
|
||||
ok = Standard_False;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!ok)
|
||||
{
|
||||
j = k - 1;
|
||||
aVFlg(j) = Standard_True;
|
||||
//++myNbSamplesV;
|
||||
break;
|
||||
}
|
||||
|
||||
if(aVFlg(k))
|
||||
{
|
||||
j = k;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!ok) {
|
||||
j = k - 1;
|
||||
aVFlg(j) = Standard_True;
|
||||
//++myNbSamplesV;
|
||||
break;
|
||||
}
|
||||
|
||||
if(aVFlg(k)) {
|
||||
j = k;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1247,24 +1300,27 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
}
|
||||
|
||||
myNbSamplesV = 0;
|
||||
for (i = 1; i <= nbsv; i++)
|
||||
if (aVFlg(i) == Standard_True)
|
||||
for(i = 1; i <= nbsv; i++)
|
||||
if(aVFlg(i) == Standard_True)
|
||||
myNbSamplesV++;
|
||||
|
||||
if(myNbSamplesV < myMinPnts) {
|
||||
if(myNbSamplesV == 2) {
|
||||
|
||||
if(myNbSamplesV < myMinPnts)
|
||||
{
|
||||
if(myNbSamplesV == 2)
|
||||
{
|
||||
//"uniform" distribution;
|
||||
Standard_Integer nn = nbsv/myMinPnts;
|
||||
aVFlg(1+nn) = Standard_True;
|
||||
aVFlg(nbsv-nn) = Standard_True;
|
||||
Standard_Integer nn = nbsv / myMinPnts;
|
||||
aVFlg(1 + nn) = Standard_True;
|
||||
aVFlg(nbsv - nn) = Standard_True;
|
||||
myNbSamplesV = myMinPnts;
|
||||
}
|
||||
else { //myNbSamplesU == 3
|
||||
else
|
||||
{ //myNbSamplesU == 3
|
||||
//insert in bigger segment
|
||||
i = 2;
|
||||
while(!aVFlg(i++));
|
||||
if(i < nbsv/2) j = Min(i+(nbsv-i)/2, nbsv-1);
|
||||
else j = Max(i/2, 2);
|
||||
if(i < nbsv / 2) j = Min(i + (nbsv - i) / 2, nbsv - 1);
|
||||
else j = Max(i / 2, 2);
|
||||
}
|
||||
myNbSamplesV = myMinPnts;
|
||||
aVFlg(j) = Standard_True;
|
||||
@@ -1275,41 +1331,51 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
Standard_Boolean bFlag;
|
||||
//
|
||||
// U
|
||||
bFlag=(myNbSamplesU < theNUmin);
|
||||
if (bFlag) {
|
||||
myNbSamplesU=nbsu;
|
||||
bFlag = (myNbSamplesU < theNUmin);
|
||||
if(bFlag)
|
||||
{
|
||||
myNbSamplesU = nbsu;
|
||||
}
|
||||
//
|
||||
myUPars = new TColStd_HArray1OfReal(1, myNbSamplesU);
|
||||
//
|
||||
for(j = 0, i = 1; i <= nbsu; ++i) {
|
||||
if (bFlag) {
|
||||
myUPars->SetValue(i,anUPars(i));
|
||||
for(j = 0, i = 1; i <= nbsu; ++i)
|
||||
{
|
||||
if(bFlag)
|
||||
{
|
||||
myUPars->SetValue(i, anUPars(i));
|
||||
}
|
||||
else {
|
||||
if(anUFlg(i)) {
|
||||
else
|
||||
{
|
||||
if(anUFlg(i))
|
||||
{
|
||||
++j;
|
||||
myUPars->SetValue(j,anUPars(i));
|
||||
myUPars->SetValue(j, anUPars(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// V
|
||||
bFlag=(myNbSamplesV < theNVmin);
|
||||
if (bFlag) {
|
||||
myNbSamplesV=nbsv;
|
||||
bFlag = (myNbSamplesV < theNVmin);
|
||||
if(bFlag)
|
||||
{
|
||||
myNbSamplesV = nbsv;
|
||||
}
|
||||
//
|
||||
myVPars = new TColStd_HArray1OfReal(1, myNbSamplesV);
|
||||
//
|
||||
for(j = 0, i = 1; i <= nbsv; ++i) {
|
||||
if (bFlag) {
|
||||
myVPars->SetValue(i,aVPars(i));
|
||||
for(j = 0, i = 1; i <= nbsv; ++i)
|
||||
{
|
||||
if(bFlag)
|
||||
{
|
||||
myVPars->SetValue(i, aVPars(i));
|
||||
}
|
||||
else {
|
||||
if(aVFlg(i)) {
|
||||
else
|
||||
{
|
||||
if(aVFlg(i))
|
||||
{
|
||||
++j;
|
||||
myVPars->SetValue(j,aVPars(i));
|
||||
myVPars->SetValue(j, aVPars(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1320,18 +1386,18 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
|
||||
j = 0;
|
||||
for(i = 1; i <= nbsu; ++i) {
|
||||
if(anUFlg(i)) {
|
||||
++j;
|
||||
myUPars->SetValue(j,anUPars(i));
|
||||
}
|
||||
if(anUFlg(i)) {
|
||||
++j;
|
||||
myUPars->SetValue(j,anUPars(i));
|
||||
}
|
||||
}
|
||||
|
||||
j = 0;
|
||||
for(i = 1; i <= nbsv; ++i) {
|
||||
if(aVFlg(i)) {
|
||||
++j;
|
||||
myVPars->SetValue(j,aVPars(i));
|
||||
}
|
||||
if(aVFlg(i)) {
|
||||
++j;
|
||||
myVPars->SetValue(j,aVPars(i));
|
||||
}
|
||||
}
|
||||
*/
|
||||
//modified by NIZNHY-PKV Mon Dec 26 12:25:35 2011t
|
||||
|
@@ -28,14 +28,11 @@
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
static
|
||||
void MakeShell(const BOPCol_ListOfShape& ,
|
||||
@@ -43,6 +40,7 @@ static
|
||||
//
|
||||
static
|
||||
void RefineShell(TopoDS_Shell& theShell,
|
||||
const BOPCol_IndexedDataMapOfShapeListOfShape& theMEF,
|
||||
BOPCol_ListOfShape& aLShX);
|
||||
//
|
||||
static
|
||||
@@ -338,135 +336,212 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
|
||||
BOPCol_ListOfShape& myLoops=aCB.ChangeLoops();
|
||||
myLoops.Clear();
|
||||
//
|
||||
// 1. Shells Usual
|
||||
// Copy faces into the map, for recursive search of free bounds
|
||||
BOPCol_MapOfOrientedShape aMFaces;
|
||||
aItF.Initialize (myShapes);
|
||||
for (; aItF.More(); aItF.Next()) {
|
||||
const TopoDS_Shape& aFF = aItF.Value();
|
||||
BOPTools::MapShapesAndAncestors (aFF,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aEFMap);
|
||||
aMFaces.Add(aItF.Value());
|
||||
}
|
||||
//
|
||||
// remove the faces with free edges from processing
|
||||
for (;;) {
|
||||
// map the shapes
|
||||
aEFMap.Clear();
|
||||
aItF.Initialize(myShapes);
|
||||
for (; aItF.More(); aItF.Next()) {
|
||||
const TopoDS_Shape& aF = aItF.Value();
|
||||
if (aMFaces.Contains(aF)) {
|
||||
BOPTools::MapShapesAndAncestors (aF, TopAbs_EDGE, TopAbs_FACE, aEFMap);
|
||||
}
|
||||
}
|
||||
//
|
||||
Standard_Integer aNbBegin = aMFaces.Extent();
|
||||
// check the free edges
|
||||
Standard_Integer aNbE = aEFMap.Extent();
|
||||
for (i = 1; i <= aNbE; ++i) {
|
||||
const TopoDS_Edge& aE = TopoDS::Edge(aEFMap.FindKey(i));
|
||||
if (!(BRep_Tool::Degenerated(aE) || aE.Orientation() == TopAbs_INTERNAL)) {
|
||||
const BOPCol_ListOfShape& aLF = aEFMap(i);
|
||||
if (aLF.Extent() == 1) {
|
||||
// remove the face
|
||||
aMFaces.Remove(aLF.First());
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// check if any faces have been removed
|
||||
Standard_Integer aNbEnd = aMFaces.Extent();
|
||||
if ((aNbEnd == aNbBegin) || (aNbEnd == 0)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
if (aMFaces.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
// use only connected faces
|
||||
BOPCol_ListOfShape aLFConnected;
|
||||
aItF.Initialize (myShapes);
|
||||
for (i=1; aItF.More(); aItF.Next(), ++i) {
|
||||
for (; aItF.More(); aItF.Next()) {
|
||||
const TopoDS_Shape& aF = aItF.Value();
|
||||
if (aMFaces.Contains(aF)) {
|
||||
aLFConnected.Append(aF);
|
||||
}
|
||||
}
|
||||
//
|
||||
const Standard_Integer aNbShapes = aLFConnected.Extent();
|
||||
Standard_Boolean bAllFacesTaken = Standard_False;
|
||||
//
|
||||
// Build the shells
|
||||
aItF.Initialize (aLFConnected);
|
||||
for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i) {
|
||||
const TopoDS_Shape& aFF = aItF.Value();
|
||||
if (!AddedFacesMap.Add(aFF)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// make a new shell
|
||||
TopoDS_Shell aShell;
|
||||
aBB.MakeShell(aShell);
|
||||
aBB.Add(aShell, aFF);
|
||||
TopoDS_Shell aShellStart;
|
||||
aBB.MakeShell(aShellStart);
|
||||
aBB.Add(aShellStart, aFF);
|
||||
//
|
||||
aMEFP.Clear();
|
||||
BOPTools::MapShapesAndAncestors(aFF,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aMEFP);
|
||||
BOPCol_ListOfShape aLShells;
|
||||
aLShells.Append(aShellStart);
|
||||
//
|
||||
// loop on faces added to Shell;
|
||||
// add their neighbor faces to Shell and so on
|
||||
aItS.Initialize (aShell);
|
||||
for (; aItS.More(); aItS.Next()) {
|
||||
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value()));
|
||||
BOPCol_ListIteratorOfListOfShape aItLShells(aLShells);
|
||||
for (; aItLShells.More(); aItLShells.Next()) {
|
||||
TopoDS_Shell& aShell = TopoDS::Shell(aItLShells.ChangeValue());
|
||||
//
|
||||
// loop on edges of aF; find a good neighbor face of aF by aE
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
|
||||
aMEFP.Clear();
|
||||
BOPTools::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||
//
|
||||
// loop on faces added to Shell;
|
||||
// add their neighbor faces to Shell and so on
|
||||
aItS.Initialize(aShell);
|
||||
for (; aItS.More(); aItS.Next()) {
|
||||
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value()));
|
||||
//
|
||||
//1
|
||||
if (aMEFP.Contains(aE)) {
|
||||
const BOPCol_ListOfShape& aLFP=aMEFP.FindFromKey(aE);
|
||||
aNbFP=aLFP.Extent();
|
||||
if (aNbFP>1) {
|
||||
// loop on edges of aF; find a good neighbor face of aF by aE
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
|
||||
//
|
||||
// proceed only free edges in this shell
|
||||
if (aMEFP.Contains(aE)) {
|
||||
const BOPCol_ListOfShape& aLFP = aMEFP.FindFromKey(aE);
|
||||
aNbFP = aLFP.Extent();
|
||||
if (aNbFP > 1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// avoid processing of internal edges
|
||||
anOr = aE.Orientation();
|
||||
if (anOr == TopAbs_INTERNAL) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//2
|
||||
anOr=aE.Orientation();
|
||||
if (anOr==TopAbs_INTERNAL) {
|
||||
continue;
|
||||
}
|
||||
//3
|
||||
if (BRep_Tool::Degenerated(aE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// candidate faces list
|
||||
const BOPCol_ListOfShape& aLF=aEFMap.FindFromKey(aE);
|
||||
aNbLF=aLF.Extent();
|
||||
if (!aNbLF) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// try to select one of neighbors
|
||||
// check if a face already added to Shell shares E
|
||||
Standard_Boolean bFound;
|
||||
BOPCol_ListIteratorOfListOfShape aItLF;
|
||||
BOPTools_ListOfCoupleOfShape aLCSOff;
|
||||
//
|
||||
aItLF.Initialize(aLF);
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Face& aFL=(*(TopoDS_Face*)(&aItLF.Value()));
|
||||
if (aF.IsSame(aFL)) {
|
||||
continue;
|
||||
}
|
||||
if (AddedFacesMap.Contains(aFL)){
|
||||
// avoid processing of degenerated edges
|
||||
if (BRep_Tool::Degenerated(aE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bFound=BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL);
|
||||
if (!bFound) {
|
||||
// candidate faces list
|
||||
const BOPCol_ListOfShape& aLF = aEFMap.FindFromKey(aE);
|
||||
aNbLF = aLF.Extent();
|
||||
if (!aNbLF) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aCSOff.SetShape1(aEL);
|
||||
aCSOff.SetShape2(aFL);
|
||||
aLCSOff.Append(aCSOff);
|
||||
}//for (; aItLF.More(); aItLF.Next()) {
|
||||
//
|
||||
aNbOff=aLCSOff.Extent();
|
||||
if (!aNbOff){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
TopoDS_Face aSelF;
|
||||
if (aNbOff==1) {
|
||||
aSelF=(*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
|
||||
}
|
||||
else if (aNbOff>1){
|
||||
BOPTools_AlgoTools::GetFaceOff(aE,
|
||||
aF,
|
||||
aLCSOff,
|
||||
aSelF,
|
||||
aContext);
|
||||
}
|
||||
//
|
||||
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
|
||||
aBB.Add(aShell, aSelF);
|
||||
BOPTools::MapShapesAndAncestors(aSelF,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aMEFP);
|
||||
}
|
||||
} // for (; aExp.More(); aExp.Next()) {
|
||||
} // for (; aItS.More(); aItS.Next()) {
|
||||
//
|
||||
BOPCol_ListOfShape aLShX;
|
||||
BOPCol_ListIteratorOfListOfShape aItLShX;
|
||||
//
|
||||
RefineShell(aShell, aLShX);
|
||||
//
|
||||
aItLShX.Initialize(aLShX);
|
||||
for (; aItLShX.More(); aItLShX.Next()) {
|
||||
TopoDS_Shell& aShX=*((TopoDS_Shell*)&aItLShX.Value());
|
||||
// prepare for selecting the next face
|
||||
// take only not-processed faces as a candidates
|
||||
BOPTools_ListOfCoupleOfShape aLCSOff;
|
||||
//
|
||||
BOPCol_ListIteratorOfListOfShape aItLF(aLF);
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Face& aFL = (*(TopoDS_Face*)(&aItLF.Value()));
|
||||
if (aF.IsSame(aFL) || AddedFacesMap.Contains(aFL)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// find current edge in the face
|
||||
if (!BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aCSOff.SetShape1(aEL);
|
||||
aCSOff.SetShape2(aFL);
|
||||
aLCSOff.Append(aCSOff);
|
||||
}//for (; aItLF.More(); aItLF.Next()) {
|
||||
//
|
||||
aNbOff = aLCSOff.Extent();
|
||||
if (!aNbOff){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// among all the adjacent faces chose one with the minimal
|
||||
// angle to the current one
|
||||
TopoDS_Face aSelF;
|
||||
if (aNbOff == 1) {
|
||||
aSelF = (*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
|
||||
}
|
||||
else if (aNbOff > 1) {
|
||||
BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, aContext);
|
||||
}
|
||||
//
|
||||
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
|
||||
aBB.Add(aShell, aSelF);
|
||||
BOPTools::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||
}
|
||||
} // for (; aExp.More(); aExp.Next()) {
|
||||
} // for (; aItS.More(); aItS.Next()) {
|
||||
//
|
||||
if (BRep_Tool::IsClosed(aShX)) {
|
||||
aShX.Closed(Standard_True);
|
||||
myLoops.Append(aShX);
|
||||
// split the shell on multi-connected edges
|
||||
BOPCol_ListOfShape aLShSp;
|
||||
RefineShell(aShell, aMEFP, aLShSp);
|
||||
//
|
||||
// collect the not closed shells for further processing
|
||||
BOPCol_ListOfShape aLShNC;
|
||||
//
|
||||
BOPCol_ListIteratorOfListOfShape aItLShSp(aLShSp);
|
||||
for (; aItLShSp.More(); aItLShSp.Next()) {
|
||||
TopoDS_Shell& aShSp = *((TopoDS_Shell*)&aItLShSp.Value());
|
||||
//
|
||||
if (BRep_Tool::IsClosed(aShSp)) {
|
||||
aShSp.Closed(Standard_True);
|
||||
myLoops.Append(aShSp);
|
||||
}
|
||||
else {
|
||||
aLShNC.Append(aShSp);
|
||||
}
|
||||
}
|
||||
//
|
||||
bAllFacesTaken = (AddedFacesMap.Extent() == aNbShapes);
|
||||
if (bAllFacesTaken) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
if (aLShSp.Extent() == 1) {
|
||||
// not further processing of not closed shells is needed,
|
||||
// as it will not bring any new results
|
||||
continue;
|
||||
}
|
||||
//
|
||||
Standard_Integer aNbShNC = aLShNC.Extent();
|
||||
if (aNbShNC == 1) {
|
||||
// try to complete the shell with other faces
|
||||
aLShells.Append(aLShNC);
|
||||
}
|
||||
else if (aNbShNC > 1) {
|
||||
// remove th faces of not closed shells from the map of processed faces
|
||||
// and try to rebuild the shells using all not processed faces,
|
||||
// because faces of one shell might be needed for building the other
|
||||
BOPCol_ListIteratorOfListOfShape aItLShNC(aLShNC);
|
||||
for (; aItLShNC.More(); aItLShNC.Next()) {
|
||||
TopoDS_Iterator aItNC(aItLShNC.Value());
|
||||
for (; aItNC.More(); aItNC.Next()) {
|
||||
AddedFacesMap.Remove(aItNC.Value());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // for (; aItF.More(); aItF.Next()) {
|
||||
@@ -475,49 +550,67 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
|
||||
//function : RefineShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RefineShell(TopoDS_Shell& theShell,
|
||||
BOPCol_ListOfShape& aLShX)
|
||||
void RefineShell(TopoDS_Shell& theShell,
|
||||
const BOPCol_IndexedDataMapOfShapeListOfShape& theMEF,
|
||||
BOPCol_ListOfShape& theLShSp)
|
||||
{
|
||||
TopoDS_Iterator aIt;
|
||||
//
|
||||
aIt.Initialize(theShell);
|
||||
TopoDS_Iterator aIt(theShell);
|
||||
if(!aIt.More()) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
Standard_Integer i, aNbMEF, aNbF, aNbMFB;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
|
||||
TopoDS_Builder aBB;
|
||||
TopExp_Explorer aExp;
|
||||
BOPCol_IndexedMapOfShape aMFB;
|
||||
BOPCol_MapOfShape aMEStop, aMFProcessed;
|
||||
BOPCol_ListIteratorOfListOfShape aItLF, aItLFP;
|
||||
BOPCol_ListOfShape aLFP, aLFP1;
|
||||
// Find edges with more than 2 adjacent faces - branch edges -
|
||||
// edges on which the input shell should be split
|
||||
BOPCol_MapOfShape aMEStop;
|
||||
//
|
||||
// Branch points
|
||||
BOPTools::MapShapesAndAncestors (theShell,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aMEF);
|
||||
//
|
||||
aNbMEF=aMEF.Extent();
|
||||
for (i=1; i<=aNbMEF; ++i) {
|
||||
const TopoDS_Shape& aE=aMEF.FindKey(i);
|
||||
const BOPCol_ListOfShape& aLF=aMEF.FindFromIndex(i);
|
||||
aNbF=aLF.Extent();
|
||||
if (aNbF>2) {
|
||||
Standard_Integer i, aNbMEF = theMEF.Extent();
|
||||
for (i = 1; i <= aNbMEF; ++i) {
|
||||
const TopoDS_Edge& aE = TopoDS::Edge(theMEF.FindKey(i));
|
||||
const BOPCol_ListOfShape& aLF = theMEF(i);
|
||||
if (aLF.Extent() > 2) {
|
||||
aMEStop.Add(aE);
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// check for internal edges - count faces, in which the edge
|
||||
// is internal, twice
|
||||
Standard_Integer aNbF = 0;
|
||||
BOPCol_ListIteratorOfListOfShape aItLF(aLF);
|
||||
for (; aItLF.More() && aNbF <= 2; aItLF.Next()) {
|
||||
const TopoDS_Face& aF = TopoDS::Face(aItLF.Value());
|
||||
++aNbF;
|
||||
TopExp_Explorer aExp(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Shape& aEF = aExp.Current();
|
||||
if (aEF.IsSame(aE)) {
|
||||
if (aEF.Orientation() == TopAbs_INTERNAL) {
|
||||
++aNbF;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
if (aNbF > 2) {
|
||||
aMEStop.Add(aE);
|
||||
}
|
||||
}
|
||||
//
|
||||
if (aMEStop.IsEmpty()) {
|
||||
aLShX.Append(theShell);
|
||||
theLShSp.Append(theShell);
|
||||
return;
|
||||
}
|
||||
//
|
||||
// The first Face
|
||||
TopoDS_Builder aBB;
|
||||
TopExp_Explorer aExp;
|
||||
BOPCol_IndexedMapOfShape aMFB;
|
||||
BOPCol_MapOfOrientedShape aMFProcessed;
|
||||
BOPCol_ListOfShape aLFP, aLFP1;
|
||||
BOPCol_ListIteratorOfListOfShape aItLF, aItLFP;
|
||||
//
|
||||
// The first Face
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aF1=aIt.Value();
|
||||
const TopoDS_Shape& aF1 = aIt.Value();
|
||||
if (!aMFProcessed.Add(aF1)) {
|
||||
continue;
|
||||
}
|
||||
@@ -531,12 +624,12 @@ void RefineShell(TopoDS_Shell& theShell,
|
||||
// Trying to reach the branch point
|
||||
for (;;) {
|
||||
aItLFP.Initialize(aLFP);
|
||||
for (; aItLFP.More(); aItLFP.Next()) {
|
||||
const TopoDS_Shape& aFP=aItLFP.Value();
|
||||
for (; aItLFP.More(); aItLFP.Next()) {
|
||||
const TopoDS_Shape& aFP = aItLFP.Value();
|
||||
//
|
||||
aExp.Init(aFP, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
|
||||
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
|
||||
if (aMEStop.Contains(aE)) {
|
||||
continue;
|
||||
}
|
||||
@@ -549,11 +642,11 @@ void RefineShell(TopoDS_Shell& theShell,
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const BOPCol_ListOfShape& aLF=aMEF.FindFromKey(aE);
|
||||
const BOPCol_ListOfShape& aLF = theMEF.FindFromKey(aE);
|
||||
//
|
||||
aItLF.Initialize(aLF);
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Shape& aFP1=aItLF.Value();
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Shape& aFP1 = aItLF.Value();
|
||||
if (aFP1.IsSame(aFP)) {
|
||||
continue;
|
||||
}
|
||||
@@ -561,9 +654,10 @@ void RefineShell(TopoDS_Shell& theShell,
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aMFProcessed.Add(aFP1);
|
||||
aMFB.Add(aFP1);
|
||||
aLFP1.Append(aFP1);
|
||||
if (aMFProcessed.Add(aFP1)) {
|
||||
aMFB.Add(aFP1);
|
||||
aLFP1.Append(aFP1);
|
||||
}
|
||||
}// for (; aItLF.More(); aItLF.Next()) {
|
||||
}// for (; aExp.More(); aExp.Next()) {
|
||||
} // for (; aItLFP.More(); aItLFP.Next()) {
|
||||
@@ -574,24 +668,19 @@ void RefineShell(TopoDS_Shell& theShell,
|
||||
}
|
||||
//
|
||||
aLFP.Clear();
|
||||
aItLF.Initialize(aLFP1);
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Shape& aFP1=aItLF.Value();
|
||||
aLFP.Append(aFP1);
|
||||
}
|
||||
aLFP1.Clear();
|
||||
aLFP.Append(aLFP1);
|
||||
}// for (;;) {
|
||||
//
|
||||
aNbMFB=aMFB.Extent();
|
||||
Standard_Integer aNbMFB = aMFB.Extent();
|
||||
if (aNbMFB) {
|
||||
TopoDS_Shell aShX;
|
||||
aBB.MakeShell(aShX);
|
||||
TopoDS_Shell aShSp;
|
||||
aBB.MakeShell(aShSp);
|
||||
//
|
||||
for (i=1; i<=aNbMFB; ++i) {
|
||||
const TopoDS_Shape& aFB=aMFB(i);
|
||||
aBB.Add(aShX, aFB);
|
||||
for (i = 1; i <= aNbMFB; ++i) {
|
||||
const TopoDS_Shape& aFB = aMFB(i);
|
||||
aBB.Add(aShSp, aFB);
|
||||
}
|
||||
aLShX.Append(aShX);
|
||||
theLShSp.Append(aShSp);
|
||||
}
|
||||
}//for (; aIt.More(); aIt.Next()) {
|
||||
}
|
||||
|
@@ -59,10 +59,6 @@
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:14:23 2002 f
|
||||
//#include <BRepAlgo_Cut.hxx>
|
||||
//#include <BRepAlgo_Fuse.hxx>
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:14:26 2002 t
|
||||
#ifdef OCCT_DEBUG
|
||||
extern Standard_Boolean BRepFeat_GettraceFEAT();
|
||||
#endif
|
||||
@@ -285,25 +281,15 @@ void BRepFeat_MakePrism::Perform(const Standard_Real Length)
|
||||
// if there is no gluing -> call of ope topo
|
||||
if(!myJustGluer) {
|
||||
if(myFuse == 1 && !myJustFeat) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:55:30 2002 f
|
||||
//BRepAlgo_Fuse f(mySbase, myGShape);
|
||||
//myShape = f.Shape();
|
||||
//UpdateDescendants(f.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Fuse f(mySbase, myGShape);
|
||||
myShape = f.Shape();
|
||||
UpdateDescendants(f, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:55:34 2002 t
|
||||
Done();
|
||||
}
|
||||
else if(myFuse == 0) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:55:59 2002 f
|
||||
//BRepAlgo_Cut c(mySbase, myGShape);
|
||||
//myShape = c.Shape();
|
||||
//UpdateDescendants(c.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Cut c(mySbase, myGShape);
|
||||
myShape = c.Shape();
|
||||
UpdateDescendants(c, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:56:02 2002 t
|
||||
Done();
|
||||
}
|
||||
else {
|
||||
@@ -373,10 +359,10 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
|
||||
TopAbs_Orientation Or;
|
||||
if (ASI.IsDone() && ASI.NbPoints(1) >=1) {
|
||||
if (myFuse == 1) {
|
||||
Or = ASI.Point(1,1).Orientation();
|
||||
Or = ASI.Point(1, 1).Orientation();
|
||||
}
|
||||
else {
|
||||
Or = ASI.Point(1,ASI.NbPoints(1)).Orientation();
|
||||
Or = ASI.Point(1, ASI.NbPoints(1)).Orientation();
|
||||
}
|
||||
if(sens==-1) Or=TopAbs::Reverse(Or);
|
||||
TopoDS_Face FUntil = ASI.Point(1,1).Face();
|
||||
@@ -385,80 +371,31 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
|
||||
B.MakeCompound(TopoDS::Compound(Comp));
|
||||
TopoDS_Solid S = BRepFeat::Tool(mySUntil, FUntil, Or);
|
||||
if (!S.IsNull()) B.Add(Comp,S);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:56:31 2002 f
|
||||
//BRepAlgo_Cut trP(VraiPrism,Comp);
|
||||
//UpdateDescendants(trP.Builder(),trP.Shape(), Standard_False);
|
||||
BRepAlgoAPI_Cut trP(VraiPrism,Comp);
|
||||
UpdateDescendants(trP, trP.Shape(), Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:56:38 2002 t
|
||||
//
|
||||
TopExp_Explorer ex(trP.Shape(), TopAbs_SOLID);
|
||||
TopoDS_Shape Cutsh = ex.Current();
|
||||
if(myFuse == 1 && !myJustFeat) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:57:49 2002 f
|
||||
//BRepAlgo_Fuse f(mySbase, Cutsh);
|
||||
//myShape = f.Shape();
|
||||
//UpdateDescendants(f.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Fuse f(mySbase, Cutsh);
|
||||
myShape = f.Shape();
|
||||
UpdateDescendants(f, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:57:53 2002 t
|
||||
Done();
|
||||
if (myFuse == 1 && !myJustFeat) {
|
||||
BRepAlgoAPI_Fuse f(mySbase, Cutsh);
|
||||
myShape = f.Shape();
|
||||
UpdateDescendants(f, myShape, Standard_False);
|
||||
Done();
|
||||
}
|
||||
else if(myFuse == 0) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:59:33 2002 f
|
||||
//BRepAlgo_Cut c(mySbase, Cutsh);
|
||||
//myShape = c.Shape();
|
||||
//UpdateDescendants(c.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Cut c(mySbase, Cutsh);
|
||||
myShape = c.Shape();
|
||||
UpdateDescendants(c, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 17:59:43 2002 t
|
||||
Done();
|
||||
BRepAlgoAPI_Cut c(mySbase, Cutsh);
|
||||
myShape = c.Shape();
|
||||
UpdateDescendants(c, myShape, Standard_False);
|
||||
Done();
|
||||
}
|
||||
else {
|
||||
myShape = Cutsh;
|
||||
Done();
|
||||
myShape = Cutsh;
|
||||
Done();
|
||||
}
|
||||
}
|
||||
}
|
||||
/* // loop of control of descendance
|
||||
|
||||
TopExp_Explorer expr(mySbase, TopAbs_FACE);
|
||||
char nom1[20], nom2[20];
|
||||
Standard_Integer ii = 0;
|
||||
for(; expr.More(); expr.Next()) {
|
||||
ii++;
|
||||
sprintf(nom1, "faceinitial_%d", ii);
|
||||
DBRep::Set(nom1, expr.Current());
|
||||
Standard_Integer jj = 0;
|
||||
const TopTools_ListOfShape& list = Modified(expr.Current());
|
||||
TopTools_ListIteratorOfListOfShape ite(list);
|
||||
for(; ite.More(); ite.Next()) {
|
||||
jj++;
|
||||
sprintf(nom2, "facemodifie_%d_%d", ii, jj);
|
||||
DBRep::Set(nom2, ite.Value());
|
||||
}
|
||||
}
|
||||
|
||||
expr.Init(myPbase, TopAbs_EDGE);
|
||||
ii=0;
|
||||
for(; expr.More(); expr.Next()) {
|
||||
ii++;
|
||||
sprintf(nom1, "edgeinitial_%d", ii);
|
||||
DBRep::Set(nom1, expr.Current());
|
||||
Standard_Integer jj = 0;
|
||||
const TopTools_ListOfShape& list = Generated(expr.Current());
|
||||
TopTools_ListIteratorOfListOfShape ite(list);
|
||||
for(; ite.More(); ite.Next()) {
|
||||
jj++;
|
||||
sprintf(nom2, "facegeneree_%d_%d", ii, jj);
|
||||
DBRep::Set(nom2, ite.Value());
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose : construction of a sufficiently long and properly oriented prism
|
||||
@@ -593,12 +530,11 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
|
||||
OrU = OrF;
|
||||
OrF = Or;
|
||||
}
|
||||
TopoDS_Shape Comp;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound(TopoDS::Compound(Comp));
|
||||
//
|
||||
TopTools_ListOfShape aLTools;
|
||||
TopoDS_Solid S = BRepFeat::Tool(mySUntil, FUntil, OrU);
|
||||
if (!S.IsNull()) {
|
||||
B.Add(Comp,S);
|
||||
aLTools.Append(S);
|
||||
}
|
||||
else {
|
||||
NotDone();
|
||||
@@ -607,85 +543,41 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
|
||||
}
|
||||
TopoDS_Solid SS = BRepFeat::Tool(mySFrom, FFrom, OrF);
|
||||
if (!SS.IsNull()) {
|
||||
B.Add(Comp,SS);
|
||||
aLTools.Append(SS);
|
||||
}
|
||||
else {
|
||||
NotDone();
|
||||
myStatusError = BRepFeat_NullToolF;
|
||||
return;
|
||||
}
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:00:10 2002 f
|
||||
//BRepAlgo_Cut trP(VraiPrism,Comp);
|
||||
//UpdateDescendants(trP.Builder(), trP.Shape(), Standard_False);
|
||||
BRepAlgoAPI_Cut trP(VraiPrism,Comp);
|
||||
//
|
||||
TopTools_ListOfShape aLObj;
|
||||
aLObj.Append(VraiPrism);
|
||||
//
|
||||
BRepAlgoAPI_Cut trP;
|
||||
trP.SetArguments(aLObj);
|
||||
trP.SetTools(aLTools);
|
||||
trP.Build();
|
||||
UpdateDescendants(trP, trP.Shape(), Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:00:16 2002 t
|
||||
if(myFuse == 1 && !myJustFeat) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:00:35 2002 f
|
||||
//BRepAlgo_Fuse f(mySbase, trP.Shape());
|
||||
//myShape = f.Shape();
|
||||
//UpdateDescendants(f.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Fuse f(mySbase, trP.Shape());
|
||||
myShape = f.Shape();
|
||||
UpdateDescendants(f, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:00:40 2002 t
|
||||
Done();
|
||||
}
|
||||
else if(myFuse == 0) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:01:01 2002 f
|
||||
//BRepAlgo_Cut c(mySbase, trP.Shape());
|
||||
//myShape = c.Shape();
|
||||
//UpdateDescendants(c.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Cut c(mySbase, trP.Shape());
|
||||
myShape = c.Shape();
|
||||
UpdateDescendants(c, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:01:13 2002 t
|
||||
Done();
|
||||
}
|
||||
else {
|
||||
myShape = trP.Shape();
|
||||
Done();
|
||||
}
|
||||
}
|
||||
// control history
|
||||
/*
|
||||
TopExp_Explorer expr(mySbase, TopAbs_FACE);
|
||||
char nom1[20], nom2[20];
|
||||
Standard_Integer ii = 0;
|
||||
for(; expr.More(); expr.Next()) {
|
||||
ii++;
|
||||
sprintf(nom1, "faceinitial_%d", ii);
|
||||
DBRep::Set(nom1, expr.Current());
|
||||
Standard_Integer jj = 0;
|
||||
const TopTools_ListOfShape& list = Modified(expr.Current());
|
||||
TopTools_ListIteratorOfListOfShape ite(list);
|
||||
for(; ite.More(); ite.Next()) {
|
||||
jj++;
|
||||
sprintf(nom2, "facemodifie_%d_%d", ii, jj);
|
||||
DBRep::Set(nom2, ite.Value());
|
||||
Done();
|
||||
}
|
||||
}
|
||||
|
||||
expr.Init(myPbase, TopAbs_EDGE);
|
||||
ii=0;
|
||||
for(; expr.More(); expr.Next()) {
|
||||
ii++;
|
||||
sprintf(nom1, "edgeinitial_%d", ii);
|
||||
DBRep::Set(nom1, expr.Current());
|
||||
Standard_Integer jj = 0;
|
||||
const TopTools_ListOfShape& list = Generated(expr.Current());
|
||||
TopTools_ListIteratorOfListOfShape ite(list);
|
||||
for(; ite.More(); ite.Next()) {
|
||||
jj++;
|
||||
sprintf(nom2, "egdegeneree_%d_%d", ii, jj);
|
||||
DBRep::Set(nom2, ite.Value());
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformUntilEnd
|
||||
//purpose : construction of a prism and reconstruction
|
||||
@@ -717,16 +609,10 @@ void BRepFeat_MakePrism::PerformUntilEnd()
|
||||
GluedFacesValid();
|
||||
|
||||
if(myFuse == 0) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:02:46 2002 f
|
||||
//BRepAlgo_Cut c(mySbase, myGShape);
|
||||
BRepAlgoAPI_Cut c(mySbase, myGShape);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:03:15 2002 t
|
||||
if (c.IsDone()) {
|
||||
myShape = c.Shape();
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:03:38 2002 f
|
||||
//UpdateDescendants(c.Builder(), myShape, Standard_False);
|
||||
UpdateDescendants(c, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:03:42 2002 t
|
||||
Done();
|
||||
}
|
||||
}
|
||||
@@ -819,16 +705,11 @@ void BRepFeat_MakePrism::PerformFromEnd(const TopoDS_Shape& Until)
|
||||
Trf = TransformShapeFU(0);
|
||||
FFrom = TopoDS::Face(mySFrom);
|
||||
}
|
||||
// else {
|
||||
// NotDone();
|
||||
// return;
|
||||
// }
|
||||
TopoDS_Shape Comp;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound(TopoDS::Compound(Comp));
|
||||
|
||||
TopTools_ListOfShape aLTools;
|
||||
TopoDS_Solid Sol = BRepFeat::Tool(mySUntil, FUntil, OrU);
|
||||
if (!Sol.IsNull()) {
|
||||
B.Add(Comp,Sol);
|
||||
aLTools.Append(Sol);
|
||||
}
|
||||
else {
|
||||
NotDone();
|
||||
@@ -838,50 +719,42 @@ void BRepFeat_MakePrism::PerformFromEnd(const TopoDS_Shape& Until)
|
||||
|
||||
TopoDS_Solid Sol1 = BRepFeat::Tool(mySFrom, FFrom, OrF);
|
||||
if (!Sol1.IsNull()) {
|
||||
B.Add(Comp,Sol1);
|
||||
aLTools.Append(Sol1);
|
||||
}
|
||||
else {
|
||||
NotDone();
|
||||
myStatusError = BRepFeat_NullToolF;
|
||||
return;
|
||||
}
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:03:57 2002 f
|
||||
//BRepAlgo_Cut trP(VraiPrism,Comp);
|
||||
//UpdateDescendants(trP.Builder(), trP.Shape(), Standard_False);
|
||||
BRepAlgoAPI_Cut trP(VraiPrism,Comp);
|
||||
//
|
||||
TopTools_ListOfShape aLObj;
|
||||
aLObj.Append(VraiPrism);
|
||||
//
|
||||
BRepAlgoAPI_Cut trP;
|
||||
trP.SetArguments(aLObj);
|
||||
trP.SetTools(aLTools);
|
||||
trP.Build();
|
||||
//
|
||||
UpdateDescendants(trP, trP.Shape(), Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:04:08 2002 t
|
||||
if(myFuse == 1 && !myJustFeat) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:04:33 2002 f
|
||||
//BRepAlgo_Fuse f(mySbase, trP.Shape());
|
||||
//myShape = f.Shape();
|
||||
//UpdateDescendants(f.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Fuse f(mySbase, trP.Shape());
|
||||
myShape = f.Shape();
|
||||
UpdateDescendants(f, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:04:41 2002 t
|
||||
Done();
|
||||
}
|
||||
else if(myFuse == 0) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:04:54 2002 f
|
||||
//BRepAlgo_Cut c(mySbase, trP.Shape());
|
||||
//myShape = c.Shape();
|
||||
//UpdateDescendants(c.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Cut c(mySbase, trP.Shape());
|
||||
myShape = c.Shape();
|
||||
UpdateDescendants(c, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:05:00 2002 t
|
||||
Done();
|
||||
}
|
||||
else {
|
||||
myShape = trP.Shape();
|
||||
Done();
|
||||
Done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformThruAll
|
||||
//purpose :
|
||||
@@ -918,16 +791,10 @@ void BRepFeat_MakePrism::PerformThruAll()
|
||||
GeneratedShapeValid();
|
||||
|
||||
if(myFuse == 0) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:05:31 2002 f
|
||||
//BRepAlgo_Cut c(mySbase, myGShape);
|
||||
BRepAlgoAPI_Cut c(mySbase, myGShape);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:05:33 2002 t
|
||||
if (c.IsDone()) {
|
||||
myShape = c.Shape();
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:05:46 2002 f
|
||||
//UpdateDescendants(c.Builder(), myShape, Standard_False);
|
||||
UpdateDescendants(c, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:05:50 2002 t
|
||||
Done();
|
||||
}
|
||||
}
|
||||
@@ -938,14 +805,13 @@ void BRepFeat_MakePrism::PerformThruAll()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformUntilHauteur
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepFeat_MakePrism::PerformUntilHeight(const TopoDS_Shape& Until,
|
||||
const Standard_Real Length)
|
||||
const Standard_Real Length)
|
||||
{
|
||||
#ifdef OCCT_DEBUG
|
||||
Standard_Boolean trc = BRepFeat_GettraceFEAT();
|
||||
@@ -1008,39 +874,25 @@ void BRepFeat_MakePrism::PerformUntilHeight(const TopoDS_Shape& Until,
|
||||
TopoDS_Solid S = BRepFeat::Tool(mySUntil, FUntil, Or);
|
||||
if (!S.IsNull()) B.Add(Comp,S);
|
||||
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:06:09 2002 f
|
||||
//BRepAlgo_Cut trP(VraiPrism,Comp);
|
||||
//UpdateDescendants(trP.Builder(), trP.Shape(), Standard_False);
|
||||
BRepAlgoAPI_Cut trP(VraiPrism,Comp);
|
||||
UpdateDescendants(trP, trP.Shape(), Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:06:15 2002 t
|
||||
if(myFuse == 1 && !myJustFeat) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:06:36 2002 f
|
||||
//BRepAlgo_Fuse f(mySbase, trP.Shape());
|
||||
//myShape = f.Shape();
|
||||
//UpdateDescendants(f.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Fuse f(mySbase, trP.Shape());
|
||||
myShape = f.Shape();
|
||||
UpdateDescendants(f, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:06:41 2002 t
|
||||
Done();
|
||||
BRepAlgoAPI_Fuse f(mySbase, trP.Shape());
|
||||
myShape = f.Shape();
|
||||
UpdateDescendants(f, myShape, Standard_False);
|
||||
Done();
|
||||
}
|
||||
else if(myFuse == 0) {
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:07:06 2002 f
|
||||
//BRepAlgo_Cut c(mySbase, trP.Shape());
|
||||
//myShape = c.Shape();
|
||||
//UpdateDescendants(c.Builder(), myShape, Standard_False);
|
||||
BRepAlgoAPI_Cut c(mySbase, trP.Shape());
|
||||
myShape = c.Shape();
|
||||
UpdateDescendants(c, myShape, Standard_False);
|
||||
//modified by NIZNHY-PKV Thu Mar 21 18:07:12 2002 t
|
||||
Done();
|
||||
BRepAlgoAPI_Cut c(mySbase, trP.Shape());
|
||||
myShape = c.Shape();
|
||||
UpdateDescendants(c, myShape, Standard_False);
|
||||
Done();
|
||||
}
|
||||
else {
|
||||
myShape = trP.Shape();
|
||||
Done();
|
||||
myShape = trP.Shape();
|
||||
Done();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,11 +1,16 @@
|
||||
# Original bug : pro14942
|
||||
# Date : 26Aout98
|
||||
|
||||
puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
|
||||
restore [locate_data_file CTO904_pro14942a.rle] a
|
||||
restore [locate_data_file pro14942b.rle] b
|
||||
|
||||
bcut result a b
|
||||
|
||||
checkshape result
|
||||
|
||||
checkprops result -s 192941
|
||||
|
||||
checknbshapes result -face 43 -shell 1 -solid 1
|
||||
|
||||
checkview -display result -2d -s -otherwise { a b } -path ${imagedir}/${test_image}.png
|
||||
|
@@ -1,3 +1,2 @@
|
||||
puts "TODO OCC26018 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
source [locate_data_file 51679_tkz_montecristo_sbr.prt.1.gdml.tcl]
|
||||
|
||||
|
@@ -1,6 +1,10 @@
|
||||
# test script on make volume operation
|
||||
# cone plane
|
||||
|
||||
puts "TODO CR28503 ALL: Error : The area of result shape is"
|
||||
puts "TODO CR28503 ALL: Error : is WRONG because number of SOLID entities in shape"
|
||||
puts "TODO CR28503 ALL: Faulty shapes in variables faulty_"
|
||||
|
||||
# planar face
|
||||
plane pln_f1 27.577164466275352 -1038.2137499999999 27.577164466275359 0.70710678118654746 4.4408920985006262e-016 0.70710678118654768
|
||||
erase pln_f1
|
||||
@@ -34,5 +38,6 @@ mkface f6 con_f6 0 6.2831853071795862 0 1000000
|
||||
# make volume operation
|
||||
mkvolume result f1 f2 f3 f4 f5 f6
|
||||
|
||||
checkprops result -s 5.1932e+006
|
||||
checkprops result -s 5.19571e+006
|
||||
|
||||
checknbshapes result -solid 16
|
@@ -1,6 +1,8 @@
|
||||
# test script on make volume operation
|
||||
# cone plane
|
||||
|
||||
puts "TODO CR28503 ALL: Error : is WRONG because number of SOLID entities in shape"
|
||||
|
||||
# planar face
|
||||
plane pln_f1 -306.53078964627537 -1038.2137499999999 -251.37646071372467 -0.70710678118654746 4.4408920985006262e-016 0.70710678118654768
|
||||
erase pln_f1
|
||||
@@ -39,4 +41,6 @@ mkface f7 con_f7 0 6.2831853071795862 0 1000000
|
||||
# make volume operation
|
||||
mkvolume result f1 f2 f3 f4 f5 f6 f7
|
||||
|
||||
checkprops result -s 6.22995e+006
|
||||
checkprops result -s 6.45353e+006
|
||||
|
||||
checknbshapes result -solid 29
|
@@ -1,4 +1,6 @@
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
puts "TODO OCC11111 ALL: Faulty shapes in variables faulty_1 to faulty_ "
|
||||
|
||||
puts "============"
|
||||
puts "OCC10160"
|
||||
puts "============"
|
||||
|
@@ -1,4 +1,6 @@
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of"
|
||||
puts "TODO OCC11111 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
|
||||
puts "============"
|
||||
puts "OCC10160"
|
||||
puts "============"
|
||||
|
@@ -6,7 +6,7 @@ puts ""
|
||||
# Wrong pcurve of the section curve
|
||||
###########################################################
|
||||
|
||||
set ExpectedTol 5.6061116035240048e-005
|
||||
set ExpectedTol 6.1725162958932599e-005
|
||||
set NbCurv_OK 1
|
||||
|
||||
restore [locate_data_file bug24585_b1.brep] b1
|
||||
|
@@ -6,6 +6,8 @@ puts ""
|
||||
# Invalid result of boolean operation
|
||||
######################################################
|
||||
|
||||
puts "TODO OCC11111 ALL: Error : Boolean operations common is WRONG because number of "
|
||||
|
||||
restore [locate_data_file bug26132_shape.brep] c
|
||||
|
||||
explode c
|
||||
|
@@ -6,6 +6,8 @@ puts ""
|
||||
## Wrong result obtained by intersection algorithm.
|
||||
###############################
|
||||
|
||||
puts "TODO OCC11111 ALL: Error : Wrong result obtained by intersection algorithm"
|
||||
|
||||
restore [locate_data_file bug26132_shape.brep] q
|
||||
|
||||
explode q
|
||||
|
@@ -6,6 +6,8 @@ puts ""
|
||||
## Wrong result obtained by intersection algorithm.
|
||||
###############################
|
||||
|
||||
puts "TODO OCC11111 ALL: Error : Wrong result obtained by intersection algorithm"
|
||||
|
||||
restore [locate_data_file bug26132_shape.brep] q
|
||||
|
||||
explode q
|
||||
|
22
tests/bugs/modalg_6/bug28501_1
Normal file
22
tests/bugs/modalg_6/bug28501_1
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "========"
|
||||
puts "OCC28501"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Incomplete result of offset operation in mode Complete with Join type intersection
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file bug28501_ls.brep] ls
|
||||
|
||||
mkvolume result ls -c
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -solid 3
|
||||
|
||||
checkprops result -s 284510 -v 3.44632e+006
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
22
tests/bugs/modalg_6/bug28501_2
Normal file
22
tests/bugs/modalg_6/bug28501_2
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "========"
|
||||
puts "OCC28501"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Incomplete result of offset operation in mode Complete with Join type intersection
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file bug28501_ls2.brep] ls
|
||||
|
||||
mkvolume result ls -c
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -solid 31
|
||||
|
||||
checkprops result -s 1.86075e+006 -v 1.80713e+007
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
22
tests/bugs/modalg_6/bug28501_3
Normal file
22
tests/bugs/modalg_6/bug28501_3
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "========"
|
||||
puts "OCC28501"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Incomplete result of offset operation in mode Complete with Join type intersection
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file bug28501_ls_full.brep] ls
|
||||
|
||||
mkvolume result ls -c
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -solid 28
|
||||
|
||||
checkprops result -s 1.80723e+006 -v 1.8558e+007
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
22
tests/bugs/modalg_6/bug28501_4
Normal file
22
tests/bugs/modalg_6/bug28501_4
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "========"
|
||||
puts "OCC28501"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Incomplete result of offset operation in mode Complete with Join type intersection
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file bug28501_D5_ls.brep] ls
|
||||
|
||||
mkvolume result ls -c
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -solid 9 -shell 17
|
||||
|
||||
checkprops result -s 7.22211e+006 -v 3.44873e+008
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
22
tests/bugs/modalg_6/bug28501_5
Normal file
22
tests/bugs/modalg_6/bug28501_5
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "========"
|
||||
puts "OCC28501"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Incomplete result of offset operation in mode Complete with Join type intersection
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file bug28501_J7_trim_faces.brep] ls
|
||||
|
||||
mkvolume result ls -c
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -solid 22 -shell 29
|
||||
|
||||
checkprops result -s 625791 -v 9.65475e+006
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
22
tests/bugs/modalg_6/bug28501_6
Normal file
22
tests/bugs/modalg_6/bug28501_6
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "========"
|
||||
puts "OCC28501"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Incomplete result of offset operation in mode Complete with Join type intersection
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file bug28501_J7_trim1_faces.brep] ls
|
||||
|
||||
mkvolume result ls -c
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -solid 13 -shell 20
|
||||
|
||||
checkprops result -s 419486 -v 6.49567e+006
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
22
tests/bugs/modalg_6/bug28501_7
Normal file
22
tests/bugs/modalg_6/bug28501_7
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "========"
|
||||
puts "OCC28501"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Incomplete result of offset operation in mode Complete with Join type intersection
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file bug28501_N9_lf.brep] ls
|
||||
|
||||
mkvolume result ls -c -ni
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -solid 3 -shell 3
|
||||
|
||||
checkprops result -s 193823 -v 4.88386e+006
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
43
tests/bugs/modalg_6/bug29260_1
Normal file
43
tests/bugs/modalg_6/bug29260_1
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "================"
|
||||
puts "OCC29260"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Boolean operation hangs on the intersection stage
|
||||
#######################################################################
|
||||
|
||||
restore [locate_data_file bug29260_sewedShapeb1.brep] a
|
||||
restore [locate_data_file bug29260_cuttingTool1b1.brep] t1
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects a
|
||||
baddtools t1
|
||||
|
||||
dchrono cr reset
|
||||
dchrono cr start
|
||||
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
dchrono cr stop
|
||||
|
||||
bbop rs 4
|
||||
|
||||
dchrono cr show
|
||||
|
||||
if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
|
||||
puts "ERROR: the section is not closed"
|
||||
} else {
|
||||
puts "The section is OK"
|
||||
}
|
||||
|
||||
checknbshapes result -solid 1 -shell 1
|
||||
checkprops result -s 0.00926451
|
||||
checkshape result
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
43
tests/bugs/modalg_6/bug29260_2
Normal file
43
tests/bugs/modalg_6/bug29260_2
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "================"
|
||||
puts "OCC29260"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Boolean operation hangs on the intersection stage
|
||||
#######################################################################
|
||||
|
||||
restore [locate_data_file bug29260_sewedShapeb1.brep] a
|
||||
restore [locate_data_file bug29260_cuttingTool2b1.brep] t2
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects a
|
||||
baddtools t2
|
||||
|
||||
dchrono cr reset
|
||||
dchrono cr start
|
||||
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
dchrono cr stop
|
||||
|
||||
bbop rs 4
|
||||
|
||||
dchrono cr show
|
||||
|
||||
if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
|
||||
puts "ERROR: the section is not closed"
|
||||
} else {
|
||||
puts "The section is OK"
|
||||
}
|
||||
|
||||
checknbshapes result -solid 1 -shell 1
|
||||
checkprops result -s 0.00926434
|
||||
checkshape result
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
43
tests/bugs/modalg_6/bug29260_3
Normal file
43
tests/bugs/modalg_6/bug29260_3
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "================"
|
||||
puts "OCC29260"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Boolean operation hangs on the intersection stage
|
||||
#######################################################################
|
||||
|
||||
restore [locate_data_file bug29260_sewedShapeb2.brep] a
|
||||
restore [locate_data_file bug29260_cuttingTool1b2.brep] t1
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects a
|
||||
baddtools t1
|
||||
|
||||
dchrono cr reset
|
||||
dchrono cr start
|
||||
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
dchrono cr stop
|
||||
|
||||
bbop rs 4
|
||||
|
||||
dchrono cr show
|
||||
|
||||
if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
|
||||
puts "ERROR: the section is not closed"
|
||||
} else {
|
||||
puts "The section is OK"
|
||||
}
|
||||
|
||||
checknbshapes result -solid 1 -shell 1
|
||||
checkprops result -s 0.0105663
|
||||
checkshape result
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
46
tests/bugs/modalg_6/bug29260_4
Normal file
46
tests/bugs/modalg_6/bug29260_4
Normal file
@@ -0,0 +1,46 @@
|
||||
puts "================"
|
||||
puts "OCC29260"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Boolean operation hangs on the intersection stage
|
||||
#######################################################################
|
||||
|
||||
puts "TODO OCC29260 ALL: ERROR: the section is not closed"
|
||||
puts "TODO OCC29260 ALL: Error : The area of result shape is"
|
||||
|
||||
restore [locate_data_file bug29260_sewedShapeb2.brep] a
|
||||
restore [locate_data_file bug29260_cuttingTool2b2.brep] t2
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects a
|
||||
baddtools t2
|
||||
|
||||
dchrono cr reset
|
||||
dchrono cr start
|
||||
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
dchrono cr stop
|
||||
|
||||
bbop rs 4
|
||||
|
||||
dchrono cr show
|
||||
|
||||
if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
|
||||
puts "ERROR: the section is not closed"
|
||||
} else {
|
||||
puts "The section is OK"
|
||||
}
|
||||
|
||||
checknbshapes result -solid 1 -shell 1
|
||||
checkprops result -s 0.00926451
|
||||
checkshape result
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
@@ -1,9 +1,7 @@
|
||||
#puts "TODO OCC12345 ALL: An exception was caught"
|
||||
#puts "TODO OCC12345 ALL: \\*\\* Exception \\*\\*.*"
|
||||
#puts "TODO OCC12345 ALL: TEST INCOMPLETE"
|
||||
#puts "TODO OCC12345 ALL: xception"
|
||||
puts "TODO OCC25892 ALL: Faulty shapes in variables"
|
||||
puts "TODO OCC25892 ALL: The area of result shape is"
|
||||
puts "TODO OCC28556 ALL: Faulty shapes in variables"
|
||||
puts "TODO OCC28556 ALL: The area of result shape is"
|
||||
puts "TODO OCC28556 ALL: The volume of result shape is"
|
||||
puts "TODO OCC28556 ALL: Error : is WRONG because number of"
|
||||
|
||||
puts "========================"
|
||||
puts " OCC469 "
|
||||
@@ -16,11 +14,10 @@ puts ""
|
||||
restore [locate_data_file OCC469.brep] a
|
||||
explode a
|
||||
|
||||
checkshape a_1
|
||||
checkshape a_2
|
||||
|
||||
bfuse result a_1 a_2
|
||||
checkshape result
|
||||
|
||||
checkprops result -s 10
|
||||
checkshape result
|
||||
checkprops result -s 30523.3 -v 22730.1
|
||||
checknbshapes result -shell 1 -solid 1
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
@@ -13,7 +13,7 @@ stepread [locate_data_file OCC11856.stp] a *
|
||||
|
||||
tpcompound result
|
||||
|
||||
checkprops result -s 611185 -eps 0.1
|
||||
checkprops result -s 653034
|
||||
checkshape result
|
||||
checknbshapes result -vertex 684 -edge 1222 -wire 519 -face 512 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 2940
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
Reference in New Issue
Block a user