topotopo 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/NOTICE +40 -10
  2. package/README.md +475 -111
  3. package/dist/cli.js +328 -133
  4. package/dist/config.d.ts +48 -0
  5. package/dist/config.js +170 -0
  6. package/dist/core/analysis.d.ts +5 -1
  7. package/dist/core/analysis.js +8 -3
  8. package/dist/core/bake.d.ts +16 -8
  9. package/dist/core/bake.js +165 -29
  10. package/dist/core/bevel.d.ts +3 -1
  11. package/dist/core/bevel.js +238 -97
  12. package/dist/core/decimate.d.ts +65 -0
  13. package/dist/core/decimate.js +409 -3
  14. package/dist/core/erosion.d.ts +37 -0
  15. package/dist/core/erosion.js +41 -1
  16. package/dist/core/geometry.d.ts +5 -1
  17. package/dist/core/geometry.js +204 -4
  18. package/dist/core/heightfield.d.ts +27 -4
  19. package/dist/core/heightfield.js +54 -16
  20. package/dist/core/imageops.d.ts +6 -0
  21. package/dist/core/imageops.js +51 -0
  22. package/dist/core/intrinsics.d.ts +7 -0
  23. package/dist/core/intrinsics.js +94 -0
  24. package/dist/core/manifold.d.ts +12 -1
  25. package/dist/core/manifold.js +78 -6
  26. package/dist/core/materials.d.ts +11 -0
  27. package/dist/core/materials.js +56 -0
  28. package/dist/core/noise.d.ts +9 -0
  29. package/dist/core/noise.js +10 -1
  30. package/dist/core/packed.js +11 -0
  31. package/dist/core/particles.d.ts +1 -1
  32. package/dist/core/particles.js +1 -1
  33. package/dist/core/polymerge.d.ts +21 -0
  34. package/dist/core/polymerge.js +327 -0
  35. package/dist/core/rbd.js +13 -1
  36. package/dist/core/repair.d.ts +2 -0
  37. package/dist/core/repair.js +2 -0
  38. package/dist/core/report.d.ts +70 -0
  39. package/dist/core/report.js +275 -0
  40. package/dist/core/scatter.d.ts +1 -1
  41. package/dist/core/scatter.js +1 -1
  42. package/dist/core/scene.d.ts +20 -0
  43. package/dist/core/scene.js +72 -0
  44. package/dist/core/sha256.d.ts +4 -0
  45. package/dist/core/sha256.js +69 -0
  46. package/dist/core/shapes.d.ts +3 -0
  47. package/dist/core/shapes.js +34 -0
  48. package/dist/core/snippet-lib.d.ts +15 -2
  49. package/dist/core/snippet-lib.js +40 -14
  50. package/dist/core/solidify.d.ts +38 -0
  51. package/dist/core/solidify.js +356 -0
  52. package/dist/core/tangents.d.ts +54 -0
  53. package/dist/core/tangents.js +218 -0
  54. package/dist/core/texcoord.d.ts +4 -0
  55. package/dist/core/texcoord.js +14 -0
  56. package/dist/core/texnoise.d.ts +6 -1
  57. package/dist/core/texnoise.js +6 -2
  58. package/dist/core/texsdf.d.ts +131 -0
  59. package/dist/core/texsdf.js +637 -0
  60. package/dist/core/texture.d.ts +163 -9
  61. package/dist/core/texture.js +844 -20
  62. package/dist/core/topology.d.ts +32 -0
  63. package/dist/core/topology.js +238 -7
  64. package/dist/core/traceimage.d.ts +7 -0
  65. package/dist/core/traceimage.js +221 -0
  66. package/dist/core/tritri.d.ts +5 -0
  67. package/dist/core/tritri.js +120 -0
  68. package/dist/core/unwrap.d.ts +72 -0
  69. package/dist/core/unwrap.js +800 -0
  70. package/dist/core/usercode.d.ts +27 -0
  71. package/dist/core/usercode.js +87 -0
  72. package/dist/core/uv.d.ts +15 -16
  73. package/dist/core/uv.js +36 -189
  74. package/dist/core/uvislands.d.ts +62 -0
  75. package/dist/core/uvislands.js +574 -0
  76. package/dist/core/uvoverlap.d.ts +58 -0
  77. package/dist/core/uvoverlap.js +220 -0
  78. package/dist/core/uvpack.d.ts +64 -0
  79. package/dist/core/uvpack.js +628 -0
  80. package/dist/core/uvreport.d.ts +127 -0
  81. package/dist/core/uvreport.js +372 -0
  82. package/dist/core/wrangle.d.ts +6 -1
  83. package/dist/core/wrangle.js +27 -16
  84. package/dist/core/xatlas.d.ts +16 -1
  85. package/dist/core/xatlas.js +95 -61
  86. package/dist/engines.d.ts +63 -0
  87. package/dist/engines.js +180 -0
  88. package/dist/explain.d.ts +4 -3
  89. package/dist/explain.js +129 -12
  90. package/dist/graph/engine.d.ts +92 -29
  91. package/dist/graph/engine.js +298 -148
  92. package/dist/graph/expr.d.ts +6 -3
  93. package/dist/graph/expr.js +18 -8
  94. package/dist/graph/outputs.d.ts +23 -0
  95. package/dist/graph/outputs.js +41 -0
  96. package/dist/graph/packages.d.ts +72 -0
  97. package/dist/graph/packages.js +261 -0
  98. package/dist/graph/parallel.d.ts +3 -1
  99. package/dist/graph/parallel.js +4 -1
  100. package/dist/graph/params.d.ts +6 -0
  101. package/dist/graph/params.js +34 -7
  102. package/dist/graph/scope.d.ts +55 -0
  103. package/dist/graph/scope.js +14 -0
  104. package/dist/graph/types.d.ts +75 -12
  105. package/dist/graph/types.js +4 -2
  106. package/dist/graph/vars.d.ts +16 -0
  107. package/dist/graph/vars.js +80 -0
  108. package/dist/host/artifacts.d.ts +10 -1
  109. package/dist/host/artifacts.js +37 -6
  110. package/dist/host/cook.d.ts +241 -0
  111. package/dist/host/cook.js +844 -0
  112. package/dist/host/export-targets.d.ts +42 -5
  113. package/dist/host/export-targets.js +72 -13
  114. package/dist/host/godot-commands.d.ts +4 -0
  115. package/dist/host/godot-commands.js +21 -0
  116. package/dist/host/godot.d.ts +183 -0
  117. package/dist/host/godot.js +916 -0
  118. package/dist/host/node.d.ts +12 -7
  119. package/dist/host/node.js +27 -9
  120. package/dist/host/pool.js +51 -2
  121. package/dist/host/sidecars.d.ts +8 -0
  122. package/dist/host/sidecars.js +50 -0
  123. package/dist/host/types.d.ts +19 -6
  124. package/dist/host/version.d.ts +1 -0
  125. package/dist/host/version.js +3 -0
  126. package/dist/host/worker.js +5 -2
  127. package/dist/index.d.ts +5 -3
  128. package/dist/index.js +3 -2
  129. package/dist/inspect.d.ts +84 -1
  130. package/dist/inspect.js +271 -24
  131. package/dist/io/common.d.ts +33 -5
  132. package/dist/io/export.js +2 -1
  133. package/dist/io/files.d.ts +23 -4
  134. package/dist/io/files.js +60 -8
  135. package/dist/io/gltf.js +355 -51
  136. package/dist/io/heightmap.d.ts +3 -0
  137. package/dist/io/heightmap.js +1 -0
  138. package/dist/io/import.js +10 -0
  139. package/dist/io/inspect-scene.d.ts +55 -0
  140. package/dist/io/inspect-scene.js +155 -0
  141. package/dist/io/kinds.d.ts +81 -0
  142. package/dist/io/kinds.js +163 -0
  143. package/dist/io/points.d.ts +2 -1
  144. package/dist/io/points.js +3 -1
  145. package/dist/io/sidecars.d.ts +24 -0
  146. package/dist/io/sidecars.js +57 -0
  147. package/dist/io/source.d.ts +65 -0
  148. package/dist/io/source.js +112 -0
  149. package/dist/io/targets.d.ts +47 -3
  150. package/dist/io/targets.js +149 -14
  151. package/dist/io/textures.js +21 -1
  152. package/dist/io/unreal.js +5 -1
  153. package/dist/mcp/docs.d.ts +10 -1
  154. package/dist/mcp/docs.js +816 -119
  155. package/dist/mcp/inputs.d.ts +12 -5
  156. package/dist/mcp/inputs.js +50 -13
  157. package/dist/mcp/server.js +70 -24
  158. package/dist/mcp/tools.d.ts +14 -7
  159. package/dist/mcp/tools.js +207 -108
  160. package/dist/mcp/verify.d.ts +2 -2
  161. package/dist/mcp/verify.js +1 -1
  162. package/dist/mcp/workspace.d.ts +15 -0
  163. package/dist/mcp/workspace.js +349 -0
  164. package/dist/nodes/attributes.js +198 -1
  165. package/dist/nodes/bake.js +207 -83
  166. package/dist/nodes/beam.d.ts +1 -0
  167. package/dist/nodes/beam.js +201 -0
  168. package/dist/nodes/bevel.js +54 -5
  169. package/dist/nodes/cloth.js +2 -0
  170. package/dist/nodes/code.js +22 -10
  171. package/dist/nodes/curves.js +440 -93
  172. package/dist/nodes/flow.js +53 -33
  173. package/dist/nodes/generate.js +13 -39
  174. package/dist/nodes/heightfield.js +248 -77
  175. package/dist/nodes/imageops.d.ts +1 -0
  176. package/dist/nodes/imageops.js +203 -0
  177. package/dist/nodes/index.d.ts +4 -0
  178. package/dist/nodes/index.js +4 -0
  179. package/dist/nodes/material.js +91 -23
  180. package/dist/nodes/measure.js +45 -18
  181. package/dist/nodes/particles.js +2 -0
  182. package/dist/nodes/pcg.js +6 -5
  183. package/dist/nodes/procedural.js +4 -3
  184. package/dist/nodes/rbd.js +1 -1
  185. package/dist/nodes/remesh.js +71 -15
  186. package/dist/nodes/scene.d.ts +1 -0
  187. package/dist/nodes/scene.js +55 -0
  188. package/dist/nodes/sdf.js +10 -5
  189. package/dist/nodes/solid.js +20 -5
  190. package/dist/nodes/solidify.d.ts +1 -0
  191. package/dist/nodes/solidify.js +52 -0
  192. package/dist/nodes/splines.d.ts +15 -1
  193. package/dist/nodes/splines.js +112 -105
  194. package/dist/nodes/texture.d.ts +21 -6
  195. package/dist/nodes/texture.js +1318 -185
  196. package/dist/nodes/topology.d.ts +7 -0
  197. package/dist/nodes/topology.js +133 -6
  198. package/dist/nodes/transform.js +11 -3
  199. package/dist/nodes/util.d.ts +1 -1
  200. package/dist/nodes/uv.js +192 -174
  201. package/dist/nodes/wasmcall.js +6 -2
  202. package/dist/open.d.ts +19 -0
  203. package/dist/open.js +12 -0
  204. package/dist/package.d.ts +288 -0
  205. package/dist/package.js +772 -0
  206. package/dist/packages/check.d.ts +32 -0
  207. package/dist/packages/check.js +169 -0
  208. package/dist/packages/commands.d.ts +57 -0
  209. package/dist/packages/commands.js +537 -0
  210. package/dist/packages/registry.d.ts +796 -0
  211. package/dist/packages/registry.js +2998 -0
  212. package/dist/packages/update.d.ts +124 -0
  213. package/dist/packages/update.js +476 -0
  214. package/dist/render/options.d.ts +2 -0
  215. package/dist/render/options.js +44 -5
  216. package/dist/render/pbr.d.ts +28 -0
  217. package/dist/render/pbr.js +378 -0
  218. package/dist/render/preview.d.ts +69 -0
  219. package/dist/render/preview.js +26 -0
  220. package/dist/render/raster.d.ts +78 -7
  221. package/dist/render/raster.js +600 -145
  222. package/dist/render/texview.d.ts +7 -1
  223. package/dist/render/texview.js +34 -2
  224. package/dist/scan.d.ts +61 -0
  225. package/dist/scan.js +228 -0
  226. package/dist/session.d.ts +311 -0
  227. package/dist/session.js +849 -0
  228. package/dist/viewer/app/api.js +48 -6
  229. package/dist/viewer/app/camera.js +1 -1
  230. package/dist/viewer/app/cooking.js +78 -0
  231. package/dist/viewer/app/embed.js +100 -0
  232. package/dist/viewer/app/export-popover.js +118 -16
  233. package/dist/viewer/app/grid.js +6 -2
  234. package/dist/viewer/app/guides.js +123 -1
  235. package/dist/viewer/app/keymap.js +7 -4
  236. package/dist/viewer/app/layers.js +5 -5
  237. package/dist/viewer/app/main.js +186 -53
  238. package/dist/viewer/app/markers.js +61 -1
  239. package/dist/viewer/app/outliner.js +72 -27
  240. package/dist/viewer/app/output-info.js +45 -0
  241. package/dist/viewer/app/outputs.css +147 -8
  242. package/dist/viewer/app/outputs.js +168 -54
  243. package/dist/viewer/app/packages.js +614 -0
  244. package/dist/viewer/app/props.js +177 -53
  245. package/dist/viewer/app/scene.js +35 -6
  246. package/dist/viewer/app/select.js +5 -4
  247. package/dist/viewer/app/selection.js +1 -1
  248. package/dist/viewer/app/status.js +12 -15
  249. package/dist/viewer/app/style.css +66 -8
  250. package/dist/viewer/app/units.js +1 -1
  251. package/dist/viewer/app/vars.js +48 -1
  252. package/dist/viewer/app/welcome.js +72 -0
  253. package/dist/viewer/graph-file.d.ts +62 -0
  254. package/dist/viewer/graph-file.js +175 -0
  255. package/dist/viewer/index.html +24 -11
  256. package/dist/viewer/json-edit.d.ts +13 -0
  257. package/dist/viewer/json-edit.js +274 -0
  258. package/dist/viewer/outputs.d.ts +49 -5
  259. package/dist/viewer/outputs.js +264 -56
  260. package/dist/viewer/packages.d.ts +121 -0
  261. package/dist/viewer/packages.js +584 -0
  262. package/dist/viewer/server.d.ts +24 -7
  263. package/dist/viewer/server.js +289 -31
  264. package/dist/web/app/web.css +419 -0
  265. package/dist/web/app/web.js +188 -0
  266. package/dist/web/bake.d.ts +34 -0
  267. package/dist/web/bake.js +153 -0
  268. package/dist/web/folder-page.d.ts +101 -0
  269. package/dist/web/folder-page.js +146 -0
  270. package/dist/web/folders.d.ts +280 -0
  271. package/dist/web/folders.js +970 -0
  272. package/dist/web/library.d.ts +91 -0
  273. package/dist/web/library.js +228 -0
  274. package/dist/web/markdown.d.ts +45 -0
  275. package/dist/web/markdown.js +677 -0
  276. package/dist/web/pages.d.ts +258 -0
  277. package/dist/web/pages.js +301 -0
  278. package/dist/web/server.d.ts +24 -0
  279. package/dist/web/server.js +1068 -0
  280. package/dist/workspace.d.ts +88 -105
  281. package/dist/workspace.js +359 -375
  282. package/integrations/godot/addons/topotopo/LICENSE +202 -0
  283. package/integrations/godot/addons/topotopo/README.md +57 -0
  284. package/integrations/godot/addons/topotopo/context_menu.gd +43 -0
  285. package/integrations/godot/addons/topotopo/dock.gd +266 -0
  286. package/integrations/godot/addons/topotopo/dock.tscn +72 -0
  287. package/integrations/godot/addons/topotopo/export_filter.gd +72 -0
  288. package/integrations/godot/addons/topotopo/gltf_instancing.gd +131 -0
  289. package/integrations/godot/addons/topotopo/icons/topotopo.svg +1 -0
  290. package/integrations/godot/addons/topotopo/inspector.gd +38 -0
  291. package/integrations/godot/addons/topotopo/instances_post_import.gd +111 -0
  292. package/integrations/godot/addons/topotopo/package.gd +23 -0
  293. package/integrations/godot/addons/topotopo/package_importer.gd +187 -0
  294. package/integrations/godot/addons/topotopo/plugin.cfg +7 -0
  295. package/integrations/godot/addons/topotopo/plugin.gd +970 -0
  296. package/integrations/godot/addons/topotopo/record.gd +435 -0
  297. package/integrations/godot/addons/topotopo/runner.gd +458 -0
  298. package/integrations/godot/addons/topotopo/tools/check.gd +42 -0
  299. package/integrations/godot/addons/topotopo/watcher.gd +199 -0
  300. package/kernels/pkg/README.md +23 -29
  301. package/kernels/pkg-simd/README.md +23 -29
  302. package/library/architecture/versions/1.0/architecture.topo +12 -0
  303. package/{shelf → library/architecture/versions/1.0/graphs}/arch.json +3 -3
  304. package/{shelf → library/architecture/versions/1.0/graphs}/beam_truss.json +6 -6
  305. package/{shelf → library/architecture/versions/1.0/graphs}/brick_wall.json +8 -8
  306. package/{shelf → library/architecture/versions/1.0/graphs}/door_frame.json +3 -3
  307. package/{shelf → library/architecture/versions/1.0/graphs}/hex_grid_floor.json +3 -2
  308. package/{shelf → library/architecture/versions/1.0/graphs}/house.json +8 -8
  309. package/library/architecture/versions/1.0/graphs/lineup.json +42 -0
  310. package/{shelf → library/architecture/versions/1.0/graphs}/pillar.json +3 -2
  311. package/{shelf → library/architecture/versions/1.0/graphs}/railing.json +5 -5
  312. package/{shelf → library/architecture/versions/1.0/graphs}/roof_gable.json +2 -2
  313. package/{shelf → library/architecture/versions/1.0/graphs}/roof_hip.json +2 -2
  314. package/{shelf → library/architecture/versions/1.0/graphs}/roof_skeleton.json +2 -1
  315. package/{shelf → library/architecture/versions/1.0/graphs}/scaffold.json +4 -4
  316. package/{shelf → library/architecture/versions/1.0/graphs}/spiral_stairs.json +3 -2
  317. package/{shelf → library/architecture/versions/1.0/graphs}/stairs.json +6 -6
  318. package/{shelf → library/architecture/versions/1.0/graphs}/tile_floor.json +3 -2
  319. package/{shelf → library/architecture/versions/1.0/graphs}/wall_segment.json +10 -10
  320. package/{shelf → library/architecture/versions/1.0/graphs}/window_frame.json +2 -2
  321. package/library/architecture/versions/1.0/version.json +1119 -0
  322. package/{shelf → library/nature/versions/1.0/graphs}/bush.json +2 -2
  323. package/{shelf → library/nature/versions/1.0/graphs}/cliff_block.json +4 -3
  324. package/{shelf → library/nature/versions/1.0/graphs}/forest_patch.json +5 -5
  325. package/{shelf → library/nature/versions/1.0/graphs}/grass_clumps.json +2 -2
  326. package/library/nature/versions/1.0/graphs/lineup.json +24 -0
  327. package/{shelf → library/nature/versions/1.0/graphs}/log.json +6 -6
  328. package/{shelf → library/nature/versions/1.0/graphs}/rock.json +5 -4
  329. package/{shelf → library/nature/versions/1.0/graphs}/scatter_rocks.json +5 -5
  330. package/{shelf → library/nature/versions/1.0/graphs}/tree_lowpoly.json +3 -2
  331. package/library/nature/versions/1.0/nature.topo +12 -0
  332. package/library/nature/versions/1.0/version.json +534 -0
  333. package/{shelf → library/props/versions/1.0/graphs}/barrel.json +5 -4
  334. package/{shelf → library/props/versions/1.0/graphs}/crate.json +3 -3
  335. package/library/props/versions/1.0/graphs/lineup.json +18 -0
  336. package/{shelf → library/props/versions/1.0/graphs}/pallet.json +4 -3
  337. package/{shelf → library/props/versions/1.0/graphs}/pipe_run.json +3 -3
  338. package/{shelf → library/props/versions/1.0/graphs}/sandbag_wall.json +5 -5
  339. package/library/props/versions/1.0/props.topo +12 -0
  340. package/library/props/versions/1.0/version.json +336 -0
  341. package/{shelf → library/street/versions/1.0/graphs}/bench.json +5 -5
  342. package/{shelf → library/street/versions/1.0/graphs}/bollard.json +2 -1
  343. package/{shelf → library/street/versions/1.0/graphs}/cable.json +4 -4
  344. package/{shelf → library/street/versions/1.0/graphs}/fence.json +7 -7
  345. package/{shelf → library/street/versions/1.0/graphs}/lamp_post.json +2 -2
  346. package/library/street/versions/1.0/graphs/lineup.json +22 -0
  347. package/{shelf → library/street/versions/1.0/graphs}/road_strip.json +2 -2
  348. package/{shelf → library/street/versions/1.0/graphs}/sign_post.json +1 -1
  349. package/library/street/versions/1.0/street.topo +12 -0
  350. package/library/street/versions/1.0/version.json +421 -0
  351. package/package.json +23 -8
  352. package/dist/graph/migrate.d.ts +0 -23
  353. package/dist/graph/migrate.js +0 -58
  354. package/shelf/index.json +0 -190
@@ -29,7 +29,7 @@
29
29
  "in": ["none"],
30
30
  "params": {
31
31
  "run_over": "detail",
32
- "code": "const W = vars.width, H = vars.height, D = vars.depth, f = Math.min(vars.frame_width, W / 4);\nconst add = (p, s) => { const q = addpoint(0, p); setpointattrib(0, 'scale', q, s); };\nadd([-(W - f) / 2, H / 2, 0], [f, H, D]); add([(W - f) / 2, H / 2, 0], [f, H, D]); add([0, H - f / 2, 0], [W - 2 * f, f, D]);"
32
+ "code": "const W = width, H = height, D = depth, f = Math.min(frame_width, W / 4);\nconst add = (p, s) => { const q = addpoint(0, p); setpointattrib(0, 'scale', q, s); };\nadd([-(W - f) / 2, H / 2, 0], [f, H, D]); add([(W - f) / 2, H / 2, 0], [f, H, D]); add([0, H - f / 2, 0], [W - 2 * f, f, D]);"
33
33
  }
34
34
  },
35
35
  "leaf_pts": {
@@ -38,7 +38,7 @@
38
38
  "note": "the leaf, then raised panels on both faces",
39
39
  "params": {
40
40
  "run_over": "detail",
41
- "code": "const W = vars.width, H = vars.height, f = Math.min(vars.frame_width, W / 4), t = 0.045;\nconst lw = W - 2 * f - 0.006, lh = H - f - 0.012, n = Math.round(vars.panels), mx = Math.min(0.12, lw * 0.15), my = 0.12;\nconst add = (p, s) => { const q = addpoint(0, p); setpointattrib(0, 'scale', q, s); };\nadd([0, 0.008 + lh / 2, 0], [lw, lh, t]);\nconst ph = (lh - my * (n + 1)) / Math.max(1, n);\nfor (let i = 0; i < n; i++) for (const sz of [-1, 1]) add([0, 0.008 + my + i * (ph + my) + ph / 2, sz * (t / 2 + 0.006)], [lw - 2 * mx, ph, 0.012]);"
41
+ "code": "const W = width, H = height, f = Math.min(frame_width, W / 4), t = 0.045;\nconst lw = W - 2 * f - 0.006, lh = H - f - 0.012, n = Math.round(panels), mx = Math.min(0.12, lw * 0.15), my = 0.12;\nconst add = (p, s) => { const q = addpoint(0, p); setpointattrib(0, 'scale', q, s); };\nadd([0, 0.008 + lh / 2, 0], [lw, lh, t]);\nconst ph = (lh - my * (n + 1)) / Math.max(1, n);\nfor (let i = 0; i < n; i++) for (const sz of [-1, 1]) add([0, 0.008 + my + i * (ph + my) + ph / 2, sz * (t / 2 + 0.006)], [lw - 2 * mx, ph, 0.012]);"
42
42
  }
43
43
  },
44
44
  "unit": { "type": "box" },
@@ -103,8 +103,8 @@
103
103
  "out": { "type": "attrib_delete", "in": ["paint"], "params": { "names": "copynum" } }
104
104
  },
105
105
  "output": "out",
106
+ "outputs": { "door_frame": { "node": "out", "label": "Door", "kind": "mesh", "tags": ["door", "wall-opening", "modular", "building"] } },
106
107
  "meta": {
107
- "shelf_group": "architecture",
108
108
  "watertight": true,
109
109
  "thumbnail_render": { "azimuth": 30, "elevation": 12 }
110
110
  }
@@ -33,7 +33,7 @@
33
33
  "note": "flat-topped hex lattice: columns 1.5 r apart, rows sqrt(3) r apart, odd columns shifted half a row",
34
34
  "params": {
35
35
  "run_over": "detail",
36
- "code": "const X = vars.size_x, Z = vars.size_z, r = vars.radius, g = Math.min(vars.gap, r), s = vars.seed;\nconst dx = 1.5 * r, dz = Math.sqrt(3) * r, nx = Math.floor(X / 2 / dx) + 1, nz = Math.floor(Z / 2 / dz) + 1;\nconst k = (r - g / Math.sqrt(3)) / r;\nfor (let i = -nx; i <= nx; i++) for (let j = -nz - 1; j <= nz; j++) {\n const x = i * dx, z = j * dz + (Math.abs(i) % 2 ? dz / 2 : 0);\n if (Math.abs(x) > X / 2 || Math.abs(z) > Z / 2) continue;\n const h = Math.max(0.005, vars.height + (rand(i, j, s) - 0.5) * 2 * vars.height_jitter);\n const q = addpoint(0, [x, 0, z]);\n setpointattrib(0, 'scale', q, [r * k, h, r * k]);\n setpointattrib(0, 'tint', q, 0.78 + 0.35 * rand(i, j, s, 2));\n}"
36
+ "code": "const X = size_x, Z = size_z, r = radius, g = Math.min(gap, r), s = seed;\nconst dx = 1.5 * r, dz = Math.sqrt(3) * r, nx = Math.floor(X / 2 / dx) + 1, nz = Math.floor(Z / 2 / dz) + 1;\nconst k = (r - g / Math.sqrt(3)) / r;\nfor (let i = -nx; i <= nx; i++) for (let j = -nz - 1; j <= nz; j++) {\n const x = i * dx, z = j * dz + (Math.abs(i) % 2 ? dz / 2 : 0);\n if (Math.abs(x) > X / 2 || Math.abs(z) > Z / 2) continue;\n const h = Math.max(0.005, height + (rand(i, j, s) - 0.5) * 2 * height_jitter);\n const q = addpoint(0, [x, 0, z]);\n setpointattrib(0, 'scale', q, [r * k, h, r * k]);\n setpointattrib(0, 'tint', q, 0.78 + 0.35 * rand(i, j, s, 2));\n}"
37
37
  }
38
38
  },
39
39
  "hex": {
@@ -62,5 +62,6 @@
62
62
  "out": { "type": "attrib_delete", "in": ["paint"], "params": { "names": "tint scale copynum" } }
63
63
  },
64
64
  "output": "out",
65
- "meta": { "shelf_group": "architecture", "watertight": true, "thumbnail_render": { "elevation": 40 } }
65
+ "outputs": { "hex_grid_floor": { "node": "out", "label": "Hexagonal paving", "kind": "mesh", "tags": ["floor", "paving", "hexagonal", "tiles"] } },
66
+ "meta": { "watertight": true, "thumbnail_render": { "elevation": 40 } }
66
67
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "House built from a footprint polygon: one wall_segment per footprint edge (facing outward, floors stacked, a door on the first edge), topped with a roof_skeleton hip roof that follows the footprint exactly (straight skeleton: L-shapes, courtyards and any simple polygon get correct valleys and ridges). Input 0 is an optional closed polygon on the XZ ground plane; without it a width × depth rectangle is used. The walls, windows, doors and roof are the shelf generators themselves, so editing wall_segment or roof_skeleton changes every house. Pivot: the footprint's origin on the ground. Pieces come from the child assets (wall, window_frame, door_frame, roof).",
2
+ "description": "House built from a footprint polygon: one wall_segment per footprint edge (facing outward, floors stacked, a door on the first edge), topped with a roof_skeleton hip roof that follows the footprint exactly (straight skeleton: L-shapes, courtyards and any simple polygon get correct valleys and ridges). Input 0 is an optional closed polygon on the XZ ground plane; without it a width × depth rectangle is used. The walls, windows, doors and roof are this package's own wall_segment and roof_skeleton outputs, so a change to those changes every house. Pivot: the footprint's origin on the ground. Pieces come from those outputs (wall, window_frame, door_frame, roof).",
3
3
  "params": {
4
4
  "width": {
5
5
  "type": "float",
@@ -67,7 +67,6 @@
67
67
  "door": true
68
68
  },
69
69
  "meta": {
70
- "shelf_group": "architecture",
71
70
  "pivot": "footprint origin, ground",
72
71
  "thumbnail_render": {
73
72
  "azimuth": 30,
@@ -134,18 +133,18 @@
134
133
  }
135
134
  },
136
135
  "ground": {
137
- "type": "wall_segment",
136
+ "type": "topotopo/architecture/wall_segment",
138
137
  "params": {
139
- "length": "=prim('piece', 0, 'len')",
138
+ "wall_length": "=prim('piece', 0, 'len')",
140
139
  "height": "=floor_height",
141
140
  "windows": "=max(0, floor(prim('piece', 0, 'len') / window_spacing))",
142
141
  "door": "=door && iteration == 0"
143
142
  }
144
143
  },
145
144
  "upper": {
146
- "type": "wall_segment",
145
+ "type": "topotopo/architecture/wall_segment",
147
146
  "params": {
148
- "length": "=prim('piece', 0, 'len')",
147
+ "wall_length": "=prim('piece', 0, 'len')",
149
148
  "height": "=floor_height",
150
149
  "windows": "=max(0, floor(prim('piece', 0, 'len') / window_spacing))",
151
150
  "door": false
@@ -222,7 +221,7 @@
222
221
  }
223
222
  },
224
223
  "roof": {
225
- "type": "roof_skeleton",
224
+ "type": "topotopo/architecture/roof_skeleton",
226
225
  "in": [
227
226
  "fp"
228
227
  ],
@@ -252,5 +251,6 @@
252
251
  ]
253
252
  }
254
253
  },
255
- "output": "out"
254
+ "output": "out",
255
+ "outputs": { "house": { "node": "out", "label": "House", "kind": "mesh", "tags": ["house", "building", "residential", "footprint", "modular"] } }
256
256
  }
@@ -0,0 +1,42 @@
1
+ {
2
+ "description": "TopoTopo's architecture package, its 17 outputs side by side at their defaults. The package's default output and its preview, from arch to window_frame along +X, 1 m apart.",
3
+ "nodes": {
4
+ "arch": {"type":"topotopo/architecture/arch"},
5
+ "arch_at": {"type":"transform","in":["arch"],"params":{"translate":[1.54,0,0]}},
6
+ "beam_truss": {"type":"topotopo/architecture/beam_truss"},
7
+ "beam_truss_at": {"type":"transform","in":["beam_truss"],"params":{"translate":[8.11,0,0]}},
8
+ "brick_wall": {"type":"topotopo/architecture/brick_wall"},
9
+ "brick_wall_at": {"type":"transform","in":["brick_wall"],"params":{"translate":[13.14,0,0]}},
10
+ "door_frame": {"type":"topotopo/architecture/door_frame"},
11
+ "door_frame_at": {"type":"transform","in":["door_frame"],"params":{"translate":[17.641,0,0]}},
12
+ "hex_grid_floor": {"type":"topotopo/architecture/hex_grid_floor"},
13
+ "hex_grid_floor_at": {"type":"transform","in":["hex_grid_floor"],"params":{"translate":[21.679,0,0]}},
14
+ "house": {"type":"topotopo/architecture/house"},
15
+ "house_at": {"type":"transform","in":["house"],"params":{"translate":[29.753,0,0]}},
16
+ "pillar": {"type":"topotopo/architecture/pillar"},
17
+ "pillar_at": {"type":"transform","in":["pillar"],"params":{"translate":[35.597,0,0]}},
18
+ "railing": {"type":"topotopo/architecture/railing"},
19
+ "railing_at": {"type":"transform","in":["railing"],"params":{"translate":[36.933,0,0]}},
20
+ "roof_gable": {"type":"topotopo/architecture/roof_gable"},
21
+ "roof_gable_at": {"type":"transform","in":["roof_gable"],"params":{"translate":[46.382,0,0]}},
22
+ "roof_hip": {"type":"topotopo/architecture/roof_hip"},
23
+ "roof_hip_at": {"type":"transform","in":["roof_hip"],"params":{"translate":[56.302,0,0]}},
24
+ "roof_skeleton": {"type":"topotopo/architecture/roof_skeleton"},
25
+ "roof_skeleton_at": {"type":"transform","in":["roof_skeleton"],"params":{"translate":[66.237,0,0]}},
26
+ "scaffold": {"type":"topotopo/architecture/scaffold"},
27
+ "scaffold_at": {"type":"transform","in":["scaffold"],"params":{"translate":[71.822,0,0]}},
28
+ "spiral_stairs": {"type":"topotopo/architecture/spiral_stairs"},
29
+ "spiral_stairs_at": {"type":"transform","in":["spiral_stairs"],"params":{"translate":[80.379,0,0]}},
30
+ "stairs": {"type":"topotopo/architecture/stairs"},
31
+ "stairs_at": {"type":"transform","in":["stairs"],"params":{"translate":[83.086,0,0]}},
32
+ "tile_floor": {"type":"topotopo/architecture/tile_floor"},
33
+ "tile_floor_at": {"type":"transform","in":["tile_floor"],"params":{"translate":[86.686,0,0]}},
34
+ "wall_segment": {"type":"topotopo/architecture/wall_segment"},
35
+ "wall_segment_at": {"type":"transform","in":["wall_segment"],"params":{"translate":[89.686,0,0]}},
36
+ "window_frame": {"type":"topotopo/architecture/window_frame"},
37
+ "window_frame_at": {"type":"transform","in":["window_frame"],"params":{"translate":[95.236,0,0]}},
38
+ "lineup": {"type":"merge","in":["arch_at","beam_truss_at","brick_wall_at","door_frame_at","hex_grid_floor_at","house_at","pillar_at","railing_at","roof_gable_at","roof_hip_at","roof_skeleton_at","scaffold_at","spiral_stairs_at","stairs_at","tile_floor_at","wall_segment_at","window_frame_at"]}
39
+ },
40
+ "output": "lineup",
41
+ "outputs": {"lineup":{"node":"lineup","label":"Architecture line-up","kind":"mesh","tags":["lineup","architecture"]}}
42
+ }
@@ -37,7 +37,7 @@
37
37
  "type": "wrangle",
38
38
  "in": ["round_shaft"],
39
39
  "params": {
40
- "code": "if (vars.style !== 'fluted') return; const a = Math.atan2(@P.z, @P.x), r = Math.hypot(@P.x, @P.z), k = 1 - 0.06 * Math.pow(Math.abs(Math.cos(a * vars.flutes / 2)), 2); @P.x = Math.cos(a) * r * k; @P.z = Math.sin(a) * r * k;"
40
+ "code": "if (style !== 'fluted') return; const a = Math.atan2(@P.z, @P.x), r = Math.hypot(@P.x, @P.z), k = 1 - 0.06 * Math.pow(Math.abs(Math.cos(a * flutes / 2)), 2); @P.x = Math.cos(a) * r * k; @P.z = Math.sin(a) * r * k;"
41
41
  }
42
42
  },
43
43
  "square_shaft": { "type": "box", "params": { "size": ["=radius * 2", 1, "=radius * 2"], "center": [0, 0.5, 0] } },
@@ -133,5 +133,6 @@
133
133
  "out": { "type": "normal", "in": ["paint"], "params": { "cusp_angle": 50 } }
134
134
  },
135
135
  "output": "out",
136
- "meta": { "shelf_group": "architecture", "watertight": true, "thumbnail_render": { "elevation": 15 } }
136
+ "outputs": { "pillar": { "node": "out", "label": "Pillar", "kind": "mesh", "tags": ["pillar", "column", "classical", "stone"] } },
137
+ "meta": { "watertight": true, "thumbnail_render": { "elevation": 15 } }
137
138
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "version": 1,
3
- "description": "Railing along a curve (input 0; without one, a straight run of `length` along +X from the origin): posts at even spacing including both ends, a handrail on top, lower rails and balusters. Sits on the curve (pivot = the curve). Pieces: railing_posts, railing_rails, railing_balusters (all metal_dark).",
3
+ "description": "Railing along a curve (input 0; without one, a straight run of `run_length` along +X from the origin): posts at even spacing including both ends, a handrail on top, lower rails and balusters. Sits on the curve (pivot = the curve). Pieces: railing_posts, railing_rails, railing_balusters (all metal_dark).",
4
4
  "params": {
5
- "length": {
5
+ "run_length": {
6
6
  "type": "float",
7
7
  "default": 4,
8
8
  "min": 0.5,
@@ -45,7 +45,7 @@
45
45
  }
46
46
  },
47
47
  "vars": {
48
- "length": 4,
48
+ "run_length": 4,
49
49
  "height": 1,
50
50
  "post_spacing": 1.5,
51
51
  "baluster_spacing": 0.15,
@@ -56,7 +56,7 @@
56
56
  "curve_in": { "type": "input", "params": { "index": 0, "label": "curve to follow (polyline); optional" } },
57
57
  "straight": {
58
58
  "type": "line",
59
- "params": { "origin": [0, 0, 0], "direction": [1, 0, 0], "length": "=length", "points": 2 }
59
+ "params": { "origin": [0, 0, 0], "direction": [1, 0, 0], "length": "=run_length", "points": 2 }
60
60
  },
61
61
  "path": {
62
62
  "type": "switch",
@@ -156,8 +156,8 @@
156
156
  }
157
157
  },
158
158
  "output": "out",
159
+ "outputs": { "railing": { "node": "out", "label": "Railing", "kind": "mesh", "tags": ["railing", "balustrade", "along-curve", "metal"] } },
159
160
  "meta": {
160
- "shelf_group": "architecture",
161
161
  "pivot": "curve",
162
162
  "inputs": ["curve"],
163
163
  "thumbnail_render": { "elevation": 25, "zoom": 1.3 }
@@ -30,7 +30,7 @@
30
30
  "note": "the slab cross-section (a thick Λ) in the ZY plane; its underside passes through the wall-top edges",
31
31
  "params": {
32
32
  "run_over": "detail",
33
- "code": "const B = vars.depth / 2 + vars.overhang, s = Math.tan(radians(vars.pitch)), tc = vars.thickness / Math.cos(radians(vars.pitch));\nconst h = vars.depth / 2 * s, ye = -vars.overhang * s;\nconst P = [[0, ye, -B], [0, ye + tc, -B], [0, h + tc, 0], [0, ye + tc, B], [0, ye, B], [0, h, 0]];\naddprim(0, 'poly', P.map((p) => addpoint(0, p)));"
33
+ "code": "const B = depth / 2 + overhang, s = Math.tan(radians(pitch)), tc = thickness / Math.cos(radians(pitch));\nconst h = depth / 2 * s, ye = -overhang * s;\nconst P = [[0, ye, -B], [0, ye + tc, -B], [0, h + tc, 0], [0, ye + tc, B], [0, ye, B], [0, h, 0]];\naddprim(0, 'poly', P.map((p) => addpoint(0, p)));"
34
34
  }
35
35
  },
36
36
  "slab": {
@@ -119,8 +119,8 @@
119
119
  "out": { "type": "attrib_delete", "in": ["paint"], "params": { "groups": "*" } }
120
120
  },
121
121
  "output": "out",
122
+ "outputs": { "roof_gable": { "node": "out", "label": "Gable roof", "kind": "mesh", "tags": ["roof", "gable-roof", "building", "modular"] } },
122
123
  "meta": {
123
- "shelf_group": "architecture",
124
124
  "watertight": true,
125
125
  "pivot": "wall_top",
126
126
  "thumbnail_render": { "elevation": 25 }
@@ -29,7 +29,7 @@
29
29
  "note": "soffit, four fascia quads, two slopes and two hip ends around a ridge along the longer side; prim groups tiles, fascia",
30
30
  "params": {
31
31
  "run_over": "detail",
32
- "code": "const swap = vars.depth > vars.width, a = swap ? vars.depth : vars.width, b = swap ? vars.width : vars.depth, o = vars.overhang;\nconst s = Math.tan(radians(vars.pitch)), tc = vars.thickness / Math.cos(radians(vars.pitch));\nconst A = a / 2 + o, B = b / 2 + o, ye = -o * s, yt = b / 2 * s + tc, rl = Math.max(0, a / 2 - b / 2);\nconst P = (x, y, z) => addpoint(0, swap ? [z, y, x] : [x, y, z]);\nconst b0 = P(-A, ye, -B), b1 = P(A, ye, -B), b2 = P(A, ye, B), b3 = P(-A, ye, B);\nconst e0 = P(-A, ye + tc, -B), e1 = P(A, ye + tc, -B), e2 = P(A, ye + tc, B), e3 = P(-A, ye + tc, B);\nconst r0 = P(-rl, yt, 0), r1 = rl > 1e-6 ? P(rl, yt, 0) : r0;\nconst face = (pts, grp) => { const u = pts.filter((p, i) => pts.indexOf(p) === i); const pr = addprim(0, 'poly', swap ? u.slice().reverse() : u); setprimgroup(0, grp, pr, 1); };\nface([b0, b1, b2, b3], 'fascia');\nface([b3, b2, e2, e3], 'fascia'); face([b1, b0, e0, e1], 'fascia'); face([b2, b1, e1, e2], 'fascia'); face([b0, b3, e3, e0], 'fascia');\nface([e3, e2, r1, r0], 'tiles'); face([e1, e0, r0, r1], 'tiles'); face([e2, e1, r1], 'tiles'); face([e0, e3, r0], 'tiles');"
32
+ "code": "const swap = depth > width, a = swap ? depth : width, b = swap ? width : depth, o = overhang;\nconst s = Math.tan(radians(pitch)), tc = thickness / Math.cos(radians(pitch));\nconst A = a / 2 + o, B = b / 2 + o, ye = -o * s, yt = b / 2 * s + tc, rl = Math.max(0, a / 2 - b / 2);\nconst P = (x, y, z) => addpoint(0, swap ? [z, y, x] : [x, y, z]);\nconst b0 = P(-A, ye, -B), b1 = P(A, ye, -B), b2 = P(A, ye, B), b3 = P(-A, ye, B);\nconst e0 = P(-A, ye + tc, -B), e1 = P(A, ye + tc, -B), e2 = P(A, ye + tc, B), e3 = P(-A, ye + tc, B);\nconst r0 = P(-rl, yt, 0), r1 = rl > 1e-6 ? P(rl, yt, 0) : r0;\nconst face = (pts, grp) => { const u = pts.filter((p, i) => pts.indexOf(p) === i); const pr = addprim(0, 'poly', swap ? u.slice().reverse() : u); setprimgroup(0, grp, pr, 1); };\nface([b0, b1, b2, b3], 'fascia');\nface([b3, b2, e2, e3], 'fascia'); face([b1, b0, e0, e1], 'fascia'); face([b2, b1, e1, e2], 'fascia'); face([b0, b3, e3, e0], 'fascia');\nface([e3, e2, r1, r0], 'tiles'); face([e1, e0, r0, r1], 'tiles'); face([e2, e1, r1], 'tiles'); face([e0, e3, r0], 'tiles');"
33
33
  }
34
34
  },
35
35
  "solid_name": {
@@ -86,8 +86,8 @@
86
86
  "out": { "type": "attrib_delete", "in": ["paint"], "params": { "groups": "*" } }
87
87
  },
88
88
  "output": "out",
89
+ "outputs": { "roof_hip": { "node": "out", "label": "Hip roof", "kind": "mesh", "tags": ["roof", "hip-roof", "building", "modular"] } },
89
90
  "meta": {
90
- "shelf_group": "architecture",
91
91
  "watertight": true,
92
92
  "pivot": "wall_top",
93
93
  "thumbnail_render": { "elevation": 30 }
@@ -21,5 +21,6 @@
21
21
  "paint": { "type": "color", "in": ["material"], "params": { "color": "#9a4a35" } }
22
22
  },
23
23
  "output": "paint",
24
- "meta": { "shelf_group": "architecture", "inputs": ["footprint"], "pivot": "wall_top", "watertight": true, "thumbnail_render": { "elevation": 30 } }
24
+ "outputs": { "roof_skeleton": { "node": "paint", "label": "Roof on a footprint", "kind": "mesh", "tags": ["roof", "hip-roof", "footprint", "building"] } },
25
+ "meta": { "inputs": ["footprint"], "pivot": "wall_top", "watertight": true, "thumbnail_render": { "elevation": 30 } }
25
26
  }
@@ -33,7 +33,7 @@
33
33
  "note": "every tube as a two-point polyline",
34
34
  "params": {
35
35
  "run_over": "detail",
36
- "code": "const nb = Math.round(vars.bays), nl = Math.round(vars.lifts), w = vars.bay_width, h = vars.lift_height, D = vars.depth / 2;\nconst top = nl * h + 1.0;\nconst line = (a, b) => addprim(0, 'polyline', [addpoint(0, a), addpoint(0, b)]);\nfor (let i = 0; i <= nb; i++) for (const z of [-D, D]) line([i * w, 0.02, z], [i * w, top, z]);\nfor (let l = 1; l <= nl; l++) {\n const y = l * h;\n for (const z of [-D, D]) line([-0.15, y, z], [nb * w + 0.15, y, z]);\n for (let i = 0; i <= nb; i++) line([i * w, y - 0.05, -D - 0.15], [i * w, y - 0.05, D + 0.15]);\n}\nfor (const z of [-D, D]) { line([-0.15, nl * h + 0.5, z], [nb * w + 0.15, nl * h + 0.5, z]); line([-0.15, nl * h + 1.0 - 0.02, z], [nb * w + 0.15, nl * h + 1.0 - 0.02, z]); }\nline([-0.15, 0.25, -D], [nb * w + 0.15, 0.25, -D]); line([-0.15, 0.25, D], [nb * w + 0.15, 0.25, D]);\nif (vars.braces) for (let i = 0; i < nb; i++) for (let l = 0; l < nl; l++) {\n const up = (i + l) % 2 === 0;\n line([i * w, l * h + (up ? 0.25 : h), D + 0.06], [(i + 1) * w, l * h + (up ? h : 0.25), D + 0.06]);\n}"
36
+ "code": "const nb = Math.round(bays), nl = Math.round(lifts), w = bay_width, h = lift_height, D = depth / 2;\nconst top = nl * h + 1.0;\nconst line = (a, b) => addprim(0, 'polyline', [addpoint(0, a), addpoint(0, b)]);\nfor (let i = 0; i <= nb; i++) for (const z of [-D, D]) line([i * w, 0.02, z], [i * w, top, z]);\nfor (let l = 1; l <= nl; l++) {\n const y = l * h;\n for (const z of [-D, D]) line([-0.15, y, z], [nb * w + 0.15, y, z]);\n for (let i = 0; i <= nb; i++) line([i * w, y - 0.05, -D - 0.15], [i * w, y - 0.05, D + 0.15]);\n}\nfor (const z of [-D, D]) { line([-0.15, nl * h + 0.5, z], [nb * w + 0.15, nl * h + 0.5, z]); line([-0.15, nl * h + 1.0 - 0.02, z], [nb * w + 0.15, nl * h + 1.0 - 0.02, z]); }\nline([-0.15, 0.25, -D], [nb * w + 0.15, 0.25, -D]); line([-0.15, 0.25, D], [nb * w + 0.15, 0.25, D]);\nif (braces) for (let i = 0; i < nb; i++) for (let l = 0; l < nl; l++) {\n const up = (i + l) % 2 === 0;\n line([i * w, l * h + (up ? 0.25 : h), D + 0.06], [(i + 1) * w, l * h + (up ? h : 0.25), D + 0.06]);\n}"
37
37
  }
38
38
  },
39
39
  "tubes": {
@@ -56,7 +56,7 @@
56
56
  "in": ["none"],
57
57
  "params": {
58
58
  "run_over": "detail",
59
- "code": "const nb = Math.round(vars.bays), nl = Math.round(vars.lifts), w = vars.bay_width, h = vars.lift_height, D = vars.depth;\nconst n = Math.max(2, Math.floor((D - 0.05) / 0.23)), bw = 0.22, start = -((n - 1) * 0.23) / 2;\nfor (let l = 1; l <= nl; l++) for (let i = 0; i < nb; i++) for (let k = 0; k < n; k++) {\n const q = addpoint(0, [i * w + w / 2, l * h + 0.0, start + k * 0.23]);\n setpointattrib(0, 'scale', q, [w + 0.18, 0.038, bw]);\n setpointattrib(0, 'tint', q, 0.85 + 0.25 * rand(l, i, k));\n}"
59
+ "code": "const nb = Math.round(bays), nl = Math.round(lifts), w = bay_width, h = lift_height, D = depth;\nconst n = Math.max(2, Math.floor((D - 0.05) / 0.23)), bw = 0.22, start = -((n - 1) * 0.23) / 2;\nfor (let l = 1; l <= nl; l++) for (let i = 0; i < nb; i++) for (let k = 0; k < n; k++) {\n const q = addpoint(0, [i * w + w / 2, l * h + 0.0, start + k * 0.23]);\n setpointattrib(0, 'scale', q, [w + 0.18, 0.038, bw]);\n setpointattrib(0, 'tint', q, 0.85 + 0.25 * rand(l, i, k));\n}"
60
60
  }
61
61
  },
62
62
  "unit": { "type": "box" },
@@ -77,7 +77,7 @@
77
77
  "in": ["none"],
78
78
  "params": {
79
79
  "run_over": "detail",
80
- "code": "for (let i = 0; i <= Math.round(vars.bays); i++) for (const z of [-vars.depth / 2, vars.depth / 2]) { const q = addpoint(0, [i * vars.bay_width, 0.01, z]); setpointattrib(0, 'scale', q, [0.15, 0.02, 0.15]); }"
80
+ "code": "for (let i = 0; i <= Math.round(bays); i++) for (const z of [-depth / 2, depth / 2]) { const q = addpoint(0, [i * bay_width, 0.01, z]); setpointattrib(0, 'scale', q, [0.15, 0.02, 0.15]); }"
81
81
  }
82
82
  },
83
83
  "plates": { "type": "copy_to_points", "in": ["unit", "plate_pts"] },
@@ -107,8 +107,8 @@
107
107
  }
108
108
  },
109
109
  "output": "out",
110
+ "outputs": { "scaffold": { "node": "out", "label": "Scaffold", "kind": "mesh", "tags": ["scaffold", "construction", "industrial", "modular"] } },
110
111
  "meta": {
111
- "shelf_group": "architecture",
112
112
  "watertight": true,
113
113
  "thumbnail_render": { "azimuth": 30, "elevation": 20 }
114
114
  }
@@ -25,7 +25,7 @@
25
25
  "note": "taper the tread to the step angle: its width grows linearly from the column to the rim",
26
26
  "params": {
27
27
  "run_over": "points",
28
- "code": "const a = radians(vars.turn) * 1.08, w = (x) => 2 * Math.max(0.03, x) * Math.tan(a / 2);\n@P.z *= w(@P.x);"
28
+ "code": "const a = radians(turn) * 1.08, w = (x) => 2 * Math.max(0.03, x) * Math.tan(a / 2);\n@P.z *= w(@P.x);"
29
29
  }
30
30
  },
31
31
  "treads": {
@@ -113,5 +113,6 @@
113
113
  }
114
114
  },
115
115
  "output": "out",
116
- "meta": { "shelf_group": "architecture", "watertight": true, "thumbnail_render": { "elevation": 20 } }
116
+ "outputs": { "spiral_stairs": { "node": "out", "label": "Spiral stairs", "kind": "mesh", "tags": ["stairs", "spiral", "staircase", "interior"] } },
117
+ "meta": { "watertight": true, "thumbnail_render": { "elevation": 20 } }
117
118
  }
@@ -23,7 +23,7 @@
23
23
  "note": "sawtooth side profile in the ZY plane (x = 0)",
24
24
  "params": {
25
25
  "run_over": "detail",
26
- "code": "const n = Math.round(vars.steps), r = vars.rise, d = vars.run, pts = [addpoint(0, [0, 0, 0])];\nfor (let i = 0; i < n; i++) { pts.push(addpoint(0, [0, (i + 1) * r, i * d])); pts.push(addpoint(0, [0, (i + 1) * r, (i + 1) * d])); }\npts.push(addpoint(0, [0, 0, n * d]));\naddprim(0, 'poly', pts);"
26
+ "code": "const n = Math.round(steps), r = rise, d = run, pts = [addpoint(0, [0, 0, 0])];\nfor (let i = 0; i < n; i++) { pts.push(addpoint(0, [0, (i + 1) * r, i * d])); pts.push(addpoint(0, [0, (i + 1) * r, (i + 1) * d])); }\npts.push(addpoint(0, [0, 0, n * d]));\naddprim(0, 'poly', pts);"
27
27
  }
28
28
  },
29
29
  "flight": {
@@ -46,7 +46,7 @@
46
46
  "in": ["none"],
47
47
  "params": {
48
48
  "run_over": "detail",
49
- "code": "const n = Math.round(vars.steps), r = vars.rise, d = vars.run;\nfor (let i = 0; i < n; i++) { const q = addpoint(0, [0, (i + 1) * r - 0.025, i * d + d / 2]); setpointattrib(0, 'scale', q, [vars.width - 0.1, 0.05, d + 0.02]); setpointattrib(0, 'tint', q, 0.85 + 0.25 * rand(i, 3)); }"
49
+ "code": "const n = Math.round(steps), r = rise, d = run;\nfor (let i = 0; i < n; i++) { const q = addpoint(0, [0, (i + 1) * r - 0.025, i * d + d / 2]); setpointattrib(0, 'scale', q, [width - 0.1, 0.05, d + 0.02]); setpointattrib(0, 'tint', q, 0.85 + 0.25 * rand(i, 3)); }"
50
50
  }
51
51
  },
52
52
  "unit": { "type": "box" },
@@ -67,7 +67,7 @@
67
67
  "note": "board under the tread ends: top edge through the tread noses, 0.3 m deep, cut at the ground",
68
68
  "params": {
69
69
  "run_over": "detail",
70
- "code": "const n = Math.round(vars.steps), r = vars.rise, d = vars.run, L = n * d, k = r / d;\nconst z0 = Math.max(0, L - (n * r - 0.3) / k);\nconst P = [[0, 0, 0], [0, r, 0], [0, n * r, Math.max(0, L - d)], [0, n * r, L], [0, Math.max(0, n * r - 0.3), L], [0, 0, z0]];\nconst out = [];\nfor (const p of P) if (!out.length || distance(out[out.length - 1], p) > 1e-6) out.push(p);\nif (out.length > 3 && distance(out[0], out[out.length - 1]) <= 1e-6) out.pop();\naddprim(0, 'poly', out.map((p) => addpoint(0, p)));"
70
+ "code": "const n = Math.round(steps), r = rise, d = run, L = n * d, k = r / d;\nconst z0 = Math.max(0, L - (n * r - 0.3) / k);\nconst P = [[0, 0, 0], [0, r, 0], [0, n * r, Math.max(0, L - d)], [0, n * r, L], [0, Math.max(0, n * r - 0.3), L], [0, 0, z0]];\nconst out = [];\nfor (const p of P) if (!out.length || distance(out[out.length - 1], p) > 1e-6) out.push(p);\nif (out.length > 3 && distance(out[0], out[out.length - 1]) <= 1e-6) out.pop();\naddprim(0, 'poly', out.map((p) => addpoint(0, p)));"
71
71
  }
72
72
  },
73
73
  "stringer": {
@@ -103,7 +103,7 @@
103
103
  "note": "posts every third step and at the top, on both sides; the rail runs through their tops",
104
104
  "params": {
105
105
  "run_over": "detail",
106
- "code": "const n = Math.round(vars.steps), r = vars.rise, d = vars.run, x = vars.width / 2 - 0.04;\nconst idx = []; for (let i = 0; i < n; i += 3) idx.push(i); if (idx[idx.length - 1] !== n - 1) idx.push(n - 1);\nfor (const sx of [-1, 1]) for (const i of idx) { const q = addpoint(0, [sx * x, (i + 1) * r, i * d + d / 2]); setpointattrib(0, 'scale', q, [0.04, 0.9, 0.04]); }"
106
+ "code": "const n = Math.round(steps), r = rise, d = run, x = width / 2 - 0.04;\nconst idx = []; for (let i = 0; i < n; i += 3) idx.push(i); if (idx[idx.length - 1] !== n - 1) idx.push(n - 1);\nfor (const sx of [-1, 1]) for (const i of idx) { const q = addpoint(0, [sx * x, (i + 1) * r, i * d + d / 2]); setpointattrib(0, 'scale', q, [0.04, 0.9, 0.04]); }"
107
107
  }
108
108
  },
109
109
  "post_unit": { "type": "box", "params": { "center": [0, 0.5, 0] } },
@@ -113,7 +113,7 @@
113
113
  "in": ["none"],
114
114
  "params": {
115
115
  "run_over": "detail",
116
- "code": "const n = Math.round(vars.steps), r = vars.rise, d = vars.run, x = vars.width / 2 - 0.04, h = 0.9 + 0.02;\nfor (const sx of [-1, 1]) {\n const a = addpoint(0, [sx * x, r + h - 0.15 * r / d, d / 2 - 0.15]), b = addpoint(0, [sx * x, n * r + h + 0.15 * r / d, (n - 1) * d + d / 2 + 0.15]);\n addprim(0, 'polyline', [a, b]);\n}"
116
+ "code": "const n = Math.round(steps), r = rise, d = run, x = width / 2 - 0.04, h = 0.9 + 0.02;\nfor (const sx of [-1, 1]) {\n const a = addpoint(0, [sx * x, r + h - 0.15 * r / d, d / 2 - 0.15]), b = addpoint(0, [sx * x, n * r + h + 0.15 * r / d, (n - 1) * d + d / 2 + 0.15]);\n addprim(0, 'polyline', [a, b]);\n}"
117
117
  }
118
118
  },
119
119
  "rails": { "type": "sweep", "in": ["rail_path"], "params": { "radius": 0.025, "divisions": 10 } },
@@ -141,8 +141,8 @@
141
141
  "out": { "type": "attrib_delete", "in": ["paint"], "params": { "names": "tint copynum", "groups": "*" } }
142
142
  },
143
143
  "output": "out",
144
+ "outputs": { "stairs": { "node": "out", "label": "Stairs", "kind": "mesh", "tags": ["stairs", "staircase", "concrete", "wooden"] } },
144
145
  "meta": {
145
- "shelf_group": "architecture",
146
146
  "watertight": true,
147
147
  "thumbnail_render": { "azimuth": -120, "elevation": 25 }
148
148
  }
@@ -46,7 +46,7 @@
46
46
  "note": "one point per (clipped) tile; checker's dark tiles go to point group dark",
47
47
  "params": {
48
48
  "run_over": "detail",
49
- "code": "const X = vars.size_x, Z = vars.size_z, T = vars.tile_size, g = Math.min(vars.gap, T * 0.4), t = vars.thickness, bed = 0.01, s = vars.seed;\nconst nz = Math.ceil(Z / T) + 1, nx = Math.ceil(X / T) + 2;\nconst z0 = addpoint(0, [0, 0, 0]); setpointgroup(0, 'dark', z0, 0); removepoint(0, z0);\nfor (let j = 0; j < nz; j++) {\n const off = vars.pattern === 'offset' && j % 2 ? T / 2 : 0;\n for (let i = -1; i < nx; i++) {\n const xa = -X / 2 + i * T - off + g / 2, xb = xa + T - g, za = -Z / 2 + j * T + g / 2, zb = za + T - g;\n const x0 = Math.max(-X / 2, xa), x1 = Math.min(X / 2, xb), zz0 = Math.max(-Z / 2, za), zz1 = Math.min(Z / 2, zb);\n if (x1 - x0 < 0.004 || zz1 - zz0 < 0.004) continue;\n const h = t + (rand(i, j, s) - 0.5) * 2 * vars.height_jitter;\n const q = addpoint(0, [(x0 + x1) / 2, bed + h / 2, (zz0 + zz1) / 2]);\n setpointattrib(0, 'scale', q, [x1 - x0, h, zz1 - zz0]);\n setpointattrib(0, 'tint', q, 0.9 + 0.18 * rand(i, j, s, 2));\n if (vars.pattern === 'checker' && (i + j) % 2 !== 0) setpointgroup(0, 'dark', q, 1);\n }\n}"
49
+ "code": "const X = size_x, Z = size_z, T = tile_size, g = Math.min(gap, T * 0.4), t = thickness, bed = 0.01, s = seed;\nconst nz = Math.ceil(Z / T) + 1, nx = Math.ceil(X / T) + 2;\nconst z0 = addpoint(0, [0, 0, 0]); setpointgroup(0, 'dark', z0, 0); removepoint(0, z0);\nfor (let j = 0; j < nz; j++) {\n const off = pattern === 'offset' && j % 2 ? T / 2 : 0;\n for (let i = -1; i < nx; i++) {\n const xa = -X / 2 + i * T - off + g / 2, xb = xa + T - g, za = -Z / 2 + j * T + g / 2, zb = za + T - g;\n const x0 = Math.max(-X / 2, xa), x1 = Math.min(X / 2, xb), zz0 = Math.max(-Z / 2, za), zz1 = Math.min(Z / 2, zb);\n if (x1 - x0 < 0.004 || zz1 - zz0 < 0.004) continue;\n const h = t + (rand(i, j, s) - 0.5) * 2 * height_jitter;\n const q = addpoint(0, [(x0 + x1) / 2, bed + h / 2, (zz0 + zz1) / 2]);\n setpointattrib(0, 'scale', q, [x1 - x0, h, zz1 - zz0]);\n setpointattrib(0, 'tint', q, 0.9 + 0.18 * rand(i, j, s, 2));\n if (pattern === 'checker' && (i + j) % 2 !== 0) setpointgroup(0, 'dark', q, 1);\n }\n}"
50
50
  }
51
51
  },
52
52
  "unit": { "type": "box" },
@@ -101,5 +101,6 @@
101
101
  }
102
102
  },
103
103
  "output": "out",
104
- "meta": { "shelf_group": "architecture", "watertight": true, "thumbnail_render": { "elevation": 40 } }
104
+ "outputs": { "tile_floor": { "node": "out", "label": "Tiled floor", "kind": "mesh", "tags": ["floor", "tiles", "interior"] } },
105
+ "meta": { "watertight": true, "thumbnail_render": { "elevation": 40 } }
105
106
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "version": 1,
3
- "description": "Straight wall from x = 0 to x = length with window (and an optional door) openings cut by a boolean, filled with the window_frame and door_frame shelf assets. The openings are spread in equal bays; the door takes the middle bay. Modular: segments placed end to end line up. Pivot at the start of the wall, on the ground, centred in thickness (+Z = outside). Pieces: wall (plaster) plus the frames' pieces. Every piece is closed (the wall is one watertight solid).",
3
+ "description": "Straight wall from x = 0 to x = wall_length with window (and an optional door) openings cut by a boolean, filled with this package's window_frame and door_frame outputs. The openings are spread in equal bays; the door takes the middle bay. Modular: segments placed end to end line up. Pivot at the start of the wall, on the ground, centred in thickness (+Z = outside). Pieces: wall (plaster) plus the frames' pieces. Every piece is closed (the wall is one watertight solid).",
4
4
  "params": {
5
- "length": { "type": "float", "default": 4, "min": 0.5, "max": 60, "desc": "length along X (m)" },
5
+ "wall_length": { "type": "float", "default": 4, "min": 0.5, "max": 60, "desc": "length along X (m)" },
6
6
  "height": { "type": "float", "default": 3, "min": 1, "max": 10, "desc": "height (m)" },
7
7
  "thickness": { "type": "float", "default": 0.25, "min": 0.05, "max": 1, "desc": "thickness along Z (m)" },
8
8
  "windows": { "type": "int", "default": 2, "min": 0, "max": 24, "desc": "number of window openings" },
@@ -31,7 +31,7 @@
31
31
  "frames": { "type": "bool", "default": true, "desc": "fill the openings with window_frame / door_frame" }
32
32
  },
33
33
  "vars": {
34
- "length": 4,
34
+ "wall_length": 4,
35
35
  "height": 3,
36
36
  "thickness": 0.25,
37
37
  "windows": 2,
@@ -44,7 +44,7 @@
44
44
  "nodes": {
45
45
  "wall": {
46
46
  "type": "box",
47
- "params": { "size": ["=length", "=height", "=thickness"], "center": ["=length / 2", "=height / 2", 0] }
47
+ "params": { "size": ["=wall_length", "=height", "=thickness"], "center": ["=wall_length / 2", "=height / 2", 0] }
48
48
  },
49
49
  "none": { "type": "points", "params": { "positions": [] } },
50
50
  "openings": {
@@ -53,7 +53,7 @@
53
53
  "note": "cutter boxes (group cut, with scale) and frame anchors at the bottom centre of each opening (groups win_at, door_at)",
54
54
  "params": {
55
55
  "run_over": "detail",
56
- "code": "const L = vars.length, H = vars.height, T = vars.thickness, nw = Math.round(vars.windows), bays = nw + (vars.door ? 1 : 0);\nconst z = addpoint(0, [0, 0, 0]);\nfor (const g of ['cut', 'win_at', 'door_at']) setpointgroup(0, g, z, 0);\nif (!bays) return;\nconst bw = L / bays, dbay = vars.door ? Math.floor(bays / 2) : -1;\nconst ww = Math.min(vars.window_width, bw - 0.2), sill = Math.min(vars.sill_height, H - 0.45), wh = Math.min(vars.window_height, H - sill - 0.15);\nconst dw = Math.min(1, bw - 0.2), dh = Math.min(2.1, H - 0.15);\nfor (let i = 0; i < bays; i++) {\n const x = bw * (i + 0.5), door = i === dbay;\n if ((door ? dw : ww) <= 0.05 || (door ? dh : wh) <= 0.05) continue;\n const c = addpoint(0, door ? [x, (dh - 0.05) / 2, 0] : [x, sill + wh / 2, 0]);\n setpointattrib(0, 'scale', c, door ? [dw, dh + 0.05, T + 0.2] : [ww, wh, T + 0.2]);\n setpointgroup(0, 'cut', c, 1);\n const a = addpoint(0, [x, door ? 0 : sill, 0]);\n setpointgroup(0, door ? 'door_at' : 'win_at', a, 1);\n}"
56
+ "code": "const L = wall_length, H = height, T = thickness, nw = Math.round(windows), bays = nw + (door ? 1 : 0);\nconst z = addpoint(0, [0, 0, 0]);\nfor (const g of ['cut', 'win_at', 'door_at']) setpointgroup(0, g, z, 0);\nif (!bays) return;\nconst bw = L / bays, dbay = door ? Math.floor(bays / 2) : -1;\nconst ww = Math.min(window_width, bw - 0.2), sill = Math.min(sill_height, H - 0.45), wh = Math.min(window_height, H - sill - 0.15);\nconst dw = Math.min(1, bw - 0.2), dh = Math.min(2.1, H - 0.15);\nfor (let i = 0; i < bays; i++) {\n const x = bw * (i + 0.5), isDoor = i === dbay;\n if ((isDoor ? dw : ww) <= 0.05 || (isDoor ? dh : wh) <= 0.05) continue;\n const c = addpoint(0, isDoor ? [x, (dh - 0.05) / 2, 0] : [x, sill + wh / 2, 0]);\n setpointattrib(0, 'scale', c, isDoor ? [dw, dh + 0.05, T + 0.2] : [ww, wh, T + 0.2]);\n setpointgroup(0, 'cut', c, 1);\n const a = addpoint(0, [x, isDoor ? 0 : sill, 0]);\n setpointgroup(0, isDoor ? 'door_at' : 'win_at', a, 1);\n}"
57
57
  }
58
58
  },
59
59
  "unit": { "type": "box" },
@@ -71,9 +71,9 @@
71
71
  "params": { "name": "plaster", "base_color": "#ddd3c1", "roughness": 0.85 }
72
72
  },
73
73
  "window": {
74
- "type": "window_frame",
74
+ "type": "topotopo/architecture/window_frame",
75
75
  "params": {
76
- "width": "=Math.min(window_width, length / Math.max(1, windows + (door ? 1 : 0)) - 0.2)",
76
+ "width": "=Math.min(window_width, wall_length / Math.max(1, windows + (door ? 1 : 0)) - 0.2)",
77
77
  "height": "=Math.min(window_height, height - Math.min(sill_height, height - 0.45) - 0.15)",
78
78
  "depth": "=Math.min(0.12, thickness * 0.6)",
79
79
  "sill_depth": "=thickness / 2 - Math.min(0.12, thickness * 0.6) / 2 + 0.05"
@@ -81,9 +81,9 @@
81
81
  },
82
82
  "windows_geo": { "type": "copy_to_points", "in": ["window", "openings"], "params": { "group": "win_at" } },
83
83
  "door_geo": {
84
- "type": "door_frame",
84
+ "type": "topotopo/architecture/door_frame",
85
85
  "params": {
86
- "width": "=Math.min(1, length / Math.max(1, windows + 1) - 0.2)",
86
+ "width": "=Math.min(1, wall_length / Math.max(1, windows + 1) - 0.2)",
87
87
  "height": "=Math.min(2.1, height - 0.15)",
88
88
  "depth": "=thickness + 0.02"
89
89
  }
@@ -103,8 +103,8 @@
103
103
  "out": { "type": "attrib_delete", "in": ["paint"], "params": { "names": "copynum", "groups": "*" } }
104
104
  },
105
105
  "output": "out",
106
+ "outputs": { "wall_segment": { "node": "out", "label": "Wall", "kind": "mesh", "tags": ["wall", "window", "building", "modular"] } },
106
107
  "meta": {
107
- "shelf_group": "architecture",
108
108
  "watertight": true,
109
109
  "thumbnail_render": { "azimuth": 25, "elevation": 15 }
110
110
  }
@@ -34,7 +34,7 @@
34
34
  "in": ["none"],
35
35
  "params": {
36
36
  "run_over": "detail",
37
- "code": "const W = vars.width, H = vars.height, D = vars.depth, f = Math.min(vars.frame_width, W / 4, H / 4), m = f * 0.6;\nconst mx = Math.round(vars.mullions_x), my = Math.round(vars.mullions_y), iw = W - 2 * f, ih = H - 2 * f;\nconst add = (p, s) => { const q = addpoint(0, p); setpointattrib(0, 'scale', q, s); };\nadd([-(W - f) / 2, H / 2, 0], [f, H, D]); add([(W - f) / 2, H / 2, 0], [f, H, D]);\nadd([0, f / 2, 0], [iw, f, D]); add([0, H - f / 2, 0], [iw, f, D]);\nfor (let i = 1; i <= mx; i++) add([-iw / 2 + iw * i / (mx + 1), H / 2, 0], [m, ih, D * 0.7]);\nfor (let j = 1; j <= my; j++) add([0, f + ih * j / (my + 1), 0], [iw, m, D * 0.6]);"
37
+ "code": "const W = width, H = height, D = depth, f = Math.min(frame_width, W / 4, H / 4), m = f * 0.6;\nconst mx = Math.round(mullions_x), my = Math.round(mullions_y), iw = W - 2 * f, ih = H - 2 * f;\nconst add = (p, s) => { const q = addpoint(0, p); setpointattrib(0, 'scale', q, s); };\nadd([-(W - f) / 2, H / 2, 0], [f, H, D]); add([(W - f) / 2, H / 2, 0], [f, H, D]);\nadd([0, f / 2, 0], [iw, f, D]); add([0, H - f / 2, 0], [iw, f, D]);\nfor (let i = 1; i <= mx; i++) add([-iw / 2 + iw * i / (mx + 1), H / 2, 0], [m, ih, D * 0.7]);\nfor (let j = 1; j <= my; j++) add([0, f + ih * j / (my + 1), 0], [iw, m, D * 0.6]);"
38
38
  }
39
39
  },
40
40
  "unit": { "type": "box" },
@@ -93,8 +93,8 @@
93
93
  "out": { "type": "attrib_delete", "in": ["paint"], "params": { "names": "copynum" } }
94
94
  },
95
95
  "output": "out",
96
+ "outputs": { "window_frame": { "node": "out", "label": "Window", "kind": "mesh", "tags": ["window", "glass", "wall-opening", "modular", "building"] } },
96
97
  "meta": {
97
- "shelf_group": "architecture",
98
98
  "watertight": true,
99
99
  "pivot": "opening",
100
100
  "thumbnail_render": { "azimuth": 25, "elevation": 15 }