mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0025843: Wire containing degenerated edge is not written to IGES / STEP
add check for edges with null 2D and 3D curves for STEP, for IGES problem exists only with wires, where non-invalid edge is only one, and it is not the last in wire(fixed). Test case for issue CR25843
This commit is contained in:
parent
4dcc5ecb4f
commit
7f0b39bec9
@ -525,8 +525,8 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
||||
AddWarning(mywire, "an Edge is a null entity");
|
||||
}
|
||||
else {
|
||||
ent = TransferEdge(E, Standard_False);
|
||||
if (!ent.IsNull()) Seq->Append(ent);
|
||||
ent = TransferEdge(E, Standard_False);
|
||||
if (!ent.IsNull()) Seq->Append(ent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -537,7 +537,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferWire
|
||||
Standard_Integer nbedges = Seq->Length();
|
||||
Handle(IGESData_HArray1OfIGESEntity) Tab;
|
||||
if ( nbedges == 1 ) {
|
||||
res = ent;
|
||||
res = GetCasted(IGESData_IGESEntity, Seq->Value(1));
|
||||
}
|
||||
else if ( nbedges >= 2) {
|
||||
Tab = new IGESData_HArray1OfIGESEntity(1,nbedges);
|
||||
|
@ -54,6 +54,9 @@
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
|
||||
#include <StepGeom_CartesianPoint.hxx>
|
||||
#include <StepGeom_Curve.hxx>
|
||||
#include <StepGeom_SurfaceCurve.hxx>
|
||||
@ -178,8 +181,15 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
|
||||
//?? curveList->Append(Gpms);
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
BRepAdaptor_Curve CA ( anEdge );
|
||||
|
||||
BRepAdaptor_Curve CA;
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
CA.Initialize (anEdge);
|
||||
}
|
||||
catch (Standard_NullObject) {
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// Vertices
|
||||
TopoDS_Vertex Vfirst, Vlast;
|
||||
|
23
tests/bugs/iges/bug25843_iges
Executable file
23
tests/bugs/iges/bug25843_iges
Executable file
@ -0,0 +1,23 @@
|
||||
puts "============"
|
||||
puts "OCC25843"
|
||||
puts "============"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Wire containing degenerated edge is not written to IGES / STEP
|
||||
#######################################################################
|
||||
|
||||
restore [locate_data_file bug25843_onewire.brep] w
|
||||
|
||||
set aFile ${imagedir}/bug25843_onewire.igs
|
||||
|
||||
file delete ${aFile}
|
||||
|
||||
brepiges w ${aFile}
|
||||
|
||||
if { ![file exists ${aFile}] } {
|
||||
puts "Error: Wire containing degenerated edge is not written to IGES file"
|
||||
} else {
|
||||
puts "OK: Wire containing degenerated edge is written to IGES file"
|
||||
}
|
||||
|
||||
catch {exec chmod 777 ${aFile}}
|
23
tests/bugs/step/bug25843_step
Executable file
23
tests/bugs/step/bug25843_step
Executable file
@ -0,0 +1,23 @@
|
||||
puts "============"
|
||||
puts "OCC25843"
|
||||
puts "============"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Wire containing degenerated edge is not written to IGES / STEP
|
||||
#######################################################################
|
||||
|
||||
restore [locate_data_file bug25843_onewire.brep] w
|
||||
|
||||
set aFile ${imagedir}/bug25843_onewire.stp
|
||||
|
||||
catch { file delete ${aFile} }
|
||||
|
||||
stepwrite 0 w ${aFile}
|
||||
|
||||
if { ![file exists ${aFile}] } {
|
||||
puts "Error: Wire containing degenerated edge is not written to STEP file"
|
||||
} else {
|
||||
puts "OK: Wire containing degenerated edge is written to STEP file"
|
||||
}
|
||||
|
||||
catch {exec chmod 777 ${aFile}}
|
Loading…
x
Reference in New Issue
Block a user