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

Inset Special Mk2 #4060

Merged
merged 4 commits into from
Apr 22, 2021
Merged

Inset Special Mk2 #4060

merged 4 commits into from
Apr 22, 2021

Conversation

vicdoval
Copy link
Collaborator

@vicdoval vicdoval commented Apr 21, 2021

Inset Special Mk2:
Speed test done with a 5000 faces voronoi sphere
Upgrades:

  • Numpy implementation (between 2 and 3,5 times faster than old implementation)
  • Multi-level recursive node

New modes:

  • Sides : Works like the inset faces node but around 1,5x faster for constant inset and 16x for variable inset (*only partial support for concave polygons)
  • Matrix: Works like Extrude Faces and Extrude Faces Lite in Matrix Mode but 8 times faster

New Input:

  • Custom Normals - custom normals for inset displacement

New outputs:

  • Original Vert Idx - the index of the original vertex. Can be used to pass Vertex Data to new vertices. In case of Zero inset in Fan mode the index of the new vertex will be the first index of the polygon
  • Original Face Idx - the index of the original face. Can be used to pass Face Data to new faces
  • Pols Group - Outputs a list to mask polygons from the modified mesh,
    0 = Original Polygon
    1 = Side polygon
    2 = Inset Polygon.
  • New Verts Mask - Mask of the new vertices

Custom Normal Example
image

Original Face idx and Original Vert Idx Example
image

New verts mask used to bevel only inset vertices
image

Pols group output to filter the outputted polygons
image

  • Code changes complete.
  • Code documentation complete.
  • Documentation for users complete (or not required, if user never sees these changes).
  • Manual testing done.
  • Unit-tests implemented.
  • Ready for merge.

@vicdoval vicdoval merged commit c74bbc7 into nortikin:master Apr 22, 2021
@zeffii
Copy link
Collaborator

zeffii commented Apr 22, 2021

very nice indeed. super fast :)

@Durman
Copy link
Collaborator

Durman commented Apr 22, 2021

Is it faster know than inset faces?

@vicdoval
Copy link
Collaborator Author

vicdoval commented Apr 22, 2021

Sides : Works like the inset faces node but around 1,5x faster for constant inset and 16x for variable inset (*only partial support for concave polygons)

Yes is faster but not so robust for concave polygons. Even with "Concave support" enable fails for polygons with weird shapes

@zeffii
Copy link
Collaborator

zeffii commented Apr 22, 2021

Even with "Concave support" enable fails for polygons with weird shapes

fails? as in flipping normals? not that that really matters, weird shapes polygons are uncommon, unless the user is specifically passing that kind of mesh, in practice it's not bothered me.

@vicdoval
Copy link
Collaborator Author

The normals are ok in all cases. This is what i call 'fail'
image

@zeffii
Copy link
Collaborator

zeffii commented Apr 23, 2021

ah, it doesn't know what's inside or outside, in the case of the concave. and therefor it doesn't know which direction to move the new vertex towards. just using the angles between consecutive verts isn't enough, i was working on an algorithm for this, if i recall correctly it used the fact that further processing was needed if it encountered any crossover edges (or non colinear edges pairs)

lots of methods to choose from, if A is the original edge, and B is the generated edge, if the middle of edges A is not offset distance away from the middle of edge B, then mark that vertex as a boundary of inflexion.

@vicdoval
Copy link
Collaborator Author

Yes, i was also thinking about some method @Durman suggested, something like:

pick the most left vertex of the polygon,
if the generated vertex is even more in the left then it means is outside.
An use that point to check the parallelism of the rest edges..

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