View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026901 | Community | OCCT:Modeling Algorithms | public | 2015-11-19 15:12 | 2023-08-01 15:08 |
Reporter | Istvan Csanady | Assigned To | |||
Priority | normal | Severity | minor | ||
Status | assigned | Resolution | open | ||
Target Version | Unscheduled | ||||
Summary | 0026901: BRepFeat_SplitShape generates invalid result | ||||
Description | If 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 Reproduce | circle 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 | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
Screen Shot 2015-11-19 at 1.11.02 PM.png (119,026 bytes) |
|
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. |
|
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. |
|
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. |
2015-11-20 10:00 developer |
wrong_splitshape.PNG (39,320 bytes) |
|
I could reproduce the bug. The draw script in the steps to reproduce field. The attached snapshot shows the result. |
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 |
|
Note Added: 0048392 | |
2015-11-19 18:59 |
|
Assigned To | msv => Istvan Csanady |
2015-11-19 18:59 |
|
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 |
|
Steps to Reproduce Updated | |
2015-11-20 10:00 |
|
File Added: wrong_splitshape.PNG | |
2015-11-20 10:02 |
|
Note Added: 0048400 | |
2015-11-20 10:02 |
|
Assigned To | Istvan Csanady => jgv |
2015-11-20 10:02 |
|
Status | feedback => assigned |
2015-11-20 10:02 |
|
Target Version | 7.0.0 => 7.1.0 |
2015-11-20 10:03 |
|
Steps to Reproduce Updated | |
2016-10-28 15:33 |
|
Target Version | 7.1.0 => 7.2.0 |
2017-07-21 11:34 |
|
Target Version | 7.2.0 => 7.3.0 |
2017-12-05 17:09 |
|
Target Version | 7.3.0 => 7.4.0 |
2019-08-12 16:44 |
|
Target Version | 7.4.0 => 7.5.0 |
2020-09-14 22:55 |
|
Target Version | 7.5.0 => 7.6.0 |
2021-08-29 18:52 |
|
Target Version | 7.6.0 => 7.7.0 |
2022-10-24 10:42 |
|
Target Version | 7.7.0 => 7.8.0 |
2023-08-01 15:08 | dpasukhi | Target Version | 7.8.0 => Unscheduled |