1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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

@@ -826,6 +826,43 @@ void BRepTools::Clean(const TopoDS_Shape& theShape)
aBuilder.UpdateEdge (aEdge, aNullPoly3d);
}
}
//=======================================================================
//function : CleanGeometry
//purpose :
//=======================================================================
void BRepTools::CleanGeometry(const TopoDS_Shape& theShape)
{
if (theShape.IsNull())
return;
BRep_Builder aBuilder;
for (TopExp_Explorer aFaceIt(theShape, TopAbs_FACE); aFaceIt.More(); aFaceIt.Next())
{
TopLoc_Location aLocation;
const TopoDS_Face& aFace = TopoDS::Face(aFaceIt.Current());
const Handle(Geom_Surface)& aSurface = BRep_Tool::Surface(aFace, aLocation);
for (TopExp_Explorer aEdgeIt(aFace, TopAbs_EDGE); aEdgeIt.More(); aEdgeIt.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(aEdgeIt.Current());
aBuilder.UpdateEdge(anEdge, Handle(Geom2d_Curve)(), aSurface,
aLocation, BRep_Tool::Tolerance(anEdge));
}
aBuilder.UpdateFace(aFace, Handle(Geom_Surface)(), aFace.Location(), BRep_Tool::Tolerance(aFace));
}
for (TopExp_Explorer aEdgeIt2(theShape, TopAbs_EDGE); aEdgeIt2.More(); aEdgeIt2.Next())
{
const TopoDS_Edge& anEdge = TopoDS::Edge(aEdgeIt2.Current());
aBuilder.UpdateEdge(anEdge, Handle(Geom_Curve)(),
TopLoc_Location(), BRep_Tool::Tolerance(anEdge));
}
}
//=======================================================================
//function : RemoveUnusedPCurves

View File

@@ -155,6 +155,9 @@ public:
//! edges.
Standard_EXPORT static void Clean (const TopoDS_Shape& S);
//! Removes geometry (curves and surfaces) from all edges and faces of the shape
Standard_EXPORT static void CleanGeometry(const TopoDS_Shape& theShape);
//! Removes all the pcurves of the edges of <S> that
//! refer to surfaces not belonging to any face of <S>
Standard_EXPORT static void RemoveUnusedPCurves (const TopoDS_Shape& S);