mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0033407: Shape Healing - Exception on fixshape call
Added proper processing of singularities for a surface of revolution on a line.
This commit is contained in:
parent
166845748b
commit
a6120daa43
@ -32,11 +32,13 @@
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BndLib_Add3dCurve.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <Extrema_ExtElC.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_BoundedSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_OffsetSurface.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
@ -218,8 +220,35 @@ void ShapeAnalysis_Surface::ComputeSingularities()
|
||||
}
|
||||
else if ((mySurf->IsKind(STANDARD_TYPE(Geom_BoundedSurface))) ||
|
||||
(mySurf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) || //:b2 abv 18 Feb 98
|
||||
(mySurf->IsKind(STANDARD_TYPE(Geom_OffsetSurface)))) { //rln S4135
|
||||
|
||||
(mySurf->IsKind(STANDARD_TYPE(Geom_OffsetSurface))))
|
||||
{
|
||||
Handle(Geom_SurfaceOfRevolution) aSoR = Handle(Geom_SurfaceOfRevolution)::DownCast(mySurf);
|
||||
if (mySurf->IsKind(STANDARD_TYPE(Geom_OffsetSurface)))
|
||||
{
|
||||
aSoR = Handle(Geom_SurfaceOfRevolution)::DownCast((Handle(Geom_OffsetSurface)::DownCast(mySurf))->BasisSurface());
|
||||
}
|
||||
if (!aSoR.IsNull() &&
|
||||
aSoR->BasisCurve()->IsKind(STANDARD_TYPE(Geom_Line)))
|
||||
{
|
||||
const gp_Lin aLine(aSoR->Axis());
|
||||
Extrema_ExtElC anExtrema(aLine, (Handle(Geom_Line)::DownCast(aSoR->BasisCurve()))->Lin(), Precision::Angular());
|
||||
if (anExtrema.IsDone() &&
|
||||
anExtrema.NbExt() == 1)
|
||||
{
|
||||
Extrema_POnCurv anExPnts[2];
|
||||
anExtrema.Points(1, anExPnts[0], anExPnts[1]);
|
||||
myPreci[0] = 0;
|
||||
myP3d[0] = anExPnts[1].Value();
|
||||
myFirstP2d[0].SetCoord(su1, anExPnts[1].Parameter());
|
||||
myLastP2d[0].SetCoord(su2, anExPnts[1].Parameter());
|
||||
myFirstPar[0] = su1;
|
||||
myLastPar[0] = su2;
|
||||
myUIsoDeg[0] = Standard_False;
|
||||
myNbDeg = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//rln S4135 //:r3
|
||||
myP3d[0] = myAdSur->Value(su1, 0.5 * (sv1 + sv2));
|
||||
myFirstP2d[0].SetCoord(su1, sv2);
|
||||
@ -257,6 +286,7 @@ void ShapeAnalysis_Surface::ComputeSingularities()
|
||||
|
||||
myNbDeg = 4;
|
||||
}
|
||||
}
|
||||
SortSingularities();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user