mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0031242: Scaling with different coefficients along axes produces invalid shape
GeomConvert_1.cxx: Creation periodic BSpline surfaces from trimmed periodic surface if trim is boundaries of periodic domain is allowed BRepTools_NurbsConvertModification.cxx: Checking domain of 2dCurves if surfaces are periodic is added Test case tests/bugs/mesh/bug30008_2 is modified according to current behavior Test case tests/bugs/modalg_7/bug31242 is added
This commit is contained in:
@@ -329,6 +329,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface
|
||||
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);
|
||||
@@ -380,7 +381,10 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
||||
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);
|
||||
@@ -409,7 +413,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
||||
Handle(Geom_CylindricalSurface)::DownCast(Surf);
|
||||
|
||||
gp_Cylinder Cyl = TheElSurf->Cylinder();
|
||||
if (Strim->IsUClosed()) {
|
||||
if (isUClosed) {
|
||||
Convert_CylinderToBSplineSurface Convert (Cyl, VFirst, VLast);
|
||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||
}
|
||||
@@ -425,7 +429,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
||||
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);
|
||||
}
|
||||
@@ -442,7 +446,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
||||
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);
|
||||
@@ -461,7 +465,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
||||
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);
|
||||
|
Reference in New Issue
Block a user