DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0023860

Bad memory access intersecting two nearly coincident cylindrical faces

CommunityOCCT:Modeling Algorithmsclosed23 public notes

Search issues

Description

Executing the following code results in an access violation in Release on Windows and MacOS. It throws an exception in debug.

Steps to reproduce

gp_Ax3 axes1(gp_Pnt(1031.3339148728076, -113.25868616662650, 56.152387686082520),
                        gp_Dir(-0.86602540378443815, 0.50000000000000089, 0.00000000000000000),
                        gp_Dir(-0.50000000000000089, -0.86602540378443815, 0.00000000000000000));
        Handle(Geom_CylindricalSurface) surface1(new Geom_CylindricalSurface(axes1, 76.499999999999986));
        gp_Ax3 axes2(gp_Pnt(1017.0706583606553, -103.24955863669388, 56.152387686082548),
                        gp_Dir(0.86602540378443915, -0.49999999999999933, 0.00000000000000000),
                        gp_Dir(0.49999999999999933, 0.86602540378443915, 0.00000000000000000));
        Handle(Geom_CylindricalSurface) surface2(new Geom_CylindricalSurface(axes2, 76.499999999999986));
        BRep_Builder builder;
        TopoDS_Face face1;
        TopoDS_Face face2;
        builder.MakeFace(face1, surface1, Precision::Confusion());
        builder.MakeFace(face2, surface2, Precision::Confusion());
        IntTools_FaceFace intersection;
        intersection.SetParameters(false, true, true, Precision::Confusion());
        intersection.Perform(face1, face2);

Public activity

23 archived notes

Participants are labeled by their role within this record.

01Commenter 1
It is needed to create a test case.
02Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: vmigunov
Date: Wed Jun 29 09:58:57 2022 +0300

    0023860: Bad memory access intersecting two nearly coincident cylindrical faces
    
    Test of 2 nearly coincident cylindrical faces intersection is added
03Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
04Commenter 4
See branch CR23860
05Commenter 5
No need to convert curves to edges:
mkedge e1 c_1
mkedge e2 c_2


Check of picture for each edge is redundant:
checkview -display e1 -2d -path ${imagedir}/${test_image}_e1.png
checkview -display e2 -2d -path ${imagedir}/${test_image}_e2.png

Both edges could be shown at once, you may use
xwd ${imagedir}/${test_image}.png


Also, I would expect the check of some numeric values of the result, at least the number of curves, and probably some other values of those curves.
06Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
07Commenter 7
Done. See branch CR23860.
08Commenter 3
Commenter 3, please make review of this patch.
09Commenter 4
Please, use construction 'puts "REQUIRED ALL"' in case with bad but expected function behavior.
In this case, nessesary to use another tcl constructions like:
set r [expr]
if {$r != val} { puts "error" }
10Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
11Commenter 11
Done. See branch CR23860.
12Commenter 5
Commenter 5 please don't forget to change status to resolved and assign to a person for review.
13Commenter 4
Branch for integrate CR23860
14Commenter 14
It is needed to pass false in the first parameter of the call to intersection.SetParameters. It is not so when we use bopcurves command.
15Commenter 15
Please also rerun tests on jenkins.
16Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
17Commenter 17
18Commenter 18
Please add new option -noapprox instead of -2d12.
19Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
20Commenter 20
21Commenter 21
Branch CR23860 seems to be valid
22Commenter 6
Commenter 5,

please put a clear resolution of the bug here and into git commit.
From the current discussion and patch it is completely unclear what has been done and for which purpose.
Was bug solved by some other patch?
In which OCCT version it was last reproducible if any?
23Commenter 4
Please, close current bug.
The problem was resolved in previous versions.