MantisBT - Open CASCADE
View Issue Details
0024397Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2013-11-22 14:432020-09-14 22:58
emv 
ifv 
normalminor 
assignedopen 
[OCCT] 6.6.0 
[OCCT] 7.6.0* 
bugs modalg_5 bug24397_1, bug24397_2, bug24397_3
0024397: BRepBuilderAPI_Copy works not correct
BRepBuilderAPI_Copy works not correct with some shapes.
1. the problem described in the test case boolean bcommon_2d A7
restore [locate_data_file case_1_wire3.brep] b
lprops b
tcopy b b1
lprops b1
#An exception was caught 006C429C : Standard_NullObject: BRepAdaptor_Curve::No geometry
#** Exception ** 006C429C : Standard_NullObject: BRepAdaptor_Curve::No geometry

2. the problem described in the test case bugs modalg_2 bug476_7
restore [locate_data_file OCC485b.brep] b
nbshapes b
# VERTEX : 3
# EDGE : 6
# WIRE : 4
# FACE : 4
tcopy b b1
nbshapes b1
# VERTEX : 6
# EDGE : 9
# WIRE : 5
# FACE : 5

3. the problem described in the test case bugs modalg_2 bug22678
brestore [locate_data_file bug22678_objCut.brep] b
nbshapes b
# VERTEX : 8
# EDGE : 12
# WIRE : 11
# FACE : 9
tcopy b b1
nbshapes b1
# VERTEX : 12
# EDGE : 19
# WIRE : 13
# FACE : 11
No tags attached.
parent of 0027063closed abv BRepGProps raises exception on edge with no curves 
Issue History
2013-11-22 14:43emvNew Issue
2013-11-22 14:43emvAssigned To => ifv
2013-11-22 14:47emvStatusnew => assigned
2013-11-22 14:47emvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6339#r6339
2013-12-10 15:57ifvNote Added: 0027156
2013-12-10 15:57ifvAssigned Toifv => jgv
2013-12-10 15:57ifvStatusassigned => resolved
2013-12-10 16:29jgvNote Added: 0027158
2013-12-10 16:29jgvStatusresolved => reviewed
2013-12-10 16:35apnAssigned Tojgv => apn
2013-12-11 15:55apnNote Added: 0027172
2013-12-11 15:56apnTest case number => bugs modalg_5 bug24397
2013-12-11 15:56apnAssigned Toapn => ifv
2013-12-11 15:56apnStatusreviewed => assigned
2013-12-12 18:20ifvNote Added: 0027194
2013-12-12 18:20ifvAssigned Toifv => jgv
2013-12-12 18:20ifvStatusassigned => resolved
2013-12-12 18:42jgvNote Added: 0027195
2013-12-12 18:42jgvStatusresolved => reviewed
2013-12-12 19:07apnAssigned Tojgv => apn
2013-12-13 14:30apnNote Added: 0027208
2013-12-13 14:30apnAssigned Toapn => bugmaster
2013-12-13 14:30apnStatusreviewed => tested
2013-12-13 14:30apnTarget Version => 6.7.1
2013-12-19 13:34bugmasterAssigned Tobugmaster => abv
2013-12-19 13:34bugmasterStatustested => feedback
2014-04-04 17:42abvTarget Version6.7.1 => 6.8.0
2014-09-11 09:23abvTarget Version6.8.0 => 7.1.0
2016-01-07 23:50abvFile Added: bug24397_emptyedge.brep
2016-01-07 23:56gitNote Added: 0049720
2016-01-08 00:27abvRelationship addedparent of 0027063
2016-01-08 00:39gitNote Added: 0049723
2016-01-08 00:39abvNote Deleted: 0049723
2016-01-08 00:39abvNote Deleted: 0049720
2016-01-08 01:02abvNote Added: 0049724
2016-01-08 01:02abvAssigned Toabv => msv
2016-01-08 01:10abvFile Deleted: bug24397_emptyedge.brep
2016-01-08 20:06msvNote Added: 0049731
2016-01-08 20:06msvAssigned Tomsv => ifv
2016-01-08 20:06msvStatusfeedback => assigned
2016-01-08 20:22abvNote Added: 0049735
2016-01-08 20:23abvNote Edited: 0049735bug_revision_view_page.php?bugnote_id=49735#r12725
2016-01-09 00:49msvNote Added: 0049745
2016-10-28 11:54msvTarget Version7.1.0 => 7.2.0
2017-07-24 09:32msvTarget Version7.2.0 => 7.3.0
2017-11-02 12:23mkvTest case numberbugs modalg_5 bug24397 => bugs modalg_5 bug24397_1, bug24397_2, bug24397_3
2017-11-02 12:23mkvNote Added: 0071930
2017-12-05 17:08msvTarget Version7.3.0 => 7.4.0
2019-08-12 16:37msvTarget Version7.4.0 => 7.5.0
2020-09-14 22:58msvTarget Version7.5.0 => 7.6.0*

Notes
(0027156)
ifv   
2013-12-10 15:57   
Please review branch CR24397

The first problem is fixed (see branch CR24397)
2 and 3 examplex are not bugs:
nbshapes take in account only different TShapes, but number of Shapes is more.
Algorithm of BRepBuilderAPI_Copy copies each shape, so after copiing number of shapes increased because now each Shape has own TShape.
(0027158)
jgv   
2013-12-10 16:29   
No remarks.
(0027172)
apn   
2013-12-11 15:55   
Dear BugMaster,

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

Number of compiler warnings:

occt component :
Linux: 103 (103 on master)
Windows: 0 (0 on master)

products component :
Linux: 21 (21 on master)
Windows: 8 (8 on master)

Regressions/Differences:
blend complex D4
http://occt-tests/CR24397-master-occt/Debian60-64/blend/complex/D4.html [^]
http://occt-tests/CR24397-master-occt/Windows-32-VC9/blend/complex/D4.html [^]

Testing cases:
bugs modalg_5 bug24397 - OK
http://occt-tests/CR24397-master-occt/Debian60-64/bugs/modalg_5/bug24397_1.html [^]
http://occt-tests/CR24397-master-occt/Windows-32-VC9/bugs/modalg_5/bug24397_1.html [^]

Testing on Linux:
Total MEMORY difference: 358227524 / 358815008
Total CPU difference: 43385.850000000246 / 67594.15000000007

Testing on Windows:
Total MEMORY difference: 413074624 / 413199408
Total CPU difference: 28030.078125 / 30599.515625

There are not differences in images found by testdiff.
(0027194)
ifv   
2013-12-12 18:20   
Please review updated CR24397
(0027195)
jgv   
2013-12-12 18:42   
Ok.
(0027208)
apn   
2013-12-13 14:30   
Dear BugMaster,

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

Number of compiler warnings:

occt component :
Linux: 103 (103 on master)
Windows: 0 (0 on master)

products component :
Linux: 21 (21 on master)
Windows: 8 (8 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
bugs modalg_5 bug24397 - OK
http://occt-tests/CR24397-master-occt/Debian60-64/bugs/modalg_5/bug24397.html [^]
http://occt-tests/CR24397-master-occt/Windows-32-VC9/bugs/modalg_5/bug24397.html [^]

Testing on Linux:
Total MEMORY difference: 358902548 / 358958380
Total CPU difference: 47639.15000000007 / 67597.07000000007

Testing on Windows:
Total MEMORY difference: 413061768 / 413232620
Total CPU difference: 30182.84375 / 30599.546875

There are not differences in images found by testdiff.
(0049724)
abv   
2016-01-08 01:02   
The fix for lprops is separated to new issue, 0027063.

That fix does not prevent BRepBuilderAPI_Copy to construct problematic edge (degenerated edge with no pcurves). I suppose that BRepBuilderAPI_Copy behaves correctly: it copies the degenerated edge as it is, but does not copy pcurves on faces which are not part of the original shape. Copy operation is expected to preserve topological structure of the result shape to be exactly as in the source, thus it may not eliminate null edges from the result. Thus the edge is copied correctly, the difference between original edge and result is that the former contains a pcurve, which is skipped in the result since the copied shape is wire.

The inconsistency remains between original shape which is considered valid, and result of the copy operation which is not valid:

restore [locate_data_file case_1_wire3.brep] a
checkshape a ;# OK
tcopy a b
checkshape b ;# fail

I suppose that checkshape should report error in both cases here (degenerated edge may not be part of wire unless it is part of the face).
(0049731)
msv   
2016-01-08 20:06   
Dear Igor, please implement the fix for checkshape as Andrey suggested.

@Andrey: My one concern is: if we take a wire of a face with degeneracy then checkshape will report an error on such wire. Is this OK then?
(0049735)
abv   
2016-01-08 20:22   
(edited on: 2016-01-08 20:23)
Yep, naturally, these wires will be invalid. I suppose we shall need a tool to bring such wires into valid state (by removing degenerated edges). Alternatively, we can allow degenerated edges with no curves in such wires, then checkshape should be fixed to not fail on such shapes.

(0049745)
msv   
2016-01-09 00:49   
I think the natural entry point for such tool should be fixshape. By default it will remove degenerated edges from wires not belonging to a face.
(0071930)
mkv   
2017-11-02 12:23   
Problem is reproduced on the current master.