// File: BRepTest_ShellCommands.cxx // Created: Mon Dec 21 10:19:27 1998 // Author: Michael KAZAKOV // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static Standard_Boolean issame(TopoDS_Face& face, TopoDS_Face& newface) { TopExp_Explorer exp(face,TopAbs_VERTEX),newexp(newface,TopAbs_VERTEX); Standard_Integer newcounter=0,counter=0; for (;exp.More();exp.Next()) { counter++; gp_Pnt p(BRep_Tool::Pnt(TopoDS::Vertex(exp.Current()))); for (;newexp.More();newexp.Next()) { gp_Pnt newp(BRep_Tool::Pnt(TopoDS::Vertex(newexp.Current()))); if (p.IsEqual(newp,1e-7)) { newcounter++; break; }; }; }; if (counter==newcounter) return Standard_True; return Standard_False; } static TopoDS_Face findface(TopoDS_Shape& shape, TopoDS_Face& face) { TopoDS_Face newface; TopExp_Explorer exp(shape,TopAbs_FACE); for (;exp.More();exp.Next()) { newface = TopoDS::Face(exp.Current()); if (issame(face,newface)) { break; }; }; return newface; } static Standard_Integer shell(Draw_Interpretor& di, Standard_Integer n, const char** a) { TopoDS_Shape Shape = DBRep::Get(a[1]); TopTools_ListOfShape ListOfCorks; //cout <<"You have "< 0 = Interior. BRepOffsetAPI_MakeThickSolid MKTS (Shape, ListOfCorks, OffsetValue, Tol, BRepOffset_Skin, 1, Standard_False); DBRep::Set("Result.brep",MKTS.Shape()); TopTools_ListOfShape Larg; Larg.Append(Shape); //Check if the shape has at least one face TopExp_Explorer FExp (MKTS.Shape (), TopAbs_FACE); if (FExp.More ()) { //cout << "Standard_True"<