diff --git a/src/RWStl/RWStl_Reader.cxx b/src/RWStl/RWStl_Reader.cxx index cb49a570f0..19e22a3cff 100644 --- a/src/RWStl/RWStl_Reader.cxx +++ b/src/RWStl/RWStl_Reader.cxx @@ -416,7 +416,7 @@ Standard_Boolean RWStl_Reader::ReadBinary (Standard_IStream& theStream, const std::streamsize aDataToRead = aNbFacesInBuffer * aFaceDataLen; if (theStream.read (aBuffer, aDataToRead).gcount() != aDataToRead) { - Message::DefaultMessenger()->Send ("Error: read filed", Message_Fail); + Message::DefaultMessenger()->Send ("Error: binary STL read failed", Message_Fail); return false; } aBufferPtr = aBuffer; diff --git a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx index fe80118545..c42e9314c8 100644 --- a/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx +++ b/src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx @@ -105,36 +105,61 @@ static Standard_Integer readstl(Draw_Interpretor& theDI, Standard_Integer theArgc, const char** theArgv) { - if (theArgc < 3) + TCollection_AsciiString aShapeName, aFilePath; + bool toCreateCompOfTris = false; + for (Standard_Integer anArgIter = 1; anArgIter < theArgc; ++anArgIter) { - theDI << "wrong number of parameters" << "\n"; - return 1; - } - else - { - if (theArgc == 4 && - strcmp("triangulation", theArgv[3]) == 0) + TCollection_AsciiString anArg (theArgv[anArgIter]); + anArg.LowerCase(); + if (aShapeName.IsEmpty()) { - // Read STL file to the triangulation. - Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (theDI, 1); - Handle(Poly_Triangulation) aTriangulation = RWStl::ReadFile (theArgv[2], aProgress); - - TopoDS_Face aFace; - BRep_Builder aB; - aB.MakeFace(aFace); - aB.UpdateFace(aFace, aTriangulation); - DBRep::Set(theArgv[1], aFace); + aShapeName = theArgv[anArgIter]; + } + else if (aFilePath.IsEmpty()) + { + aFilePath = theArgv[anArgIter]; + } + else if (anArg == "-brep") + { + toCreateCompOfTris = true; + if (anArgIter + 1 < theArgc + && ViewerTest::ParseOnOff (theArgv[anArgIter + 1], toCreateCompOfTris)) + { + ++anArgIter; + } } else { - TopoDS_Shape aShape; - Standard_DISABLE_DEPRECATION_WARNINGS - StlAPI::Read(aShape, theArgv[2]); - Standard_ENABLE_DEPRECATION_WARNINGS - DBRep::Set(theArgv[1], aShape); + std::cout << "Syntax error: unknown argument '" << theArgv[anArgIter] << "'\n"; + return 1; } } + if (aFilePath.IsEmpty()) + { + std::cout << "Syntax error: not enough arguments\n"; + return 1; + } + TopoDS_Shape aShape; + if (!toCreateCompOfTris) + { + // Read STL file to the triangulation. + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (theDI, 1); + Handle(Poly_Triangulation) aTriangulation = RWStl::ReadFile (aFilePath.ToCString(), aProgress); + + TopoDS_Face aFace; + BRep_Builder aB; + aB.MakeFace (aFace); + aB.UpdateFace (aFace, aTriangulation); + aShape = aFace; + } + else + { + Standard_DISABLE_DEPRECATION_WARNINGS + StlAPI::Read(aShape, aFilePath.ToCString()); + Standard_ENABLE_DEPRECATION_WARNINGS + } + DBRep::Set (aShapeName.ToCString(), aShape); return 0; } @@ -1233,7 +1258,12 @@ void XSDRAWSTLVRML::InitCommands (Draw_Interpretor& theCommands) theCommands.Add ("writevrml", "shape file [version VRML#1.0/VRML#2.0 (1/2): 2 by default] [representation shaded/wireframe/both (0/1/2): 1 by default]",__FILE__,writevrml,g); theCommands.Add ("writestl", "shape file [ascii/binary (0/1) : 1 by default] [InParallel (0/1) : 0 by default]",__FILE__,writestl,g); - theCommands.Add ("readstl", "shape file [triangulation: no by default]",__FILE__,readstl,g); + theCommands.Add ("readstl", + "readstl shape file [-brep]" + "\n\t\t: Reads STL file and creates a new shape with specified name." + "\n\t\t: When -brep is specified, creates a Compound of per-triangle Faces." + "\n\t\t: Single triangulation-only Face is created otherwise (default).", + __FILE__, readstl, g); theCommands.Add ("loadvrml" , "shape file",__FILE__,loadvrml,g); theCommands.Add ("meshfromstl", "creates MeshVS_Mesh from STL file", __FILE__, createmesh, g ); diff --git a/tests/bugs/fclasses/bug23192_1 b/tests/bugs/fclasses/bug23192_1 index caf6ad76cd..56a7b162a5 100755 --- a/tests/bugs/fclasses/bug23192_1 +++ b/tests/bugs/fclasses/bug23192_1 @@ -22,7 +22,7 @@ writestl res ${aFile} ${anASCIImode} catch {exec chmod 777 ${aFile}} if { [file exists ${aFile}] } { - readstl result ${aFile} + readstl result ${aFile} -brep checknbshapes result -vertex 8 -edge 18 -wire 12 -face 12 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 51 # Check file size diff --git a/tests/bugs/fclasses/bug23192_2 b/tests/bugs/fclasses/bug23192_2 index 73fbd35448..3081072bd2 100755 --- a/tests/bugs/fclasses/bug23192_2 +++ b/tests/bugs/fclasses/bug23192_2 @@ -22,7 +22,7 @@ writestl res ${aFile} ${anASCIImode} catch {exec chmod 777 ${aFile}} if { [file exists ${aFile}] } { - readstl result ${aFile} + readstl result ${aFile} -brep checknbshapes result -vertex 8 -edge 18 -wire 12 -face 12 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 51 # Check file size diff --git a/tests/bugs/modalg_7/bug29524 b/tests/bugs/modalg_7/bug29524 index 49e5b390d9..058c5f3d55 100644 --- a/tests/bugs/modalg_7/bug29524 +++ b/tests/bugs/modalg_7/bug29524 @@ -4,7 +4,7 @@ puts "========" puts "" pload VISUALIZATION XDE MODELING -readstl m [locate_data_file model_stl_045.stl] triangulation +readstl m [locate_data_file model_stl_045.stl] vclear vinit View1 vdisplay -dispMode 1 m diff --git a/tests/bugs/stlvrml/bug26338 b/tests/bugs/stlvrml/bug26338 index 4281732454..2a1a0f1a4c 100644 --- a/tests/bugs/stlvrml/bug26338 +++ b/tests/bugs/stlvrml/bug26338 @@ -16,7 +16,7 @@ incmesh comp 1. writestl comp $imagedir/${casename}.stl 1 # load STL -readstl result $imagedir/${casename}.stl +readstl result $imagedir/${casename}.stl -brep # check that bounding box is bounding -s result -save Xmin Ymin Zmin Xmax Ymax Zmax -nodraw diff --git a/tests/bugs/stlvrml/bug27622 b/tests/bugs/stlvrml/bug27622 index f6df1c9ef0..a19f4d2fc8 100644 --- a/tests/bugs/stlvrml/bug27622 +++ b/tests/bugs/stlvrml/bug27622 @@ -6,7 +6,7 @@ puts "" # Data Exchange - STL file having less than 4 triangles cannot be read ######################################################################## -readstl result [locate_data_file bug27622_Design1.stl] +readstl result [locate_data_file bug27622_Design1.stl] -brep set nbshapes_expected " Number of shapes in result diff --git a/tests/bugs/stlvrml/bug28680 b/tests/bugs/stlvrml/bug28680 index 03d360b01e..f71256f6ae 100644 --- a/tests/bugs/stlvrml/bug28680 +++ b/tests/bugs/stlvrml/bug28680 @@ -1,4 +1,4 @@ -readstl m [locate_data_file bug28680_sample01b.stl] triangulation +readstl m [locate_data_file bug28680_sample01b.stl] # Number of triangles check checktrinfo m -tri 62075 -nod 31879 diff --git a/tests/bugs/xde/bug22670_1 b/tests/bugs/xde/bug22670_1 index 59705c766c..1718c22cac 100755 --- a/tests/bugs/xde/bug22670_1 +++ b/tests/bugs/xde/bug22670_1 @@ -8,7 +8,7 @@ puts "" set BugNumber OCC22670 -readstl res_mesh [locate_data_file OMF6391_box.stl] +readstl res_mesh [locate_data_file OMF6391_box.stl] -brep set aFile ${imagedir}/OCC22670.stl file delete ${aFile} @@ -19,7 +19,7 @@ set anASCIImode 0 writestl res_mesh ${aFile} ${anASCIImode} catch {exec chmod 777 ${aFile}} -readstl result ${aFile} +readstl result ${aFile} -brep checknbshapes result -vertex 8 -edge 18 -wire 12 -face 12 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 51 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/xde/bug22670_2 b/tests/bugs/xde/bug22670_2 index dbee0d88d5..d9d4938f01 100755 --- a/tests/bugs/xde/bug22670_2 +++ b/tests/bugs/xde/bug22670_2 @@ -18,7 +18,7 @@ puts "" set BugNumber OCC22670 set filepath [locate_data_file OMF6391_box.stl] -if { [catch { readstl res_mesh $filepath } catch_result] } { +if { [catch { readstl res_mesh $filepath -brep } catch_result] } { puts "Faulty ${BugNumber}: here is reading problem" } else { set aFile $imagedir/${test_image}.stl @@ -30,7 +30,7 @@ if { [catch { readstl res_mesh $filepath } catch_result] } { writestl res_mesh ${aFile} ${anASCIImode} catch {exec chmod 777 ${aFile}} - readstl result ${aFile} + readstl result ${aFile} -brep checknbshapes result -vertex 8 -edge 18 -wire 12 -face 12 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 51 } diff --git a/tests/bugs/xde/bug22898 b/tests/bugs/xde/bug22898 index e6bbf4ff08..eb57743479 100644 --- a/tests/bugs/xde/bug22898 +++ b/tests/bugs/xde/bug22898 @@ -43,7 +43,7 @@ checkarea step_1 3.978e8 1e6 0.001 # STL incmesh hammer 38.9076 writestl hammer $imagedir/hammer.stl -readstl stl $imagedir/hammer.stl +readstl stl $imagedir/hammer.stl -brep checkshape stl tolerance stl checkarea stl 3.978e8 1e6 0.001 diff --git a/tests/bugs/xde/bug6384 b/tests/bugs/xde/bug6384 index aa5bc90c7d..17c5e0ac3f 100755 --- a/tests/bugs/xde/bug6384 +++ b/tests/bugs/xde/bug6384 @@ -6,10 +6,8 @@ puts "" # StlAPI_Reader still use old Sewing algorithm ####################################################################################### -## readstl command from XSDRAWSTLVRML.cxx file !!!!! - set BugNumber OCC6384 -readstl res_mesh [locate_data_file OMF6391_box.stl] +readstl res_mesh [locate_data_file OMF6391_box.stl] -brep diff --git a/tests/de_mesh/shape_write_stl/A1 b/tests/de_mesh/shape_write_stl/A1 index 56c8d9f56a..02b9698cd0 100644 --- a/tests/de_mesh/shape_write_stl/A1 +++ b/tests/de_mesh/shape_write_stl/A1 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 22748 -nod 11376 diff --git a/tests/de_mesh/shape_write_stl/A10 b/tests/de_mesh/shape_write_stl/A10 index 49e1f03405..7742f52721 100644 --- a/tests/de_mesh/shape_write_stl/A10 +++ b/tests/de_mesh/shape_write_stl/A10 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 130 -nod 67 diff --git a/tests/de_mesh/shape_write_stl/A11 b/tests/de_mesh/shape_write_stl/A11 index 8e341640bb..129b48d780 100644 --- a/tests/de_mesh/shape_write_stl/A11 +++ b/tests/de_mesh/shape_write_stl/A11 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 150 -nod 77 diff --git a/tests/de_mesh/shape_write_stl/A12 b/tests/de_mesh/shape_write_stl/A12 index 8c5a21fb6e..e85d6a7dbf 100644 --- a/tests/de_mesh/shape_write_stl/A12 +++ b/tests/de_mesh/shape_write_stl/A12 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 4396 -nod 2200 diff --git a/tests/de_mesh/shape_write_stl/A2 b/tests/de_mesh/shape_write_stl/A2 index 98ba1d9ff0..efd25eb107 100644 --- a/tests/de_mesh/shape_write_stl/A2 +++ b/tests/de_mesh/shape_write_stl/A2 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 290 -nod 147 diff --git a/tests/de_mesh/shape_write_stl/A3 b/tests/de_mesh/shape_write_stl/A3 index fb4900b931..37d90b40c5 100644 --- a/tests/de_mesh/shape_write_stl/A3 +++ b/tests/de_mesh/shape_write_stl/A3 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 200 -nod 102 diff --git a/tests/de_mesh/shape_write_stl/A4 b/tests/de_mesh/shape_write_stl/A4 index c8494c0920..ad125c7aa8 100644 --- a/tests/de_mesh/shape_write_stl/A4 +++ b/tests/de_mesh/shape_write_stl/A4 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 146 -nod 75 diff --git a/tests/de_mesh/shape_write_stl/A5 b/tests/de_mesh/shape_write_stl/A5 index 83367a17cf..26b708e409 100644 --- a/tests/de_mesh/shape_write_stl/A5 +++ b/tests/de_mesh/shape_write_stl/A5 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 13102 -nod 6553 diff --git a/tests/de_mesh/shape_write_stl/A6 b/tests/de_mesh/shape_write_stl/A6 index 83d7eceed7..f8d423f902 100644 --- a/tests/de_mesh/shape_write_stl/A6 +++ b/tests/de_mesh/shape_write_stl/A6 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 2398 -nod 1201 diff --git a/tests/de_mesh/shape_write_stl/A7 b/tests/de_mesh/shape_write_stl/A7 index ec1cedd84c..72d9e6a644 100644 --- a/tests/de_mesh/shape_write_stl/A7 +++ b/tests/de_mesh/shape_write_stl/A7 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 40 -nod 22 diff --git a/tests/de_mesh/shape_write_stl/A8 b/tests/de_mesh/shape_write_stl/A8 index 0546cf0d52..0511e3450e 100644 --- a/tests/de_mesh/shape_write_stl/A8 +++ b/tests/de_mesh/shape_write_stl/A8 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 58 -nod 31 diff --git a/tests/de_mesh/shape_write_stl/A9 b/tests/de_mesh/shape_write_stl/A9 index 9284f43a31..5acc70b927 100644 --- a/tests/de_mesh/shape_write_stl/A9 +++ b/tests/de_mesh/shape_write_stl/A9 @@ -6,7 +6,7 @@ incmesh m 1.0 # Save, read and delete file writestl m $imagedir/${casename} -readstl res $imagedir/${casename} triangulation +readstl res $imagedir/${casename} file delete $imagedir/${casename} checktrinfo res -tri 56 -nod 30 diff --git a/tests/de_mesh/stl_read/A1 b/tests/de_mesh/stl_read/A1 index 05b7c6b05c..7f5980fa02 100644 --- a/tests/de_mesh/stl_read/A1 +++ b/tests/de_mesh/stl_read/A1 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_001.stl] triangulation +readstl m [locate_data_file model_stl_001.stl] # Number of triangles check checktrinfo m -tri 3609 -nod 1807 diff --git a/tests/de_mesh/stl_read/A10 b/tests/de_mesh/stl_read/A10 index e92d07b1bd..b1eccdbc2c 100644 --- a/tests/de_mesh/stl_read/A10 +++ b/tests/de_mesh/stl_read/A10 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_010.stl] triangulation +readstl m [locate_data_file model_stl_010.stl] # Number of triangles check checktrinfo m -tri 26582 -nod 13346 diff --git a/tests/de_mesh/stl_read/A11 b/tests/de_mesh/stl_read/A11 index f653e3240a..c02e3c3922 100644 --- a/tests/de_mesh/stl_read/A11 +++ b/tests/de_mesh/stl_read/A11 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_011.stl] triangulation +readstl m [locate_data_file model_stl_011.stl] # Number of triangles check checktrinfo m -tri 9170 -nod 4595 diff --git a/tests/de_mesh/stl_read/A12 b/tests/de_mesh/stl_read/A12 index c6698965e7..09d8b2bc50 100644 --- a/tests/de_mesh/stl_read/A12 +++ b/tests/de_mesh/stl_read/A12 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_012.stl] triangulation +readstl m [locate_data_file model_stl_012.stl] # Number of triangles check checktrinfo m -tri 10059 -nod 5036 diff --git a/tests/de_mesh/stl_read/A13 b/tests/de_mesh/stl_read/A13 index b2fe449270..b020f8bd50 100644 --- a/tests/de_mesh/stl_read/A13 +++ b/tests/de_mesh/stl_read/A13 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_013.stl] triangulation +readstl m [locate_data_file model_stl_013.stl] # Number of triangles check checktrinfo m -tri 8773 -nod 4406 diff --git a/tests/de_mesh/stl_read/A14 b/tests/de_mesh/stl_read/A14 index 563490b35d..c98aed11ed 100644 --- a/tests/de_mesh/stl_read/A14 +++ b/tests/de_mesh/stl_read/A14 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_014.stl] triangulation +readstl m [locate_data_file model_stl_014.stl] # Number of triangles check checktrinfo m -tri 18462 -nod 9272 diff --git a/tests/de_mesh/stl_read/A15 b/tests/de_mesh/stl_read/A15 index 7e4b2269b6..7b0e95bac1 100644 --- a/tests/de_mesh/stl_read/A15 +++ b/tests/de_mesh/stl_read/A15 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_015.stl] triangulation +readstl m [locate_data_file model_stl_015.stl] # Number of triangles check checktrinfo m -tri 7662 -nod 3836 diff --git a/tests/de_mesh/stl_read/A2 b/tests/de_mesh/stl_read/A2 index 45540707e9..d7b3bb6b68 100644 --- a/tests/de_mesh/stl_read/A2 +++ b/tests/de_mesh/stl_read/A2 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_002.stl] triangulation +readstl m [locate_data_file model_stl_002.stl] # Number of triangles check checktrinfo m -tri 19034 -nod 9535 diff --git a/tests/de_mesh/stl_read/A3 b/tests/de_mesh/stl_read/A3 index 27b3c5f4cb..a07092bce7 100644 --- a/tests/de_mesh/stl_read/A3 +++ b/tests/de_mesh/stl_read/A3 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_003.stl] triangulation +readstl m [locate_data_file model_stl_003.stl] # Number of triangles check checktrinfo m -tri 3236 -nod 1620 diff --git a/tests/de_mesh/stl_read/A4 b/tests/de_mesh/stl_read/A4 index 50a38c28ba..5f6a3d2637 100644 --- a/tests/de_mesh/stl_read/A4 +++ b/tests/de_mesh/stl_read/A4 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_004.stl] triangulation +readstl m [locate_data_file model_stl_004.stl] # Number of triangles check checktrinfo m -tri 15479 -nod 7793 diff --git a/tests/de_mesh/stl_read/A5 b/tests/de_mesh/stl_read/A5 index 5afc02d98a..b2c51d7bcb 100644 --- a/tests/de_mesh/stl_read/A5 +++ b/tests/de_mesh/stl_read/A5 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_005.stl] triangulation +readstl m [locate_data_file model_stl_005.stl] # Number of triangles check checktrinfo m -tri 10526 -nod 5265 diff --git a/tests/de_mesh/stl_read/A6 b/tests/de_mesh/stl_read/A6 index 0e48971355..bd4d9c9d5a 100644 --- a/tests/de_mesh/stl_read/A6 +++ b/tests/de_mesh/stl_read/A6 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_006.stl] triangulation +readstl m [locate_data_file model_stl_006.stl] # Number of triangles check checktrinfo m -tri 14447 -nod 7264 diff --git a/tests/de_mesh/stl_read/A7 b/tests/de_mesh/stl_read/A7 index f12fbcea30..ab6db8e7e0 100644 --- a/tests/de_mesh/stl_read/A7 +++ b/tests/de_mesh/stl_read/A7 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_007.stl] triangulation +readstl m [locate_data_file model_stl_007.stl] # Number of triangles check checktrinfo m -tri 4199 -nod 2109 diff --git a/tests/de_mesh/stl_read/A8 b/tests/de_mesh/stl_read/A8 index 90f24f77ad..302242e5a8 100644 --- a/tests/de_mesh/stl_read/A8 +++ b/tests/de_mesh/stl_read/A8 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_008.stl] triangulation +readstl m [locate_data_file model_stl_008.stl] # Number of triangles check checktrinfo m -tri 22149 -nod 11118 diff --git a/tests/de_mesh/stl_read/A9 b/tests/de_mesh/stl_read/A9 index 29414dae38..8bc8b2930c 100644 --- a/tests/de_mesh/stl_read/A9 +++ b/tests/de_mesh/stl_read/A9 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_009.stl] triangulation +readstl m [locate_data_file model_stl_009.stl] # Number of triangles check checktrinfo m -tri 5678 -nod 2841 diff --git a/tests/de_mesh/stl_read/B1 b/tests/de_mesh/stl_read/B1 index 7471f26f26..35debdfa83 100644 --- a/tests/de_mesh/stl_read/B1 +++ b/tests/de_mesh/stl_read/B1 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_016.stl] triangulation +readstl m [locate_data_file model_stl_016.stl] # Number of triangles check checktrinfo m -tri 68 -nod 36 diff --git a/tests/de_mesh/stl_read/B10 b/tests/de_mesh/stl_read/B10 index dc37f45b48..b8bf452961 100644 --- a/tests/de_mesh/stl_read/B10 +++ b/tests/de_mesh/stl_read/B10 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_025.stl] triangulation +readstl m [locate_data_file model_stl_025.stl] # Number of triangles check checktrinfo m -tri 54364 -nod 24452 diff --git a/tests/de_mesh/stl_read/B11 b/tests/de_mesh/stl_read/B11 index 8d13a7e40b..71a2ff477e 100644 --- a/tests/de_mesh/stl_read/B11 +++ b/tests/de_mesh/stl_read/B11 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_026.stl] triangulation +readstl m [locate_data_file model_stl_026.stl] # Number of triangles check checktrinfo m -tri 41113 -nod 18457 diff --git a/tests/de_mesh/stl_read/B12 b/tests/de_mesh/stl_read/B12 index d964b25e0e..c74e25108b 100644 --- a/tests/de_mesh/stl_read/B12 +++ b/tests/de_mesh/stl_read/B12 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_027.stl] triangulation +readstl m [locate_data_file model_stl_027.stl] # Number of triangles check checktrinfo m -tri 7440 -nod 3720 diff --git a/tests/de_mesh/stl_read/B13 b/tests/de_mesh/stl_read/B13 index 55170fcfbf..32db62ffc2 100644 --- a/tests/de_mesh/stl_read/B13 +++ b/tests/de_mesh/stl_read/B13 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_028.stl] triangulation +readstl m [locate_data_file model_stl_028.stl] # Number of triangles check checktrinfo m -tri 10956 -nod 5238 diff --git a/tests/de_mesh/stl_read/B14 b/tests/de_mesh/stl_read/B14 index 9ec0c22023..f4f08fd3b4 100644 --- a/tests/de_mesh/stl_read/B14 +++ b/tests/de_mesh/stl_read/B14 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_029.stl] triangulation +readstl m [locate_data_file model_stl_029.stl] # Number of triangles check checktrinfo m -tri 33313 -nod 15442 diff --git a/tests/de_mesh/stl_read/B15 b/tests/de_mesh/stl_read/B15 index f50053bccc..1d0eacfb63 100644 --- a/tests/de_mesh/stl_read/B15 +++ b/tests/de_mesh/stl_read/B15 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_030.stl] triangulation +readstl m [locate_data_file model_stl_030.stl] # Number of triangles check checktrinfo m -tri 38380 -nod 19158 diff --git a/tests/de_mesh/stl_read/B2 b/tests/de_mesh/stl_read/B2 index 29aee4924f..d4c2d4fedf 100644 --- a/tests/de_mesh/stl_read/B2 +++ b/tests/de_mesh/stl_read/B2 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_017.stl] triangulation +readstl m [locate_data_file model_stl_017.stl] # Number of triangles check checktrinfo m -tri 1 -nod 3 diff --git a/tests/de_mesh/stl_read/B3 b/tests/de_mesh/stl_read/B3 index 7e9a96860f..dea130753f 100644 --- a/tests/de_mesh/stl_read/B3 +++ b/tests/de_mesh/stl_read/B3 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_018.stl] triangulation +readstl m [locate_data_file model_stl_018.stl] # Number of triangles check checktrinfo m -tri 2 -nod 5 diff --git a/tests/de_mesh/stl_read/B4 b/tests/de_mesh/stl_read/B4 index aafd93362e..3cedd16014 100644 --- a/tests/de_mesh/stl_read/B4 +++ b/tests/de_mesh/stl_read/B4 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_019.stl] triangulation +readstl m [locate_data_file model_stl_019.stl] # Number of triangles check checktrinfo m -tri 509952 -nod 254992 diff --git a/tests/de_mesh/stl_read/B5 b/tests/de_mesh/stl_read/B5 index b331d217c9..37030b03bf 100644 --- a/tests/de_mesh/stl_read/B5 +++ b/tests/de_mesh/stl_read/B5 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_020.stl] triangulation +readstl m [locate_data_file model_stl_020.stl] # Number of triangles check checktrinfo m -tri 26840 -nod 13432 diff --git a/tests/de_mesh/stl_read/B6 b/tests/de_mesh/stl_read/B6 index cfe3e9eae2..040e6a862c 100644 --- a/tests/de_mesh/stl_read/B6 +++ b/tests/de_mesh/stl_read/B6 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_021.stl] triangulation +readstl m [locate_data_file model_stl_021.stl] # Number of triangles check checktrinfo m -tri 63268 -nod 31445 diff --git a/tests/de_mesh/stl_read/B7 b/tests/de_mesh/stl_read/B7 index 1e90521217..128bff4f70 100644 --- a/tests/de_mesh/stl_read/B7 +++ b/tests/de_mesh/stl_read/B7 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_022.stl] triangulation +readstl m [locate_data_file model_stl_022.stl] # Number of triangles check checktrinfo m -tri 4388 -nod 2194 diff --git a/tests/de_mesh/stl_read/B8 b/tests/de_mesh/stl_read/B8 index 60a64f356a..e03dd63194 100644 --- a/tests/de_mesh/stl_read/B8 +++ b/tests/de_mesh/stl_read/B8 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_023.stl] triangulation +readstl m [locate_data_file model_stl_023.stl] # Number of triangles check checktrinfo m -tri 288 -nod 144 diff --git a/tests/de_mesh/stl_read/B9 b/tests/de_mesh/stl_read/B9 index 0d301f0df3..278ad3a82b 100644 --- a/tests/de_mesh/stl_read/B9 +++ b/tests/de_mesh/stl_read/B9 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_024.stl] triangulation +readstl m [locate_data_file model_stl_024.stl] # Number of triangles check checktrinfo m -tri 116 -nod 60 diff --git a/tests/de_mesh/stl_read/C1 b/tests/de_mesh/stl_read/C1 index 724a954b36..59402d9716 100644 --- a/tests/de_mesh/stl_read/C1 +++ b/tests/de_mesh/stl_read/C1 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_031.stl] triangulation +readstl m [locate_data_file model_stl_031.stl] # Number of triangles check checktrinfo m -tri 29606 -nod 14817 diff --git a/tests/de_mesh/stl_read/C10 b/tests/de_mesh/stl_read/C10 index b19ade9c37..ed77395e6f 100644 --- a/tests/de_mesh/stl_read/C10 +++ b/tests/de_mesh/stl_read/C10 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_040.stl] triangulation +readstl m [locate_data_file model_stl_040.stl] # Number of triangles check checktrinfo m -tri 5720 -nod 2864 diff --git a/tests/de_mesh/stl_read/C11 b/tests/de_mesh/stl_read/C11 index d1015545e9..f8f8f7ced0 100644 --- a/tests/de_mesh/stl_read/C11 +++ b/tests/de_mesh/stl_read/C11 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_041.stl] triangulation +readstl m [locate_data_file model_stl_041.stl] # Number of triangles check checktrinfo m -tri 6082 -nod 3052 diff --git a/tests/de_mesh/stl_read/C12 b/tests/de_mesh/stl_read/C12 index 33a35065c1..4551264e8a 100644 --- a/tests/de_mesh/stl_read/C12 +++ b/tests/de_mesh/stl_read/C12 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_042.stl] triangulation +readstl m [locate_data_file model_stl_042.stl] # Number of triangles check checktrinfo m -tri 10131 -nod 5068 diff --git a/tests/de_mesh/stl_read/C13 b/tests/de_mesh/stl_read/C13 index fbaa132ee9..2bf0ce3cb3 100644 --- a/tests/de_mesh/stl_read/C13 +++ b/tests/de_mesh/stl_read/C13 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_043.stl] triangulation +readstl m [locate_data_file model_stl_043.stl] # Number of triangles check checktrinfo m -tri 17780 -nod 8954 diff --git a/tests/de_mesh/stl_read/C14 b/tests/de_mesh/stl_read/C14 index 3b2304effd..e7dc7621cb 100644 --- a/tests/de_mesh/stl_read/C14 +++ b/tests/de_mesh/stl_read/C14 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_044.stl] triangulation +readstl m [locate_data_file model_stl_044.stl] # Number of triangles check checktrinfo m -tri 5998 -nod 3002 diff --git a/tests/de_mesh/stl_read/C15 b/tests/de_mesh/stl_read/C15 index 380b0c7c65..3c6fce881a 100644 --- a/tests/de_mesh/stl_read/C15 +++ b/tests/de_mesh/stl_read/C15 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_045.stl] triangulation +readstl m [locate_data_file model_stl_045.stl] # Number of triangles check checktrinfo m -tri 19011 -nod 9598 diff --git a/tests/de_mesh/stl_read/C2 b/tests/de_mesh/stl_read/C2 index 92e960fe73..58459f5402 100644 --- a/tests/de_mesh/stl_read/C2 +++ b/tests/de_mesh/stl_read/C2 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_032.stl] triangulation +readstl m [locate_data_file model_stl_032.stl] # Number of triangles check checktrinfo m -tri 4340 -nod 2172 diff --git a/tests/de_mesh/stl_read/C3 b/tests/de_mesh/stl_read/C3 index 91c2b3a3d6..65cee8a70f 100644 --- a/tests/de_mesh/stl_read/C3 +++ b/tests/de_mesh/stl_read/C3 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_033.stl] triangulation +readstl m [locate_data_file model_stl_033.stl] # Number of triangles check checktrinfo m -tri 25560 -nod 12928 diff --git a/tests/de_mesh/stl_read/C4 b/tests/de_mesh/stl_read/C4 index 550104d056..2e2bf50ee6 100644 --- a/tests/de_mesh/stl_read/C4 +++ b/tests/de_mesh/stl_read/C4 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_034.stl] triangulation +readstl m [locate_data_file model_stl_034.stl] # Number of triangles check checktrinfo m -tri 10762 -nod 5387 diff --git a/tests/de_mesh/stl_read/C5 b/tests/de_mesh/stl_read/C5 index 0a8e5b5c65..e9b284dd85 100644 --- a/tests/de_mesh/stl_read/C5 +++ b/tests/de_mesh/stl_read/C5 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_035.stl] triangulation +readstl m [locate_data_file model_stl_035.stl] # Number of triangles check checktrinfo m -tri 21778 -nod 10963 diff --git a/tests/de_mesh/stl_read/C6 b/tests/de_mesh/stl_read/C6 index 6be3e8faeb..77c6534c9c 100644 --- a/tests/de_mesh/stl_read/C6 +++ b/tests/de_mesh/stl_read/C6 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_036.stl] triangulation +readstl m [locate_data_file model_stl_036.stl] # Number of triangles check checktrinfo m -tri 7806 -nod 3907 diff --git a/tests/de_mesh/stl_read/C7 b/tests/de_mesh/stl_read/C7 index 3ac2724399..f7d0b486e2 100644 --- a/tests/de_mesh/stl_read/C7 +++ b/tests/de_mesh/stl_read/C7 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_037.stl] triangulation +readstl m [locate_data_file model_stl_037.stl] # Number of triangles check checktrinfo m -tri 8286 -nod 4164 diff --git a/tests/de_mesh/stl_read/C8 b/tests/de_mesh/stl_read/C8 index dcf04b7131..87eb51ac9c 100644 --- a/tests/de_mesh/stl_read/C8 +++ b/tests/de_mesh/stl_read/C8 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_038.stl] triangulation +readstl m [locate_data_file model_stl_038.stl] # Number of triangles check checktrinfo m -tri 6811 -nod 3408 diff --git a/tests/de_mesh/stl_read/C9 b/tests/de_mesh/stl_read/C9 index 3d85f5109b..fc1729882c 100644 --- a/tests/de_mesh/stl_read/C9 +++ b/tests/de_mesh/stl_read/C9 @@ -1,4 +1,4 @@ -readstl m [locate_data_file model_stl_039.stl] triangulation +readstl m [locate_data_file model_stl_039.stl] # Number of triangles check checktrinfo m -tri 19651 -nod 9862 diff --git a/tests/de_mesh/stl_read/D1 b/tests/de_mesh/stl_read/D1 index 2161e54e2b..e712b80e01 100644 --- a/tests/de_mesh/stl_read/D1 +++ b/tests/de_mesh/stl_read/D1 @@ -19,7 +19,7 @@ set fd [open ${imagedir}/${casename}_one_ascii_dos.stl w] fconfigure $fd -translation crlf puts $fd $minimal_ascii_stl close $fd -readstl res_one_ascii_dos ${imagedir}/${casename}_one_ascii_dos.stl +readstl res_one_ascii_dos ${imagedir}/${casename}_one_ascii_dos.stl -brep checknbshapes res_one_ascii_dos -face 1 puts "\n#======================================================================" @@ -29,7 +29,7 @@ set fd [open ${imagedir}/${casename}_one_ascii_unix.stl w] fconfigure $fd -translation lf puts $fd $minimal_ascii_stl close $fd -readstl res_one_ascii_unix ${imagedir}/${casename}_one_ascii_unix.stl +readstl res_one_ascii_unix ${imagedir}/${casename}_one_ascii_unix.stl -brep checknbshapes res_one_ascii_unix -face 1 puts "\n#======================================================================" @@ -39,7 +39,7 @@ set fd [open ${imagedir}/${casename}_one_ascii_noeol.stl w] fconfigure $fd -translation lf puts -nonewline $fd $minimal_ascii_stl close $fd -readstl res_one_ascii_noeol ${imagedir}/${casename}_one_ascii_noeol.stl +readstl res_one_ascii_noeol ${imagedir}/${casename}_one_ascii_noeol.stl -brep checknbshapes res_one_ascii_noeol -face 1 puts "\n#======================================================================" @@ -49,7 +49,7 @@ set fd [open ${imagedir}/${casename}_zero_ascii_dos.stl w] fconfigure $fd -translation crlf puts $fd "solid \nendsolid" close $fd -readstl res_zero_ascii_dos ${imagedir}/${casename}_zero_ascii_dos.stl +readstl res_zero_ascii_dos ${imagedir}/${casename}_zero_ascii_dos.stl -brep puts "\n#======================================================================" puts "# Ascii file with no facets, LF" @@ -58,7 +58,7 @@ set fd [open ${imagedir}/${casename}_zero_ascii_unix.stl w] fconfigure $fd -translation lf puts $fd "solid \nendsolid" close $fd -readstl res_zero_ascii_unix ${imagedir}/${casename}_zero_ascii_unix.stl +readstl res_zero_ascii_unix ${imagedir}/${casename}_zero_ascii_unix.stl -brep puts "\n#======================================================================" puts "# Binary file with single facet" @@ -68,7 +68,7 @@ fconfigure $fd -translation binary puts -nonewline $fd "stl [string repeat { } 76]" puts -nonewline $fd [binary format if3f3f3f3t 1 {0 0 1} {0 0 0} {1 0 0} {0 1 0} 0] close $fd -readstl res_one_binary ${imagedir}/${casename}_one_binary.stl +readstl res_one_binary ${imagedir}/${casename}_one_binary.stl -brep checknbshapes res_one_binary -face 1 puts "\n#======================================================================" @@ -79,7 +79,7 @@ set fd [open ${imagedir}/${casename}_zero_binary.stl w] fconfigure $fd -translation binary puts -nonewline $fd "stl [string repeat { } 76][binary format i 0]" close $fd -readstl res_zero_binary ${imagedir}/${casename}_zero_binary.stl +readstl res_zero_binary ${imagedir}/${casename}_zero_binary.stl -brep puts "\n#======================================================================" puts "# Empty file" @@ -87,5 +87,5 @@ puts "#======================================================================" puts "REQUIRED ALL: Error: unexpected format of facet at line 2" set fd [open ${imagedir}/${casename}_empty.stl w] close $fd -readstl res_empty ${imagedir}/${casename}_empty.stl +readstl res_empty ${imagedir}/${casename}_empty.stl -brep