View Issue Details

IDProjectCategoryView StatusLast Update
0026901CommunityOCCT:Modeling Algorithmspublic2023-08-01 15:08
ReporterIstvan Csanady Assigned Tojgv 
PrioritynormalSeverityminor 
Status assignedResolutionopen 
Target VersionUnscheduled 
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 Files

  • Screen Shot 2015-11-19 at 1.11.02 PM.png (119,026 bytes)
  • wrong_splitshape.PNG (39,320 bytes)

Activities

Istvan Csanady

2015-11-19 15:12

developer  

Screen Shot 2015-11-19 at 1.11.02 PM.png (119,026 bytes)

msv

2015-11-19 18:59

developer   ~0048392

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.

Istvan Csanady

2015-11-19 19:01

developer   ~0048393

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.

Istvan Csanady

2015-11-19 19:24

developer   ~0048395

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.

msv

2015-11-20 10:00

developer  

wrong_splitshape.PNG (39,320 bytes)

msv

2015-11-20 10:02

developer   ~0048400

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
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
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
2019-08-12 16:44 msv Target Version 7.4.0 => 7.5.0
2020-09-14 22:55 msv Target Version 7.5.0 => 7.6.0
2021-08-29 18:52 msv Target Version 7.6.0 => 7.7.0
2022-10-24 10:42 szy Target Version 7.7.0 => 7.8.0
2023-08-01 15:08 dpasukhi Target Version 7.8.0 => Unscheduled