mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +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:
parent
505e241c8a
commit
107f794fc9
@ -937,6 +937,9 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BRepFill_PipeShell::Prepare()
|
void BRepFill_PipeShell::Prepare()
|
||||||
{
|
{
|
||||||
|
WSeq.Clear();
|
||||||
|
myEdgeNewEdges.Clear();
|
||||||
|
|
||||||
TopoDS_Wire theSect;
|
TopoDS_Wire theSect;
|
||||||
if (!IsReady()) throw StdFail_NotDone("PipeShell");
|
if (!IsReady()) throw StdFail_NotDone("PipeShell");
|
||||||
if (!myLocation.IsNull() && !mySection.IsNull()) return; // It is ready
|
if (!myLocation.IsNull() && !mySection.IsNull()) return; // It is ready
|
||||||
|
@ -856,6 +856,24 @@ static Standard_Integer gensweep(Draw_Interpretor&,
|
|||||||
return 0;
|
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
|
// simulsweep
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -998,6 +1016,9 @@ void BRepTest::SweepCommands(Draw_Interpretor& theCommands)
|
|||||||
theCommands.Add("gensweep", "gensweep res subshape_of_profile",
|
theCommands.Add("gensweep", "gensweep res subshape_of_profile",
|
||||||
__FILE__,gensweep,g);
|
__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]"
|
theCommands.Add("simulsweep", "simulsweep r [n] [option]"
|
||||||
__FILE__,simulsweep,g);
|
__FILE__,simulsweep,g);
|
||||||
theCommands.Add("geompipe", "geompipe r spineedge profileedge radius [byACR [byrotate]]"
|
theCommands.Add("geompipe", "geompipe r spineedge profileedge radius [byACR [byrotate]]"
|
||||||
|
@ -835,21 +835,14 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
|
|||||||
error *= C.Radius();
|
error *= C.Radius();
|
||||||
if (error <= Tol) {
|
if (error <= Tol) {
|
||||||
SError = error;
|
SError = error;
|
||||||
error += Radius + Abs(RotRadius - C.Radius())/2;
|
error += Radius;
|
||||||
if (error <= Tol || Radius <= Tol) {
|
if (Radius <= Tol) {
|
||||||
// (2.1.a) Sphere
|
// (2.1.a) Sphere
|
||||||
Standard_Real f = UFirst , l = ULast, aRadius = 0.0;
|
Standard_Real f = UFirst , l = ULast, aRadius = 0.0;
|
||||||
SError = error;
|
SError = error;
|
||||||
Centre.BaryCenter(1.0, C.Location(), 1.0);
|
Centre.BaryCenter(1.0, C.Location(), 1.0);
|
||||||
gp_Ax3 AxisOfSphere(Centre, DN, DS);
|
gp_Ax3 AxisOfSphere(Centre, DN, DS);
|
||||||
if (Radius <= Tol)
|
aRadius = C.Radius();
|
||||||
{
|
|
||||||
aRadius = C.Radius();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
aRadius = (RotRadius + C.Radius()) / 2;
|
|
||||||
}
|
|
||||||
gp_Sphere theSphere( AxisOfSphere, aRadius );
|
gp_Sphere theSphere( AxisOfSphere, aRadius );
|
||||||
S = new Geom_SphericalSurface(theSphere);
|
S = new Geom_SphericalSurface(theSphere);
|
||||||
// Pour les spheres on ne peut pas controler le parametre
|
// Pour les spheres on ne peut pas controler le parametre
|
||||||
|
@ -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."
|
|
||||||
}
|
|
36
tests/bugs/modalg_6/bug28661_1
Normal file
36
tests/bugs/modalg_6/bug28661_1
Normal 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
|
39
tests/bugs/modalg_6/bug28661_2
Normal file
39
tests/bugs/modalg_6/bug28661_2
Normal 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"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user