-
Notifications
You must be signed in to change notification settings - Fork 233
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
"Relax mesh" node #3807
"Relax mesh" node #3807
Conversation
@@ -125,6 +126,8 @@ def process(self): | |||
new_face_data = [] | |||
bm.free() | |||
|
|||
new_faces = get_unique_faces(new_faces) |
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.
@portnov why did you add this line?, it slows a lot the node
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.
I don't remember exactly, there was some node which created meshes with duplicate faces, which broke the node...
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.
So you want me to leave it as an option or just delete it?
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.
Probably the correct option would be to remove it from here, and to create a separate node for "fixing any mesh"...
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.
Probably the correct option would be to remove it from here, and to create a separate node for "fixing any mesh"...
Yes, there is even request for such node. #3989
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.
i think such node might want to also output the indices from the original face list, which it has discarded
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.
I thought it should remove only repeated faces and edges. Bmesh module should be able to handle repeated vertices (with the same coordinates). Such vertices can be removed by 'Merge by distance' if needed.
This node moves vertices of the input mesh, in order to make it more "relaxed",
i.e. for mesh elements to have more even distribution in some sense. There are
several algorithms supported, each of which has different definition of what "relaxed" is:
each vertex, find centers of all incident faces, and then find the average of
those points; this will be the new location of the vertex. Effectively, this
algorithm tries to make each face as close to circle as possible. This
algorithm shows it's best for meshes that consist of Tris.
same length. Target edge length can be minimum, maximum or average of all
lengths of edges of the source mesh.
area. Target face area can be minimum, maximum or average of all areas of
faces of the source mes.
These algorithms can change the overall shape of the mesh a lot. In order to
try to preserve original shape of the mesh at least partially, the following
methods are supported:
found the new location of the vertex, put it at the same distance from the
plane where centers of incident faces lie, as the original vertex was. This
method can be slow for large meshes.
perpendicular to vertex normal).
on the original mesh.
Preflight checklist
Put an x letter in each brackets when you're done this item: