From 3601161d8012b185c6b69d2fd8712e99b855a047 Mon Sep 17 00:00:00 2001 From: Louis Gombert Date: Sun, 21 Dec 2025 23:06:14 +0100 Subject: [PATCH] Part: clean mesh before adding triangulation in setupCoinGeometry Calling BRepMesh_IncrementalMesh repeatedly would accumulate BRep_CurveRepresentation instances attached to the BRep_TEdges of the shape. We now clean added triangulations before adding a new one, which improves performance in the long run. Co-authored-by: Kacper Donat --- src/Mod/Part/Gui/ViewProviderExt.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index af69992726..b73f592a41 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -1095,6 +1096,13 @@ void ViewProviderPartExt::setupCoinGeometry( meshParams.InParallel = Standard_True; meshParams.AllowQualityDecrease = Standard_True; + // Clear triangulation and PCurves from geometry which can slow down the process +#if OCC_VERSION_HEX < 0x070600 + BRepTools::Clean(shape); +#else + BRepTools::Clean(shape, Standard_True); +#endif + BRepMesh_IncrementalMesh(shape, meshParams); // We must reset the location here because the transformation data