+ // copy source shape
+ BRepBuilderAPI_Copy aCopy( aShape, Standard_False );
+ TopoDS_Shape aCopyShape = aCopy.Shape();
+ // ASCII mode
+ aWriter.ASCIIMode() = anIsASCII;
+#if OCC_VERSION_LARGE > 0x06080000
+ if ( anIsRelative ) {
+ Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+ Bnd_Box bndBox;
+ BRepBndLib::Add( aShape, bndBox );
+ bndBox.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax );
+ aDeflection = MAX3( aXmax-aXmin, aYmax-aYmin, aZmax-aZmin ) * aDeflection;
+ }
+ //Compute triangulation
+ BRepTools::Clean( aCopyShape );
+ BRepMesh_IncrementalMesh aMesh( aCopyShape, aDeflection );
+#else