#include <Precision.hxx>
#include <BRep_Builder.hxx>
+#include <BRepTools.hxx>
//=======================================================================
//function : Draft_Modification
(typs == STANDARD_TYPE(Geom_ConicalSurface));
if ( JeRecadre) {
- gp_Pnt2d PF,PL;
- BRep_Tool::UVPoints(E,F,PF,PL);
- gp_Pnt2d NewPF = C->Value(Fp);
- gp_Vec2d vectra(2.*M_PI,0.);
-
- if (NewPF.Translated(vectra).SquareDistance(PF)
- < NewPF.SquareDistance(PF)) {
- C->Translate(vectra);
-
+ Standard_Boolean bTranslate;
+ Standard_Real aD2, aT1, aT2;
+ gp_Pnt2d PF, NewPF, aP2DT;
+ gp_Vec2d aV2DT, vectra(2.*M_PI,0.);
+ Handle(Geom2d_Curve) aC2DE;
+ //
+ aC2DE=BRep_Tool::CurveOnSurface(E, F, aT1, aT2);
+ //
+ PF=aC2DE->Value(0.5*(aT1+aT2));
+ //
+ NewPF=C->Value(0.5*(Fp+Lp));
+ //
+ aD2=NewPF.SquareDistance(PF);
+ //
+ bTranslate=Standard_False;
+ if (NewPF.Translated(vectra).SquareDistance(PF) < aD2) {
+ aV2DT=vectra;
+ bTranslate=!bTranslate; //True
}
- else if (NewPF.Translated(-vectra).SquareDistance(PF)
- < NewPF.SquareDistance(PF)) {
- C->Translate(-vectra);
-
+ else if (NewPF.Translated(-vectra).SquareDistance(PF) < aD2) {
+ aV2DT=-vectra;
+ bTranslate=!bTranslate; //True
+ }
+ //
+ if (bTranslate) {
+ C->Translate(aV2DT);
}
}
-
return Standard_True;
}
return;
}
//----------------------------------------
+ Standard_Boolean bFound;
Standard_Integer aNbVtx, aNbVtxWas, i;
Standard_Real aTolPC, aT, aT1, aT2, aTmid, aTwoPI, aTolPC1;
Standard_Real aU1, aV1, aU2, aV2;
aTwoPI=M_PI+M_PI;
aTolPC=Precision::PConfusion();
aNbVtxWas=GeomInt_LineTool::NbVertex(aLine);
+
aNbVtx=aNbVtxWas+2;
//-------------------------------------2
aTS1=myHS1->GetType();
pVtx=new IntTools_RealWithFlag [aNbVtx];
//
pVtx[0].SetValue(0.);
- pVtx[1].SetValue(2.*M_PI);
+ pVtx[1].SetValue(aTwoPI);
//
for(i=1; i<=aNbVtxWas; ++i) {
aT=GeomInt_LineTool::Vertex(aLine, i).ParameterOnLine();
//
RejectDuplicates(aNbVtx, pVtx, aTolPC);
//
+ if ((aType==IntPatch_Circle || aType==IntPatch_Ellipse)&& aNbVtx>2) { // zz
+ bFound=Standard_False;
+ for(i=1; i<=aNbVtxWas; ++i) {
+ aT=GeomInt_LineTool::Vertex(aLine, i).ParameterOnLine();
+ if (fabs(aT) < aTolPC1 || fabs(aT-aTwoPI) < aTolPC1) {
+ bFound=!bFound;
+ break;
+ }
+ }
+ if (!bFound) {
+ aT=pVtx[1].Value()+aTwoPI;
+ pVtx[aNbVtx-1].SetValue(aT);
+ //
+ for(i=0; i<aNbVtx; ++i) {
+ aT=pVtx[i+1].Value();
+ pVtx[i].SetValue(aT);
+ }
+ --aNbVtx;
+ }
+ }
+ //
for(i=0; i<aNbVtx-1; ++i) {
aT1=pVtx[i].Value();
aT2=pVtx[i+1].Value();
--- /dev/null
+puts "========="
+puts "CR23765"
+puts "========="
+puts ""
+##################################################
+## The result of section operation contains redundant vertex.
+##################################################
+
+restore [locate_data_file bug23765_b1.brep] b1
+restore [locate_data_file bug23765_b2.brep] b2
+
+bop b1 b2
+bopsection result
+
+set nb_v_good 2
+
+set 2dviewer 1
} else {
puts "Good value of parametric range rc1"
}
-if {${rc2} > ${2_PI}} {
+if {${rc2} < ${2_PI}} {
puts "Error: Bad value of parametric range rc2"
} else {
puts "Good value of parametric range rc2"
set square 225009
# Analysis of "nbshapes result"
-set nb_v_good 8
-set nb_e_good 12
+set nb_v_good 6
+set nb_e_good 10
set nb_w_good 8
set nb_f_good 6
set nb_sh_good 1
set nb_sol_good 0
set nb_compsol_good 0
set nb_compound_good 1
-set nb_shape_good 36
+set nb_shape_good 32
set 3dviewer 1