Skip to content

10-100x speedup on per corner normals + caching adjacency#1745

Merged
alecjacobson merged 9 commits intomainfrom
piecewise-smooth-normals
Apr 12, 2021
Merged

10-100x speedup on per corner normals + caching adjacency#1745
alecjacobson merged 9 commits intomainfrom
piecewise-smooth-normals

Conversation

@alecjacobson
Copy link
Copy Markdown
Contributor

Fixes a few flaws in igl::per_corner_normals. Replaces vector<vector>> style adjacency with serialized adjacency, provides overload with cached adjacency, new function to build this cached adjacency (e.g., at mesh load) so --- for example --- sharp creases/corners are maintained during smooth deformation (compared to rerunning vanilla igl::per_corner_normals which could cause crease-popping). This alone gave good speedups, adding parallel_for moves it into 100x speedup range on my machine.

@alecjacobson alecjacobson changed the title 10-100x speed up on per corner normals + caching adjacency 10-100x speedup on per corner normals + caching adjacency Mar 8, 2021
Copy link
Copy Markdown
Collaborator

@jdumas jdumas left a comment

Choose a reason for hiding this comment

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

Nice!
My main recommendation for this PR would be to use stableNormalize() to normalize vectors, otherwise this may introduce NaNs for degenerate facets.

I'd be curious to compare speed with the compute_normal function we have in Lagrange -- it should be pretty optimized.

@jdumas jdumas added this to the v3.0.0 milestone Mar 8, 2021
@alecjacobson
Copy link
Copy Markdown
Contributor Author

#1785 is causing macos to fail. It was passing before and passes locally. I'm moving on.

@alecjacobson alecjacobson merged commit 4ba9c8d into main Apr 12, 2021
@alecjacobson alecjacobson deleted the piecewise-smooth-normals branch April 12, 2021 18:12
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.

2 participants