git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

nodes/relax.json (3.2K)

 1 {
 2   "name": "Relax",
 3   "type": "relax",
 4   "inputs": 1,
 5   "outputs": 1,
 6   "params": [
 7     {
 8       "name": "input",
 9       "label": "Input",
10       "default": "",
11       "type": "node",
12       "description": "The geometry to relax. Its points are moved and everything else passes through."
13     },
14     {
15       "name": "mode",
16       "label": "Mode",
17       "type": "choice:Springs,Repel,Tangential",
18       "default": "Springs",
19       "description": "Springs pulls edge lengths back toward those of the Rest geometry. Repel pushes points apart until spheres of Radius stop overlapping. Tangential evens out triangles along the surface."
20     },
21     {
22       "name": "rest",
23       "label": "Rest",
24       "default": "",
25       "type": "node",
26       "show_when": "mode == Springs",
27       "description": "The geometry whose edge lengths the springs restore; inside a simnet usually its input node. Must have the same point count as Input, or nothing moves.",
28       "group": "springs"
29     },
30     {
31       "name": "pin_group",
32       "label": "Pin Group",
33       "default": "",
34       "type": "group",
35       "show_when": "mode == Springs",
36       "description": "Points in this group keep their input position and push the others instead, so a displacement applied to them spreads through the surface. Empty pins nothing.",
37       "group": "springs"
38     },
39     {
40       "name": "stiffness",
41       "label": "Stiffness",
42       "type": "slider",
43       "default": "0.50",
44       "min": 0.0,
45       "max": 1.0,
46       "step": 0.05,
47       "show_when": "mode == Springs",
48       "description": "Fraction of each edge's length error corrected per pass. Higher values relax faster and stiffer; 0 leaves the points where they are.",
49       "group": "springs"
50     },
51     {
52       "name": "iterations",
53       "label": "Iterations",
54       "type": "spinbox",
55       "default": "8",
56       "min": 0.0,
57       "max": 50.0,
58       "step": 1.0,
59       "description": "Number of relaxation passes. More passes settle further. In Repel and Tangential modes 0 turns the node off; Springs always runs at least one.",
60       "group": "solve"
61     },
62     {
63       "name": "radius",
64       "label": "Radius",
65       "type": "slider",
66       "default": "0.05",
67       "min": 0.001,
68       "max": 1.0,
69       "step": 0.001,
70       "show_when": "mode == Repel",
71       "description": "Radius of the sphere around each point, in world units; points are pushed apart until these spheres stop overlapping. Larger spaces points further apart.",
72       "group": "repel"
73     },
74     {
75       "name": "in_3d_space",
76       "label": "In 3D Space",
77       "type": "toggle",
78       "default": "false",
79       "show_when": "mode == Repel",
80       "description": "When off, points slide only along the surface (in their tangent plane) as they repel. When on, they may move freely in 3D and leave the surface.",
81       "group": "repel"
82     },
83     {
84       "name": "amount",
85       "label": "Amount",
86       "type": "slider",
87       "default": "0.50",
88       "min": 0.0,
89       "max": 1.0,
90       "step": 0.01,
91       "show_when": "mode == Tangential",
92       "description": "How far each point moves toward the centroid of its neighbours per pass, 0 to 1, less the part along its normal, so triangles even out while the shape stays. 0 turns it off.",
93       "group": "tangential"
94     }
95   ]
96 }