Skip to content

Commit

Permalink
Merge branch 'smaller_tol_occ_center' into 'master'
Browse files Browse the repository at this point in the history
smaller tolerance in occ center

See merge request ngsolve/netgen!538
  • Loading branch information
ChrLackner committed Oct 17, 2022
2 parents bce715a + 4714aa9 commit bdc738f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libsrc/occ/occ_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,22 @@ namespace netgen
inline gp_Pnt Center (TopoDS_Shape shape)
{
GProp_GProps props;
double tol;
switch (shape.ShapeType())
{
case TopAbs_SOLID:
case TopAbs_COMPOUND:
case TopAbs_COMPSOLID:
BRepGProp::VolumeProperties (shape, props); break;
tol = 1e-2 * BRep_Tool::MaxTolerance(shape, TopAbs_FACE);
BRepGProp::VolumeProperties (shape, props, tol); break;
case TopAbs_FACE:
case TopAbs_SHELL:
BRepGProp::SurfaceProperties (shape, props); break;
tol = 1e-2 * BRep_Tool::MaxTolerance(shape, TopAbs_FACE);
BRepGProp::SurfaceProperties (shape, props, tol); break;
case TopAbs_WIRE:
case TopAbs_EDGE:
tol = 1e-2 * BRep_Tool::MaxTolerance(shape, TopAbs_EDGE);
BRepGProp::LinearProperties(shape, props, tol); break;
default:
BRepGProp::LinearProperties(shape, props);
}
Expand Down

0 comments on commit bdc738f

Please sign in to comment.