mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0032842: Modeling Data - a regression in conversion of a face to bspline
GeomConvert/GeomConvert_1.cxx - forbid using CheckAndSegment if trim is out of base period when converting trimmed torus tests/bugs/moddata_3/bug32842 - test case added
This commit is contained in:
parent
08d9c0ae45
commit
fc41d3b1c0
@ -477,7 +477,13 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
||||
Handle(Geom_ToroidalSurface)::DownCast(Surf);
|
||||
|
||||
gp_Torus Tr = TheElSurf->Torus();
|
||||
if (isUClosed) {
|
||||
//
|
||||
// if isUClosed = true and U trim does not coinside with first period of torus,
|
||||
// method CheckAndSegment shifts position of U seam boundary of surface.
|
||||
// probably bug? So, for this case we must build not periodic surface.
|
||||
Standard_Boolean isUFirstPeriod = !(UFirst < 0. || ULast > 2.*M_PI);
|
||||
Standard_Boolean isVFirstPeriod = !(VFirst < 0. || VLast > 2.*M_PI);
|
||||
if (isUClosed && isUFirstPeriod) {
|
||||
Convert_TorusToBSplineSurface Convert (Tr, VFirst, VLast,
|
||||
Standard_False);
|
||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||
@ -487,7 +493,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
||||
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
|
||||
}
|
||||
}
|
||||
else if (Strim->IsVClosed()) {
|
||||
else if (Strim->IsVClosed() && isVFirstPeriod) {
|
||||
Convert_TorusToBSplineSurface Convert (Tr, UFirst, ULast);
|
||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||
Standard_Integer aNbK = TheSurface->NbVKnots();
|
||||
|
17
tests/bugs/moddata_3/bug32842
Normal file
17
tests/bugs/moddata_3/bug32842
Normal file
@ -0,0 +1,17 @@
|
||||
puts "==========================================================="
|
||||
puts "0032842: Modeling Data - a regression in conversion of a face to bspline"
|
||||
puts "==========================================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32842.brep] s
|
||||
nurbsconvert bs s
|
||||
explode bs e
|
||||
pcurve pc2 bs_2 bs
|
||||
bounds pc2 t1 t2
|
||||
2dcvalue pc2 t1 x1 y1
|
||||
2dcvalue pc2 t2 x2 y2
|
||||
mksurface surf bs
|
||||
bounds surf u1 u2 v1 v2
|
||||
|
||||
checkreal "U21" [dval (u2-x1)] 0 1.e-7 1.e-7
|
||||
checkreal "U22" [dval (u2-x2)] 0 1.e-7 1.e-7
|
Loading…
x
Reference in New Issue
Block a user