Can I do non uniform scaling ?

Hi !

gp_Trsf only support uniform scaling, can I do non uniform scaling of a TopoDS_Shape object ?

For example if I would like to make an ellipsoid out of a sphere or something like that ?


Arnaud Magnier's picture


There are two key classes to define a non-uniform transformation on a shape. These are:

- Class gp_GTrsf to define the transformation by itself.

- Class BRepBuilderAPI_GTransform to modify your shape by applying the transformation.

Hoping this will help you, regards,


Thomas Moreau's picture

As Arnaud Magnier told you, you can define a 3D transformation by itself (with a 4-by-4 matrix).

And for non uniform scaling, you just have to use this matrix:

M= fx 0 0 0

0 fy 0 0

0 0 fz 0

0 0 0 0

where fx, fy, fz define scaling factor for every axis.

Regards, Thomas