// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Standard_Stream.hxx>
-
-#include <stdio.h>
-
-#include <MeshTest.ixx>
-#include <MeshTest_DrawableMesh.hxx>
-#include <TopAbs_ShapeEnum.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <DBRep.hxx>
-#include <BRepTest.hxx>
-#include <GeometryTest.hxx>
-#include <BRep_Tool.hxx>
+#include <AppCont_ContMatrices.hxx>
+#include <Bnd_Box.hxx>
#include <BRep_Builder.hxx>
-#include <Draw_MarkerShape.hxx>
-#include <Draw_Appli.hxx>
-#include <Draw.hxx>
-#include <DrawTrSurf.hxx>
-#include <BRepMesh_Triangle.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepBndLib.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_MakePolygon.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepLib.hxx>
#include <BRepMesh_DataStructureOfDelaun.hxx>
#include <BRepMesh_Delaun.hxx>
-#include <BRepMesh_FastDiscret.hxx>
-#include <BRepMesh_Vertex.hxx>
#include <BRepMesh_Edge.hxx>
+#include <BRepMesh_FastDiscret.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <Bnd_Box.hxx>
-#include <Precision.hxx>
+#include <BRepMesh_Triangle.hxx>
+#include <BRepMesh_Vertex.hxx>
+#include <BRepTest.hxx>
+#include <BRepTools.hxx>
+#include <CSLib.hxx>
+#include <CSLib_DerivativeStatus.hxx>
+#include <DBRep.hxx>
+#include <Draw.hxx>
+#include <Draw_Appli.hxx>
#include <Draw_Interpretor.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_Surface.hxx>
#include <Draw_Marker3D.hxx>
+#include <Draw_MarkerShape.hxx>
#include <Draw_Segment2D.hxx>
-
+#include <DrawTrSurf.hxx>
+#include <Extrema_LocateExtPC.hxx>
#include <GCPnts_UniformAbscissa.hxx>
-#include <GeomAdaptor_Curve.hxx>
#include <Geom_Curve.hxx>
-#include <Extrema_LocateExtPC.hxx>
-
-#include <TopLoc_Location.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_Surface.hxx>
+#include <GeomAdaptor_Curve.hxx>
+#include <GeometryTest.hxx>
+#include <gp_Pln.hxx>
#include <gp_Trsf.hxx>
-#include <Poly_Triangulation.hxx>
+#include <math.hxx>
+#include <math_Matrix.hxx>
+#include <math_Vector.hxx>
+#include <MeshTest.hxx>
+#include <MeshTest_DrawableMesh.hxx>
+#include <PLib.hxx>
#include <Poly_Connect.hxx>
+#include <Poly_PolygonOnTriangulation.hxx>
+#include <Poly_Triangulation.hxx>
+#include <Precision.hxx>
+#include <Standard_Stream.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
+#include <TCollection_AsciiString.hxx>
#include <TColStd_HArray1OfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TopAbs_ShapeEnum.hxx>
#include <TopExp_Explorer.hxx>
-#include <gp_Pln.hxx>
-
-#include <PLib.hxx>
-#include <AppCont_ContMatrices.hxx>
-#include <math_Vector.hxx>
-#include <math_Matrix.hxx>
-#include <math.hxx>
-
-#include <CSLib_DerivativeStatus.hxx>
-#include <CSLib.hxx>
-#include <BRepAdaptor_Surface.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-
-
-//epa Memory leaks test
-#include <BRepBuilderAPI_MakePolygon.hxx>
+#include <TopLoc_Location.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
-#include <BRepTools.hxx>
-
-//OAN: for triepoints
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <Poly_PolygonOnTriangulation.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
-#ifdef WNT
+#include <stdio.h>
+//epa Memory leaks test
+//OAN: for triepoints
+#ifdef _WIN32
Standard_IMPORT Draw_Viewer dout;
#endif
//function : incrementalmesh
//purpose :
//=======================================================================
-
static Standard_Integer incrementalmesh(Draw_Interpretor& di, Standard_Integer nbarg, const char** argv)
{
- if (nbarg < 3) {
- di << " use incmesh shape deflection [inParallel (0/1) : 0 by default]\n";
+ if (nbarg < 3)
+ {
+ di << "\
+Builds triangular mesh for the shape\n\
+usage: incmesh Shape LinearDeflection [options]\n\
+options:\n\
+ -a val angular deflection in deg\n\
+ (default ~28.64 deg = 0.5 rad)\n\n\
+ -min minimum size parameter limiting size of triangle's\n\
+ edges to prevent sinking into amplification in case\n\
+ of distorted curves and surfaces\n\n\
+ -relative notifies that relative deflection is used\n\
+ (switched off by default)\n\n\
+ -int_vert_off disables insertion of internal vertices into mesh\n\
+ (enabled by default)\n\
+ -surf_def_off disables control of deflection of mesh from real\n\
+ surface (enabled by default)\n\
+ -parallel enables parallel execution (switched off by default)\n\
+ -adaptive enables adaptive computation of minimal value in parametric space\n";
return 0;
}
TopoDS_Shape aShape = DBRep::Get(argv[1]);
- if (aShape.IsNull()) {
- di << " null shapes is not allowed here\n";
+ if (aShape.IsNull())
+ {
+ di << " Null shapes are not allowed here\n";
return 0;
}
- Standard_Real aDeflection = Draw::Atof(argv[2]);
- Standard_Boolean isInParallel = Standard_False;
- if (nbarg == 4) {
- isInParallel = Draw::Atoi(argv[3]) == 1;
+ Standard_Real aLinDeflection = Max(Draw::Atof(argv[2]), Precision::Confusion());
+ Standard_Real aAngDeflection = 0.5;
+ Standard_Real aMinSize = Precision::Confusion();
+ Standard_Boolean isRelative = Standard_False;
+ Standard_Boolean isInParallel = Standard_False;
+ Standard_Boolean isIntVertices = Standard_True;
+ Standard_Boolean isControlSurDef = Standard_True;
+ Standard_Boolean isAdaptiveMin = Standard_False;
+
+ if (nbarg > 3)
+ {
+ Standard_Integer i = 3;
+ while (i < nbarg)
+ {
+ TCollection_AsciiString aOpt(argv[i++]);
+ aOpt.LowerCase();
+
+ if (aOpt == "")
+ continue;
+ else if (aOpt == "-relative")
+ isRelative = Standard_True;
+ else if (aOpt == "-parallel")
+ isInParallel = Standard_True;
+ else if (aOpt == "-int_vert_off")
+ isIntVertices = Standard_False;
+ else if (aOpt == "-surf_def_off")
+ isControlSurDef = Standard_False;
+ else if (aOpt == "-adaptive")
+ isAdaptiveMin = Standard_True;
+ else if (i < nbarg)
+ {
+ Standard_Real aVal = Draw::Atof(argv[i++]);
+ if (aOpt == "-a")
+ aAngDeflection = aVal * M_PI / 180.;
+ else if (aOpt == "-min")
+ aMinSize = aVal;
+ else
+ --i;
+ }
+ }
}
+
di << "Incremental Mesh, multi-threading "
- << (isInParallel ? "ON\n" : "OFF\n");
+ << (isInParallel ? "ON" : "OFF") << "\n";
+
+ BRepMesh_FastDiscret::Parameters aMeshParams;
+ aMeshParams.Deflection = aLinDeflection;
+ aMeshParams.Angle = aAngDeflection;
+ aMeshParams.Relative = isRelative;
+ aMeshParams.InParallel = isInParallel;
+ aMeshParams.MinSize = aMinSize;
+ aMeshParams.InternalVerticesMode = isIntVertices;
+ aMeshParams.ControlSurfaceDeflection = isControlSurDef;
+ aMeshParams.AdaptiveMin = isAdaptiveMin;
- BRepMesh_IncrementalMesh MESH(aShape, aDeflection, Standard_False, 0.5, isInParallel);
- Standard_Integer statusFlags = MESH.GetStatusFlags();
+ BRepMesh_IncrementalMesh aMesher (aShape, aMeshParams);
di << "Meshing statuses: ";
-
+ Standard_Integer statusFlags = aMesher.GetStatusFlags();
if( !statusFlags )
{
di << "NoError";
return 0;
}
+//=======================================================================
+//function : tessellate
+//purpose :
+//=======================================================================
+static Standard_Integer tessellate (Draw_Interpretor& /*di*/, Standard_Integer nbarg, const char** argv)
+{
+ if (nbarg != 5)
+ {
+ std::cerr << "Builds regular triangulation with specified number of triangles\n"
+ " Usage: tessellate result {surface|face} nbu nbv\n"
+ " Triangulation is put into the face with natural bounds (result);\n"
+ " it will have 2*nbu*nbv triangles and (nbu+1)*(nbv+1) nodes";
+ return 1;
+ }
+
+ const char *aResName = argv[1];
+ const char *aSrcName = argv[2];
+ int aNbU = Draw::Atoi (argv[3]);
+ int aNbV = Draw::Atoi (argv[4]);
+
+ if (aNbU <= 0 || aNbV <= 0)
+ {
+ std::cerr << "Error: Arguments nbu and nbv must be both greater than 0\n";
+ return 1;
+ }
+
+ Handle(Geom_Surface) aSurf = DrawTrSurf::GetSurface(aSrcName);
+ double aUMin, aUMax, aVMin, aVMax;
+ if (! aSurf.IsNull())
+ {
+ aSurf->Bounds (aUMin, aUMax, aVMin, aVMax);
+ }
+ else
+ {
+ TopoDS_Shape aShape = DBRep::Get(aSrcName);
+ if (aShape.IsNull() || aShape.ShapeType() != TopAbs_FACE)
+ {
+ std::cerr << "Error: " << aSrcName << " is not a face\n";
+ return 1;
+ }
+ TopoDS_Face aFace = TopoDS::Face (aShape);
+ aSurf = BRep_Tool::Surface (aFace);
+ if (aSurf.IsNull())
+ {
+ std::cerr << "Error: Face " << aSrcName << " has no surface\n";
+ return 1;
+ }
+
+ BRepTools::UVBounds (aFace, aUMin, aUMax, aVMin, aVMax);
+ }
+ if (Precision::IsInfinite (aUMin) || Precision::IsInfinite (aUMax) ||
+ Precision::IsInfinite (aVMin) || Precision::IsInfinite (aVMax))
+ {
+ std::cerr << "Error: surface has infinite parametric range, aborting\n";
+ return 1;
+ }
+
+ BRepBuilderAPI_MakeFace aFaceMaker (aSurf, aUMin, aUMax, aVMin, aVMax, Precision::Confusion());
+ if (! aFaceMaker.IsDone())
+ {
+ std::cerr << "Error: cannot build face with natural bounds, aborting\n";
+ return 1;
+ }
+ TopoDS_Face aFace = aFaceMaker;
+
+ // create triangulation
+ int aNbNodes = (aNbU + 1) * (aNbV + 1);
+ int aNbTriangles = 2 * aNbU * aNbV;
+ Handle(Poly_Triangulation) aTriangulation =
+ new Poly_Triangulation (aNbNodes, aNbTriangles, Standard_False);
+
+ // fill nodes
+ TColgp_Array1OfPnt &aNodes = aTriangulation->ChangeNodes();
+ GeomAdaptor_Surface anAdSurf (aSurf);
+ double aDU = (aUMax - aUMin) / aNbU;
+ double aDV = (aVMax - aVMin) / aNbV;
+ for (int iU = 0, iShift = 1; iU <= aNbU; iU++, iShift += aNbV + 1)
+ {
+ double aU = aUMin + iU * aDU;
+ for (int iV = 0; iV <= aNbV; iV++)
+ {
+ double aV = aVMin + iV * aDV;
+ gp_Pnt aP = anAdSurf.Value (aU, aV);
+ aNodes.SetValue (iShift + iV, aP);
+ }
+ }
+
+ // fill triangles
+ Poly_Array1OfTriangle &aTriangles = aTriangulation->ChangeTriangles();
+ for (int iU = 0, iShift = 1, iTri = 0; iU < aNbU; iU++, iShift += aNbV + 1)
+ {
+ for (int iV = 0; iV < aNbV; iV++)
+ {
+ int iBase = iShift + iV;
+ Poly_Triangle aTri1 (iBase, iBase + aNbV + 2, iBase + 1);
+ Poly_Triangle aTri2 (iBase, iBase + aNbV + 1, iBase + aNbV + 2);
+ aTriangles.SetValue (++iTri, aTri1);
+ aTriangles.SetValue (++iTri, aTri2);
+ }
+ }
+
+ // put triangulation to face
+ BRep_Builder B;
+ B.UpdateFace (aFace, aTriangulation);
+
+ // fill edge polygons
+ TColStd_Array1OfInteger aUMinIso (1, aNbV + 1), aUMaxIso (1, aNbV + 1);
+ for (int iV = 0; iV <= aNbV; iV++)
+ {
+ aUMinIso.SetValue (1 + iV, 1 + iV);
+ aUMaxIso.SetValue (1 + iV, 1 + iV + aNbU * (1 + aNbV));
+ }
+ TColStd_Array1OfInteger aVMinIso (1, aNbU + 1), aVMaxIso (1, aNbU + 1);
+ for (int iU = 0; iU <= aNbU; iU++)
+ {
+ aVMinIso.SetValue (1 + iU, 1 + iU * (1 + aNbV));
+ aVMaxIso.SetValue (1 + iU, (1 + iU) * (1 + aNbV));
+ }
+ Handle(Poly_PolygonOnTriangulation) aUMinPoly = new Poly_PolygonOnTriangulation (aUMinIso);
+ Handle(Poly_PolygonOnTriangulation) aUMaxPoly = new Poly_PolygonOnTriangulation (aUMaxIso);
+ Handle(Poly_PolygonOnTriangulation) aVMinPoly = new Poly_PolygonOnTriangulation (aVMinIso);
+ Handle(Poly_PolygonOnTriangulation) aVMaxPoly = new Poly_PolygonOnTriangulation (aVMaxIso);
+ for (TopExp_Explorer exp (aFace, TopAbs_EDGE); exp.More(); exp.Next())
+ {
+ TopoDS_Edge anEdge = TopoDS::Edge (exp.Current());
+ Standard_Real aFirst, aLast;
+ Handle(Geom2d_Curve) aC = BRep_Tool::CurveOnSurface (anEdge, aFace, aFirst, aLast);
+ gp_Pnt2d aPFirst = aC->Value (aFirst);
+ gp_Pnt2d aPLast = aC->Value (aLast);
+ if (Abs (aPFirst.X() - aPLast.X()) < 0.1 * (aUMax - aUMin)) // U=const
+ {
+ if (BRep_Tool::IsClosed (anEdge, aFace))
+ B.UpdateEdge (anEdge, aUMinPoly, aUMaxPoly, aTriangulation);
+ else
+ B.UpdateEdge (anEdge, (aPFirst.X() < 0.5 * (aUMin + aUMax) ? aUMinPoly : aUMaxPoly), aTriangulation);
+ }
+ else // V=const
+ {
+ if (BRep_Tool::IsClosed (anEdge, aFace))
+ B.UpdateEdge (anEdge, aVMinPoly, aVMaxPoly, aTriangulation);
+ else
+ B.UpdateEdge (anEdge, (aPFirst.Y() < 0.5 * (aVMin + aVMax) ? aVMinPoly : aVMaxPoly), aTriangulation);
+ }
+ }
+
+ DBRep::Set (aResName, aFace);
+ return 0;
+}
+
//=======================================================================
//function : MemLeakTest
//purpose :
const Standard_Real d = Draw::Atof(argv[2]);
- Standard_Boolean WithShare = Standard_True;
- if (nbarg > 3) WithShare = Draw::Atoi(argv[3]);
-
Bnd_Box B;
BRepBndLib::Add(S,B);
- BRepMesh_FastDiscret MESH(d,0.5,B,WithShare,Standard_True,Standard_False,Standard_True);
+ BRepMesh_FastDiscret::Parameters aParams;
+ aParams.Deflection = d;
+ aParams.Angle = 0.5;
+ BRepMesh_FastDiscret MESH(B,aParams);
//Standard_Integer NbIterations = MESH.NbIterations();
//if (nbarg > 4) NbIterations = Draw::Atoi(argv[4]);
//MESH.NbIterations() = NbIterations;
- di<<"Starting FastDiscret with :"<<"\n";
+ di<<"Starting FastDiscret with :\n";
di<<" Deflection="<<d<<"\n";
di<<" Angle="<<0.5<<"\n";
- di<<" SharedMode="<< (Standard_Integer) WithShare<<"\n";
- //di<<" NbIterations="<<NbIterations<<"\n";
Handle(Poly_Triangulation) T;
BRep_Builder aBuilder;
DBRep::Set(name,aCompViolating);
}
- di<<"FastDiscret completed with :"<<"\n";
+ di<<"FastDiscret completed with :\n";
di<<" MaxDeflection="<<maxdef<<"\n";
di<<" NbNodes="<<nbnodes<<"\n";
di<<" NbTriangles="<<nbtriangles<<"\n";
Standard_Real aDeflection = Draw::Atof(argv[3]);
if (aDeflection <= 0.)
{
- di << " Incorrect value of deflection!" << "\n";
+ di << " Incorrect value of deflection!\n";
return 1;
}
Standard_Integer nbn, nbl, nbe;
MeshStats(aShape, nbe, nbl, nbn);
- di<<"(Resultat ("<<nbe<<" mailles) ("<<nbl<<" aretes) ("<<nbn<<" sommets))"<<"\n";
+ di<<"(Resultat ("<<nbe<<" mailles) ("<<nbl<<" aretes) ("<<nbn<<" sommets))\n";
// passe de verification du maillage.
/*Standard_Integer nbc;
}
di<<"\n";
- di<<"This shape contains " <<nbtriangles<<" triangles."<<"\n";
- di<<" " <<nbnodes <<" nodes."<<"\n";
+ di<<"This shape contains " <<nbtriangles<<" triangles.\n";
+ di<<" " <<nbnodes <<" nodes.\n";
di<<"Maximal deflection " <<MaxDeflection<<"\n";
di<<"\n";
#ifdef OCCT_DEBUG_MESH_CHRONO
chPointValid.Show(pointvalid); chIsos.Show(isos); chPointsOnIsos.Show(pointsisos);
if (tot > 0.00001) {
- di <<"temps total de maillage: "<<tot <<" seconds"<< "\n";
- di <<"dont: "<< "\n";
- di <<"discretisation des edges: "<<edges <<" seconds---> "<< 100*edges/tot <<" %"<<"\n";
- di <<"maillage des edges: "<<mailledges <<" seconds---> "<< 100*mailledges/tot <<" %"<<"\n";
- di <<"controle et points internes: "<<etuinter <<" seconds---> "<< 100*etuinter/tot <<" %"<<"\n";
- di <<"derniers controles: "<<lastcontrol<<" seconds---> "<< 100*lastcontrol/tot<<" %"<<"\n";
- di <<"stockage dans la S.D. "<<stock <<" seconds---> "<< 100*stock/tot <<" %"<<"\n";
+ di <<"temps total de maillage: "<<tot <<" seconds\n";
+ di <<"dont: \n";
+ di <<"discretisation des edges: "<<edges <<" seconds---> "<< 100*edges/tot <<" %\n";
+ di <<"maillage des edges: "<<mailledges <<" seconds---> "<< 100*mailledges/tot <<" %\n";
+ di <<"controle et points internes: "<<etuinter <<" seconds---> "<< 100*etuinter/tot <<" %\n";
+ di <<"derniers controles: "<<lastcontrol<<" seconds---> "<< 100*lastcontrol/tot<<" %\n";
+ di <<"stockage dans la S.D. "<<stock <<" seconds---> "<< 100*stock/tot <<" %\n";
di << "\n";
- di <<"et plus precisement: "<<"\n";
- di <<"Add 11ere partie : "<<add11 <<" seconds---> "<<100*add11/tot <<" %"<<"\n";
- di <<"Add 12ere partie : "<<add12 <<" seconds---> "<<100*add12/tot <<" %"<<"\n";
- di <<"Add 2eme partie : "<<add2 <<" seconds---> "<<100*add2/tot <<" %"<<"\n";
- di <<"Update : "<<upda <<" seconds---> "<<100*upda/tot <<" %"<<"\n";
- di <<"AddPoint : "<<addp <<" seconds---> "<<100*addp/tot <<" %"<<"\n";
- di <<"UniformDeflection "<<unif <<" seconds---> "<<100*unif/tot <<" %"<<"\n";
- di <<"Controle : "<<contr <<" seconds---> "<<100*contr/tot <<" %"<<"\n";
- di <<"Points Internes: "<<inter <<" seconds---> "<<100*inter/tot <<" %"<<"\n";
- di <<"calcul des isos et du, dv: "<<isos <<" seconds---> "<<100*isos/tot <<" %"<<"\n";
- di <<"calcul des points sur isos: "<<pointsisos<<" seconds---> "<<100*pointsisos/tot <<" %"<<"\n";
- di <<"IsPointValid: "<<pointvalid<<" seconds---> "<<100*pointvalid/tot <<" %"<<"\n";
+ di <<"et plus precisement: \n";
+ di <<"Add 11ere partie : "<<add11 <<" seconds---> "<<100*add11/tot <<" %\n";
+ di <<"Add 12ere partie : "<<add12 <<" seconds---> "<<100*add12/tot <<" %\n";
+ di <<"Add 2eme partie : "<<add2 <<" seconds---> "<<100*add2/tot <<" %\n";
+ di <<"Update : "<<upda <<" seconds---> "<<100*upda/tot <<" %\n";
+ di <<"AddPoint : "<<addp <<" seconds---> "<<100*addp/tot <<" %\n";
+ di <<"UniformDeflection "<<unif <<" seconds---> "<<100*unif/tot <<" %\n";
+ di <<"Controle : "<<contr <<" seconds---> "<<100*contr/tot <<" %\n";
+ di <<"Points Internes: "<<inter <<" seconds---> "<<100*inter/tot <<" %\n";
+ di <<"calcul des isos et du, dv: "<<isos <<" seconds---> "<<100*isos/tot <<" %\n";
+ di <<"calcul des points sur isos: "<<pointsisos<<" seconds---> "<<100*pointsisos/tot <<" %\n";
+ di <<"IsPointValid: "<<pointvalid<<" seconds---> "<<100*pointvalid/tot <<" %\n";
di << "\n";
deflemin = Min(deflemin, defle);
if (defle > defstock) {
- di <<"face "<< nbface <<" deflection = " << defle <<" pour "<<defstock <<" stockee."<<"\n";
+ di <<"face "<< nbface <<" deflection = " << defle <<" pour "<<defstock <<" stockee.\n";
}
}
}
di<< VB(i, j) << ", ";
}
}
- di << "\n" << "\n";
+ di << "\n\n";
}
}
return 0;
return 0;
}
+//=======================================================================
+//function : correctnormals
+//purpose : Corrects normals in shape triangulation nodes (...)
+//=======================================================================
+Standard_Integer correctnormals (Draw_Interpretor& theDI,
+ Standard_Integer /*theNArg*/,
+ const char** theArgVal)
+{
+ TopoDS_Shape S = DBRep::Get(theArgVal[1]);
+
+ //Use "correctnormals shape"
+
+
+ if(!BRepLib::EnsureNormalConsistency(S))
+ {
+ theDI << "Normals have not been changed!\n";
+ }
+ else
+ {
+ theDI << "Some corrections in source shape have been made!\n";
+ }
+
+ return 0;
+}
+
//=======================================================================
void MeshTest::Commands(Draw_Interpretor& theCommands)
//=======================================================================
g = "Mesh Commands";
- theCommands.Add("incmesh","incmesh shape deflection [inParallel (0/1) : 0 by default]",__FILE__, incrementalmesh, g);
+ theCommands.Add("incmesh","Builds triangular mesh for the shape, run w/o args for help",__FILE__, incrementalmesh, g);
+ theCommands.Add("tessellate","Builds triangular mesh for the surface, run w/o args for help",__FILE__, tessellate, g);
theCommands.Add("MemLeakTest","MemLeakTest",__FILE__, MemLeakTest, g);
- theCommands.Add("fastdiscret","fastdiscret shape deflection [shared [nbiter]]",__FILE__, fastdiscret, g);
+ theCommands.Add("fastdiscret","fastdiscret shape deflection",__FILE__, fastdiscret, g);
theCommands.Add("mesh","mesh result Shape deflection",__FILE__, triangule, g);
theCommands.Add("addshape","addshape meshname Shape [deflection]",__FILE__, addshape, g);
//theCommands.Add("smooth","smooth meshname",__FILE__, smooth, g);
theCommands.Add("onetriangulation","onetriangulation name",__FILE__, onetriangulation, g);
theCommands.Add("triepoints", "triepoints shape1 [shape2 ...]",__FILE__, triedgepoints, g);
+ theCommands.Add("correctnormals", "correctnormals shape",__FILE__, correctnormals, g);
+
#if 0
theCommands.Add("extrema","extrema ",__FILE__, extrema, g);
theCommands.Add("vb","vb ",__FILE__, vb, g);