Modeling: add support for merging triangles with reference to topology
A new parameter, topology influence, is added that causes the join_triangles operator to prioritize edge joins that create quads with sensible geometry relative to existing quads, instead of selecting the 'flattest' and 'squarest' next pair and then leaving leftover triangles with no partners to merge with. This produces its best results with the face and shape thresholds set to 180 degrees (no hard limits as a restriction against merging) and topology influence somewhere between 100-130%, depending on the mesh. Too low and many parallelograms and triangles are left, too high and the algorithm tries too hard and starts making errors. Note that both quads already present in the selection, as well as the quads that are generated during the operator, will influence the topology around them. This allows the modeler to manually merge a few quads in key areas of the mesh, as a hint to the algorithm, indicating what result they way they want to see, and the algorithm will then take those quads into account and try to build around them according to the modeler's guidance. A new checkbox to leave only the remaining triangles selected has also been added. This helps users visualize what remains to be fixed. Ref !128610
This commit is contained in:
committed by
Campbell Barton
parent
085d959d87
commit
dc57693b0c
@@ -497,11 +497,36 @@ def main():
|
||||
|
||||
# Tris to Quads
|
||||
SpecMeshTest(
|
||||
"TrisToQuads", "testPlanesTrisToQuad", "expectedPlanesTrisToQuad",
|
||||
[OperatorSpecEditMode("tris_convert_to_quads", {"face_threshold": 0.174533, "shape_threshold": 0.174533,
|
||||
"uvs": True, "vcols": True, "seam": True, "sharp": True, "materials": True}, "VERT", {i for i in range(32)})],
|
||||
"TrisToQuads 10 deg no topo", "testPlanesTrisToQuad", "expectedPlanesTrisToQuad.10.notopo",
|
||||
[OperatorSpecEditMode(
|
||||
"tris_convert_to_quads",
|
||||
{"face_threshold": 0.174533, "shape_threshold": 0.174533,
|
||||
"topology_influence": 0, "deselect_joined": False,
|
||||
"uvs": True, "vcols": True, "seam": True, "sharp": True, "materials": True},
|
||||
"VERT", {i for i in range(42)})],
|
||||
),
|
||||
|
||||
SpecMeshTest(
|
||||
"TrisToQuads 180 deg no topo", "testPlanesTrisToQuad", "expectedPlanesTrisToQuad.180.notopo",
|
||||
[OperatorSpecEditMode(
|
||||
"tris_convert_to_quads",
|
||||
{"face_threshold": 3.14159, "shape_threshold": 3.14159,
|
||||
"topology_influence": 0, "deselect_joined": False,
|
||||
"uvs": True, "vcols": True, "seam": True, "sharp": True, "materials": True},
|
||||
"VERT", {i for i in range(42)})],
|
||||
),
|
||||
|
||||
SpecMeshTest(
|
||||
"TrisToQuads 180 deg topo", "testPlanesTrisToQuad", "expectedPlanesTrisToQuad.180.topo",
|
||||
[OperatorSpecEditMode(
|
||||
"tris_convert_to_quads",
|
||||
{"face_threshold": 3.14159, "shape_threshold": 3.14159,
|
||||
"topology_influence": 1, "deselect_joined": False,
|
||||
"uvs": True, "vcols": True, "seam": True, "sharp": True, "materials": True},
|
||||
"VERT", {i for i in range(42)})],
|
||||
),
|
||||
|
||||
|
||||
# unsubdivide
|
||||
# normal case
|
||||
SpecMeshTest(
|
||||
|
||||
Reference in New Issue
Block a user