MantisBT - Community
View Issue Details
0023881Community[OCCT] OCCT:Modeling Algorithmspublic2013-04-05 15:552013-04-29 15:24
Hayashi 
emv 
normalminor 
closedfixed 
WindowsVC++ 201032 bit
 
[OCCT] 6.6.0[OCCT] 6.6.0 
bugs modalg_5 bug23881
0023881: BRepAlgoAPI_Section HasAncestorFaceOn1 returned False on the boundary(6.6.0 beta)
Post from the Forum - http://www.opencascade.org/org/forum/thread_24614/?forum=6 [^]

6.6.0 beta returned False.
6.5.x returned True.

void test1()
{
    TopoDS_Wire w1 = BRepBuilderAPI_MakePolygon(gp_Pnt(0,0,0),gp_Pnt(1,0,0),gp_Pnt(1,1,0),gp_Pnt(0,1,0), 1);
    TopoDS_Wire w2 = BRepBuilderAPI_MakePolygon(gp_Pnt(0,1,0),gp_Pnt(1,1,0),gp_Pnt(1,2,0),gp_Pnt(0,2,0), 1);
    TopoDS_Face f1 = BRepBuilderAPI_MakeFace(w1,1);
    TopoDS_Face f2 = BRepBuilderAPI_MakeFace(w2,1);
    BRepBuilderAPI_Sewing sew(0.0001);
    sew.Add(f1);
    sew.Add(f2);
    sew.Perform();
    TopoDS_Shape s1 = sew.SewedShape();

    gp_Pln pl(gp_Pnt(0,1,0), gp_Dir(0,1,0));
    TopoDS_Face f3 = BRepBuilderAPI_MakeFace(pl);

    BRepAlgoAPI_Section sec(s1, f3, 0);
    sec.ComputePCurveOn1(1);
    sec.Approximation(1);
    sec.Build();
    TopExp_Explorer exp;
    exp.Init(sec.Shape(), TopAbs_EDGE);
    for (exp; exp.More(); exp.Next()){
        TopoDS_Shape edge = exp.Current();
        TopoDS_Shape face;
        if (sec.HasAncestorFaceOn1(edge, face))
            std::cout << "True ";
        else
            std::cout << "False ";
    }
}
Changes:

In classes BRepAlgo_Section and BRepAlgoAPI_Section methods HasAncestorFace* now return true only if <E> is a new edge built on intersection curve of the face.
Methods PCurveOn1() and PCurveOn2() have been removed; the pcurve can be obtained from the ancestor face by methods of BRep_Tool class.

 
No tags attached.
? bug23881 (628) 2013-04-05 17:03
https://tracker.dev.opencascade.org/
cpp test.cpp (6,342) 2013-04-09 09:27
https://tracker.dev.opencascade.org/
Issue History
2013-04-05 15:55HayashiNew Issue
2013-04-05 15:55HayashiAssigned To => jgv
2013-04-05 17:03abvNote Added: 0024020
2013-04-05 17:03abvAssigned Tojgv => emv
2013-04-05 17:03abvStatusnew => assigned
2013-04-05 17:03abvFile Added: bug23881
2013-04-05 17:07abvStatusassigned => feedback
2013-04-09 09:27HayashiFile Added: test.cpp
2013-04-09 09:28HayashiNote Added: 0024033
2013-04-09 13:01emvNote Added: 0024039
2013-04-09 13:34emvNote Added: 0024042
2013-04-09 13:34emvAssigned Toemv => abv
2013-04-09 13:34emvStatusfeedback => resolved
2013-04-09 13:34emvAdditional Information Updatedbug_revision_view_page.php?rev_id=5292#r5292
2013-04-09 15:32abvAssigned Toabv => ifv
2013-04-09 15:56abvNote Added: 0024053
2013-04-09 15:58abvNote Edited: 0024053bug_revision_view_page.php?bugnote_id=24053#r5295
2013-04-09 17:17ifvNote Added: 0024056
2013-04-09 17:17ifvAssigned Toifv => emv
2013-04-09 17:17ifvStatusresolved => reviewed
2013-04-10 10:23emvStatusreviewed => assigned
2013-04-10 10:25emvNote Added: 0024065
2013-04-10 10:25emvAssigned Toemv => abv
2013-04-10 10:25emvStatusassigned => resolved
2013-04-10 10:25emvAdditional Information Updatedbug_revision_view_page.php?rev_id=5306#r5306
2013-04-11 18:22abvNote Added: 0024095
2013-04-11 18:22abvAssigned Toabv => bugmaster
2013-04-11 18:22abvStatusresolved => reviewed
2013-04-11 18:25abvAdditional Information Updatedbug_revision_view_page.php?rev_id=5314#r5314
2013-04-11 18:27abvNote Added: 0024096
2013-04-12 04:35HayashiNote Added: 0024102
2013-04-12 15:43apnAssigned Tobugmaster => apn
2013-04-15 15:10apnTest case number => bugs modalg_5 bug23881
2013-04-15 16:06apnNote Added: 0024139
2013-04-15 16:07apnAssigned Toapn => bugmaster
2013-04-15 16:07apnStatusreviewed => tested
2013-04-15 18:01bugmasterTarget Version => 6.6.0
2013-04-16 15:16emvChangeset attached => occt master 7a9d451a
2013-04-16 15:16emvAssigned Tobugmaster => emv
2013-04-16 15:16emvStatustested => verified
2013-04-16 15:16emvResolutionopen => fixed
2013-04-23 13:35aivStatusverified => closed
2013-04-29 15:24aivFixed in Version => 6.6.0

Notes
(0024020)
abv   
2013-04-05 17:03   
I believe the current behavior is consistent with documentation of the method HasAncestorFaceOn1(); it says that it returns False if its first argument is common edge (i.e. not intersection curve). In the described case the secant plane goes exactly through the common edge of the two faces of s1, and this edge is returned as result of the section.

Eugene, please comment on this (check in the code please; I have checked in DRAW and it seems the same in OCCCT 6.5.x and 6.6.0, see attached test script).
(0024033)
Hayashi   
2013-04-09 09:28   
Also in other patterns, the result differed in 6.6.0 beta and a previous version.
Please check attached test.cpp.
If behavior of 6.6.0 beta is specification, I think that I have to return False all patterns in test1() [test.cpp].
(0024039)
emv   
2013-04-09 13:01   
The methods HasAncestorFaceOn1() and HasAncestorFaceOn2() should return true only in the case when the first argument is the new edge built from intersection curve and not an existing common edge.
So it is the correct behavior of the method HasAncestorFaceOn1() for the described case.
But for the shapes f1 and f2
polyline w1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 0
polyline w2 0 0 0 1 0 0 1 0 1 0 0 1 0 0 0
mkplane f1 w1
mkplane f2 w2
it returns true and should be fixed.
(0024042)
emv   
2013-04-09 13:34   
Git branch CR23881 contains fix for the problem.
Please review.
(0024053)
abv   
2013-04-09 15:56   
(edited on: 2013-04-09 15:58)
I have no remarks on the proposed change; in addition I believe that methods BRepAlgo_Section::PCurveOn1() and BRepAlgoAPI_Section::PCurveOn1() should be removed since the curve they return has meaning only in context of the face, but the face is not returned. If you have face obtained by call to HasAncestorFace...(), you can easily get pcurve from it without any speciel methods in *Section classes.

Please give your opinion.

P.S. Methods PCurveOn1() seem to be not used anywhere (at least in OCCT code), thus removal should be painless.

(0024056)
ifv   
2013-04-09 17:17   
I agree with proposed by emv change and with proposal of abv to remove rather useless methods PCurveOn1(2)(), which is only envelop for
 BRep_Tool::CurveOnSurface(anEdge, aFace, f, l)
(0024065)
emv   
2013-04-10 10:25   
I have removed PCurveOn1(),PCurveOn2() methods.
Please review.
http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commit;h=6840f0808fac74ba305bd411d8034809d3f52c45 [^]
(0024095)
abv   
2013-04-11 18:22   
No remarks; I have also removed the methods PCurveOn1,2() in BRepAlgo_Section class. Please test
(0024096)
abv   
2013-04-11 18:27   
Just to be sure: will HasAncestorFaceOn2() return true in the reported case? I suppose it should
(0024102)
Hayashi   
2013-04-12 04:35   
I understood that HasAncestorFaceOn1 return false when curve(BRep_Tool::Curve()) of section edge and one of edges of first or second argument of BRepAlgoAPI_Section is equal.
(return true when section edge built from new intersection curve)

BRepAlgoAPI_BooleanOperation SectionEdges() also differs from a previous version.
(0024139)
apn   
2013-04-15 16:06   
Dear BugMaster,

Branch CR23881 (and products from GIT master) was compiled on Linux and Windows platforms and tested without rebase.
SHA-1: 37f276ac0bff60f048c3d693c24ed120f8387746

Number of compiler warnings:

occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)

products component :
Linux: 0 (0 on master)
Windows: 50 (50 on master)

Regressions:
No regressions

Improvements:
No improvements

Testing cases:
bugs modalg_5 bug23881 - OK

Testing on Linux:
Total MEMORY difference: 244104448 / 244820060
Total CPU difference: 13863.009999999735 / 19944.459999999734

Testing on Windows:
Total MEMORY difference: 354121656 / 355780572
Total CPU difference: 17640.234375 / 20811.84375

There are not serious differences in images found by testdiff.