1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

0029734: Modeling Algorithms - Compute global properties of tessellated shape

New algorithms calculating global properties on mesh data have been added:
- BRepGProp_MeshCinert computes the global properties of polylines represented by a set of points;
- BRepGProp_MeshProps computes the global properties of a surface mesh.

Existing tool BRepGProp now automatically uses new algorithm for triangulation-only faces.
By default, algorithm will use exact geometry objects (surfaces), when it is available (as before the patch);
this behavior can be switched by a new flag UseTriangulation, forcing usage of triangulation instead of exact geometry when both defined.
This commit is contained in:
ifv
2018-05-17 15:38:17 +03:00
committed by kgv
parent a820bd4f13
commit 4b114473ef
15 changed files with 1090 additions and 105 deletions

View File

@@ -370,11 +370,22 @@ static Standard_Integer triangles(Draw_Interpretor& ,
static Standard_Integer tclean(Draw_Interpretor& ,
Standard_Integer n, const char** a)
{
if (n < 1) return 1;
for (Standard_Integer i = 1; i < n; i++) {
if (n == 1) return 1;
Standard_Integer aStart = 1;
Standard_Boolean toRemoveGeometry = Standard_False;
if (strcmp(a[1], "-geom") == 0)
{
aStart++;
toRemoveGeometry = Standard_True;
}
for (Standard_Integer i = aStart; i < n; i++) {
TopoDS_Shape S = DBRep::Get(a[i]);
BRepTools::Clean(S);
if (toRemoveGeometry)
BRepTools::CleanGeometry(S);
else
BRepTools::Clean(S);
}
return 0;
}
@@ -1412,7 +1423,10 @@ void DBRep::BasicCommands(Draw_Interpretor& theCommands)
theCommands.Add("hlr" ,"[no]hlr, rg1, rgn, hid, ang",__FILE__,hlr ,g);
theCommands.Add("vori","vori [name1 ...], edges are colored by orientation (see vconn)",__FILE__,dispor,g);
theCommands.Add("triangles", "triangles [name1]..., display triangles of shapes if exists",__FILE__, triangles, g);
theCommands.Add("tclean", "tclean [name1]..., erase triangulations and polygons on triangulations from shapes",__FILE__, tclean, g);
theCommands.Add("tclean", "tclean [-geom] [name1]..., depending on using or not key -geom, \n"
"\t erase geometry objects from shapes - key is used or \n"
"\t erase triangulations and polygons on triangulations from shapes - key is omitted \n",
__FILE__, tclean, g);
theCommands.Add("polygons", "polygons [name1]..., display polygons of shapes if exists",__FILE__, polygons, g);
theCommands.Add("vconn","vconn [name1 ...] , edges are colored by number of faces (see vori)",__FILE__,dispor,g);
theCommands.Add("discretisation","discretisation [nbpoints]",__FILE__,discretisation,g);