mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +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:
parent
9504a30d15
commit
bdd09cfaf4
@ -482,6 +482,8 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
|
|||||||
}
|
}
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
GeomAdaptor_Surface GAS(S,Uinf-u,Usup+u,Vinf-v,Vsup+v);
|
GeomAdaptor_Surface GAS(S,Uinf-u,Usup+u,Vinf-v,Vsup+v);
|
||||||
|
|
||||||
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(GAS);
|
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(GAS);
|
||||||
@ -490,6 +492,19 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
|
|||||||
|
|
||||||
if(ProjOnCurve.IsDone()) {
|
if(ProjOnCurve.IsDone()) {
|
||||||
Curve2d = ProjOnCurve.BSpline();
|
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);
|
Standard_Real newTol = BRepTools::EvalAndUpdateTol(newE, C3d, Curve2d, S, f3d, l3d);
|
||||||
if(newTol > Tol)
|
if(newTol > Tol)
|
||||||
{
|
{
|
||||||
|
@ -329,6 +329,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface
|
|||||||
Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
||||||
(const Handle(Geom_Surface)& Sr)
|
(const Handle(Geom_Surface)& Sr)
|
||||||
{
|
{
|
||||||
|
|
||||||
Standard_Real U1, U2, V1, V2;
|
Standard_Real U1, U2, V1, V2;
|
||||||
Sr->Bounds (U1, U2, V1, V2);
|
Sr->Bounds (U1, U2, V1, V2);
|
||||||
Standard_Real UFirst = Min (U1, U2);
|
Standard_Real UFirst = Min (U1, U2);
|
||||||
@ -380,7 +381,10 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
VFirst, VLast);
|
VFirst, VLast);
|
||||||
return SurfaceToBSplineSurface(aStrim);
|
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))) {
|
if (Surf->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
||||||
TColgp_Array2OfPnt Poles (1, 2, 1, 2);
|
TColgp_Array2OfPnt Poles (1, 2, 1, 2);
|
||||||
Poles (1, 1) = Strim->Value (U1, V1);
|
Poles (1, 1) = Strim->Value (U1, V1);
|
||||||
@ -409,7 +413,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
Handle(Geom_CylindricalSurface)::DownCast(Surf);
|
Handle(Geom_CylindricalSurface)::DownCast(Surf);
|
||||||
|
|
||||||
gp_Cylinder Cyl = TheElSurf->Cylinder();
|
gp_Cylinder Cyl = TheElSurf->Cylinder();
|
||||||
if (Strim->IsUClosed()) {
|
if (isUClosed) {
|
||||||
Convert_CylinderToBSplineSurface Convert (Cyl, VFirst, VLast);
|
Convert_CylinderToBSplineSurface Convert (Cyl, VFirst, VLast);
|
||||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||||
}
|
}
|
||||||
@ -425,7 +429,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
Handle(Geom_ConicalSurface) TheElSurf =
|
Handle(Geom_ConicalSurface) TheElSurf =
|
||||||
Handle(Geom_ConicalSurface)::DownCast(Surf);
|
Handle(Geom_ConicalSurface)::DownCast(Surf);
|
||||||
gp_Cone Co = TheElSurf->Cone();
|
gp_Cone Co = TheElSurf->Cone();
|
||||||
if (Strim->IsUClosed()) {
|
if (isUClosed) {
|
||||||
Convert_ConeToBSplineSurface Convert (Co, VFirst, VLast);
|
Convert_ConeToBSplineSurface Convert (Co, VFirst, VLast);
|
||||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||||
}
|
}
|
||||||
@ -442,7 +446,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
Handle(Geom_SphericalSurface)::DownCast(Surf);
|
Handle(Geom_SphericalSurface)::DownCast(Surf);
|
||||||
gp_Sphere Sph = TheElSurf->Sphere();
|
gp_Sphere Sph = TheElSurf->Sphere();
|
||||||
//OCC217
|
//OCC217
|
||||||
if (Strim->IsUClosed()) {
|
if (isUClosed) {
|
||||||
//if (Strim->IsVClosed()) {
|
//if (Strim->IsVClosed()) {
|
||||||
//Convert_SphereToBSplineSurface Convert (Sph, UFirst, ULast);
|
//Convert_SphereToBSplineSurface Convert (Sph, UFirst, ULast);
|
||||||
Convert_SphereToBSplineSurface Convert (Sph, VFirst, VLast, Standard_False);
|
Convert_SphereToBSplineSurface Convert (Sph, VFirst, VLast, Standard_False);
|
||||||
@ -461,7 +465,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
Handle(Geom_ToroidalSurface)::DownCast(Surf);
|
Handle(Geom_ToroidalSurface)::DownCast(Surf);
|
||||||
|
|
||||||
gp_Torus Tr = TheElSurf->Torus();
|
gp_Torus Tr = TheElSurf->Torus();
|
||||||
if (Strim->IsUClosed()) {
|
if (isUClosed) {
|
||||||
Convert_TorusToBSplineSurface Convert (Tr, VFirst, VLast,
|
Convert_TorusToBSplineSurface Convert (Tr, VFirst, VLast,
|
||||||
Standard_False);
|
Standard_False);
|
||||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||||
|
@ -19,7 +19,7 @@ nurbsconvert result result
|
|||||||
incmesh result 0.15 -a 20
|
incmesh result 0.15 -a 20
|
||||||
|
|
||||||
tricheck result
|
tricheck result
|
||||||
checktrinfo result -tri 193 -nod 147 -defl 0.04209 -tol_abs_defl 1.0e-6
|
checktrinfo result -tri 191 -nod 146 -defl 0.0362596 -tol_abs_defl 1.0e-6
|
||||||
|
|
||||||
vinit
|
vinit
|
||||||
|
|
||||||
|
13
tests/bugs/modalg_7/bug31242
Normal file
13
tests/bugs/modalg_7/bug31242
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
puts "======================================================="
|
||||||
|
puts "0031242: Scaling with different coefficients along axes produces invalid shape"
|
||||||
|
puts "======================================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug31242.brep] f
|
||||||
|
|
||||||
|
scalexyz result f 1 1 0.25
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
checkprops result -s 685.043
|
||||||
|
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user