Adding support for OpenCascade Defeaturing in API
I would suggest adding defeaturing features of OpenCascade inside the Gmsh API and then inside Gmsh GUI.
I came across a nice description of the supported features: https://dev.opencascade.org/content/3d-model-defeaturing
It seems to me only one API function with parameters could be added by looking at the example code:
TopoDS_Shape aSolid = ...; // Input shape to remove the features from
TopTools_ListOfShape aFeatures = ...; // Features to remove from the shape
Standard_Boolean bRunParallel = ...; // Parallel processing mode
Standard_Boolean isHistoryNeeded = ...; // History support
BRepAlgoAPI_Defeaturing aDF; // Defeaturing algorithm
aDF.SetShape(aSolid); // Set the shape
aDF.AddFacesToRemove(aFaces); // Add faces to remove
aDF.SetRunParallel(bRunParallel); // Define the processing mode (parallel or single)
aDF.SetToFillHistory(isHistoryNeeded); // Define whether to track the shapes modifications
aDF.Build(); // Perform the operation
if (!aDF.IsDone()) // Check for the errors
{
// error treatment
Standard_SStream aSStream;
aDF.DumpErrors(aSStream);
return;
}
if (aDF.HasWarnings()) // Check for the warnings
{
// warnings treatment
Standard_SStream aSStream;
aDF.DumpWarnings(aSStream);
}
const TopoDS_Shape& aResult = aDF.Shape(); // Result shape
Example from https://dev.opencascade.org/doc/overview/html/occt_user_guides__modeling_algos.html#occt_modalg_defeaturing