diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index 753c7db80b..f521c95072 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -78,6 +78,8 @@ # include # include +# include + //to simplify parsing input files we use the boost lib #include @@ -715,10 +717,12 @@ std::set FemMesh::getNodesBySolid(const TopoDS_Solid &solid) const Bnd_Box box; BRepBndLib::Add(solid, box); - // limit where the mesh node belongs to the solid: - double limit = box.SquareExtent()/10000.0; - //double limit = BRep_Tool::Tolerance(solid); // does not compile --> no matching function for call to 'BRep_Tool::Tolerance(const TopoDS_Solid&)' - box.Enlarge(limit); + + // limit where the mesh node belongs to the solid + TopAbs_ShapeEnum shapetype = TopAbs_SHAPE; + ShapeAnalysis_ShapeTolerance analysis; + double limit = analysis.Tolerance(solid, 1, shapetype); + Base::Console().Log("The limit if a node is in or out: %.12lf in scientific: %.4e \n", limit, limit); // get the current transform of the FemMesh const Base::Matrix4D Mtrx(getTransform());