Part: set an absolute upper limit of the deflection for the shape tessellation to avoid useless results

This commit is contained in:
wmayer
2023-04-11 18:03:12 +02:00
committed by wwmayer
parent 25c7e389a9
commit 9366b031a3

View File

@@ -940,8 +940,14 @@ void ViewProviderPartExt::updateVisual()
// Since OCCT 7.6 a value of equal 0 is not allowed any more, this can happen if a single vertex
// should be displayed.
if (deflection < gp::Resolution())
if (deflection < gp::Resolution()) {
deflection = Precision::Confusion();
}
// For very big objects the computed deflection can become very high and thus leads to a useless
// tessellation. To avoid this the upper limit is set to 20.0
// See also forum: https://forum.freecad.org/viewtopic.php?t=77521
deflection = std::min(deflection, 20.0);
// create or use the mesh on the data structure
Standard_Real AngDeflectionRads = AngularDeflection.getValue() / 180.0 * M_PI;