mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0032557: Modeling Data - Use of BRepBuilderAPI_NurbsConvert create 2d p-curves with gaps
GeomConvert/GeomConvert_1.cxx - method CheckAndSegment is added to adjust surface periodic boundaries bug32557 - test is updated by new cases
This commit is contained in:
parent
5b756182c2
commit
9923f08703
@ -504,10 +504,9 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
|
|||||||
}
|
}
|
||||||
aMinDist *= aMinDist;
|
aMinDist *= aMinDist;
|
||||||
//Old domain
|
//Old domain
|
||||||
Standard_Real t = 0.5 * (f2d + l2d);
|
gp_Pnt2d aPf = C2d->Value(f2d);
|
||||||
gp_Pnt2d aPf = C2d->Value(t);
|
|
||||||
//New domain
|
//New domain
|
||||||
gp_Pnt2d aNewPf = Curve2d->Value(t);
|
gp_Pnt2d aNewPf = Curve2d->Value(f2d);
|
||||||
gp_Vec2d aT(aNewPf, aPf);
|
gp_Vec2d aT(aNewPf, aPf);
|
||||||
if (aT.SquareMagnitude() > aMinDist)
|
if (aT.SquareMagnitude() > aMinDist)
|
||||||
{
|
{
|
||||||
|
@ -383,6 +383,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
//
|
//
|
||||||
//For cylinders, cones, spheres, toruses
|
//For cylinders, cones, spheres, toruses
|
||||||
const Standard_Boolean isUClosed = Abs((ULast - UFirst) - 2. * M_PI) <= Precision::PConfusion();
|
const Standard_Boolean isUClosed = Abs((ULast - UFirst) - 2. * M_PI) <= Precision::PConfusion();
|
||||||
|
const Standard_Real eps = 100. * Epsilon(2. * M_PI);
|
||||||
//
|
//
|
||||||
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);
|
||||||
@ -415,6 +416,11 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
if (isUClosed) {
|
if (isUClosed) {
|
||||||
Convert_CylinderToBSplineSurface Convert (Cyl, VFirst, VLast);
|
Convert_CylinderToBSplineSurface Convert (Cyl, VFirst, VLast);
|
||||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||||
|
Standard_Integer aNbK = TheSurface->NbUKnots();
|
||||||
|
if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps)
|
||||||
|
{
|
||||||
|
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Convert_CylinderToBSplineSurface
|
Convert_CylinderToBSplineSurface
|
||||||
@ -431,6 +437,11 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
if (isUClosed) {
|
if (isUClosed) {
|
||||||
Convert_ConeToBSplineSurface Convert (Co, VFirst, VLast);
|
Convert_ConeToBSplineSurface Convert (Co, VFirst, VLast);
|
||||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||||
|
Standard_Integer aNbK = TheSurface->NbUKnots();
|
||||||
|
if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps)
|
||||||
|
{
|
||||||
|
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Convert_ConeToBSplineSurface
|
Convert_ConeToBSplineSurface
|
||||||
@ -450,6 +461,11 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
//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);
|
||||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||||
|
Standard_Integer aNbK = TheSurface->NbUKnots();
|
||||||
|
if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps)
|
||||||
|
{
|
||||||
|
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Convert_SphereToBSplineSurface
|
Convert_SphereToBSplineSurface
|
||||||
@ -468,10 +484,20 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
Convert_TorusToBSplineSurface Convert (Tr, VFirst, VLast,
|
Convert_TorusToBSplineSurface Convert (Tr, VFirst, VLast,
|
||||||
Standard_False);
|
Standard_False);
|
||||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||||
|
Standard_Integer aNbK = TheSurface->NbUKnots();
|
||||||
|
if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps)
|
||||||
|
{
|
||||||
|
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (Strim->IsVClosed()) {
|
else if (Strim->IsVClosed()) {
|
||||||
Convert_TorusToBSplineSurface Convert (Tr, UFirst, ULast);
|
Convert_TorusToBSplineSurface Convert (Tr, UFirst, ULast);
|
||||||
TheSurface = BSplineSurfaceBuilder (Convert);
|
TheSurface = BSplineSurfaceBuilder (Convert);
|
||||||
|
Standard_Integer aNbK = TheSurface->NbVKnots();
|
||||||
|
if (Abs(TheSurface->VKnot(1) - VFirst) > eps || Abs(TheSurface->VKnot(aNbK) - VLast) > eps)
|
||||||
|
{
|
||||||
|
TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Convert_TorusToBSplineSurface
|
Convert_TorusToBSplineSurface
|
||||||
@ -575,7 +601,6 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
|
|||||||
2 , C->Degree(),
|
2 , C->Degree(),
|
||||||
periodic, C->IsPeriodic());
|
periodic, C->IsPeriodic());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,13 @@ puts "==========================================================="
|
|||||||
puts ""
|
puts ""
|
||||||
|
|
||||||
restore [locate_data_file bug32557.brep] f
|
restore [locate_data_file bug32557.brep] f
|
||||||
|
|
||||||
nurbsconvert bf f
|
nurbsconvert bf f
|
||||||
checkmaxtol bf -ref 1.1e-7
|
checkmaxtol bf -ref 1.1e-7
|
||||||
|
|
||||||
|
restore [locate_data_file bug32557_1.brep] f
|
||||||
|
nurbsconvert bf f
|
||||||
|
checkmaxtol bf -ref 1.1e-5
|
||||||
|
|
||||||
|
restore [locate_data_file bug32557_2.brep] f
|
||||||
|
nurbsconvert bf f
|
||||||
|
checkmaxtol bf -ref 0.0002570
|
Loading…
x
Reference in New Issue
Block a user