-
Notifications
You must be signed in to change notification settings - Fork 109
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
update unify cycles #1413
base: main
Are you sure you want to change the base?
update unify cycles #1413
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1413 +/- ##
==========================================
+ Coverage 61.57% 61.68% +0.10%
==========================================
Files 207 207
Lines 22281 22292 +11
==========================================
+ Hits 13720 13751 +31
+ Misses 8561 8541 -20 ☔ View full report in Codecov by Sentry. |
"""Unify the cycles of the mesh. | ||
|
||
Parameters | ||
---------- | ||
root : str, optional |
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.
type of root is int
src/compas/topology/orientation.py
Outdated
@@ -166,6 +172,10 @@ def unify_cycles(vertices, faces, root=None): | |||
The faces of the mesh defined as lists of vertex indices. | |||
root : str, optional |
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.
same here
src/compas/topology/orientation.py
Outdated
if nmax is not None: | ||
if radius is not None: | ||
return _face_adjacency(points, faces, nmax=nmax, radius=radius) | ||
return _face_adjacency(points, faces, nmax=nmax) | ||
if radius is not None: | ||
return _face_adjacency(points, faces, radius=radius) |
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.
perhaps it would make sense to refactor _face_adjacency
such that you can write here
if nmax or radius:
return _face_adjacency(points, faces, nmax=nmax, radius=radius)
btw, since the switch is no longer based on the number of faces, it should be easier to test using generated boundary cases... |
correct. do you have something in mind or should I leave the tests for now? |
was thinking that we could use the meshgrid with awkward proportions in x and y to generate inputs where radius and nmax provide very different results in different directions... |
As noted in #1411 there is a problem with face_adjacency on meshes with arbitrary-sized faces. I've now exposed the parameters
radius
andnmax
fromcompas.topology._face_adjacency
tocompas.topology.face_adjacency
and further propagated them tounify_cycles
andMesh.unify_cycles
.What type of change is this?
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.CHANGELOG.md
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
).compas.datastructures.Mesh
.