Skip to content
Discussion options

You must be logged in to vote

You can use Matrix3d.getCoordSystem, then get the scale of the vectors, something like

def get_non_uniform_scale(mat: Ge.Matrix3d):
    pnt = Ge.Point3d()
    x = Ge.Vector3d()
    y = Ge.Vector3d()
    z = Ge.Vector3d()
    mat.getCoordSystem(pnt, x, y, z)
    return Ge.Scale3d(x.length(), y.length(), z.length())

@command()
def doit():
    mat = Ge.Matrix3d()
    mat.setCoordSystem(
        Ge.Point3d.kOrigin,
        Ge.Vector3d.kXAxis * 10,
        Ge.Vector3d.kYAxis * 100,
        Ge.Vector3d.kZAxis * 1000,
    )
    print(get_non_uniform_scale(mat))

(10.00000000000000,100.00000000000000,1000.00000000000000)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@CEXT-Dan
Comment options

@gswifort
Comment options

gswifort Jun 5, 2025
Collaborator Author

Answer selected by gswifort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants