Forum archiveIssue archiveOther usage issues

Archived discussion

Can I do non uniform scaling ?

Other usage issuesSat, 03/04/2000 - 01:032 replies

Browse this forum
QuestionAuthor

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 ?

Mikael

Discussion

2 archived replies

Posts are displayed in their archived order.

01Commenter-1

Mikael,

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,

Commenter-1.

02Commenter-2

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, Commenter-2