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

Use a point object instead of x, y arguments #4

Open
osresearch opened this issue Nov 29, 2023 · 4 comments
Open

Use a point object instead of x, y arguments #4

osresearch opened this issue Nov 29, 2023 · 4 comments

Comments

@osresearch
Copy link

Since the _local_to_world() and _world_to_local() return tuples, what do you think about having a class that implements points instead of passing x, y arguments? They could also carry a flag for world or local coordinates, allowing the functions to take either pre-translated or untranslated coords.

@cibomahto
Copy link
Member

Hmm- I'd prefer not to introduce an extra layer to interact with the interface, though an absolute point would be convenient would be convenient for this.

@osresearch
Copy link
Author

For my Track class (#3) I added an optional argument world=false so that coordinates can be specified in default local or optionally world frame. Adding such an option to each method of painter is doable, but might be as invasive as a point class.

@cibomahto
Copy link
Member

How about a container that explicitly stores a fixed position: main...fixedpoint

@cibomahto
Copy link
Member

Could also add a convenience function to CircuitPainter, that returns a point, something like:

class CircuitPointer:
    ...
    def get_fixed_point(self, x, y):
        return FixedPoint(self, x, y)

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

2 participants