graphic design tool
git clone https://git.lucas.co/cce-designer.git
nodes/remesh.json (7.2K)
1 {
2 "name": "Remesh",
3 "type": "node",
4 "inputs": 1,
5 "outputs": 1,
6 "params": [
7 {
8 "name": "input",
9 "label": "Input",
10 "type": "node",
11 "default": "",
12 "description": "The node whose surface is remeshed. Its triangles are rebuilt toward an even edge length; point attributes ride through splits and collapses."
13 },
14 {
15 "name": "target_length",
16 "label": "Target Length",
17 "type": "slider",
18 "default": "0.10",
19 "min": 0.001,
20 "max": 1.0,
21 "step": 0.005,
22 "description": "Edge length, in world units, the mesh is steered toward. Edges over 4/3 of it are split and edges under 4/5 collapsed; smaller means denser."
23 },
24 {
25 "name": "iterations",
26 "label": "Iterations",
27 "type": "spinbox",
28 "default": "3",
29 "min": 1.0,
30 "max": 20.0,
31 "step": 1.0,
32 "description": "How many times the split, collapse, flip, relax and project passes repeat. More rounds settle the mesh closer to the target; it stops early once a round changes nothing."
33 },
34 {
35 "name": "relax",
36 "label": "Relax",
37 "type": "slider",
38 "default": "0.50",
39 "min": 0.0,
40 "max": 1.0,
41 "step": 0.01,
42 "description": "How far each point slides toward its neighbours' centroid along the surface in every round, evening out the triangles. 0 turns the relaxation off; 1 is full strength."
43 },
44 {
45 "name": "transfer",
46 "label": "Transfer",
47 "type": "toggle",
48 "default": "false",
49 "description": "After remeshing, copy point attributes (and optionally groups) onto the new points from the nearest point of a source mesh, so they survive the rebuild.",
50 "group": "transfer"
51 },
52 {
53 "name": "from",
54 "label": "From",
55 "type": "node",
56 "default": "",
57 "show_when": "transfer == true",
58 "description": "The node whose point attributes and groups are copied onto the remeshed points. Empty uses the remesh's own input, as it was before remeshing.",
59 "group": "transfer"
60 },
61 {
62 "name": "attributes",
63 "label": "Attributes",
64 "type": "text",
65 "default": "",
66 "show_when": "transfer == true",
67 "description": "Comma-separated names of the point attributes to copy from the source. Empty copies every point attribute the source has.",
68 "group": "transfer"
69 },
70 {
71 "name": "transfer_groups",
72 "label": "Transfer Groups",
73 "type": "toggle",
74 "default": "false",
75 "show_when": "transfer == true",
76 "description": "Also copy point group membership from the nearest source point, joining and leaving groups to match the source.",
77 "group": "transfer"
78 },
79 {
80 "name": "groups",
81 "label": "Groups",
82 "type": "text",
83 "default": "",
84 "show_when": "transfer == true && transfer_groups == true",
85 "description": "Comma-separated names of the point groups to copy. Empty copies every point group the source has.",
86 "group": "transfer"
87 },
88 {
89 "name": "maximum_distance",
90 "label": "Maximum Distance",
91 "type": "slider",
92 "default": "0.00",
93 "min": 0.0,
94 "max": 10.0,
95 "step": 0.01,
96 "show_when": "transfer == true",
97 "description": "Only points within this many world units of a source point receive values; farther points keep their own. 0 means no limit.",
98 "group": "transfer"
99 }
100 ],
101 "children": [
102 {
103 "name": "input1",
104 "type": "input",
105 "params": [],
106 "position": [
107 0.0,
108 0.0
109 ],
110 "geometry_visible": false
111 },
112 {
113 "name": "repeat1",
114 "type": "repeat",
115 "position": [
116 0.0,
117 1.0
118 ],
119 "params": [
120 {
121 "name": "input",
122 "default": "input1"
123 },
124 {
125 "name": "iterations",
126 "default": "chi(\"../iterations\")",
127 "expr": true
128 },
129 {
130 "name": "stop_when_unchanged",
131 "default": "true"
132 }
133 ],
134 "children": [
135 {
136 "name": "input1",
137 "type": "input",
138 "params": [],
139 "position": [
140 0.0,
141 0.0
142 ],
143 "geometry_visible": false
144 },
145 {
146 "name": "seed1",
147 "type": "seed",
148 "params": [],
149 "position": [
150 2.0,
151 0.0
152 ],
153 "geometry_visible": false
154 },
155 {
156 "name": "split1",
157 "type": "split_edges",
158 "position": [
159 0.0,
160 1.0
161 ],
162 "params": [
163 {
164 "name": "input",
165 "default": "input1"
166 },
167 {
168 "name": "target_length",
169 "default": "chf(\"../../target_length\")",
170 "expr": true
171 }
172 ],
173 "geometry_visible": false
174 },
175 {
176 "name": "collapse1",
177 "type": "collapse_edges",
178 "position": [
179 0.0,
180 2.0
181 ],
182 "params": [
183 {
184 "name": "input",
185 "default": "split1"
186 },
187 {
188 "name": "target_length",
189 "default": "chf(\"../../target_length\")",
190 "expr": true
191 }
192 ],
193 "geometry_visible": false
194 },
195 {
196 "name": "flip1",
197 "type": "flip_edges",
198 "position": [
199 0.0,
200 3.0
201 ],
202 "params": [
203 {
204 "name": "input",
205 "default": "collapse1"
206 },
207 {
208 "name": "target_length",
209 "default": "chf(\"../../target_length\")",
210 "expr": true
211 }
212 ],
213 "geometry_visible": false
214 },
215 {
216 "name": "relax1",
217 "type": "relax",
218 "position": [
219 0.0,
220 4.0
221 ],
222 "params": [
223 {
224 "name": "input",
225 "default": "flip1"
226 },
227 {
228 "name": "mode",
229 "default": "Tangential"
230 },
231 {
232 "name": "iterations",
233 "default": "1"
234 },
235 {
236 "name": "amount",
237 "default": "chf(\"../../relax\")",
238 "expr": true
239 }
240 ],
241 "geometry_visible": false
242 },
243 {
244 "name": "project1",
245 "type": "project",
246 "position": [
247 1.0,
248 5.0
249 ],
250 "params": [
251 {
252 "name": "input",
253 "default": "relax1"
254 },
255 {
256 "name": "surface",
257 "default": "seed1"
258 }
259 ],
260 "geometry_visible": false
261 },
262 {
263 "name": "output1",
264 "type": "output",
265 "position": [
266 1.0,
267 6.0
268 ],
269 "params": [
270 {
271 "name": "input",
272 "default": "project1"
273 }
274 ],
275 "geometry_visible": false
276 }
277 ],
278 "geometry_visible": false
279 },
280 {
281 "name": "transfer1",
282 "type": "transfer",
283 "position": [
284 1.0,
285 2.0
286 ],
287 "params": [
288 {
289 "name": "input",
290 "default": "repeat1"
291 },
292 {
293 "name": "from",
294 "default": "if(chs(\"../from\"), chs(\"../from\"), \"input1\")",
295 "expr": true
296 },
297 {
298 "name": "attributes",
299 "default": "chs(\"../attributes\")",
300 "expr": true
301 },
302 {
303 "name": "transfer_groups",
304 "default": "chb(\"../transfer_groups\")",
305 "expr": true
306 },
307 {
308 "name": "groups",
309 "default": "chs(\"../groups\")",
310 "expr": true
311 },
312 {
313 "name": "maximum_distance",
314 "default": "chf(\"../maximum_distance\")",
315 "expr": true
316 }
317 ],
318 "geometry_visible": false
319 },
320 {
321 "name": "transfer_switch1",
322 "type": "switch",
323 "position": [
324 0.0,
325 3.0
326 ],
327 "params": [
328 {
329 "name": "input",
330 "default": "repeat1"
331 },
332 {
333 "name": "input_2",
334 "default": "transfer1"
335 },
336 {
337 "name": "index",
338 "default": "chi(\"../transfer\")",
339 "expr": true
340 }
341 ]
342 },
343 {
344 "name": "output1",
345 "type": "output",
346 "position": [
347 0.0,
348 4.0
349 ],
350 "params": [
351 {
352 "name": "input",
353 "default": "transfer_switch1"
354 }
355 ],
356 "geometry_visible": false
357 }
358 ]
359 }