ellipsoid strikes back


I'm trying to build an ellipsoid, currently using DRAW, but I'll implement afterwards using the c++ libraries.

There are two ways of doing this, that I'm able to think of:

1) Build an sphere. Then make an anisotropic scale transform.
2) Build 1/8 of it using arcs of ellipses and then mirroring and fusing.

The first is not implemented in DRAW, I don't know if you can do that with Opencascade libraries. It only allows you to do an isotropic scaling.
The second should work using the sweep command, however, I'm not able to solve it without glitches in the shape. The "guide" option is turning a bit problematic for me:

These are the DRAW commands:

set h 10
set l 20
set w 10
ellipse e1 0 0 0 $h $w
trim e1 e1 0 pi/2
ellipse e2 0 0 0 1 0 0 $l $w
trim e2 e2 -pi/2 0
ellipse e3 0 0 0 0 1 0 $l $h
trim e3 e3 0 pi/2
mkedge e1 e1
mkedge e2 e2
mkedge e3 e3
wire w_envelope e1
wire w_short_spine e2
wire w_long_spine e3

mksweep w_long_spine
setsweep -G w_short_spine 0 0
addsweep w_envelope -R
buildsweep shell -R


Maybe someone knows if this could be achieved using NURBS, or whatever. Please, help me!

Thank you in advance.

Bearloga's picture

Actually the first way is implemented in Draw. Consider the command deform. You will get a NURBS surface.
Another way is to make revolution of a half ellipse:
ellipse el 0 0 0 20 10
mkedge e el 0 pi
revol r e 0 0 0 1 0 0 360
The result will be a surface of revolution.

Alvaro's picture


The deform command was what i was just looking for.

However, the second option you are proposing is actually only special case of ellipsoid, but imagine you squeeze the sphere in two axis. Then you can't do it with a revolution surface. Actually I did managed to achieve that special case both with sweep and revolution commands.

Thank you very much, Bearloga.