Skip to content

Translation doesn't work on existing objects #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
edmundsj opened this issue Oct 5, 2020 · 1 comment
Open

Translation doesn't work on existing objects #28

edmundsj opened this issue Oct 5, 2020 · 1 comment

Comments

@edmundsj
Copy link

edmundsj commented Oct 5, 2020

It looks like if I create a cube and then attempt to translate it, it doesn't do anything (I still have the same cube):

my_cube = ops.Cube([10, 10, 10])
my_cube.translate([0, 0, 50])

But if I do it in one step, then it renders correctly:

my_cube = ops.Cube([10, 10, 10]).tranlate([0, 0, 50])

Is there a reason for this behavior? Is it dramatically easier to implement? This seems to break my intuition about how to use OOP. It also just leads to ugly-long lines of code.

@edmundsj
Copy link
Author

edmundsj commented Oct 5, 2020

Nope, it doesn't break my intuition, because this works just fine:

my_cube = ops.Cube([10, 10, 10])
my_cube = my_cube.translate([0, 0, 50])

Can you state somewhere that the transformations return the modified object, but do not modify it in place? This wasn't clear from the README. Additional API documentation would be very helpful. It's a neat module!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant