Skip to content
Discussion options

You must be logged in to vote

Vectors don’t have a position, only a direction and magnitude(scale)
This sample should illustrate the behavior

from pyrx_imp import Ap, Db, Ed, Ge, Gi, Gs, Rx

def transformBy(m):
    v = Ge.Vector2d.kXAxis
    p = Ge.Point2d(1.0, 1.0)
    v.transformBy(m)
    p.transformBy(m)
    print(v)
    print(p)
    print("\n....")

def PyRxCmd_doit():
    try:
        #position
        transformBy(Ge.Matrix2d.translation(Ge.Vector2d(100.0, 50.0)))
        #rotation
        transformBy(Ge.Matrix2d.rotation(0.785398,Ge.Point2d(1.0, 1.0)))
        #scale
        transformBy(Ge.Matrix2d.scaling(2,Ge.Point2d(1.0, 1.0)))
        #rotation around the origin
        transformBy(Ge.Matrix2d.rotation(0.785398

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
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