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

0028661: BRepOffsetAPI_MakePipeShell throws an exception Standard_NoSuchObject: NCollection_DataMap::Find

1. Clearance of fields of class has been added to the method BRepFill_PipeShell::Prepare().
2. Calculation of error on surfaces has been corrected in the method GeomFill_Sweep::BuildKPart().
3. New Draw command "errorsweep" has been added to check the error reached on the surfaces built by BRepOffsetAPI_MakePipeShell algorithm.
This commit is contained in:
jgv 2017-04-20 14:08:07 +03:00 committed by bugmaster
parent 505e241c8a
commit 107f794fc9
6 changed files with 102 additions and 37 deletions

View File

@ -937,6 +937,9 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
//=======================================================================
void BRepFill_PipeShell::Prepare()
{
WSeq.Clear();
myEdgeNewEdges.Clear();
TopoDS_Wire theSect;
if (!IsReady()) throw StdFail_NotDone("PipeShell");
if (!myLocation.IsNull() && !mySection.IsNull()) return; // It is ready

View File

@ -856,6 +856,24 @@ static Standard_Integer gensweep(Draw_Interpretor&,
return 0;
}
//=======================================================================
//function : errorsweep
//purpose : returns the summary error on resulting surfaces
// reached by Sweep
//=======================================================================
static Standard_Integer errorsweep(Draw_Interpretor& di,
Standard_Integer, const char**)
{
if (!Sweep->IsDone())
{
di << "Sweep is not done\n";
return 1;
}
Standard_Real ErrorOnSurfaces = Sweep->ErrorOnSurface();
di << "Tolerance on surfaces = " << ErrorOnSurfaces << "\n";
return 0;
}
//=======================================================================
// simulsweep
//=======================================================================
@ -998,6 +1016,9 @@ void BRepTest::SweepCommands(Draw_Interpretor& theCommands)
theCommands.Add("gensweep", "gensweep res subshape_of_profile",
__FILE__,gensweep,g);
theCommands.Add("errorsweep", "errorsweep: returns the summary error on resulting surfaces reached by Sweep",
__FILE__,errorsweep,g);
theCommands.Add("simulsweep", "simulsweep r [n] [option]"
__FILE__,simulsweep,g);
theCommands.Add("geompipe", "geompipe r spineedge profileedge radius [byACR [byrotate]]"

View File

@ -835,21 +835,14 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
error *= C.Radius();
if (error <= Tol) {
SError = error;
error += Radius + Abs(RotRadius - C.Radius())/2;
if (error <= Tol || Radius <= Tol) {
error += Radius;
if (Radius <= Tol) {
// (2.1.a) Sphere
Standard_Real f = UFirst , l = ULast, aRadius = 0.0;
SError = error;
Centre.BaryCenter(1.0, C.Location(), 1.0);
gp_Ax3 AxisOfSphere(Centre, DN, DS);
if (Radius <= Tol)
{
aRadius = C.Radius();
}
else
{
aRadius = (RotRadius + C.Radius()) / 2;
}
aRadius = C.Radius();
gp_Sphere theSphere( AxisOfSphere, aRadius );
S = new Geom_SphericalSurface(theSphere);
// Pour les spheres on ne peut pas controler le parametre

View File

@ -1,27 +0,0 @@
puts "========"
puts "OCC27769"
puts "========"
puts ""
#################################################
# BRepOffsetAPI_MakePipeShell produces a face
# based on degenerated toroidal surfaces
#################################################
restore [locate_data_file bug27769_W5_slot.brep] w
restore [locate_data_file bug27769_A4_slot.brep] e
wire p e
mksweep p
addsweep w
buildsweep r
explode r f
mksurface s1 r_1
set info [dump s1]
set check [regexp "SphericalSurface" $info]
if { ${check} == 1 } {
puts "OK: The basic surface is spherical surface."
} else {
puts "Faulty: The basic surface is not spherical surface."
}

View File

@ -0,0 +1,36 @@
puts "============"
puts "OCC28661"
puts "============"
puts ""
#######################################################################
# BRepOffsetAPI_MakePipeShell throws an exception Standard_NoSuchObject
#######################################################################
restore [locate_data_file bug27769_W5_slot.brep] pr
restore [locate_data_file bug27769_A4_slot.brep] sp
wire sp sp
mksweep sp
addsweep pr
buildsweep r
explode r f
mksurface s1 r_1
set info [dump s1]
set check [regexp "SphericalSurface" $info]
if { ${check} == 1 } {
puts "OK: The basic surface is spherical surface."
} else {
puts "Faulty: The basic surface is not spherical surface."
}
set info1 [errorsweep]
set check [regexp {Tolerance on surfaces = ([0-9\-+Ee.]+)} $info1 str error]
checkreal "Accuracy" $error 0 1.e-10 0
setsweep -FR
buildsweep r1

View File

@ -0,0 +1,39 @@
puts "============"
puts "OCC28661"
puts "============"
puts ""
#######################################################################
# BRepOffsetAPI_MakePipeShell throws an exception Standard_NoSuchObject
#######################################################################
circle sp 0 0 0 6
mkedge sp sp
wire sp sp
circle pr 0 0 0 0 -1 0 10
trim pr pr 0 pi
mkedge pr pr
wire pr pr
mksweep sp
addsweep pr
buildsweep r
explode r f
mksurface s1 r_1
set info [dump s1]
set check [regexp "SphericalSurface" $info]
if { ${check} == 1 } {
puts "OK: The basic surface is spherical surface."
} else {
puts "Faulty: The basic surface is not spherical surface."
}
set info1 [errorsweep]
set check [regexp {Tolerance on surfaces = ([0-9\-+Ee.]+)} $info1 str error]
if { $error != 0 } {
puts "Faulty: tolerance reached on resulting surfaces is wrong"
}