mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0025858: Incorrect result of open offset on single edge based on BSpline curve
Test cases for issue CR25858
This commit is contained in:
parent
9bf3177ff6
commit
ef237d732d
@ -233,7 +233,6 @@ static Standard_Boolean KPartCircle
|
|||||||
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap,
|
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap,
|
||||||
Standard_Boolean& myIsDone)
|
Standard_Boolean& myIsDone)
|
||||||
{
|
{
|
||||||
// The only contour which is a closed circle
|
|
||||||
TopExp_Explorer exp(mySpine,TopAbs_EDGE);
|
TopExp_Explorer exp(mySpine,TopAbs_EDGE);
|
||||||
Standard_Integer NbEdges = 0;
|
Standard_Integer NbEdges = 0;
|
||||||
TopoDS_Edge E;
|
TopoDS_Edge E;
|
||||||
@ -263,13 +262,15 @@ static Standard_Boolean KPartCircle
|
|||||||
Handle(Geom2d_Curve) OC;
|
Handle(Geom2d_Curve) OC;
|
||||||
if (AHC->GetType() == GeomAbs_Line)
|
if (AHC->GetType() == GeomAbs_Line)
|
||||||
{
|
{
|
||||||
if (E.Orientation() == TopAbs_REVERSED) anOffset *= -1;
|
if (E.Orientation() == TopAbs_REVERSED)
|
||||||
|
anOffset *= -1;
|
||||||
Adaptor3d_OffsetCurve Off(AHC,anOffset);
|
Adaptor3d_OffsetCurve Off(AHC,anOffset);
|
||||||
OC = new Geom2d_Line(Off.Line());
|
OC = new Geom2d_Line(Off.Line());
|
||||||
}
|
}
|
||||||
else if (AHC->GetType() == GeomAbs_Circle)
|
else if (AHC->GetType() == GeomAbs_Circle)
|
||||||
{
|
{
|
||||||
if (E.Orientation() == TopAbs_FORWARD) anOffset *= -1;
|
if (E.Orientation() == TopAbs_FORWARD)
|
||||||
|
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);
|
||||||
@ -281,7 +282,8 @@ static Standard_Boolean KPartCircle
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (E.Orientation() == TopAbs_REVERSED) anOffset *= -1;
|
if (E.Orientation() == TopAbs_FORWARD)
|
||||||
|
anOffset *= -1;
|
||||||
Handle(Geom2d_TrimmedCurve) G2dT = new Geom2d_TrimmedCurve(aPCurve, f, l);
|
Handle(Geom2d_TrimmedCurve) G2dT = new Geom2d_TrimmedCurve(aPCurve, f, l);
|
||||||
OC = new Geom2d_OffsetCurve( G2dT, anOffset);
|
OC = new Geom2d_OffsetCurve( G2dT, anOffset);
|
||||||
}
|
}
|
||||||
|
37
tests/bugs/modalg_5/bug25858_1
Normal file
37
tests/bugs/modalg_5/bug25858_1
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC25858"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# Incorrect result of open offset on single edge based on BSpline curve
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug25858_hf2d.brep] ff
|
||||||
|
|
||||||
|
explode ff
|
||||||
|
|
||||||
|
smallview
|
||||||
|
donly ff_1
|
||||||
|
fit
|
||||||
|
display ff
|
||||||
|
|
||||||
|
openoffset res ff 1 0.1
|
||||||
|
renamevar res_1 result
|
||||||
|
|
||||||
|
set length 0.879164
|
||||||
|
|
||||||
|
set nbshapes_expected "
|
||||||
|
Number of shapes in shape
|
||||||
|
VERTEX : 2
|
||||||
|
EDGE : 1
|
||||||
|
WIRE : 1
|
||||||
|
FACE : 0
|
||||||
|
SHELL : 0
|
||||||
|
SOLID : 0
|
||||||
|
COMPSOLID : 0
|
||||||
|
COMPOUND : 0
|
||||||
|
SHAPE : 4
|
||||||
|
"
|
||||||
|
checknbshapes result ${nbshapes_expected} 1 "Result of open offset on single edge based on BSpline curve"
|
||||||
|
|
||||||
|
set only_screen_axo 1
|
38
tests/bugs/modalg_5/bug25858_2
Normal file
38
tests/bugs/modalg_5/bug25858_2
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC25858"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# Incorrect result of open offset on single edge based on BSpline curve
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug25858_hf2d.brep] ff
|
||||||
|
|
||||||
|
invert ff
|
||||||
|
explode ff
|
||||||
|
|
||||||
|
smallview
|
||||||
|
donly ff_1
|
||||||
|
fit
|
||||||
|
display ff
|
||||||
|
|
||||||
|
openoffset res ff 1 0.1
|
||||||
|
renamevar res_1 result
|
||||||
|
|
||||||
|
set length 0.879164
|
||||||
|
|
||||||
|
set nbshapes_expected "
|
||||||
|
Number of shapes in shape
|
||||||
|
VERTEX : 2
|
||||||
|
EDGE : 1
|
||||||
|
WIRE : 1
|
||||||
|
FACE : 0
|
||||||
|
SHELL : 0
|
||||||
|
SOLID : 0
|
||||||
|
COMPSOLID : 0
|
||||||
|
COMPOUND : 0
|
||||||
|
SHAPE : 4
|
||||||
|
"
|
||||||
|
checknbshapes result ${nbshapes_expected} 1 "Result of open offset on single edge based on BSpline curve"
|
||||||
|
|
||||||
|
set only_screen_axo 1
|
Loading…
x
Reference in New Issue
Block a user