View Issue Details

IDProjectCategoryView StatusLast Update
0023881CommunityOCCT:Modeling Algorithmspublic2013-04-29 15:24
ReporterHayashi Assigned Toemv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2010 
Target Version6.6.0Fixed in Version6.6.0 
Summary0023881: BRepAlgoAPI_Section HasAncestorFaceOn1 returned False on the boundary(6.6.0 beta)
DescriptionPost 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 ";
    }
}
Additional information
and documentation updates
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.

 
TagsNo tags attached.
Test case numberbugs modalg_5 bug23881

Attached Files

  • bug23881 (628 bytes)
  • test.cpp (6,342 bytes)

Activities

abv

2013-04-05 17:03

manager   ~0024020

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).

abv

2013-04-05 17:03

manager  

bug23881 (628 bytes)

Hayashi

2013-04-09 09:27

reporter  

test.cpp (6,342 bytes)

Hayashi

2013-04-09 09:28

reporter   ~0024033

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].

emv

2013-04-09 13:01

developer   ~0024039

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.

emv

2013-04-09 13:34

developer   ~0024042

Git branch CR23881 contains fix for the problem.
Please review.

abv

2013-04-09 15:56

manager   ~0024053

Last edited: 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.

ifv

2013-04-09 17:17

developer   ~0024056

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)

emv

2013-04-10 10:25

developer   ~0024065

I have removed PCurveOn1(),PCurveOn2() methods.
Please review.
http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commit;h=6840f0808fac74ba305bd411d8034809d3f52c45

abv

2013-04-11 18:22

manager   ~0024095

No remarks; I have also removed the methods PCurveOn1,2() in BRepAlgo_Section class. Please test

abv

2013-04-11 18:27

manager   ~0024096

Just to be sure: will HasAncestorFaceOn2() return true in the reported case? I suppose it should

Hayashi

2013-04-12 04:35

reporter   ~0024102

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.

apn

2013-04-15 16:06

administrator   ~0024139

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.

Related Changesets

occt: master 7a9d451a

2013-04-15 14:19:01

emv

Details Diff
0023881: BRepAlgoAPI_Section HasAncestorFaceOn1 returned False on the boundary(6.6.0 beta).
The methods HasAncestorFaceOn1() and HasAncestorFaceOn1() return true only in the case when their first argument is the new edge built from intersection curve and not an existing common edge.
PCurveOn1() and PCurveOn2() have been removed.
Methods PCurveOn1() and PCurveOn2() removed from BRepAlgo_Section class.
Added test case bugs/modalg_5/bug23881
Affected Issues
0023881
mod - src/BRepAlgo/BRepAlgo_Section.cdl Diff File
mod - src/BRepAlgo/BRepAlgo_Section.cxx Diff File
mod - src/BRepAlgoAPI/BRepAlgoAPI_Section.cdl Diff File
mod - src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx Diff File
add - tests/bugs/modalg_5/bug23881 Diff File

Issue History

Date Modified Username Field Change
2013-04-05 15:55 Hayashi New Issue
2013-04-05 15:55 Hayashi Assigned To => jgv
2013-04-05 17:03 abv Note Added: 0024020
2013-04-05 17:03 abv Assigned To jgv => emv
2013-04-05 17:03 abv Status new => assigned
2013-04-05 17:03 abv File Added: bug23881
2013-04-05 17:07 abv Status assigned => feedback
2013-04-09 09:27 Hayashi File Added: test.cpp
2013-04-09 09:28 Hayashi Note Added: 0024033
2013-04-09 13:01 emv Note Added: 0024039
2013-04-09 13:34 emv Note Added: 0024042
2013-04-09 13:34 emv Assigned To emv => abv
2013-04-09 13:34 emv Status feedback => resolved
2013-04-09 13:34 emv Additional Information Updated
2013-04-09 15:32 abv Assigned To abv => ifv
2013-04-09 15:56 abv Note Added: 0024053
2013-04-09 15:58 abv Note Edited: 0024053
2013-04-09 17:17 ifv Note Added: 0024056
2013-04-09 17:17 ifv Assigned To ifv => emv
2013-04-09 17:17 ifv Status resolved => reviewed
2013-04-10 10:23 emv Status reviewed => assigned
2013-04-10 10:25 emv Note Added: 0024065
2013-04-10 10:25 emv Assigned To emv => abv
2013-04-10 10:25 emv Status assigned => resolved
2013-04-10 10:25 emv Additional Information Updated
2013-04-11 18:22 abv Note Added: 0024095
2013-04-11 18:22 abv Assigned To abv => bugmaster
2013-04-11 18:22 abv Status resolved => reviewed
2013-04-11 18:25 abv Additional Information Updated
2013-04-11 18:27 abv Note Added: 0024096
2013-04-12 04:35 Hayashi Note Added: 0024102
2013-04-12 15:43 apn Assigned To bugmaster => apn
2013-04-15 15:10 apn Test case number => bugs modalg_5 bug23881
2013-04-15 16:06 apn Note Added: 0024139
2013-04-15 16:07 apn Assigned To apn => bugmaster
2013-04-15 16:07 apn Status reviewed => tested
2013-04-15 18:01 bugmaster Target Version => 6.6.0
2013-04-16 15:16 emv Changeset attached => occt master 7a9d451a
2013-04-16 15:16 emv Assigned To bugmaster => emv
2013-04-16 15:16 emv Status tested => verified
2013-04-16 15:16 emv Resolution open => fixed
2013-04-23 13:35 aiv Status verified => closed
2013-04-29 15:24 aiv Fixed in Version => 6.6.0