mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0033759: Modeling Algorithms - Offset is in wrong direction
Changed the condition to avoid reversing offset for reversed edges. Added a test case.
This commit is contained in:
parent
ed20837d8b
commit
32c19c4cd4
@ -264,12 +264,12 @@ static Standard_Boolean KPartCircle
|
|||||||
}
|
}
|
||||||
else if (AHC->GetType() == GeomAbs_Circle)
|
else if (AHC->GetType() == GeomAbs_Circle)
|
||||||
{
|
{
|
||||||
if (E.Orientation() == TopAbs_FORWARD)
|
// Reverse the offset function when the edge is FORWARD and CLOSED
|
||||||
anOffset *= -1;
|
if (E.Orientation() == TopAbs_FORWARD && BRep_Tool::IsClosed(E))
|
||||||
if (!BRep_Tool::IsClosed(E))
|
|
||||||
{
|
{
|
||||||
anOffset *= -1;
|
anOffset *= -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
gp_Circ2d theCirc = AHC->Circle();
|
gp_Circ2d theCirc = AHC->Circle();
|
||||||
if (anOffset > 0. || Abs(anOffset) < theCirc.Radius())
|
if (anOffset > 0. || Abs(anOffset) < theCirc.Radius())
|
||||||
OC = new Geom2d_Circle (theCirc.Position(), theCirc.Radius() + anOffset);
|
OC = new Geom2d_Circle (theCirc.Position(), theCirc.Radius() + anOffset);
|
||||||
|
@ -23,7 +23,7 @@ vori result
|
|||||||
|
|
||||||
fit
|
fit
|
||||||
|
|
||||||
checkprops result -l 613.39
|
checkprops result -l 644.509
|
||||||
checkshape result
|
checkshape result
|
||||||
checksection result
|
checksection result
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ vori result
|
|||||||
|
|
||||||
fit
|
fit
|
||||||
|
|
||||||
checkprops result -l 354.958
|
checkprops result -l 386.077
|
||||||
checkshape result
|
checkshape result
|
||||||
checksection result
|
checksection result
|
||||||
|
|
||||||
|
39
tests/bugs/modalg_8/bug33759
Normal file
39
tests/bugs/modalg_8/bug33759
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
puts "==========================================================="
|
||||||
|
puts "0033759: Modeling Algorithms - Offset is in wrong direction"
|
||||||
|
puts "==========================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload MODELING
|
||||||
|
circle c1 0 0 0 30
|
||||||
|
|
||||||
|
# make and check FORWARD, NOT CLOSED edge
|
||||||
|
mkedge e1 c1 1.5*pi 0
|
||||||
|
wire w1 e1
|
||||||
|
plane pln1 0 0 0 0 0 1 1 0 0
|
||||||
|
mkface f1 pln1 w1
|
||||||
|
openoffset of1 f1 1 7
|
||||||
|
checkprops of1_1 -l 58.1195
|
||||||
|
|
||||||
|
# make and check REVERSED, NOT CLOSED edge
|
||||||
|
complement e1
|
||||||
|
wire w1 e1
|
||||||
|
plane pln1 0 0 0 0 0 1 1 0 0
|
||||||
|
mkface f1 pln1 w1
|
||||||
|
openoffset of1 f1 1 7
|
||||||
|
checkprops of1_1 -l 58.1195
|
||||||
|
|
||||||
|
# make and check FORWARD CLOSED edge
|
||||||
|
mkedge e1 c1 0 0
|
||||||
|
wire w1 e1
|
||||||
|
plane pln1 0 0 0 0 0 1 1 0 0
|
||||||
|
mkface f1 pln1 w1
|
||||||
|
openoffset of1 f1 1 7
|
||||||
|
checkprops of1_1 -l 232.478
|
||||||
|
|
||||||
|
# make and check REVERSED CLOSED edge
|
||||||
|
complement e1
|
||||||
|
wire w1 e1
|
||||||
|
plane pln1 0 0 0 0 0 1 1 0 0
|
||||||
|
mkface f1 pln1 w1
|
||||||
|
openoffset of1 f1 1 7
|
||||||
|
checkprops of1_1 -l 232.478
|
Loading…
x
Reference in New Issue
Block a user