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

DM-13905: Change SpherePoint.getVector to return a sphgeom UnitVector3d #17

Merged
merged 2 commits into from Apr 26, 2018

Conversation

r-owen
Copy link
Contributor

@r-owen r-owen commented Apr 25, 2018

No description provided.

Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Interesting that some code is simpler now that we're using an object that doesn't distinguish between absolute and relative positions - I've always wondered if having different types for those was worthwhile, and I think this changeset is a small data point suggesting that it wasn't.

@r-owen
Copy link
Contributor Author

r-owen commented Apr 26, 2018

My own opinion is that having different types for point and extent is usually a nuisance. Image.getXY0 is the classic example: much of the time we want to use it as an extent, but sometimes it needs to be treated as a point. I know of exactly one situation where it has proved quite valuable: constructing boxes. It is very clever to have (point, point) and (point, extent) constructors. However I would give that up in a heartbeat in order to be able to stop casting points to extents and vice versa.

@TallJimbo
Copy link
Member

Yup, that's a good summary of the big pros and cons.

It's probably a moot point now, but if I had it to do all over again, I'd probably have a single vector class instead of Point and Extent, have a Python Box constructor that required kwargs, and have C++ Box construction go through fromMinMax and fromMinSize static methods.

@r-owen r-owen merged commit 9ebf31a into master Apr 26, 2018
@ktlim ktlim deleted the tickets/DM-13905 branch August 25, 2018 05:56
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.

None yet

2 participants