Skip to content

Commit 148fd89

Browse files
[UPDATE] **Labs Quadrangulate 2.0 SOP** - Replaced Dissolve SOP internally with version 2.0 to make it compilable, set internal group code, cleaned up the network and removed the nested networks.
1 parent 56ea147 commit 148fd89

File tree

13 files changed

+4369
-5875
lines changed

13 files changed

+4369
-5875
lines changed
Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,64 @@
11
= Labs Quadrangulate =
22

3-
#type: node
4-
#context: sop
5-
#internal: labs::sop_quadrangulate::2.0
6-
#icon: quadrangulate
7-
#tags: sidefxlabs, model, gamedev, cleanup
3+
#type: node
4+
#context: sop
5+
#internal: labs::sop_quadrangulate::2.0
6+
#icon: quadrangulate
87

9-
""" Simple Node to take a triangulated mesh and attempt to collapse the diagonal edges to return the mesh to a quad dominant state """
8+
"""Converts triangulated meshes back into a quad-dominant topology by collapsing diagonal edges and repairing resulting N-gons."""
109

11-
The Quadrangulate Node is designed to remove obvious edges from a triangulated mesh in order to return to what the original quad mesh would've looked like.
10+
The _Labs Quadrangulate SOP_ identifies and collapses diagonal edges created during triangulation to approximate the original quad layout of a mesh.
1211

13-
It works as a 2 step process, the first step is identifying the diagonal edges in the quads, this can be done iteratively or by assuming a good vertex order.
14-
15-
Those edges are then deleted, but in some cases this also deletes polygons that were tris on the original mesh.
12+
The process consists of two stages:
13+
# *Reduction Stage* — Identifies diagonal edges in triangulated quads and collapses them. This can be performed iteratively or by assuming a consistent vertex order.
14+
15+
# *Refinement Stage* — Repairs polygons with more than four vertices that result from edge removal. These regions can be resolved through quadrilateral PolyFill operations or through iterative subdivision until only quads or triangles remain.
1616

17-
The second step works by fixing those edges that have more than 4 points, you can either use a polyFill approach to fix those areas, or another iterative approach where it divides the mesh up until quads are left.
17+
This workflow restores quad structure while avoiding silhouette loss when desired.
1818

1919
[Image:/images/quadrangulate_2_squab.jpg]
2020

2121
[Image:/images/quadrangulate_2_sphere.jpg]
2222

2323
@parameters
24-
2524
== Reduction Method ==
26-
Method:
27-
Vertex Order:
28-
Delete every Nth edge of a model
25+
Method:
26+
#id: method
27+
The method used to identify edges for collapse.
2928

30-
Longest Edge:
31-
Iteratively remove the longest edge in the mesh until there are only quads left
29+
Vertex Order:
30+
Collapses every Nth diagonal edge based on vertex ordering.
31+
32+
Longest Edge:
33+
Iteratively collapses the longest edges until only quads remain.
3234

3335
Edge to Collapse:
34-
While in Vertex Order Mode this selects which edge of the triangle to collapse, 1st, 2nd or 3rd
36+
#id: edgetocollapse
37+
Specifies which edge of each triangle is collapsed when *Method* is set to `Vertex Order`. Options correspond to the 1st, 2nd, or 3rd edge in vertex order.
3538

36-
Protect Silhouette:
37-
Avoid deletion of edges that break the silhouette
39+
Protect Silhouette:
40+
#id: protectsilhouette
41+
Prevents collapsing edges that would alter the mesh silhouette.
3842

39-
Normal Angle:
40-
When Protect Silhouette is on, this determines the angle between 2 faces to break in.
43+
Normal Angle:
44+
#id: normalangle
45+
The angle between adjacent polygons used to detect silhouette-breaking edges when *Protect Silhouette* is turned on.
4146

4247
== Refine Method ==
43-
Refine Method:
48+
Refine Method:
49+
#id: refinemethod
50+
The method used to resolve N-gons created by edge removal.
51+
4452
PolyFill:
45-
Resolve NGons by using the PolyFill Quadrilaterals option.
53+
Fills N-gons using the PolyFill quadrilateral generation method.
4654

4755
Iterative Divide:
48-
Iterative slice the NGons until they are all quads or tris.
56+
Iteratively divides N-gons until only quads or triangles remain.
4957

5058
Fallback Fill Mode:
51-
When in PolyFill mode, how to resolve cases where the Quadrilaterals option fails
59+
#id: fillmode
60+
Fallback strategy used when PolyFill quadrilateral generation fails.
5261

5362
Edge to Dissolve:
54-
When in Iterative Divide mode, how to determine which edge to be divided
55-
56-
63+
#id: edgemethod
64+
Determines which edges are dissolved when *Refine Method* is set to `Iterative Divide`.

otls/quadrangulate.hda/INDEX__SECTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Path: oplib:/labs::Sop/quadrangulate::2.0?labs::Sop/quadrangulate::2.0
1818
Icon: opdef:/labs::Sop/quadrangulate::2.0?IconSVG
1919
Table: Sop
2020
License:
21-
Extra:
21+
Extra: inputcolors='1 "RGB 0.700195 0.700195 0.700195" ' outputcolors='1 "RGB 0.700195 0.700195 0.700195" '
2222
User:
2323
Inputs: 1 to 1
2424
Subnet: true
2525
Python: false
2626
Empty: false
27-
Modified: Mon Dec 12 12:29:07 2022
27+
Modified: Tue Dec 9 16:42:30 2025
2828

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
{
2-
"hdaroot/final_groups1.def":1570731914,
3-
"hdaroot/force_remove_group1.def":1570731876,
4-
"hdaroot/switch4.def":1572884588,
52
"hdaroot/to_ignore_group1.def":1570731876,
6-
"hdaroot/force_remove_group.def":1570731876,
3+
"hdaroot/groupcombine1.def":1570731914,
74
"hdaroot/to_ingore_merge.def":1570731983,
8-
"hdaroot/grouptransfer1.def":1570731978,
95
"hdaroot/to_ignore_group.def":1570731876,
10-
"hdaroot/object_merge1.def":1570731589,
11-
"hdaroot/REMOVE_BOUNDARIES1/subtract_borders.def":1570731263,
12-
"hdaroot/REMOVE_BOUNDARIES1.def":1570731308,
13-
"hdaroot/on_ignore_boundaries.def":1570731317,
14-
"hdaroot/groupcombine1.def":1570731914,
15-
"hdaroot/REMOVE_BOUNDARIES/group_borders.def":1570731220,
16-
"hdaroot/REMOVE_BOUNDARIES1/groupdelete2.def":1570731286,
17-
"hdaroot/REMOVE_BOUNDARIES.def":1570731308,
18-
"hdaroot/output0.def":1569529275,
19-
"hdaroot/cleanup_long_edge_group.def":1569528521,
20-
"hdaroot/CHECK_FOR_UVS.def":1570731103,
21-
"hdaroot/REMOVE_BOUNDARIES/subtract_borders.def":1570731263,
6+
"hdaroot/redivide_to_ensure_quads.def":1569528679,
7+
"hdaroot/REMOVE_BOUNDARIES/groupdelete2.def":1570731286,
8+
"hdaroot/sop_uv_transfer1.def":1569522948,
9+
"hdaroot/REMOVE_BOUNDARIES1/group_borders.def":1570731220,
10+
"hdaroot/switch2.def":1569528658,
11+
"hdaroot/final_groups1.def":1570731914,
12+
"hdaroot/grouptransfer1.def":1570731978,
13+
"hdaroot/divide5.def":1397218636,
2214
"hdaroot/groupdelete1.def":1569528521,
23-
"hdaroot/divide7.def":1569509073,
15+
"hdaroot/force_remove_group.def":1570731876,
2416
"hdaroot/groupcombine2.def":1570731914,
25-
"hdaroot/dissolve4.def":1397293990,
26-
"hdaroot/divide5.def":1397218636,
27-
"hdaroot/REMOVE_BOUNDARIES1/to_edges.def":1570731242,
28-
"hdaroot/IN.def":1569528576,
29-
"hdaroot/redivide_to_ensure_quads.def":1569528679,
30-
"hdaroot/switch1.def":1569528572,
31-
"hdaroot/facet1.def":1397218607,
3217
"hdaroot/fuse1.def":1397218657,
33-
"hdaroot/final_groups.def":1570731914,
18+
"hdaroot/dissolve4.def":1397293990,
3419
"hdaroot/sop_uv_transfer2.def":1569522948,
35-
"hdaroot/convert1.def":1397218623,
36-
"hdaroot/sop_uv_transfer1.def":1569522948,
20+
"hdaroot/switch3.def":1572884588,
21+
"hdaroot/attribwrangle2.def":1397238966,
3722
"hdaroot/long_edge_based_on_angle.def":1397238966,
38-
"hdaroot/REMOVE_BOUNDARIES/to_edges.def":1570731242,
39-
"hdaroot/REMOVE_BOUNDARIES/groupdelete2.def":1570731286,
40-
"hdaroot/attribwrangle3.def":1397238966,
41-
"hdaroot/dissolve1.def":1397293990,
42-
"hdaroot/switch2.def":1569528658,
23+
"hdaroot/IN.def":1569528576,
24+
"hdaroot/object_merge1.def":1570731589,
25+
"hdaroot.def":1572878768,
4326
"hdaroot/group_long_edges.def":1397238966,
44-
"hdaroot/on_ignore_boundaries1.def":1570731317,
45-
"hdaroot/tristrip1.def":1397217803,
46-
"hdaroot/switch3.def":1572884588,
47-
"hdaroot/REMOVE_BOUNDARIES1/group_borders.def":1570731220,
48-
"hdaroot/__netbox1.netboxinit":1570731035,
27+
"hdaroot/REMOVE_BOUNDARIES1/subtract_borders.def":1570731263,
28+
"hdaroot/final_groups.def":1570731914,
29+
"hdaroot/facet1.def":1397218607,
30+
"hdaroot/cleanup_long_edge_group.def":1569528521,
4931
"hdaroot/dissolve_long_edges.def":1397293990,
50-
"hdaroot/attribwrangle2.def":1397238966,
32+
"hdaroot/force_remove_group1.def":1570731876,
33+
"hdaroot/REMOVE_BOUNDARIES1/groupdelete2.def":1570731286,
34+
"hdaroot/convert1.def":1397218623,
35+
"hdaroot/on_ignore_boundaries.def":1570731317,
36+
"hdaroot/dissolve1.def":1397293990,
37+
"hdaroot/switch4.def":1572884588,
38+
"hdaroot/attribwrangle3.def":1397238966,
39+
"hdaroot/divide7.def":1569509073,
40+
"hdaroot/REMOVE_BOUNDARIES/to_edges.def":1570731242,
5141
"hdaroot/attribtransfer1.def":1570731584,
52-
"hdaroot.def":1572878768
42+
"hdaroot/REMOVE_BOUNDARIES1.def":1570731308,
43+
"hdaroot/output0.def":1569529275,
44+
"hdaroot/CHECK_FOR_UVS.def":1570731103,
45+
"hdaroot/REMOVE_BOUNDARIES1/to_edges.def":1570731242,
46+
"hdaroot/REMOVE_BOUNDARIES/subtract_borders.def":1570731263,
47+
"hdaroot/switch1.def":1569528572,
48+
"hdaroot/__netbox1.netboxinit":1570731035,
49+
"hdaroot/REMOVE_BOUNDARIES/group_borders.def":1570731220,
50+
"hdaroot/REMOVE_BOUNDARIES.def":1570731308,
51+
"hdaroot/on_ignore_boundaries1.def":1570731317,
52+
"hdaroot/tristrip1.def":1397217803
5353
}

otls/quadrangulate.hda/labs_8_8Sop_1quadrangulate/Contents.dir/Contents.houdini_versions

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,48 @@
22
"values":["17.5.360"
33
],
44
"indexes":{
5-
"hdaroot/final_groups1.userdata":0,
6-
"hdaroot/force_remove_group1.userdata":0,
7-
"hdaroot/switch4.userdata":0,
8-
"hdaroot/force_remove_group.userdata":0,
9-
"hdaroot/to_ingore_merge.userdata":0,
10-
"hdaroot/groupcombine2.userdata":0,
11-
"hdaroot/to_ignore_group.userdata":0,
12-
"hdaroot/object_merge1.userdata":0,
13-
"hdaroot/final_groups.userdata":0,
5+
"hdaroot/fuse1.userdata":0,
6+
"hdaroot/REMOVE_BOUNDARIES1/groupdelete2.userdata":0,
7+
"hdaroot/REMOVE_BOUNDARIES/group_borders.userdata":0,
8+
"hdaroot/output0.userdata":0,
149
"hdaroot/on_ignore_boundaries1.userdata":0,
15-
"hdaroot/REMOVE_BOUNDARIES1/subtract_borders.userdata":0,
16-
"hdaroot/grouptransfer1.userdata":0,
17-
"hdaroot/REMOVE_BOUNDARIES1/to_edges.userdata":0,
10+
"hdaroot/attribtransfer1.userdata":0,
11+
"hdaroot/groupcombine2.userdata":0,
1812
"hdaroot/on_ignore_boundaries.userdata":0,
13+
"hdaroot/to_ignore_group.userdata":0,
1914
"hdaroot/REMOVE_BOUNDARIES/groupdelete2.userdata":0,
20-
"hdaroot/REMOVE_BOUNDARIES/subtract_borders.userdata":0,
21-
"hdaroot/REMOVE_BOUNDARIES/group_borders.userdata":0,
22-
"hdaroot/REMOVE_BOUNDARIES1/group_borders.userdata":0,
23-
"hdaroot/REMOVE_BOUNDARIES.userdata":0,
24-
"hdaroot/CHECK_FOR_UVS.userdata":0,
25-
"hdaroot/attribtransfer1.userdata":0,
15+
"hdaroot/to_ignore_group1.userdata":0,
2616
"hdaroot/dissolve_long_edges.userdata":0,
2717
"hdaroot/IN.userdata":0,
2818
"hdaroot/groupdelete1.userdata":0,
29-
"hdaroot/switch1.userdata":0,
30-
"hdaroot/divide7.userdata":0,
31-
"hdaroot/groupcombine1.userdata":0,
32-
"hdaroot/dissolve4.userdata":0,
33-
"hdaroot/REMOVE_BOUNDARIES1/groupdelete2.userdata":0,
34-
"hdaroot/switch2.userdata":0,
35-
"hdaroot/divide5.userdata":0,
36-
"hdaroot/to_ignore_group1.userdata":0,
37-
"hdaroot/convert1.userdata":0,
38-
"hdaroot/facet1.userdata":0,
19+
"hdaroot/CHECK_FOR_UVS.userdata":0,
3920
"hdaroot/switch3.userdata":0,
40-
"hdaroot/dissolve1.userdata":0,
21+
"hdaroot/final_groups1.userdata":0,
22+
"hdaroot/force_remove_group1.userdata":0,
23+
"hdaroot/dissolve4.userdata":0,
24+
"hdaroot/divide7.userdata":0,
25+
"hdaroot/redivide_to_ensure_quads.userdata":0,
4126
"hdaroot/tristrip1.userdata":0,
27+
"hdaroot/grouptransfer1.userdata":0,
4228
"hdaroot/REMOVE_BOUNDARIES/to_edges.userdata":0,
43-
"hdaroot/cleanup_long_edge_group.userdata":0,
29+
"hdaroot/final_groups.userdata":0,
30+
"hdaroot/facet1.userdata":0,
31+
"hdaroot/REMOVE_BOUNDARIES1/group_borders.userdata":0,
4432
"hdaroot/REMOVE_BOUNDARIES1.userdata":0,
45-
"hdaroot/output0.userdata":0,
46-
"hdaroot/fuse1.userdata":0,
47-
"hdaroot/redivide_to_ensure_quads.userdata":0
33+
"hdaroot/cleanup_long_edge_group.userdata":0,
34+
"hdaroot/switch1.userdata":0,
35+
"hdaroot/convert1.userdata":0,
36+
"hdaroot/REMOVE_BOUNDARIES1/subtract_borders.userdata":0,
37+
"hdaroot/force_remove_group.userdata":0,
38+
"hdaroot/REMOVE_BOUNDARIES1/to_edges.userdata":0,
39+
"hdaroot/divide5.userdata":0,
40+
"hdaroot/to_ingore_merge.userdata":0,
41+
"hdaroot/REMOVE_BOUNDARIES/subtract_borders.userdata":0,
42+
"hdaroot/switch2.userdata":0,
43+
"hdaroot/REMOVE_BOUNDARIES.userdata":0,
44+
"hdaroot/object_merge1.userdata":0,
45+
"hdaroot/switch4.userdata":0,
46+
"hdaroot/dissolve1.userdata":0,
47+
"hdaroot/groupcombine1.userdata":0
4848
}
4949
}
Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
{
2-
"hdaroot/final_groups1.def":1572899595,
3-
"hdaroot/force_remove_group1.def":1572884841,
4-
"hdaroot/switch4.def":1572899349,
52
"hdaroot/to_ignore_group1.def":1572899468,
6-
"hdaroot/force_remove_group.def":1572884841,
3+
"hdaroot/groupcombine1.def":1572899236,
74
"hdaroot/to_ingore_merge.def":1572899519,
8-
"hdaroot/grouptransfer1.def":1572899585,
95
"hdaroot/to_ignore_group.def":1572899228,
10-
"hdaroot/object_merge1.def":1570731963,
11-
"hdaroot/REMOVE_BOUNDARIES1/subtract_borders.def":1570731308,
12-
"hdaroot/REMOVE_BOUNDARIES1.def":1572884773,
13-
"hdaroot/on_ignore_boundaries.def":1572884831,
14-
"hdaroot/groupcombine1.def":1572899236,
15-
"hdaroot/REMOVE_BOUNDARIES/group_borders.def":1570731308,
16-
"hdaroot/REMOVE_BOUNDARIES1/groupdelete2.def":1570731308,
17-
"hdaroot/REMOVE_BOUNDARIES.def":1572884831,
18-
"hdaroot/output0.def":1572884773,
19-
"hdaroot/cleanup_long_edge_group.def":1572884773,
20-
"hdaroot/CHECK_FOR_UVS.def":1572884773,
21-
"hdaroot/REMOVE_BOUNDARIES/subtract_borders.def":1570731308,
6+
"hdaroot/redivide_to_ensure_quads.def":1572884773,
7+
"hdaroot/REMOVE_BOUNDARIES/groupdelete2.def":1570731308,
8+
"hdaroot/sop_uv_transfer1.def":1572884773,
9+
"hdaroot/REMOVE_BOUNDARIES1/group_borders.def":1570731308,
10+
"hdaroot/switch2.def":1572884773,
11+
"hdaroot/final_groups1.def":1572899595,
12+
"hdaroot/grouptransfer1.def":1572899585,
13+
"hdaroot/divide5.def":1572884773,
2214
"hdaroot/groupdelete1.def":1572884773,
23-
"hdaroot/divide7.def":1572899595,
15+
"hdaroot/force_remove_group.def":1572884841,
2416
"hdaroot/groupcombine2.def":1572899591,
25-
"hdaroot/dissolve4.def":1572899594,
26-
"hdaroot/divide5.def":1572884773,
27-
"hdaroot/REMOVE_BOUNDARIES1/to_edges.def":1570731308,
28-
"hdaroot/IN.def":1572884517,
29-
"hdaroot/redivide_to_ensure_quads.def":1572884773,
30-
"hdaroot/switch1.def":1572884773,
31-
"hdaroot/facet1.def":1572884773,
3217
"hdaroot/fuse1.def":1572884773,
33-
"hdaroot/final_groups.def":1572899507,
18+
"hdaroot/dissolve4.def":1572899594,
3419
"hdaroot/sop_uv_transfer2.def":1572884773,
35-
"hdaroot/convert1.def":1572884773,
36-
"hdaroot/sop_uv_transfer1.def":1572884773,
20+
"hdaroot/switch3.def":1572899225,
21+
"hdaroot/attribwrangle2.def":1572884773,
3722
"hdaroot/long_edge_based_on_angle.def":1572884773,
38-
"hdaroot/REMOVE_BOUNDARIES/to_edges.def":1570731308,
39-
"hdaroot/REMOVE_BOUNDARIES/groupdelete2.def":1570731308,
40-
"hdaroot/attribwrangle3.def":1572884773,
41-
"hdaroot/dissolve1.def":1572884773,
42-
"hdaroot/switch2.def":1572884773,
23+
"hdaroot/IN.def":1572884517,
24+
"hdaroot/object_merge1.def":1570731963,
25+
"hdaroot.def":1572899857,
4326
"hdaroot/group_long_edges.def":1572884833,
44-
"hdaroot/on_ignore_boundaries1.def":1572884773,
45-
"hdaroot/tristrip1.def":1572884773,
46-
"hdaroot/switch3.def":1572899225,
47-
"hdaroot/REMOVE_BOUNDARIES1/group_borders.def":1570731308,
48-
"hdaroot/__netbox1.netboxinit":1572878773,
27+
"hdaroot/REMOVE_BOUNDARIES1/subtract_borders.def":1570731308,
28+
"hdaroot/final_groups.def":1572899507,
29+
"hdaroot/facet1.def":1572884773,
30+
"hdaroot/cleanup_long_edge_group.def":1572884773,
4931
"hdaroot/dissolve_long_edges.def":1572899486,
50-
"hdaroot/attribwrangle2.def":1572884773,
32+
"hdaroot/force_remove_group1.def":1572884841,
33+
"hdaroot/REMOVE_BOUNDARIES1/groupdelete2.def":1570731308,
34+
"hdaroot/convert1.def":1572884773,
35+
"hdaroot/on_ignore_boundaries.def":1572884831,
36+
"hdaroot/dissolve1.def":1572884773,
37+
"hdaroot/switch4.def":1572899349,
38+
"hdaroot/attribwrangle3.def":1572884773,
39+
"hdaroot/divide7.def":1572899595,
40+
"hdaroot/REMOVE_BOUNDARIES/to_edges.def":1570731308,
5141
"hdaroot/attribtransfer1.def":1572884773,
52-
"hdaroot.def":1572899857
42+
"hdaroot/REMOVE_BOUNDARIES1.def":1572884773,
43+
"hdaroot/output0.def":1572884773,
44+
"hdaroot/CHECK_FOR_UVS.def":1572884773,
45+
"hdaroot/REMOVE_BOUNDARIES1/to_edges.def":1570731308,
46+
"hdaroot/REMOVE_BOUNDARIES/subtract_borders.def":1570731308,
47+
"hdaroot/switch1.def":1572884773,
48+
"hdaroot/__netbox1.netboxinit":1572878773,
49+
"hdaroot/REMOVE_BOUNDARIES/group_borders.def":1570731308,
50+
"hdaroot/REMOVE_BOUNDARIES.def":1572884831,
51+
"hdaroot/on_ignore_boundaries1.def":1572884773,
52+
"hdaroot/tristrip1.def":1572884773
5353
}

0 commit comments

Comments
 (0)