public Bounds getBounds() {
double alpha = this.getRotationAngle();
Bounds bounds = new Bounds();
ParametricPlane plane = new ParametricPlane(this.center,
this.getExtrusion().getDirectionX(),
this.getExtrusion().getDirectionY(),
this.getExtrusion().getNormal());
if ((this.startParameter == DEFAULT_START_PARAMETER) &&
(this.endParameter == DEFAULT_END_PARAMETER) && (alpha == 0.0)) {
double length = this.getHalfMajorAxisLength();
bounds.addToBounds(plane.getPoint(length, length));
bounds.addToBounds(plane.getPoint(-length, -length));
} else {
int n = 40;
// we walking over the the ellipse or elliptical arc
double h = (this.endParameter - this.startParameter) / n;
double start = this.startParameter;
//double major = this.getHalfMajorAxisLength();
//double minor = major * this.ratio;
Vector minorAxis = MathUtils.crossProduct(this.getExtrusion()
.getNormal(),
this.getMajorAxisDirection());
minorAxis = MathUtils.scaleVector(minorAxis, this.ratio);
for (int i = 0; i <= n; i++) {
Vector v1 = MathUtils.scaleVector(this.getMajorAxisDirection(),
Math.cos(start));
Vector v2 = MathUtils.scaleVector(minorAxis, Math.sin(start));
// double x = major * Math.cos(start);
// double y = minor * Math.sin(start);
double x = v1.getX() + v2.getX();
double y = v1.getY() + v2.getY();
// if (alpha != 0.0) {
// double lx = x;
// x = lx * Math.cos(alpha) - y * Math.sin(alpha);
// y = lx * Math.sin(alpha) + y * Math.cos(alpha);
// }
Point p = plane.getPoint(x, y);
bounds.addToBounds(p);
start += h;
}