diff --git a/src/IntTools/IntTools_EdgeEdge.cxx b/src/IntTools/IntTools_EdgeEdge.cxx index cdb1a769a6..3121648169 100644 --- a/src/IntTools/IntTools_EdgeEdge.cxx +++ b/src/IntTools/IntTools_EdgeEdge.cxx @@ -1371,18 +1371,17 @@ Standard_Real ResolutionCoeff(const BRepAdaptor_Curve& theBAC, case GeomAbs_OffsetCurve : { const Handle(Geom_OffsetCurve)& anOffsetCurve = Handle(Geom_OffsetCurve)::DownCast(aCurve); const Handle(Geom_Curve)& aBasisCurve = anOffsetCurve->BasisCurve(); - const GeomAbs_CurveType aBCType = GeomAdaptor_Curve(aBasisCurve).GetType(); + GeomAdaptor_Curve aGBasisCurve(aBasisCurve); + const GeomAbs_CurveType aBCType = aGBasisCurve.GetType(); if (aBCType == GeomAbs_Line) { break; } else if (aBCType == GeomAbs_Circle) { - aResCoeff = 1. / (2 * (anOffsetCurve->Offset() + - Handle(Geom_Circle)::DownCast (aBasisCurve)->Circ().Radius())); + aResCoeff = 1. / (2 * (anOffsetCurve->Offset() + aGBasisCurve.Circle().Radius())); break; } else if (aBCType == GeomAbs_Ellipse) { - aResCoeff = 1. / (anOffsetCurve->Offset() + - Handle(Geom_Ellipse)::DownCast (aBasisCurve)->MajorRadius()); + aResCoeff = 1. / (anOffsetCurve->Offset() + aGBasisCurve.Ellipse().MajorRadius()); break; } } diff --git a/tests/bugs/modalg_7/bug28982 b/tests/bugs/modalg_7/bug28982 new file mode 100644 index 0000000000..cd4c013093 --- /dev/null +++ b/tests/bugs/modalg_7/bug28982 @@ -0,0 +1,18 @@ +puts "========" +puts "OCC28982" +puts "========" +puts "" +######################################## +# 2D offset creates faulty result from wire +######################################## + +restore [locate_data_file bug28982_ellipse.brep] e +mkoffset result e 1 1 + +checkshape result_1 +if {![regexp "This shape seems to be OK" [bopcheck result_1]]} { + puts "Error: The resulting wire is self-interfered" +} +checkprops result_1 -l 305.299 + +checkview -display result_1 -2d -path ${imagedir}/${test_image}.png \ No newline at end of file