Skip to content
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

Location(translation=(10,0,0), rotation=(0,30,0)) -> unexpected keyword argument 'translation' #884

Open
jdegenstein opened this issue Jan 28, 2025 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@jdegenstein
Copy link
Collaborator

Location(translation=(10,0,0), rotation=(0,30,0)) -> Location.__init__() got an unexpected keyword argument 'translation'

This is despite following the overload function signature provided in VSCode.

@GarryBGoode
Copy link
Contributor

For background, I raised this on discord. I was thinking of making an example or tutorial, and I thought writing out the Location constructor in a verbose way could improve clarity.

@GarryBGoode
Copy link
Contributor

I had a look at Location source. True, it only takes *args and no **kwargs. There are similar patterns that use both arg and kwarg, like the _parse_intersect_args function, but I don't see a way to implement that for Location, it feels super complicated to work through.

@gumyr gumyr added the duplicate This issue or pull request already exists label Jan 28, 2025
@gumyr gumyr added this to the Gating Release 1.0.0 milestone Jan 28, 2025
@gumyr
Copy link
Owner

gumyr commented Jan 28, 2025

The orientation part of a Location can be set as another tuple as shown here:

l1 = Location((1, 1, 0), (0, 0, 0))
l2 = Location((1, -1, 0), (0, 0, 90))

Image

Note how l1 is orientated the same way as the normal coordinate system. l2 has a rotation about Z of 90 degrees so now the red line (previously the X location axis) is now in the direction of the global Y axis.

Input parsing of Location needs to be reworked as described in Issue #441.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants