mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0023597: Failed to export ellipse into STEP with units other than mm
Test case for this bug
This commit is contained in:
parent
0d167958d9
commit
72ae989503
@ -155,24 +155,12 @@ Handle(Geom2d_Curve) UnitsMethods::RadianToDegree
|
|||||||
}
|
}
|
||||||
else if (theSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
else if (theSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
||||||
uFact = vFact = LengthFact;
|
uFact = vFact = LengthFact;
|
||||||
if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
|
if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Circle)) ||
|
||||||
Handle(Geom2d_Circle) newCircle =
|
aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
|
||||||
Handle(Geom2d_Circle)::DownCast(aCurve2d);
|
gp_Trsf2d aT;
|
||||||
gp_Pnt2d Loc = newCircle->Location();
|
aT.SetScale (gp::Origin2d(), LengthFact);
|
||||||
Loc.SetX(Loc.X()*LengthFact);
|
aCurve2d->Transform (aT);
|
||||||
Loc.SetY(Loc.Y()*LengthFact);
|
return aCurve2d;
|
||||||
newCircle->SetRadius(newCircle->Radius()*LengthFact);
|
|
||||||
return newCircle;
|
|
||||||
}
|
|
||||||
else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
|
|
||||||
Handle(Geom2d_Ellipse) newEllipse =
|
|
||||||
Handle(Geom2d_Ellipse)::DownCast(aCurve2d);
|
|
||||||
gp_Pnt2d Loc = newEllipse->Location();
|
|
||||||
Loc.SetX(Loc.X()*LengthFact);
|
|
||||||
Loc.SetY(Loc.Y()*LengthFact);
|
|
||||||
newEllipse->SetMajorRadius(newEllipse->MajorRadius()*LengthFact);
|
|
||||||
newEllipse->SetMinorRadius(newEllipse->MinorRadius()*LengthFact);
|
|
||||||
return newEllipse;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -200,20 +188,12 @@ Handle(Geom2d_Curve) UnitsMethods::RadianToDegree
|
|||||||
return myNewLine2d;
|
return myNewLine2d;
|
||||||
}
|
}
|
||||||
else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Conic))) {
|
else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Conic))) {
|
||||||
if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
|
if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Circle)) ||
|
||||||
Handle(Geom2d_Circle) aCirc2d =
|
aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
|
||||||
Handle(Geom2d_Circle)::DownCast(aCurve2d);
|
|
||||||
Handle(Geom2d_BSplineCurve) aBSpline2d =
|
Handle(Geom2d_BSplineCurve) aBSpline2d =
|
||||||
Geom2dConvert::CurveToBSplineCurve(aCirc2d);
|
Geom2dConvert::CurveToBSplineCurve(aCurve2d);
|
||||||
aCurve2d = aBSpline2d;
|
aCurve2d = aBSpline2d;
|
||||||
}
|
}
|
||||||
else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
|
|
||||||
Handle(Geom2d_Ellipse) aHel2d =
|
|
||||||
Handle(Geom2d_Ellipse)::DownCast(aCurve2d);
|
|
||||||
Handle(Geom2d_BSplineCurve) aBSpline2d =
|
|
||||||
Geom2dConvert::CurveToBSplineCurve(aHel2d);
|
|
||||||
aCurve2d = aBSpline2d;
|
|
||||||
}
|
|
||||||
else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
|
else if (aCurve2d->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cout << "PCURVE of Parabola type in U or V Periodic Surface" << endl;
|
cout << "PCURVE of Parabola type in U or V Periodic Surface" << endl;
|
||||||
@ -304,24 +284,12 @@ Handle(Geom2d_Curve) UnitsMethods::DegreeToRadian
|
|||||||
}
|
}
|
||||||
else if (aSurface->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
else if (aSurface->IsKind(STANDARD_TYPE(Geom_Plane))) {
|
||||||
uFact = vFact = LengthFact;
|
uFact = vFact = LengthFact;
|
||||||
if (aPcurve->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
|
if (aPcurve->IsKind(STANDARD_TYPE(Geom2d_Circle)) ||
|
||||||
Handle(Geom2d_Circle) newCircle =
|
aPcurve->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
|
||||||
Handle(Geom2d_Circle)::DownCast(aPcurve);
|
gp_Trsf2d aT;
|
||||||
gp_Pnt2d Loc = newCircle->Location();
|
aT.SetScale (gp::Origin2d(), LengthFact);
|
||||||
Loc.SetX(Loc.X()*LengthFact);
|
aPcurve->Transform (aT);
|
||||||
Loc.SetY(Loc.Y()*LengthFact);
|
return aPcurve;
|
||||||
newCircle->SetRadius(newCircle->Radius()*LengthFact);
|
|
||||||
return newCircle;
|
|
||||||
}
|
|
||||||
else if (aPcurve->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
|
|
||||||
Handle(Geom2d_Ellipse) newEllipse =
|
|
||||||
Handle(Geom2d_Ellipse)::DownCast(aPcurve);
|
|
||||||
gp_Pnt2d Loc = newEllipse->Location();
|
|
||||||
Loc.SetX(Loc.X()*LengthFact);
|
|
||||||
Loc.SetY(Loc.Y()*LengthFact);
|
|
||||||
newEllipse->SetMajorRadius(newEllipse->MajorRadius()*LengthFact);
|
|
||||||
newEllipse->SetMinorRadius(newEllipse->MinorRadius()*LengthFact);
|
|
||||||
return newEllipse;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
28
tests/bugs/xde/bug23597
Executable file
28
tests/bugs/xde/bug23597
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "OCC23597"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Failed to export ellipse into STEP with units other than mm
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
set filedir ${imagedir}
|
||||||
|
|
||||||
|
set TheFileName bug23597_f-ellipse
|
||||||
|
if { [file exists ${filedir}/${TheFileName}.stp] } {
|
||||||
|
puts "Error : There is old ${filedir}/${TheFileName}.stp file"
|
||||||
|
}
|
||||||
|
|
||||||
|
xnorm STEP
|
||||||
|
restore [locate_data_file ${TheFileName}.brep] f
|
||||||
|
param write.step.unit FT
|
||||||
|
newmodel
|
||||||
|
stepwrite a f ${filedir}/${TheFileName}.stp
|
||||||
|
|
||||||
|
if { ![file exists ${filedir}/${TheFileName}.stp] } {
|
||||||
|
puts "Error : There is not ${filedir}/${TheFileName}.stp file"
|
||||||
|
}
|
||||||
|
|
||||||
|
catch {exec chmod 777 ${filedir}/${TheFileName}.stp }
|
||||||
|
|
||||||
|
file delete ${filedir}/${TheFileName}.stp
|
Loading…
x
Reference in New Issue
Block a user