Tue, 02/17/2026 - 09:24
PrsMgr_PresentableObject transformation defined by TopLoc_Datum3D, which is essentially just a gp_Trsf.
gp_Trsf supports only uniform scales. Such limitations are understandable for shapes, but for meshes, they impose a serious limitation on rendering certain real 3D models.
For sure, transformation can be applied to each vertex and normal when the mesh is built, but that's fine if the transformation doesn't change often. If any animation is involved, it forces the mesh to be rebuilt.
I even tried to provide a custom ModelToWorld matrix via a shader program, but with little success, since near/far clipping occurs: these planes are calculated from the geometry data without the matrix.
How to solve that? Maybe a good idea for the V8 improvement?
Tue, 02/17/2026 - 23:19
At the moment, non-uniform scaling is not supported directly. There is no direct way of use it in the clear way.
Upgrading the location to the matrix is aggressive rework and it will impacted BRep a lot. Originally OCCT is BRep kernel. Mesh is additional representation, which is not a direct interest of algorighms.
You can apply transformation on CPU using the BRepBuilderAPI_GTransform (more specific BRepTools_GTrsfModification::NewTriangulation) or you can apply similar logic into custom shader.
At the moment, updating to gp_GTrsf or similar logic is planned for the long term, not for 8.0.0, and It will be not just accepting different diagnosis of matrix, it is also will accept more operations on BRep. Which will be a huge redesign. So, unfortunately, the changes will be not soon.
Best regards, Dmitrii.
Wed, 02/18/2026 - 01:50
Thanks for the answer. I do understand limitations with BReps. But it seems that the TopoDS_Shape transformation (TopLoc_Location) and the PresentableObject transformation are not closely related. The shape's transformation is applied for the shape's triangulation. And that's ok if only gp_Trsf can be used here. But the PresentableObject's transformation is not affected by that (if I see the picture correctly).
Wed, 02/18/2026 - 06:43
gp_TrsfwithinAIS_InteractiveObjectis an unfortunate consequence of desire to reuse existingTopLoc_Datum3D, with overseen use case of non-uniform scaling (rarely needed).If we will take a look at
gp_Trsf, we will find that all its methods process the 3x3 matrix to fit definition of uniform-only scale factor (stored as a dedicated class field, hence 3x3 matrix is only for rotation), and all its fields areprivateby design.All, but one -
gp_Trsf::InitFromJson()lacks validation layer (by mistake of course, not by design), so it can be used to initialize a 'broken' transformation. If we do that to create a matrix with non-uniform scale, we can see objects displayed with this scale. However, the selection of the object will work incorrectly.One of the reasons is that
PrsMgr_PresentableObject::UpdateTransformation()computes inversed transformation out ofgp_Trsf::Inversed(). We may further hackPrsMgr_PresentableObject::InversedTransformation()to assign a properly initialized inversed matrix to it.Alternatively one may declare
gp_Trsfcopy with access to private fields and apply modifications via memory aliasing instead of serializing string forgp_Trsf::InitFromJson(). Of course, this is just a fragile hack and proof of concept, I don't suggest using it in a real code, but it might be tolerable as a temporary workaround, if you have very limited scenario to apply it.Wed, 02/25/2026 - 12:01
I have drafted a patch that replaces
gp_Trsfwithgp_GTrsfin AIS viewer. It implies many changes in API, so I'm not sure if it really worth adding support for affine transformations to AIS like this, considered very rare scenarios, where it could be actually useful for CAx tasks...Thu, 03/05/2026 - 22:13
Thank you very much for the patch.
Unfortunately, I cannot apply it as the base commit information is missing in the .patch file.
Can you please tell the commit to apply the patch to?
Fri, 03/06/2026 - 08:22
The current version of the patch could be found in the branch v7_7_x_prs_gtrsf, two commits: