1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-01 17:36:21 +03:00

0033156: Modeling Algorithms - Planar face creation problem

Implemented suggested patch to avoid unnecessary replacement of a wire.
Added the second test case.
This commit is contained in:
astromko 2024-05-17 08:55:20 +00:00 committed by dpasukhi
parent 1db93f640e
commit 8991082051
3 changed files with 39 additions and 14 deletions

View File

@ -273,18 +273,32 @@ BRepLib_MakeFace::BRepLib_MakeFace(const TopoDS_Wire& W,
aB.MakeWire (aW);
TopoDS_Wire aWForw = W;
Standard_Boolean hasDegenerated = Standard_False;
aWForw.Orientation (TopAbs_FORWARD);
TopoDS_Iterator anIter (aWForw);
for (; anIter.More(); anIter.Next())
{
const TopoDS_Edge& aE = TopoDS::Edge (anIter.Value());
if (!BRep_Tool::Degenerated (aE))
aB.Add (aW, aE);
if (BRep_Tool::Degenerated(aE))
{
hasDegenerated = Standard_True;
}
else
{
aB.Add(aW, aE);
}
}
aW.Orientation (W.Orientation()); // return to original orient
aW.Closed (W.Closed());
if (hasDegenerated)
{
aW.Orientation (W.Orientation()); // return to original orient
aW.Closed (W.Closed());
}
else
{
aW = W;
}
}
else
{

View File

@ -0,0 +1,21 @@
puts "============="
puts "0033156: Modeling Algorithms - Planar face creation problem"
puts "============="
pload MODELING
vertex v1 0 0 0
vertex v2 10 0 0
vertex v3 0 10 0
edge e1 v1 v2
edge e2 v2 v3
edge e3 v3 v1
wire w1 e1 e2 e3
mkplane f1 w1 1
set state [issubshape w1 f1]
if { [regexp "w1 is NOT sub-shape of f1" $state] == 1 } {
puts "Error : w1 is NOT sub-shape of f1"
}

View File

@ -1,10 +0,0 @@
puts "============="
puts "0033156: Modeling Algorithms - Planar face creation problem"
puts "============="
brestore [locate_data_file bug33156_face.brep] Face
explode Face W
#Face_1
mkplane result Face_1 1