}
return Standard_True;
}
+
+ //
GeomAdaptor_Surface GAS(S,Uinf-u,Usup+u,Vinf-v,Vsup+v);
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(GAS);
if(ProjOnCurve.IsDone()) {
Curve2d = ProjOnCurve.BSpline();
+ if (S->IsUPeriodic() || S->IsVPeriodic())
+ {
+ //Surface is periodic, checking curve2d domain
+ //Old domain
+ gp_Pnt2d aPf = C2d->Value(f2d);
+ //New domain
+ gp_Pnt2d aNewPf = Curve2d->Value(f2d);
+ gp_Vec2d aT(aNewPf, aPf);
+ if (aT.SquareMagnitude() > Precision::SquarePConfusion())
+ {
+ Curve2d = Handle(Geom2d_Curve)::DownCast(Curve2d->Translated(aT));
+ }
+ }
Standard_Real newTol = BRepTools::EvalAndUpdateTol(newE, C3d, Curve2d, S, f3d, l3d);
if(newTol > Tol)
{
Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
(const Handle(Geom_Surface)& Sr)
{
+
Standard_Real U1, U2, V1, V2;
Sr->Bounds (U1, U2, V1, V2);
Standard_Real UFirst = Min (U1, U2);
VFirst, VLast);
return SurfaceToBSplineSurface(aStrim);
}
-
+ //
+ //For cylinders, cones, spheres, toruses
+ const Standard_Boolean isUClosed = Abs((ULast - UFirst) - 2. * M_PI) <= Precision::PConfusion();
+ //
if (Surf->IsKind(STANDARD_TYPE(Geom_Plane))) {
TColgp_Array2OfPnt Poles (1, 2, 1, 2);
Poles (1, 1) = Strim->Value (U1, V1);
Handle(Geom_CylindricalSurface)::DownCast(Surf);
gp_Cylinder Cyl = TheElSurf->Cylinder();
- if (Strim->IsUClosed()) {
+ if (isUClosed) {
Convert_CylinderToBSplineSurface Convert (Cyl, VFirst, VLast);
TheSurface = BSplineSurfaceBuilder (Convert);
}
Handle(Geom_ConicalSurface) TheElSurf =
Handle(Geom_ConicalSurface)::DownCast(Surf);
gp_Cone Co = TheElSurf->Cone();
- if (Strim->IsUClosed()) {
+ if (isUClosed) {
Convert_ConeToBSplineSurface Convert (Co, VFirst, VLast);
TheSurface = BSplineSurfaceBuilder (Convert);
}
Handle(Geom_SphericalSurface)::DownCast(Surf);
gp_Sphere Sph = TheElSurf->Sphere();
//OCC217
- if (Strim->IsUClosed()) {
+ if (isUClosed) {
//if (Strim->IsVClosed()) {
//Convert_SphereToBSplineSurface Convert (Sph, UFirst, ULast);
Convert_SphereToBSplineSurface Convert (Sph, VFirst, VLast, Standard_False);
Handle(Geom_ToroidalSurface)::DownCast(Surf);
gp_Torus Tr = TheElSurf->Torus();
- if (Strim->IsUClosed()) {
+ if (isUClosed) {
Convert_TorusToBSplineSurface Convert (Tr, VFirst, VLast,
Standard_False);
TheSurface = BSplineSurfaceBuilder (Convert);