DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0033421

Modeling Algorithms - ShapeUpgrade_UnifySameDomain throws exception

CommunityOCCT:Modeling Algorithmsverified8 public notes

Search issues

Description

ShapeUpgrade_UnifySameDomain throws an access violation exception when accessing an empty edge.
It can happen with certain shapes that none is found when searching for the next edge in the wire. This case is not checked.

My proposed solution is to finally check if the edge is not empty before accessing it, and otherwise abort the algorithm. This at least prevents the exception.

Steps to reproduce

pcylinder c1 10 10
copy c1 c2
tmirror c2 0 0 10 0 0 1
bop c1 c2
bopfuse c3

unifysamedom result c3

checkshape result

checknbshapes result -t -solid 1 -shell 1 -face 4 -wire 4 -edge 5 -vertex 3

Public activity

8 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Tue Jul 4 20:53:37 2023 +0200

    0033421: Modeling Algorithms - ShapeUpgrade_UnifySameDomain throws exception
    
    In method ShapeUpgrade_UnifySameDomain::IntUnifyFaces() the searched edge is finally checked that it is not empty before accessing it.
02Commenter 3
Dear Commenter 4,
please check the commit and start tests if code is valid.
But I think there is a incorrect behavior - just to return(stop the algorithm). I think just break the loop in this case will be better(null nextEdge probably means end of the wire)
03Author
I also tried breaking the loop. The result is an invalid shape. Checkshape also reports some errors (UnorientableShape and NotClosed). I suspect that the input shape contains a constellation that is not handled in the algorithm at all. Although it would be nice if the two cylinder faces would merge, I would like to turn off the crash as a first measure.
Attachment 1 (PNG) (16,593 bytes)   
04Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: Commenter 1
Date: Tue Aug 1 13:10:47 2023 +0100

    0033421: Modeling Algorithms - ShapeUpgrade_UnifySameDomain throws exception
    
    In method ShapeUpgrade_UnifySameDomain::IntUnifyFaces() the searched edge is finally checked that it is not empty before accessing it.
05Commenter 1
Please, integrate branch:
OCCT - CR33421_1
Products - NONE

Results of testing:
http://jenkins-test-10.nnov.opencascade.com/view/CR33421-master-Commenter 1/view/COMPARE/
06Commenter 5
Combination -
OCCT branch : [archived branch] - IR-2023-08-04
Products branch : [archived branch] - master
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:
Ubuntu2004-64:
OCCT
Total CPU difference: 18344.600000000195 / 18390.260000000217 [-0.25%]
Products
Total CPU difference: 12102.810000000003 / 12161.439999999999 [-0.48%]
Windows-64-VC142:
OCCT
Total CPU difference: 20332.1875 / 20298.859375 [+0.16%]
Products
Total CPU difference: 14548.515625 / 14604.578125 [-0.38%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
07Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
08Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records