mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0026071: BRepOffsetAPI_MakePipeShell produces rough result
1. Correct building history: the case of closed spine. 2. Rollback method GeomFill_CorrectedFrenet::InitInterval - correct processing singularities on spine. 3. Correct test cases.
This commit is contained in:
parent
63da0df9c2
commit
bf327822d6
@ -451,7 +451,12 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
|
||||
|
||||
Standard_Boolean BRepFill_LocationLaw::IsClosed() const
|
||||
{
|
||||
return myPath.Closed();
|
||||
if (myPath.Closed())
|
||||
return Standard_True;
|
||||
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(myPath, V1, V2);
|
||||
return (V1.IsSame(V2));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@ -1377,7 +1377,7 @@ void BRepFill_PipeShell::BuildHistory(const BRepFill_Sweep& theSweep)
|
||||
BB.Add(aWire, CurEdge);
|
||||
} //for (jj = 2; jj <= SeqEdges.Length(); jj++)
|
||||
//case of closed wire
|
||||
if (mySection->IsVClosed() &&
|
||||
if (myLocation->IsClosed() &&
|
||||
!CurVertex.IsSame(FirstVertex))
|
||||
{
|
||||
const TopTools_ListOfShape& Elist = VEmap.FindFromKey(CurVertex);
|
||||
|
@ -247,6 +247,10 @@ static Standard_Integer geompipe(Draw_Interpretor&,
|
||||
std::cout << "GeomFill_Pipe cannot make a surface" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_Real Accuracy = aPipe.ErrorOnSurf();
|
||||
std::cout << "Accuracy of approximation = " << Accuracy << std::endl;
|
||||
|
||||
Handle(Geom_Surface) Sur = aPipe.Surface();
|
||||
TopoDS_Face F;
|
||||
if (!Sur.IsNull())
|
||||
|
@ -475,16 +475,16 @@ Handle(GeomFill_TrihedronLaw) GeomFill_CorrectedFrenet::Copy() const
|
||||
gp_Vec Tangent, Normal, BN, cross;
|
||||
TColStd_SequenceOfReal parameters;
|
||||
TColStd_SequenceOfReal EvolAT;
|
||||
Standard_Real Param = First, L, norm;
|
||||
Standard_Real Param = First, LengthMin, L, norm;
|
||||
Standard_Boolean isZero = Standard_True, isConst = Standard_True;
|
||||
const Standard_Real minnorm = 1.e-16;
|
||||
Standard_Integer i;
|
||||
gp_Pnt PonC;
|
||||
gp_Vec D1;
|
||||
|
||||
frenet->SetInterval(First, Last); //To have the rigth evaluation at bounds
|
||||
frenet->SetInterval(First, Last); //To have right evaluation at bounds
|
||||
GeomFill_SnglrFunc CS(myCurve);
|
||||
BndLib_Add3dCurve::Add(CS, First, Last, 1.e-2, Boite);
|
||||
LengthMin = Boite.GetGap()*1.e-4;
|
||||
|
||||
aT = gp_Vec(0, 0, 0);
|
||||
aN = gp_Vec(0, 0, 0);
|
||||
@ -541,21 +541,13 @@ Handle(GeomFill_TrihedronLaw) GeomFill_CorrectedFrenet::Copy() const
|
||||
|
||||
//Evaluate the Next step
|
||||
CS.D1(Param, PonC, D1);
|
||||
|
||||
L = PonC.XYZ().Modulus()/2;
|
||||
L = Max(PonC.XYZ().Modulus()/2, LengthMin);
|
||||
norm = D1.Magnitude();
|
||||
if (norm <= gp::Resolution())
|
||||
{
|
||||
//norm = 2.*gp::Resolution();
|
||||
norm = minnorm;
|
||||
if (norm < Precision::Confusion()) {
|
||||
norm = Precision::Confusion();
|
||||
}
|
||||
currStep = L / norm;
|
||||
if (currStep <= gp::Resolution()) //L = 0 => curvature = 0, linear segment
|
||||
currStep = Step;
|
||||
if (currStep < Precision::Confusion()) //too small step
|
||||
currStep = Precision::Confusion();
|
||||
if (currStep > Step) //too big step
|
||||
currStep = Step;//default value
|
||||
if (currStep > Step) currStep = Step;//default value
|
||||
}
|
||||
else
|
||||
currStep /= 2; // Step too long !
|
||||
|
@ -153,6 +153,9 @@ static Standard_Integer sweep (Draw_Interpretor& di,
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_Real Accuracy = Pipe.ErrorOnSurf();
|
||||
di << "Accuracy of approximation = " << Accuracy << "\n";
|
||||
|
||||
DrawTrSurf::Set(a[1], Pipe.Surface());
|
||||
return 0;
|
||||
|
||||
@ -223,6 +226,10 @@ static Standard_Integer tuyau (Draw_Interpretor& di,
|
||||
di << "GeomFill_Pipe cannot make a surface\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_Real Accuracy = Pipe.ErrorOnSurf();
|
||||
di << "Accuracy of approximation = " << Accuracy << "\n";
|
||||
|
||||
DrawTrSurf::Set(a[indice_path-1], Pipe.Surface());
|
||||
|
||||
return 0;
|
||||
|
@ -1,10 +1,7 @@
|
||||
puts "========"
|
||||
puts "OCC25883"
|
||||
puts "========"
|
||||
puts "============================================================="
|
||||
puts "OCC25883: BRepOffsetAPI_MakePipeShell produces invalid result"
|
||||
puts "============================================================="
|
||||
puts ""
|
||||
#######################################################
|
||||
# BRepOffsetAPI_MakePipeShell produces invalid result
|
||||
#######################################################
|
||||
|
||||
restore [locate_data_file OCC25883_shape.brep] a
|
||||
|
||||
@ -16,12 +13,20 @@ mksweep a_1
|
||||
addsweep a_2
|
||||
buildsweep res
|
||||
|
||||
donly res
|
||||
fit
|
||||
|
||||
set bug_info [checkshape res]
|
||||
if {[string compare $bug_info "This shape seems to be valid"] != 0} {
|
||||
puts "ERROR: OCC25883 is reproduced."
|
||||
}
|
||||
|
||||
set tolres [checkmaxtol res]
|
||||
|
||||
if { ${tolres} > 1.e-4} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
explode res
|
||||
mksurface surf2 res_2
|
||||
donly surf2
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
||||
|
@ -33,4 +33,4 @@ checkprops r4 -s 10944.1
|
||||
explode pr_1 v
|
||||
|
||||
generated r3 sweep_hist pr_1_3
|
||||
checkprops r3 -l 130.036
|
||||
checkprops r3 -l 65.0179
|
||||
|
@ -1,3 +1,5 @@
|
||||
puts "TODO OCC21413 ALL: bad accuracy of approximation"
|
||||
|
||||
puts "========"
|
||||
puts "OCC21413"
|
||||
puts "========"
|
||||
@ -8,6 +10,12 @@ puts ""
|
||||
|
||||
restore [locate_data_file bug21413_dc1_err.draw] a
|
||||
|
||||
tuyau result a 1
|
||||
set log [tuyau result a 1]
|
||||
|
||||
regexp {Accuracy of approximation = ([0-9+-.eE]*)} $log full accuracy
|
||||
|
||||
if { ${accuracy} > 0.0001} {
|
||||
puts "Error: bad accuracy of approximation"
|
||||
}
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
@ -1,4 +1,4 @@
|
||||
puts "TODO OCC23942 ALL: is not equal"
|
||||
puts "TODO OCC21413 ALL: bad accuracy of approximation"
|
||||
|
||||
puts "========"
|
||||
puts "OCC23942"
|
||||
@ -12,7 +12,13 @@ puts ""
|
||||
### 1
|
||||
#
|
||||
interpol c [locate_data_file bug23942_points.txt]
|
||||
tuyau r_1 c 5
|
||||
set log [tuyau r_1 c 5]
|
||||
|
||||
regexp {Accuracy of approximation = ([0-9+-.eE]*)} $log full accuracy
|
||||
|
||||
if { ${accuracy} > 0.0001} {
|
||||
puts "Error: bad accuracy of approximation"
|
||||
}
|
||||
|
||||
decho off
|
||||
dlog reset
|
||||
@ -38,7 +44,13 @@ puts "VKnots_1 = ${VKnots_1}"
|
||||
#
|
||||
save c ${imagedir}/cc
|
||||
restore ${imagedir}/cc
|
||||
tuyau r_2 cc 5
|
||||
set log [tuyau r_2 cc 5]
|
||||
|
||||
regexp {Accuracy of approximation = ([0-9+-.eE]*)} $log full accuracy
|
||||
|
||||
if { ${accuracy} > 0.0001} {
|
||||
puts "Error: bad accuracy of approximation"
|
||||
}
|
||||
|
||||
decho off
|
||||
dlog reset
|
||||
|
Loading…
x
Reference in New Issue
Block a user