MantisBT - Open CASCADE
View Issue Details
0022642Open CASCADE[OCCT] OCCT:Shape Healingpublic2011-07-01 16:542020-09-11 16:48
[OCCT] 6.5.1 
[OCCT] 7.6.0* 
bugs heal bug22642
0022642: Refactoring of ShapeFix_Wire::FixIntersectingEdges
This issue has been detected during processing of ACIS22625.

Currently ShapeFix_Shape tool performs shape healing for TopoDS Shells with
ModifyTopologyMode flag set to 0 in the underlying ShapeFix_Wire tool. In case
of self-intersecting input wire this leads to increasing of tolerance for the
problematic vertices. As DTE utilizes Shape Healing functionality with some
maximum acceptable tolerance, this often leads to the fact that Shape Healing
actually does nothing (as the calculated resolution tolerance exceeds the
maximum one).

This Bug is a proposition to turn ON the ModifyTopologyMode flag for Shell
entities (as we have for TopoDS Faces). Such modification, however, leads to
necessity of refactoring of ShapeFix_Wire::FixIntersectingEdges method (at
least). The following points need to be revised:

- Usage of ShapeBuild_ReShape tool must be introduced in FixIntersectingEdges
routine. Thus we can replace the truncated edges with equivalent wires in the
adjacent faces and keep them consistent so;

- Currently existing algorithm demonstrates quite strange behaviour on the
problematic face: while first intersection point is processed correctly (vertex
is shifted, curve is reparameterized), the second intersection point (actually,
with a symmetrical nature) is fixed via tolerance increasing, rather than via
vertex shifting. It looks like FixIntersectingEdges algorithm is not well formed
to proceed with some specific cases. We can suggest preliminary invocation of
ShapeFix_Edge::FixSameParameter on each processed edge before the algorithm starts;

- One of the algorithm's execution branches consists in tolerance increasing,
notably when the problematic edge cannot be truncated. As well as for
ModifyTopologyMode == 0 mode, the resulting tolerance value might become greater
than the maximum allowed one. However, algorithm finishes successfully in
contrast with similar situation for ModifyTopologyMode == 0;

Use the attached brep to reproduce the issue. DRAW commands:

pload ALL
restore ss_47.brep f
fixshape ff f -l -o -h -m -d -s +i -n
checksh ff
No tags attached.
parent of 0022908assigned ssv Open CASCADE SameParameter & SameRange flags are set incorrectly in ShapeBuild_Edge::CopyRanges 
Not all the children of this issue are yet resolved or closed.
? ss_47.brep (71,544) 2011-07-01 14:54
png 1_2d_self_intersecting.png (9,211) 2011-07-01 14:56
png SHG22642_001_initial_shell.png (24,273) 2012-01-12 18:27
png SHG22642_001_switch_mode_NO_RESHAPE.png (28,036) 2012-01-12 19:00
? ccc.brep (244,111) 2012-08-28 17:49
png 001_s1_selfinter.png (51,074) 2012-08-28 17:50
png 002_s1_selfinter.png (24,196) 2012-08-28 17:50
Issue History
2011-07-12 20:12bugmasterAssigned Tobugmaster => ssv
2011-07-12 20:12bugmasterStatusnew => assigned
2011-07-12 20:53mkvBugsThisDependsOn => 22625
2011-08-02 11:30bugmasterCategoryOCCT:SHG => OCCT:Shape Healing
2012-01-12 18:26ssvFixed in VersionEMPTY =>
2012-01-12 18:26ssvDescription Updatedbug_revision_view_page.php?rev_id=2251#r2251
2012-01-12 18:27ssvFile Added: SHG22642_001_initial_shell.png
2012-01-12 18:56ssvFile Added: SHG22642_001_switch_mode_NO_RESHAPE.png
2012-01-12 18:59ssvFile Deleted: SHG22642_001_switch_mode_NO_RESHAPE.png
2012-01-12 19:00ssvFile Added: SHG22642_001_switch_mode_NO_RESHAPE.png
2012-01-21 11:56ssvRelationship addedparent of 0022908
2012-01-25 19:54ssvNote Added: 0019267
2012-01-25 19:54ssvAssigned Tossv => gka
2012-01-25 19:54ssvStatusassigned => resolved
2012-01-25 19:55ssvNote Edited: 0019267bug_revision_view_page.php?bugnote_id=19267#r3317
2012-01-25 19:56ssvNote Edited: 0019267bug_revision_view_page.php?bugnote_id=19267#r3318
2012-01-27 10:08ssvNote Added: 0019274
2012-02-06 12:06gkaAssigned Togka => ssv
2012-02-06 12:06gkaStatusresolved => reviewed
2012-02-08 10:52abvProduct Version => 6.5.1
2012-02-08 10:52abvTarget Version => 6.5.3
2012-02-13 20:30mkvNote Added: 0019537
2012-02-13 20:31mkvStatusreviewed => assigned
2012-03-21 14:14abvTarget Version6.5.3 => 6.5.4
2012-08-28 17:49ssvFile Added: ccc.brep
2012-08-28 17:50ssvFile Added: 001_s1_selfinter.png
2012-08-28 17:50ssvFile Added: 002_s1_selfinter.png
2012-08-28 17:50ssvNote Added: 0021352
2012-08-28 17:53ssvRelationship addedrelated to 0023368
2012-10-21 11:43abvTarget Version6.5.4 => 6.6.0
2013-02-28 17:01abvTarget Version6.6.0 => 6.7.0
2013-10-15 20:58abvTarget Version6.7.0 => 6.7.1
2014-04-04 18:34abvTarget Version6.7.1 => 6.8.0
2014-09-26 11:10abvTarget Version6.8.0 => 7.1.0
2016-10-31 11:11gkaTarget Version7.1.0 => 7.2.0
2017-07-27 09:33abvTarget Version7.2.0 => 7.4.0
2017-10-11 13:24apvTest case number => bugs heal bug22642
2017-10-11 13:24apvNote Added: 0071337
2019-09-04 13:04abvTarget Version7.4.0 => 7.5.0
2020-09-11 16:48utverdovTarget Version7.5.0 => 7.6.0*

2012-01-25 19:54   
(edited on: 2012-01-25 19:56)
The following changes have been introduced:

1. ShapeFix_SplitTool: method SplitEdge added. This new one is similar to already existing method, but has more convenient signature (without passing the splitting vertex). Former code re-used.

2. ModifyTopology mode has been turned ON for shells in ShapeFix_Shape and ShapeFix_Solid classes.

3. New internal class ShapeFix_AdjInterTool has been introduced in ShapeFix_IntersectionTool. Previously, ShapeFix_IntersectionTool was used only for healing of non-adjacent intersection. The new auxillary class (ShapeFix_AdjInterTool, visible in scope of ShapeFix_IntersectionTool only) takes care of intersections between adjacent edges. New method ShapeFix_IntersectionTool::FixAdjSelfIntersectWire has been added as an entry point for this functionality. The former one (FixSelfIntersectWire) has been renamed to FixNonAdjSelfIntersectWire.

ShapeFix_AdjInterTool is initialized with the working Wire Data and Face. Then, during iteration over the underlying edges and detecting the intersection problems, this tool is populated by the next pair of intersecting edges. These edges are split by the given intersection parameters. ShapeFix_AdjInterTool records all modification requests in the shared instance of ShapeBuild_ReShape context. Once all the edges are iterated, ShapeFix_AdjInterTool prepares a new trimmed wire to exchange the initial one.

4. ShapeFix_Wire::FixSelfIntersection method has been re-factored to use ShapeFix_IntersectionTool in case of myFixIntersectingEdgesMode (adjacent intersection) just like in case of myFixNonAdjacentIntersectingEdgesMode (non-adjacent intersection).

Branch http://svn/svn/occt/branches/SHG22642/ [^] is ready for review.

Dear Galina,

Could you please review this patch?

2012-01-27 10:08   
Dear Galina,

Please review branch http://svn/svn/occt/branches/SHG22642NEW/ [^] instead of the previous one (I will remove it asap). The new one is correctly merged with trunk.
2012-02-13 20:30   
Dear BugMaster,
Workbench KAS:dev:mkv-22642-occt was created from SVN branch http://svn/svn/occt/branches/SHG22642NEW [^]
(and mkv-22642-products from trunk) and compiled on Linux platform.

There are following regressions in mkv-22642-products regarding to KAS:dev:products-20120210-opt

chl 905 A2
chl 910 H1
chl 913 J7
chl 919 A3
chl 921 A3 C5 C7
chl 927 B5 B7 Y3
chl 934 G8 P6
chl 935 U4

chp 003 A9 B7 E4

csh 001 D3

dea 001 A5

dec 007 I3 I7

xigs 102 J3 K3
xigs 103 N6 T6
xigs 303 P5

xsat 101 B8 C9 D8
xsat 102 R3 S7
xsat 103 K9
xsat 104 N1 Y6

xstp 106 A1 B9 C1 C2 C8 D1 D4 D9 F6 F7 G2 H3 H5 H7 I2 J1 J2 J7 J8 K7 L1
xstp 107 O9 P5 P6 P7 Q3 Q4 Q5 S4 S9 T1 T3 T4 U2 X7 X8 Z5
xstp 108 A4 A5 A6 A7 B8 B9 C2 D5 D6 E6 E9 F6 F7 G5 G6 G7 J1 J3 J7 J8 J9 K1 K2 K3 K5 K6 K8 K9 L1 M8
xstp 109 N2 N3 N4 P8 Q1 Q5 Q7 Q8 Q9 R1 R7 S5 T3 V1 X7
xstp 110 C1 C9 D2 D6 E1 E2
xstp 111 O6 O7 O8 P2 P6 P7 Q3 S7 S8 S9 T1 T2 T4 U2 V8 V9 W3 W4 W5 Y3 Y6 Z1 Z3
xstp 112 A9 B1 B4 B5 B6 B7 D6 E6 G1 G2 G3 I1 I4 J1 K1
xstp 113 O5 O6
xstp 209 P7 X2
xstp 212 F4 J5
xstp 306 G1
xstp 308 C3 C4 C5 E2
xstp 310 D9 E3 E4 F2 F9 G8
xstp 311 P4 T5 T9 W2 W6 Y4
xstp 312 E5 F2 G5 J4 K5 K7 K8 K9 M8
xstp 313 N6 N7

xx_t 101 A8 D9
xx_t 301 E3

See results in /QADisk/occttests/results/KAS/dev/mkv-22642-products_10022012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120210-opt_10022012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification [^]
2012-08-28 17:50   
Added one more case with the same problem.
2017-10-11 13:24   
Problem described in issue is reproduced on current state of OCCT.