mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0030272: Modeling Algorithms - Incorrect work of gproject
-fix TolU/V for approximation; -fix cutting tool for approximation; -add method Adaptor3d_HSurfaceTool::IsSurfG1. -add test bugs/moddata_3/bug30272
This commit is contained in:
@@ -17,8 +17,11 @@
|
||||
|
||||
#include <Adaptor3d_Curve.hxx>
|
||||
#include <Adaptor3d_Surface.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_BSplineCurve.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_OffsetCurve.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
@@ -98,3 +101,79 @@ Standard_Integer Adaptor3d_HSurfaceTool::NbSamplesV(const Handle(Adaptor3d_Surfa
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
Standard_Boolean Adaptor3d_HSurfaceTool::IsSurfG1(const Handle(Adaptor3d_Surface)& theSurf,
|
||||
const Standard_Boolean theAlongU,
|
||||
const Standard_Real theAngTol)
|
||||
{
|
||||
Standard_Real aUf, aUl, aVf, aVl;
|
||||
aUf = theSurf->FirstUParameter();
|
||||
aUl = theSurf->LastUParameter();
|
||||
aVf = theSurf->FirstVParameter();
|
||||
aVl = theSurf->LastVParameter();
|
||||
|
||||
Handle(Adaptor3d_Surface) aS = theSurf;
|
||||
Handle(Adaptor3d_Curve) aC;
|
||||
|
||||
Handle(Geom_BSplineSurface) aBS;
|
||||
Handle(Geom_BSplineCurve) aBC;
|
||||
|
||||
if (aS->GetType() == GeomAbs_OffsetSurface)
|
||||
{
|
||||
aS = aS->BasisSurface();
|
||||
}
|
||||
|
||||
if (aS->GetType() == GeomAbs_SurfaceOfRevolution ||
|
||||
aS->GetType() == GeomAbs_SurfaceOfExtrusion)
|
||||
{
|
||||
aC = aS->BasisCurve();
|
||||
}
|
||||
|
||||
if (!aC.IsNull())
|
||||
{
|
||||
if (aC->GetType() == GeomAbs_OffsetCurve)
|
||||
{
|
||||
Handle(Geom_OffsetCurve) aOC = aC->OffsetCurve();
|
||||
aC = new GeomAdaptor_Curve(aOC->BasisCurve());
|
||||
}
|
||||
|
||||
if (aC->GetType() == GeomAbs_BSplineCurve)
|
||||
{
|
||||
if ((theAlongU && aS->GetType() == GeomAbs_SurfaceOfExtrusion) ||
|
||||
(!theAlongU && aS->GetType() == GeomAbs_SurfaceOfRevolution))
|
||||
{
|
||||
aBC = aC->BSpline();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (aS->GetType() == GeomAbs_BSplineSurface)
|
||||
{
|
||||
aBS = aS->BSpline();
|
||||
|
||||
if (theAlongU)
|
||||
{
|
||||
const Standard_Real anIsoPar = (aVf + aVl) / 2.0;
|
||||
aBC = Handle(Geom_BSplineCurve)::DownCast(aBS->VIso(anIsoPar));
|
||||
}
|
||||
else
|
||||
{
|
||||
const Standard_Real anIsoPar = (aUf + aUl) / 2.0;
|
||||
aBC = Handle(Geom_BSplineCurve)::DownCast(aBS->UIso(anIsoPar));
|
||||
}
|
||||
}
|
||||
|
||||
if(!aBC.IsNull())
|
||||
{
|
||||
if (theAlongU)
|
||||
{
|
||||
return aBC->IsG1(aUf, aUl, theAngTol);
|
||||
}
|
||||
else
|
||||
{
|
||||
return aBC->IsG1(aVf, aVl, theAngTol);
|
||||
}
|
||||
}
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
@@ -165,6 +165,10 @@ public:
|
||||
|
||||
static Standard_Real OffsetValue (const Handle(Adaptor3d_Surface)& theSurf) { return theSurf->OffsetValue(); }
|
||||
|
||||
Standard_EXPORT static Standard_Boolean IsSurfG1 (const Handle(Adaptor3d_Surface)& theSurf,
|
||||
const Standard_Boolean theAlongU,
|
||||
const Standard_Real theAngTol = Precision::Angular());
|
||||
|
||||
Standard_EXPORT static Standard_Integer NbSamplesU (const Handle(Adaptor3d_Surface)& S);
|
||||
|
||||
Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(Adaptor3d_Surface)& S);
|
||||
|
Reference in New Issue
Block a user