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

Show points as spheres #56

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Show points as spheres #56

wants to merge 3 commits into from

Conversation

paulmelnikow
Copy link
Member

@paulmelnikow paulmelnikow commented Dec 17, 2021

TODO:

  • Apply color to the spheres

new_v = np.concatenate([mesh.v, new_v])

new_f = np.zeros((0, 3), dtype=np.int64)
for i, (a, b, c) in enumerate(mesh.f):
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: vectorize

[
np.average(triangles[:, 0:2], axis=1), # Midpoint of AB.
np.average(triangles[:, 1:3], axis=1), # Midpoint of BC.
np.average(triangles[:, 0:3:2], axis=1), # Midpoint of AC.
Copy link
Member Author

Choose a reason for hiding this comment

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

Todo: avoid duplicating points for repeated edges

]
)
if project_to_unit_sphere:
new_v = vg.normalize(new_v)
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove this. Normalize verts at the end, after repeated calls to subdivide().

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.

1 participant