Skip to content

implement Vector operators __add__, __sub__, __mul__ #6

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

Merged
merged 2 commits into from
Dec 5, 2018

Conversation

justbuchanan
Copy link
Member

No description provided.

@adam-urbanczyk
Copy link
Member

Looks good. One question though: do you have a specific use case for the Vector object in mind?

Also it would be nice to add some tests.

@justbuchanan
Copy link
Member Author

cqparts uses Vectors fairly extensively for moving between coordinate systems, among other things. Since several of the cadquery APIs accept and return Vector objects, it works out well to use them throughout. It would certainly be possible to use methods like multiply and add directly, but the operators are really convenient.

I added some test cases and implemented __truediv__ to complete the basic four operators.

@adam-urbanczyk
Copy link
Member

Thanks for the contribution @justbuchanan

@justbuchanan justbuchanan deleted the vector-operators branch December 5, 2018 22:27
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

Successfully merging this pull request may close these issues.

2 participants