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

Add Cylinder3D #84

Merged
merged 8 commits into from
Feb 1, 2020
Merged

Add Cylinder3D #84

merged 8 commits into from
Feb 1, 2020

Conversation

santiagogaray
Copy link
Contributor

Hi @chriswmackey,

I added a initial class for the cylinder for your review. This object is inspired in the cone in terms of its definition. Please let me know if that makes sense,
In regards to naming, I am not sure if the '_center' name is the most correct one here. It is actually the bottom base center of the cylinder but I'm trying to keep it simple if that makes sense.
Please let me know also if I should add any additional methods/properties to it.

Initial class properties and methods
@chriswmackey
Copy link
Member

Thanks @santiagogaray . I will review this a soon as I get the chance. You'll see that I opened an issue about adding a to_polyface method to each of the 3 special geometry type classes but we can address this in a later PR unless you want to do it now.

Also @mostaphaRoudsari brought up a good point to me the other day, which is that, for any object that cannot have a 2D counterpart, we can probably drop the 3D from the end of the class name. I realize that I kinda did this with the Plane class already without realizing it. And I think it's still ok to call keep the Face3D and Polyface3D classes named as they are because they theoretically can have a 2D counterpart even if they aren't implemented in the library right now. But this means that Sphere3D, Cone3D and Cylinder3D can be changed to Sphere, Cone and Cylinder since they have no 2D counterpart. You should feel free to make this change as part of this PR if you agree.

@chriswmackey chriswmackey self-requested a review January 27, 2020 21:35
@santiagogaray
Copy link
Contributor Author

Sounds good @chriswmackey, makes a lot of sense to drop '3D' in these cases, will start working on it.

Remove '3D' from class name.
Remove '3d' from sphere intersect methods name 
Remove '3D' from sphere_tests
Remove '3D' from class name
Remove '3D' from cone_tests
Remove '3D' from class name
Copy link
Member

@chriswmackey chriswmackey left a comment

Choose a reason for hiding this comment

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

This generally looks good @santiagogaray . Thanks for putting it together. There's just one bug to fix, one small feature request, and you'll need to add some tests for the cylinder. Then, we can merge this in.

* diameter
* height
* area
* volume
Copy link
Member

Choose a reason for hiding this comment

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

I like how you have set up the init method of this object but I think we will need easy access to the center_end point in order to use this for certain applications. This should be easy to add as a property since it's effectively the following:

self.center + self.axis

Along these lines, it would be good to have a classmethod to initialize the cylinder from a start point, end point, and radius since I know that this is how cylinders are represented in the Radiance engine.

ladybug_geometry/geometry3d/cylinder.py Outdated Show resolved Hide resolved
tests/sphere_test.py Show resolved Hide resolved
@santiagogaray
Copy link
Contributor Author

Thank you @chriswmackey for checking the code. I made the requested changes and included the cylinder tests for your review.

@chriswmackey chriswmackey self-requested a review February 1, 2020 21:33
Copy link
Member

@chriswmackey chriswmackey left a comment

Choose a reason for hiding this comment

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

This looks great @santiagogaray . Thank you for making the edits and adding the tests.
Let's merge this!

@chriswmackey chriswmackey merged commit 76ef3ef into ladybug-tools:master Feb 1, 2020
@ladybugbot
Copy link

🎉 This PR is included in version 1.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants