1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0023822: SIGSEGV 'segmentation violation' during writing IGES

checking for infinity coordinates was added.
Adding test case for this fix
Shape name correction
This commit is contained in:
ika
2013-03-15 12:25:31 +04:00
parent a1cd0db66f
commit 6db6171400
2 changed files with 24 additions and 8 deletions

View File

@@ -170,14 +170,16 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape)
//#34 22.10.98 rln BUC60081
Bnd_Box box;
BRepBndLib::Add (Shape, box);
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
box.Get (aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
gs.MaxMaxCoords (gp_XYZ (aXmax / gs.UnitValue(),
aYmax / gs.UnitValue(),
aZmax / gs.UnitValue()));
gs.MaxMaxCoords (gp_XYZ (aXmin / gs.UnitValue(),
aYmin / gs.UnitValue(),
aZmin / gs.UnitValue()));
if (!(box.IsVoid() || box.IsOpenXmax() || box.IsOpenYmax() || box.IsOpenZmax() || box.IsOpenXmin() || box.IsOpenYmin() || box.IsOpenZmin())){
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
box.Get (aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
gs.MaxMaxCoords (gp_XYZ (aXmax / gs.UnitValue(),
aYmax / gs.UnitValue(),
aZmax / gs.UnitValue()));
gs.MaxMaxCoords (gp_XYZ (aXmin / gs.UnitValue(),
aYmin / gs.UnitValue(),
aZmin / gs.UnitValue()));
}
themod->SetGlobalSection(gs);