DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0021727

BRepBuilderAPI_Copy (and possibly other similar tools) create new shape in Frozen state

Open CASCADEOCCT:Modeling Algorithmsclosed11 public notes

Search issues

Description

Tools like BREpBuilderAPI_Copy create a new shape which should be free; however
they produce shape in frozen state. Try the following commands in DRAW:

=========================

Draw[0]> pload MODELING
Draw[1]> box b 10 10 10
Draw[2]> whatis b
b is a shape SOLID FORWARD Free Modified
Draw[3]> compound b c
Draw[4]> whatis b
b is a shape SOLID FORWARD Modified
Draw[5]> tcopy b q
q
Draw[6]> whatis q
q is a shape SOLID FORWARD Modified

=============================

Note that shape b looses flag Free when it is added to compound; however q is
new shape and should be Free

Steps to reproduce

pload MODELING
box b 10 10 10
whatis b
compound b c
whatis b
tcopy b q
whatis q

Public activity

11 archived notes

Participants are labeled by their role within this record.

01Commenter 1
This issue is no longer blocking for #25132, so correction is postponed to later release, also because the solution is not obvious.
02Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: ink
Date: Thu Apr 16 11:09:26 2015 +0300

    0021727: BRepBuilderAPI_Copy (and possibly other similar tools) create new shape in Frozen state
    
    Set the value of flag Frozen to false for shape created in BRepBuilderAPI_ModifyShape::DoModif().
03Commenter 3
It is not safe to reset Free flag in DoModif method, because myModifier can leave an old shape without creation of a new one.
The better place to make the fix is in the file BRepTools_Modifier.cxx:547:

  result.Free (S.Free());

I propose to remove this line. If 'result' was got by EmptyCopied method the flag Free is always false. If 'result' is just a subshape that will be placed in a shape of upper level then the flag Free will be set when it is added to the parent shape. So, there is no necessity to set the flag Free directly.
04Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
05Commenter 5
Reviewed.
06Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
07Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
08Commenter 8
Branch [archived branch] has been rebased on the current master
09Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: apv
Date: Tue Apr 28 16:10:45 2015 +0300

    Test-case for issue #0021727

10Commenter 10
Dear Commenter 1,

Branch CR21727 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]

Number of compiler warnings:
occt component:
   Linux: 18 (18 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 4 (4 on master)
   Windows: 0 (0 on master)

Regressions/Differences:
Not detected

Testing cases:
bugs modalg_6(011) bug21727 - OK
http://occt-tests/CR21727-master-occt-64/Debian60-64/bugs/modalg_6/bug21727.html
http://occt-tests/CR21727-master-occt-64/Windows-64-VC10/bugs/modalg_6/bug21727.html

Testing on Linux:
Total MEMORY difference: 94754087 / 94536502 [+0.23%]
Total CPU difference: 54117.7799999996 / 51016.899999999456 [+6.08%]

Testing on Windows:
Total MEMORY difference: 57633079 / 57268183 [+0.64%]
Total CPU difference: 16362.492487098909 / 15811.13815279897 [+3.49%]
11Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]