mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0026138: Problems with writing periodic BSplines into IGES
Remove making BSpline surfaces rational, Add shifting of pcurves on periodic BSpline surfaces, Add cutting of segment from such surfaces. Add additional check for need of make segment Update of test-cases according to the new behavior
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <gp_Trsf2d.hxx>
|
||||
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom_CartesianPoint.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
@@ -64,6 +65,8 @@
|
||||
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <ShapeAnalysis.hxx>
|
||||
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
@@ -390,6 +393,25 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge&
|
||||
}
|
||||
else Curve2d = Handle(Geom2d_Curve)::DownCast(Curve2d->Copy());
|
||||
|
||||
//shift pcurves on periodic BSpline surfaces (issue 26138)
|
||||
if (Surf->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {
|
||||
Handle(Geom_BSplineSurface) aBSpline = Handle(Geom_BSplineSurface)::DownCast(Surf);
|
||||
Standard_Real uShift = 0., vShift = 0.;
|
||||
Standard_Real U0, U1, V0, V1;
|
||||
Surf->Bounds(U0, U1, V0, V1);
|
||||
if (aBSpline->IsUPeriodic() && Abs(Ufirst - U0) > Precision::PConfusion()) {
|
||||
uShift = ShapeAnalysis::AdjustToPeriod(Ufirst, U0, U1);
|
||||
}
|
||||
if (aBSpline->IsVPeriodic() && Abs(Vfirst - V0) > Precision::PConfusion()) {
|
||||
vShift = ShapeAnalysis::AdjustToPeriod(Vfirst, V0, V1);
|
||||
}
|
||||
if (Abs(uShift) > Precision::PConfusion() || Abs(vShift) > Precision::PConfusion()) {
|
||||
gp_Trsf2d TR;
|
||||
TR.SetTranslation(gp_Pnt2d(0.,0.),gp_Pnt2d(uShift,vShift));
|
||||
Curve2d = Handle(Geom2d_Curve)::DownCast(Curve2d->Transformed(TR));
|
||||
}
|
||||
}
|
||||
|
||||
if (!analyticMode&&((Surf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) ||
|
||||
(Surf->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) ||
|
||||
(Surf->IsKind(STANDARD_TYPE(Geom_SphericalSurface))))) {
|
||||
|
Reference in New Issue
Block a user