-
Notifications
You must be signed in to change notification settings - Fork 185
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
[Feature] Add rectangle and triangle sdf_func #387
Conversation
Thanks for your contribution! |
ppsci/geometry/geometry_2d.py
Outdated
- v3p | ||
) | ||
|
||
s = self.is_inside(points).reshape(-1, 1) * 2 - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
变量名字建议不要单个小写字母,命名尽量能表明变量本身的意义
ppsci/geometry/geometry_2d.py
Outdated
""" | ||
assert points.shape[1] == 2, "The shape of points must be [N, 2]." | ||
center = (self.xmin + self.xmax) / 2 | ||
q = np.abs(points - center) - np.array([self.xmax - self.xmin]) / 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
变量名字建议不要单个小写字母,命名尽量能表明变量本身的意义
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* add rectangle and triangle sdf_func * fix naming
PR types
New features
PR changes
APIs
Describe
In this pull request, I have added the sdf_func implementations for rectangles and triangles. The visual result can be tested using the following code:
Visual Result
#376