MantisBT - Community
View Issue Details
0029405Community[OCCT] OCCT:Modeling Algorithmspublic2017-12-29 10:572021-10-09 12:31
eryar 
smoskvin 
normalcrash 
closedfixed 
WindowsVC++ 201564 bit
[OCCT] 7.2.0 
[OCCT] 7.6.0*[OCCT] 7.6.0* 
bugs modalg_7 bug29405
0029405: Modeling Algorithms - Check normal define status in HLRBRep_Data
The member variable mySLProps in class HLRBRep_Data, in some functions does not check normal define status by mySLProps.IsNormalDefined(), such as:
HLRBRep_Data::OrientOutLine();
HLRBRep_Data::OrientOthEdge();

When query the normal vector, it raise an exception:
gp_Vec Nm = mySLProps.Normal();
pload ALL
ptorus t 17.37 17.37 [dval 2.35*180/pi]
vdisplay t
vcomputehlr t t2 -algotype algo 0 50 0 0 -50 0 0 0 1
No tags attached.
related to 0032292closed bugmaster Open CASCADE Coding Rules - improve HLRBRep_PolyAlgo readability part 1 
Issue History
2017-12-29 10:57eryarNew Issue
2017-12-29 10:57eryarAssigned To => msv
2017-12-29 10:59eryarNote Added: 0073187
2017-12-29 12:10msvNote Added: 0073190
2017-12-29 12:11msvAssigned Tomsv => eryar
2017-12-29 12:11msvStatusnew => feedback
2017-12-29 13:20eryarNote Added: 0073192
2017-12-29 13:21eryarNote Edited: 0073192bug_revision_view_page.php?bugnote_id=73192#r18407
2017-12-29 13:57eryarAssigned Toeryar => msv
2017-12-29 14:47msvNote Added: 0073194
2017-12-29 14:47msvStatusfeedback => assigned
2018-01-10 15:13msvAssigned Tomsv => isn
2018-01-10 15:13msvTarget Version => 7.4.0
2019-08-12 16:50msvTarget Version7.4.0 => 7.5.0
2020-09-14 22:54msvTarget Version7.5.0 => 7.6.0*
2021-07-09 15:26utverdovAssigned Toisn => user980
2021-07-09 15:39bugmasterAssigned Touser980 => vkuzin
2021-07-09 15:39kgvAssigned Tovkuzin => user980
2021-07-09 15:39kgvSummaryCheck normal define status in HLRBRep_Data => Modeling Algorithms - Check normal define status in HLRBRep_Data
2021-07-09 15:41bugmasterAssigned Touser980 => vkuzin
2021-08-13 16:39gitNote Added: 0103190
2021-09-01 14:50gitNote Added: 0103631
2021-09-01 16:09kgvRelationship addedrelated to 0032292
2021-09-21 13:14gitNote Added: 0104256
2021-09-27 16:14gitNote Added: 0104405
2021-09-30 18:07gitNote Added: 0104455
2021-10-05 15:04vkuzinTest case number => 29405
2021-10-05 15:04vkuzinNote Added: 0104519
2021-10-05 15:04vkuzinSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25832#r25832
2021-10-06 14:31vkuzinAssigned Tovkuzin => eryar
2021-10-06 14:57msvAssigned Toeryar => vkuzin
2021-10-08 10:42gitNote Added: 0104540
2021-10-08 12:48vkuzinNote Added: 0104544
2021-10-08 13:04vkuzinAssigned Tovkuzin => msv
2021-10-08 14:30kgvNote Added: 0104547
2021-10-08 15:30msvNote Added: 0104550
2021-10-08 15:30msvAssigned Tomsv => vkuzin
2021-10-08 16:22gitNote Added: 0104552
2021-10-08 16:26vkuzinNote Added: 0104553
2021-10-08 16:26vkuzinAssigned Tovkuzin => msv
2021-10-08 16:26vkuzinStatusassigned => resolved
2021-10-08 16:35msvNote Added: 0104554
2021-10-08 16:35msvAssigned Tomsv => bugmaster
2021-10-08 16:35msvStatusresolved => reviewed
2021-10-08 16:37msvTest case number29405 => bugs modalg_7 bug29405
2021-10-08 22:20kgvNote Added: 0104558
2021-10-08 22:20kgvNote Edited: 0104558bug_revision_view_page.php?bugnote_id=104558#r25845
2021-10-09 12:07smoskvinNote Added: 0104569
2021-10-09 12:07smoskvinStatusreviewed => tested
2021-10-09 12:31smoskvinChangeset attached => occt master 96b92906
2021-10-09 12:31smoskvinAssigned Tobugmaster => smoskvin
2021-10-09 12:31smoskvinStatustested => verified
2021-10-09 12:31smoskvinResolutionopen => fixed

Notes
(0073187)
eryar   
2017-12-29 10:59   
Dear OCC Team,
Happy new year 2018!
(0073190)
msv   
2017-12-29 12:10   
Dear eryar,
Please provide a test case to reproduce such exception.
HNY 2018!
(0073192)
eryar   
2017-12-29 13:20   
(edited on: 2017-12-29 13:21)
# Draw Script:
pload ALL

dset p pi
ptorus t 17.37 17.37 "2.35 * 180 / p"

vdisplay t

houtl h t
hload h

hproj p1
hsetprj p1

hupdate

(0073194)
msv   
2017-12-29 14:47   
Thank you for the script.
(0103190)
git   
2021-08-13 16:39   
Branch CR29405 has been created by vkuzin.

SHA-1: 367307b33a88d400ede484a33336083340b49bf8


Detailed log of new commits:

Author: vkuzin
Date: Fri Aug 13 16:36:46 2021 +0300

    added a test script for the bug 29405

Author: vkuzin
Date: Fri Aug 13 14:43:22 2021 +0300

    Fixed exception when trying to calculate line and edge normal
(0103631)
git   
2021-09-01 14:50   
Branch CR29405 has been updated forcibly by vkuzin.

SHA-1: ef4023cecad340cddc40e2013957ee4cc36c1291
(0104256)
git   
2021-09-21 13:14   
Branch CR29405 has been updated by vkuzin.

SHA-1: 30ddd4d731032b7849e8b2acb0c629dd9da9ad94


Detailed log of new commits:

Author: vkuzin
Date: Tue Sep 21 13:13:24 2021 +0300

    Merge branch 'CR29405' of ssh://git.dev.opencascade.org/occt [^] into CR29405

Author: vkuzin
Date: Fri Aug 13 14:43:22 2021 +0300

    0029405: Modeling Algorithms - Check normal define status in HLRBRep_Data
    
    Fixed exception when trying to calculate line and edge normal. Added a test script for the bug 29405.

(0104405)
git   
2021-09-27 16:14   
Branch CR29405 has been updated by vkuzin.

SHA-1: 93ea9c807a070cbcd35950cf5faed40f7528052d


Detailed log of new commits:

Author: vkuzin
Date: Mon Sep 27 16:12:50 2021 +0300

    A zero derivative check, correction of the floating-point error, and division by the zero determinant were supplied.

(0104455)
git   
2021-09-30 18:07   
Branch CR29405 has been updated forcibly by vkuzin.

SHA-1: 03d60605adf0db9c4b98fe8009c22568c2642824
(0104519)
vkuzin   
2021-10-05 15:04   
Check for the existence of a normal has been implemented at HLRBRep_Data::OrientOutLine();
HLRBRep_Data::OrientOthEdge();
A correct check for zero derivative, correction of floating point error and division by zero determinant directly in HLRBRep_EdgeFaceTool::CurvatureValue was set.
http://jenkins-test-occt.nnov.opencascade.com/view/CR29405-master-vkuzin/view/COMPARE/ [^]
(0104540)
git   
2021-10-08 10:42   
Branch CR29405 has been updated forcibly by vkuzin.

SHA-1: 50be1e38fa26f82935fb28cb0a4c097219787f3a
(0104544)
vkuzin   
2021-10-08 12:48   
Corrects the check for the existence of a normal in HLRBRRep_EdgeFaceTool::CurvatureValue, since the check for correctly determining the existence of a normal is done above in the calling method HLBRRep_Data::OrientOutLine
http://jenkins-test-occt.nnov.opencascade.com/view/CR29405-master-vkuzin/view/COMPARE/ [^]
(0104547)
kgv   
2021-10-08 14:30   
Vitaly,

if patch is ready for review, please switch it to RESOLVED state
and prepare a branch with modifications squashed into a single commit with proper description.
(0104550)
msv   
2021-10-08 15:30   
#include <LProp_NotDefined.hxx>

Is this include necessary?

-	  gp_Vec Nm = mySLProps.Normal();
+	    gp_Vec Nm;
+	    Nm = mySLProps.Normal();

Why did you do this change? Please revert it.

-	  gp_Vec Nm = mySLProps.Normal();
+	  gp_Vec Nm;
+	  if (mySLProps.IsNormalDefined()) {
+	    Nm = mySLProps.Normal();

Why did you move declaration of Nm out of scope of "if"? As I see it is not used outside of it.

In HLRBRep_EdgeFaceTool::CurvatureValue, move definition of Nm to the place where it is used.
(0104552)
git   
2021-10-08 16:22   
Branch CR29405 has been updated forcibly by vkuzin.

SHA-1: 02077b04bedd6cc8503f0d1641b49a0f7816e7d5
(0104553)
vkuzin   
2021-10-08 16:26   
Fixed exception when trying to calculate line and edge normal in methods HLRBRep_Data::OrientOutLine and HLRBRep_Data::OrientOthEdge, added a check for the existence of the normal before subsequent calculations. A correct check for zero derivative, correction of floating point error and division by zero determinant directly in HLRBRep_EdgeFaceTool::CurvatureValue was set.
http://jenkins-test-occt.nnov.opencascade.com/view/CR29405-master-vkuzin/view/COMPARE/ [^]
(0104554)
msv   
2021-10-08 16:35   
For integration:
occt - CR29405
products - none
(0104558)
kgv   
2021-10-08 22:20   
Vitaly, in next patches:
+pload ALL

Please load only plugins necessary for specific test case, not everything.

 Fixed exception when trying to calculate line and edge normal in methods HLRBRep_Data::OrientOutLine 
and HLRBRep_Data::OrientOthEdge, added a check for the existence of the normal before subsequent calculations. 
A correct check for zero derivative, correction of floating point error and division by zero determinant 
directly in HLRBRep_EdgeFaceTool::CurvatureValue was set.

Please put newlines into long commit description, so that it would be displayed properly in git clients.

+vcomputehlr t t2 -algotype algo 0 50 0 0 -50 0 0 0 1
\ No newline at end of file

Please make some screenshots via `vdump` while displaying something in 3D viewer.

(0104569)
smoskvin   
2021-10-09 12:07   
Combination -
OCCT branch : IR-2021-10-08
master SHA - 56b495d93bc70a96c9f07a6025b83e2e5e70eef7
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2021-10-08 SHA - fe10ebabd09fbeb2e94180b50cd581aa0612d135
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17935.650000000136 / 17754.63000000043 [+1.02%]
Products
Total CPU difference: 11611.53000000011 / 11405.930000000111 [+1.80%]
Windows-64-VC14:
OCCT
Total CPU difference: 19689.8125 / 19680.3125 [+0.05%]
Products
Total CPU difference: 12938.8125 / 12772.859375 [+1.30%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention