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

Cylinder with sidewall angle #571

Merged
merged 1 commit into from
Nov 15, 2022
Merged

Conversation

weiliangjin2021
Copy link
Collaborator

  • sidewall_angle etc. has been shifted to Planar.

Copy link
Contributor

@xin-flex xin-flex left a comment

Choose a reason for hiding this comment

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

I think dilation is redundant for Cylinder as it is more natural to modify radius directly. Recommend to remove dilation from Planar and add to PolySlab.

Copy link
Collaborator

@tylerflex tylerflex 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, just a few docstring edits / comments but otherwise approved. Thanks!

@@ -1359,7 +1422,9 @@ def _surface_area(self, bounds: Bound) -> float:


class Cylinder(Centered, Circular, Planar):
"""Cylindrical geometry.
"""Cylindrical geometry with optional sidewall angle along axis
direction. When ``sidewall_angle`` is nonzero, it's in fact a
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd recommend replacing "it's in fact a" with "the shape is a"

0.0,
title="Sidewall angle",
description="Angle of the sidewall. "
"``sidewall_angle=0`` (default) specifies vertical wall, "
Copy link
Collaborator

Choose a reason for hiding this comment

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

A few grammar edits

``sidewall_angle=0`` (default) specifies a vertical wall, 
``0<sidewall_angle<np.pi/2`` specifies a base that is larger than the top,
and ``-np.pi/2<sidewall_angle<0`` specifies a base that is smaller than the top.

Also, I wonder if we should add another line saying that the "base" is defined by the reference_plane field. ie

The base location is defined by the ``reference_plane`` field.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about just changing base to bottom?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like maybe "bottom" and "top" are maybe a bit confusing to use if they will be the strings used in the reference_plane. For example, if we say here that "bottom is larger than top" and set reference_plane="top", it might be ambiguous.

Copy link
Collaborator

Choose a reason for hiding this comment

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

one idea is to change reference_plane to be called base_position (or something similar) and make it a float between -1 and 1, with -1 meaning what is "bottom" now (default) and 1 meaning "top". Any ideas?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a good point. But I feel that adding another variable complicates the problem. Currently we define "top" and "bottom" in the docstring of reference_plane: "E.g. if axis=1, bottom refers to the negative side of the y-axis". Even with an additional float base_position, we still need to iterate this in both the docstrings of base_position and reference_plane . How about this: we don't mention about "top" etc. at all in the docstring of sidewall_angle, rather, we can say,

sidewall_angle=0 (default) specifies a vertical wall; 0<sidewall_angle<np.pi/2 specifies a shrinking cross section along the axis-direction; and -np.pi/2<sidewall_angle<0 specifies an expanding cross section along the axis-direction.

And we keep the docstring of reference_plane as it is.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was actually suggesting we replace reference_plane with base_position for example, the base_position specifies the polygon base between -1 and 1 with the two extremes meaning "bottom" (min value of slab along axis) and "top" (max value along axis). So it would replace reference_plane. I think what you've done to change the docstring is probably fine though. Feel free to merge this.

@weiliangjin2021 weiliangjin2021 merged commit 425b972 into develop Nov 15, 2022
@weiliangjin2021 weiliangjin2021 deleted the weiliang/slanted_cylinder branch November 15, 2022 23:05
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.

3 participants