MantisBT - Community
View Issue Details
0023943Community[OCCT] OCCT:Modeling Algorithmspublic2013-05-03 18:182013-12-19 13:55
Roman Lygin 
Roman Lygin 
normalminor 
closedfixed 
ALL
[OCCT] 6.5.4 
[OCCT] 6.7.0[OCCT] 6.7.0 
bugs moddata_3(013) bug23943_1, bug23943_2, bug23943_3, bug23943_4
0023943: OCC fails to work with offset surfaces with singularities
Unlike other types of surfaces, offsets throw an exception Geom_UndefinedValue (or _UndefinedDerivative) when trying to compute values near their singularities.

Therefore algorithms that do not expect surface evaluation to throw exception eventually produce incorrect results when working with such geometries.

The fix addresses two cases trying to improve robustness of OCC:
1. singularity is now recognized in Geom_OscullatingSurface if the derivative is below the tolerance (regardless that it should be greater than 1e-12 threshold used before)
2. ShapeAnalysis_Surface::ValueOf() now avoids going beyond the surface range for offset surfaces.


Notes:
1. In 0000001 additionally the debug output in Geom_OscullatingSurface.cxx has been suppressed in production version as otherwise it severely contaminates the log.
Suppression is done by adding another macro which could be defined only in OCC development environment. OCC team is free to modify the name as sees fit.
2. In 0000002 it would probably be good to prevent going beyond surface range for all types of (non-periodic?) surfaces. However to minimize fix impact it has been limited to offsets only.
See two independent reproducers attached.
No tags attached.
related to 0024008closed bugmaster ShapeAnalysis_Surface causes exception in Geom_OffsetSurface 
zip rep1.zip (499,784) 2013-05-03 18:18
https://tracker.dev.opencascade.org/
zip rep2.zip (227,155) 2013-05-03 18:18
https://tracker.dev.opencascade.org/
Issue History
2013-05-03 18:18Roman LyginNew Issue
2013-05-03 18:18Roman LyginAssigned To => jgv
2013-05-03 18:18Roman LyginFile Added: rep1.zip
2013-05-03 18:18Roman LyginFile Added: rep2.zip
2013-05-03 18:25Roman LyginNote Added: 0024308
2013-05-03 18:25Roman LyginStatusnew => resolved
2013-05-06 12:03jgvAssigned Tojgv => ifv
2013-05-06 18:30ifvNote Added: 0024316
2013-05-06 18:30ifvStatusresolved => reviewed
2013-05-23 11:13mkvNote Added: 0024481
2013-05-23 11:14mkvTest case number => bugs moddata_3(013) bug23943_1, bug23943_2, bug23943_3, bug23943_4
2013-05-23 11:14mkvAssigned Toifv => bugmaster
2013-05-23 11:14mkvStatusreviewed => tested
2013-05-23 12:39bugmasterTarget Version => 6.7.0
2013-05-28 14:33bugmasterNote Added: 0024534
2013-05-28 14:33bugmasterStatustested => verified
2013-05-28 14:33bugmasterResolutionopen => fixed
2013-05-28 14:33bugmasterAssigned Tobugmaster => Roman Lygin
2013-06-02 15:56abvRelationship addedrelated to 0024008
2013-12-19 13:53bugmasterStatusverified => closed
2013-12-19 13:55bugmasterFixed in Version => 6.7.0

Notes
(0024308)
Roman Lygin   
2013-05-03 18:25   
The fix pushed to the git repository
(0024316)
ifv   
2013-05-06 18:30   
The first part of correction (elimination of TolMin from test of singular point) seems to be Ok.
The second part of correction (ShapeAnalysis_Surface::ValueOf()) can be consider as temporal solution for following reasons:
  
the going beyond surface domain is not "fatal" problem for practically all types of not periodic surface including offset surface because these surfaces can be analytically extended. Of course, extension must not be too large.
Sometimes going beyong surface happens by "natural" way, for example, while getting pcurve by projection of 3d curve, which is near surface boundary.
Problem of given offset surface is that basis surface is singular and osculating surface is built for Umax, but derivative are calculated for u > Umax. Perhaps, the correct fix of bug must solve problem of extension of osculating surface, if it exists for u > Umax.
So problem requires additional investigations.
(0024481)
mkv   
2013-05-23 11:13   
Dear BugMaster,

Branch CR23943 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: b3113a1c9303200f58d7317a076b2c4fd8de0263

Number of compiler warnings:

occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)

products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
bugs moddata_3(013) bug23943_1, bug23943_2, bug23943_3, bug23943_4 - OK

Testing on Linux:
Total MEMORY difference: 365857352 / 365850136
Total CPU difference: 41145.37000000122 / 45786.650000001355

Testing on Windows:
Total MEMORY difference: 415969780 / 418014292
Total CPU difference: 38610.796875 / 29305.09375

There are not differences in images found by testdiff.
(0024534)
bugmaster   
2013-05-28 14:33   
Fix has been integrated into master of occt repository