MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0026901Community[OCCT] OCCT:Modeling Algorithmspublic2015-11-19 15:122017-12-05 17:09
ReporterIstvan Csanady 
Assigned Tojgv 
PrioritynormalSeverityminor 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0026901: BRepFeat_SplitShape generates invalid result
DescriptionIf I try to split a shell with an edge, where the start and the end of the edge is on the same inner wire, the resulting shape will have invalid topology.

See the attached image. The invalid edge is the yellow.

Sample code:

auto boundary = BRepBuilderAPI_MakeEdge(gp_Circ(gp_Ax2(gp_Pnt(), gp_Dir(0.0, 0.0, 1.0)), 5.0));
    auto face = BRepBuilderAPI_MakeFace(BRepBuilderAPI_MakeWire(boundary));
    BRepFeat_SplitShape split(face);
    auto inner = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(gp_Pnt(0.0, 0.0, 0.0), gp_Pnt(1.0, 0.0, 0.0)),
                                         BRepBuilderAPI_MakeEdge(gp_Pnt(1.0, 0.0, 0.0), gp_Pnt(1.0, 1.0, 0.0)),
                                         BRepBuilderAPI_MakeEdge(gp_Pnt(1.0, 1.0, 0.0), gp_Pnt(0.8, 0.2, 0.0)),
                                         BRepBuilderAPI_MakeEdge(gp_Pnt(0.8, 0.2, 0.0), gp_Pnt(0.0, 0.0, 0.0)));
    split.Add(inner, face);
    split.Build();
    auto newFace = split.Shape();
    
    BRepFeat_SplitShape split2(newFace);
    auto edge = BRepBuilderAPI_MakeEdge(gp_Pnt(0.0, 0.0, 0.0), gp_Pnt(1.0, 1.0, 0.0)).Edge();
    for (TopExp_Explorer exp(newFace, TopAbs_FACE); exp.More(); exp.Next())
    {
        split2.Add(edge, TopoDS::Face(exp.Current()));
        break;
    }
    
    auto shape = split2.Shape(); //The inner face is invalid, has an extra edge
Steps To Reproducecircle c 0 0 0 0 0 1 5
mkedge e c
wire w e
mkplane f w
polyline w 0 0 0 1 0 0 1 1 0 0.8 0.2 0 0 0 0
splitshape r f f w

polyline w2 0 0 0 1 1 0
explode w2
subshape r f 1
splitshape result r r_1 w2_1
don result
checkshape result
TagsNo tags attached.
Test case number
Attached Filespng file icon Screen Shot 2015-11-19 at 1.11.02 PM.png (119,026 bytes) 2015-11-19 15:12
png file icon wrong_splitshape.PNG (39,320 bytes) 2015-11-20 10:00

- Relationships

-  Notes
(0048392)
msv (developer)
2015-11-19 18:59

The algorithm BRepFeat_SplitShape requires on input that a splitting edge is located inside a face. In your case the splitting edge is outside a face. This case is incorrect for the algorithm and you should not expect a valid result from it.
(0048393)
Istvan Csanady (developer)
2015-11-19 19:01

Then the sample code is wrong, I meant to add the edge to the other face. It is generating wrong result in that case as well. Let me fix that.
(0048395)
Istvan Csanady (developer)
2015-11-19 19:24

On my machine, the first face is the bigger face (the circular face with a hole), but if on your machine the order is different, just skip the first face in the for loop.
(0048400)
msv (developer)
2015-11-20 10:02

I could reproduce the bug. The draw script in the steps to reproduce field. The attached snapshot shows the result.

- Issue History
Date Modified Username Field Change
2015-11-19 15:12 Istvan Csanady New Issue
2015-11-19 15:12 Istvan Csanady Assigned To => msv
2015-11-19 15:12 Istvan Csanady File Added: Screen Shot 2015-11-19 at 1.11.02 PM.png
2015-11-19 18:59 msv Note Added: 0048392
2015-11-19 18:59 msv Assigned To msv => Istvan Csanady
2015-11-19 18:59 msv Status new => feedback
2015-11-19 19:01 Istvan Csanady Note Added: 0048393
2015-11-19 19:24 Istvan Csanady Note Added: 0048395
2015-11-20 09:59 msv Steps to Reproduce Updated View Revisions
2015-11-20 10:00 msv File Added: wrong_splitshape.PNG
2015-11-20 10:02 msv Note Added: 0048400
2015-11-20 10:02 msv Assigned To Istvan Csanady => jgv
2015-11-20 10:02 msv Status feedback => assigned
2015-11-20 10:02 msv Target Version 7.0.0 => 7.1.0
2015-11-20 10:03 msv Steps to Reproduce Updated View Revisions
2016-10-28 15:33 msv Target Version 7.1.0 => 7.2.0
2017-07-21 11:34 msv Target Version 7.2.0 => 7.3.0
2017-12-05 17:09 msv Target Version 7.3.0 => 7.4.0*


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker