topotopo 0.4.0 → 0.5.1
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.
- package/NOTICE +10 -10
- package/README.md +460 -117
- package/dist/cli.js +327 -147
- package/dist/config.d.ts +48 -0
- package/dist/config.js +170 -0
- package/dist/core/bake.d.ts +14 -3
- package/dist/core/bake.js +153 -4
- package/dist/core/bevel.d.ts +3 -1
- package/dist/core/bevel.js +76 -3
- package/dist/core/decimate.d.ts +65 -0
- package/dist/core/decimate.js +409 -3
- package/dist/core/erosion.d.ts +37 -0
- package/dist/core/erosion.js +41 -1
- package/dist/core/geometry.d.ts +5 -1
- package/dist/core/geometry.js +203 -3
- package/dist/core/heightfield.d.ts +27 -4
- package/dist/core/heightfield.js +54 -16
- package/dist/core/intrinsics.d.ts +7 -0
- package/dist/core/intrinsics.js +94 -0
- package/dist/core/manifold.d.ts +12 -1
- package/dist/core/manifold.js +78 -6
- package/dist/core/materials.d.ts +7 -0
- package/dist/core/materials.js +45 -0
- package/dist/core/noise.d.ts +9 -0
- package/dist/core/noise.js +10 -1
- package/dist/core/polymerge.d.ts +21 -0
- package/dist/core/polymerge.js +327 -0
- package/dist/core/repair.d.ts +2 -0
- package/dist/core/repair.js +2 -0
- package/dist/core/report.d.ts +70 -0
- package/dist/core/report.js +275 -0
- package/dist/core/scene.js +2 -1
- package/dist/core/sha256.d.ts +4 -0
- package/dist/core/sha256.js +69 -0
- package/dist/core/shapes.d.ts +3 -0
- package/dist/core/shapes.js +34 -0
- package/dist/core/snippet-lib.d.ts +14 -1
- package/dist/core/snippet-lib.js +39 -13
- package/dist/core/tangents.d.ts +2 -0
- package/dist/core/tangents.js +5 -1
- package/dist/core/texnoise.d.ts +6 -1
- package/dist/core/texnoise.js +6 -2
- package/dist/core/texsdf.d.ts +131 -0
- package/dist/core/texsdf.js +637 -0
- package/dist/core/texture.d.ts +163 -9
- package/dist/core/texture.js +844 -20
- package/dist/core/topology.d.ts +10 -0
- package/dist/core/topology.js +168 -0
- package/dist/core/unwrap.d.ts +72 -0
- package/dist/core/unwrap.js +800 -0
- package/dist/core/usercode.d.ts +27 -0
- package/dist/core/usercode.js +87 -0
- package/dist/core/uv.d.ts +4 -18
- package/dist/core/uv.js +35 -188
- package/dist/core/uvislands.d.ts +62 -0
- package/dist/core/uvislands.js +574 -0
- package/dist/core/uvoverlap.d.ts +58 -0
- package/dist/core/uvoverlap.js +220 -0
- package/dist/core/uvpack.d.ts +64 -0
- package/dist/core/uvpack.js +628 -0
- package/dist/core/uvreport.d.ts +61 -0
- package/dist/core/uvreport.js +207 -143
- package/dist/core/wrangle.d.ts +6 -1
- package/dist/core/wrangle.js +27 -16
- package/dist/core/xatlas.d.ts +16 -1
- package/dist/core/xatlas.js +66 -62
- package/dist/engines.d.ts +63 -0
- package/dist/engines.js +180 -0
- package/dist/explain.d.ts +4 -3
- package/dist/explain.js +129 -12
- package/dist/graph/engine.d.ts +92 -29
- package/dist/graph/engine.js +298 -148
- package/dist/graph/expr.d.ts +6 -3
- package/dist/graph/expr.js +18 -8
- package/dist/graph/outputs.d.ts +23 -0
- package/dist/graph/outputs.js +41 -0
- package/dist/graph/packages.d.ts +72 -0
- package/dist/graph/packages.js +261 -0
- package/dist/graph/parallel.d.ts +3 -1
- package/dist/graph/parallel.js +4 -1
- package/dist/graph/params.d.ts +6 -0
- package/dist/graph/params.js +34 -7
- package/dist/graph/scope.d.ts +55 -0
- package/dist/graph/scope.js +14 -0
- package/dist/graph/types.d.ts +75 -12
- package/dist/graph/types.js +4 -2
- package/dist/graph/vars.d.ts +16 -0
- package/dist/graph/vars.js +80 -0
- package/dist/host/artifacts.d.ts +10 -1
- package/dist/host/artifacts.js +37 -6
- package/dist/host/cook.d.ts +241 -0
- package/dist/host/cook.js +844 -0
- package/dist/host/export-targets.d.ts +42 -5
- package/dist/host/export-targets.js +72 -13
- package/dist/host/godot-commands.d.ts +4 -0
- package/dist/host/godot-commands.js +21 -0
- package/dist/host/godot.d.ts +183 -0
- package/dist/host/godot.js +916 -0
- package/dist/host/node.d.ts +12 -7
- package/dist/host/node.js +27 -9
- package/dist/host/pool.js +51 -2
- package/dist/host/sidecars.d.ts +8 -0
- package/dist/host/sidecars.js +50 -0
- package/dist/host/types.d.ts +19 -6
- package/dist/host/version.d.ts +1 -0
- package/dist/host/version.js +3 -0
- package/dist/host/worker.js +5 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/inspect.d.ts +80 -2
- package/dist/inspect.js +265 -30
- package/dist/io/common.d.ts +25 -5
- package/dist/io/export.js +2 -1
- package/dist/io/files.d.ts +23 -4
- package/dist/io/files.js +60 -8
- package/dist/io/gltf.js +134 -47
- package/dist/io/heightmap.d.ts +3 -0
- package/dist/io/heightmap.js +1 -0
- package/dist/io/import.js +10 -0
- package/dist/io/inspect-scene.d.ts +55 -0
- package/dist/io/inspect-scene.js +155 -0
- package/dist/io/kinds.d.ts +81 -0
- package/dist/io/kinds.js +163 -0
- package/dist/io/points.d.ts +2 -1
- package/dist/io/points.js +3 -1
- package/dist/io/sidecars.d.ts +24 -0
- package/dist/io/sidecars.js +57 -0
- package/dist/io/source.d.ts +65 -0
- package/dist/io/source.js +112 -0
- package/dist/io/targets.d.ts +47 -3
- package/dist/io/targets.js +148 -13
- package/dist/io/textures.js +21 -1
- package/dist/io/unreal.js +5 -1
- package/dist/mcp/docs.d.ts +10 -1
- package/dist/mcp/docs.js +786 -143
- package/dist/mcp/inputs.d.ts +12 -5
- package/dist/mcp/inputs.js +50 -13
- package/dist/mcp/server.js +56 -27
- package/dist/mcp/tools.d.ts +14 -7
- package/dist/mcp/tools.js +198 -103
- package/dist/mcp/verify.d.ts +2 -2
- package/dist/mcp/verify.js +1 -1
- package/dist/mcp/workspace.d.ts +15 -0
- package/dist/mcp/workspace.js +349 -0
- package/dist/nodes/attributes.js +198 -1
- package/dist/nodes/bake.js +151 -47
- package/dist/nodes/beam.d.ts +1 -0
- package/dist/nodes/beam.js +201 -0
- package/dist/nodes/bevel.js +51 -3
- package/dist/nodes/cloth.js +2 -0
- package/dist/nodes/code.js +21 -9
- package/dist/nodes/curves.js +433 -93
- package/dist/nodes/flow.js +53 -33
- package/dist/nodes/generate.js +12 -38
- package/dist/nodes/heightfield.js +248 -77
- package/dist/nodes/imageops.js +16 -19
- package/dist/nodes/index.d.ts +1 -0
- package/dist/nodes/index.js +1 -0
- package/dist/nodes/material.js +89 -24
- package/dist/nodes/measure.js +43 -17
- package/dist/nodes/particles.js +2 -0
- package/dist/nodes/pcg.js +6 -5
- package/dist/nodes/procedural.js +4 -3
- package/dist/nodes/remesh.js +71 -15
- package/dist/nodes/scene.js +4 -2
- package/dist/nodes/sdf.js +10 -5
- package/dist/nodes/solid.js +20 -5
- package/dist/nodes/splines.d.ts +15 -1
- package/dist/nodes/splines.js +112 -105
- package/dist/nodes/texture.d.ts +21 -6
- package/dist/nodes/texture.js +1318 -185
- package/dist/nodes/topology.d.ts +7 -0
- package/dist/nodes/topology.js +133 -6
- package/dist/nodes/transform.js +6 -2
- package/dist/nodes/uv.js +192 -174
- package/dist/nodes/wasmcall.js +5 -1
- package/dist/open.d.ts +19 -0
- package/dist/open.js +12 -0
- package/dist/package.d.ts +288 -0
- package/dist/package.js +772 -0
- package/dist/packages/check.d.ts +32 -0
- package/dist/packages/check.js +169 -0
- package/dist/packages/commands.d.ts +57 -0
- package/dist/packages/commands.js +537 -0
- package/dist/packages/registry.d.ts +796 -0
- package/dist/packages/registry.js +2998 -0
- package/dist/packages/update.d.ts +124 -0
- package/dist/packages/update.js +476 -0
- package/dist/render/options.d.ts +2 -0
- package/dist/render/options.js +57 -5
- package/dist/render/preview.d.ts +17 -4
- package/dist/render/preview.js +6 -4
- package/dist/render/raster.d.ts +74 -5
- package/dist/render/raster.js +527 -143
- package/dist/render/texview.d.ts +6 -0
- package/dist/render/texview.js +27 -0
- package/dist/scan.d.ts +61 -0
- package/dist/scan.js +228 -0
- package/dist/session.d.ts +311 -0
- package/dist/session.js +849 -0
- package/dist/viewer/app/api.js +48 -6
- package/dist/viewer/app/cooking.js +78 -0
- package/dist/viewer/app/embed.js +27 -7
- package/dist/viewer/app/export-popover.js +118 -16
- package/dist/viewer/app/grid.js +5 -1
- package/dist/viewer/app/guides.js +122 -0
- package/dist/viewer/app/keymap.js +6 -3
- package/dist/viewer/app/layers.js +4 -4
- package/dist/viewer/app/main.js +185 -52
- package/dist/viewer/app/markers.js +60 -0
- package/dist/viewer/app/outliner.js +72 -27
- package/dist/viewer/app/output-info.js +45 -0
- package/dist/viewer/app/outputs.css +147 -8
- package/dist/viewer/app/outputs.js +168 -54
- package/dist/viewer/app/packages.js +614 -0
- package/dist/viewer/app/props.js +176 -52
- package/dist/viewer/app/scene.js +30 -5
- package/dist/viewer/app/select.js +4 -3
- package/dist/viewer/app/status.js +12 -15
- package/dist/viewer/app/style.css +65 -7
- package/dist/viewer/app/vars.js +47 -0
- package/dist/viewer/app/welcome.js +72 -0
- package/dist/viewer/graph-file.d.ts +62 -0
- package/dist/viewer/graph-file.js +175 -0
- package/dist/viewer/index.html +23 -10
- package/dist/viewer/json-edit.d.ts +13 -0
- package/dist/viewer/json-edit.js +274 -0
- package/dist/viewer/outputs.d.ts +49 -5
- package/dist/viewer/outputs.js +264 -56
- package/dist/viewer/packages.d.ts +121 -0
- package/dist/viewer/packages.js +584 -0
- package/dist/viewer/server.d.ts +14 -9
- package/dist/viewer/server.js +266 -28
- package/dist/web/app/web.css +419 -0
- package/dist/web/app/web.js +188 -0
- package/dist/{gallery → web}/bake.d.ts +4 -4
- package/dist/{gallery → web}/bake.js +24 -15
- package/dist/web/folder-page.d.ts +101 -0
- package/dist/web/folder-page.js +146 -0
- package/dist/web/folders.d.ts +280 -0
- package/dist/web/folders.js +970 -0
- package/dist/web/library.d.ts +91 -0
- package/dist/web/library.js +228 -0
- package/dist/web/markdown.d.ts +45 -0
- package/dist/web/markdown.js +677 -0
- package/dist/web/pages.d.ts +258 -0
- package/dist/web/pages.js +301 -0
- package/dist/web/server.d.ts +24 -0
- package/dist/web/server.js +1068 -0
- package/dist/workspace.d.ts +88 -118
- package/dist/workspace.js +358 -460
- package/integrations/godot/addons/topotopo/LICENSE +202 -0
- package/integrations/godot/addons/topotopo/README.md +57 -0
- package/integrations/godot/addons/topotopo/context_menu.gd +43 -0
- package/integrations/godot/addons/topotopo/dock.gd +266 -0
- package/integrations/godot/addons/topotopo/dock.tscn +72 -0
- package/integrations/godot/addons/topotopo/export_filter.gd +72 -0
- package/integrations/godot/addons/topotopo/gltf_instancing.gd +131 -0
- package/integrations/godot/addons/topotopo/icons/topotopo.svg +1 -0
- package/integrations/godot/addons/topotopo/inspector.gd +38 -0
- package/integrations/godot/addons/topotopo/instances_post_import.gd +111 -0
- package/integrations/godot/addons/topotopo/package.gd +23 -0
- package/integrations/godot/addons/topotopo/package_importer.gd +187 -0
- package/integrations/godot/addons/topotopo/plugin.cfg +7 -0
- package/integrations/godot/addons/topotopo/plugin.gd +970 -0
- package/integrations/godot/addons/topotopo/record.gd +435 -0
- package/integrations/godot/addons/topotopo/runner.gd +458 -0
- package/integrations/godot/addons/topotopo/tools/check.gd +42 -0
- package/integrations/godot/addons/topotopo/watcher.gd +199 -0
- package/kernels/pkg/README.md +2 -1
- package/kernels/pkg-simd/README.md +2 -1
- package/library/architecture/versions/1.0/architecture.topo +12 -0
- package/{shelf → library/architecture/versions/1.0/graphs}/arch.json +3 -3
- package/{shelf → library/architecture/versions/1.0/graphs}/beam_truss.json +6 -6
- package/{shelf → library/architecture/versions/1.0/graphs}/brick_wall.json +8 -8
- package/{shelf → library/architecture/versions/1.0/graphs}/door_frame.json +3 -3
- package/{shelf → library/architecture/versions/1.0/graphs}/hex_grid_floor.json +3 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/house.json +8 -8
- package/library/architecture/versions/1.0/graphs/lineup.json +42 -0
- package/{shelf → library/architecture/versions/1.0/graphs}/pillar.json +3 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/railing.json +5 -5
- package/{shelf → library/architecture/versions/1.0/graphs}/roof_gable.json +2 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/roof_hip.json +2 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/roof_skeleton.json +2 -1
- package/{shelf → library/architecture/versions/1.0/graphs}/scaffold.json +4 -4
- package/{shelf → library/architecture/versions/1.0/graphs}/spiral_stairs.json +3 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/stairs.json +6 -6
- package/{shelf → library/architecture/versions/1.0/graphs}/tile_floor.json +3 -2
- package/{shelf → library/architecture/versions/1.0/graphs}/wall_segment.json +10 -10
- package/{shelf → library/architecture/versions/1.0/graphs}/window_frame.json +2 -2
- package/library/architecture/versions/1.0/version.json +1119 -0
- package/{shelf → library/nature/versions/1.0/graphs}/bush.json +2 -2
- package/{shelf → library/nature/versions/1.0/graphs}/cliff_block.json +4 -3
- package/{shelf → library/nature/versions/1.0/graphs}/forest_patch.json +5 -5
- package/{shelf → library/nature/versions/1.0/graphs}/grass_clumps.json +2 -2
- package/library/nature/versions/1.0/graphs/lineup.json +24 -0
- package/{shelf → library/nature/versions/1.0/graphs}/log.json +6 -6
- package/{shelf → library/nature/versions/1.0/graphs}/rock.json +5 -4
- package/{shelf → library/nature/versions/1.0/graphs}/scatter_rocks.json +5 -5
- package/{shelf → library/nature/versions/1.0/graphs}/tree_lowpoly.json +3 -2
- package/library/nature/versions/1.0/nature.topo +12 -0
- package/library/nature/versions/1.0/version.json +534 -0
- package/{shelf → library/props/versions/1.0/graphs}/barrel.json +5 -4
- package/{shelf → library/props/versions/1.0/graphs}/crate.json +3 -3
- package/library/props/versions/1.0/graphs/lineup.json +18 -0
- package/{shelf → library/props/versions/1.0/graphs}/pallet.json +4 -3
- package/{shelf → library/props/versions/1.0/graphs}/pipe_run.json +3 -3
- package/{shelf → library/props/versions/1.0/graphs}/sandbag_wall.json +5 -5
- package/library/props/versions/1.0/props.topo +12 -0
- package/library/props/versions/1.0/version.json +336 -0
- package/{shelf → library/street/versions/1.0/graphs}/bench.json +5 -5
- package/{shelf → library/street/versions/1.0/graphs}/bollard.json +2 -1
- package/{shelf → library/street/versions/1.0/graphs}/cable.json +4 -4
- package/{shelf → library/street/versions/1.0/graphs}/fence.json +7 -7
- package/{shelf → library/street/versions/1.0/graphs}/lamp_post.json +2 -2
- package/library/street/versions/1.0/graphs/lineup.json +22 -0
- package/{shelf → library/street/versions/1.0/graphs}/road_strip.json +2 -2
- package/{shelf → library/street/versions/1.0/graphs}/sign_post.json +1 -1
- package/library/street/versions/1.0/street.topo +12 -0
- package/library/street/versions/1.0/version.json +421 -0
- package/package.json +13 -8
- package/dist/gallery/app/gallery.css +0 -100
- package/dist/gallery/app/gallery.js +0 -80
- package/dist/gallery/cli.d.ts +0 -4
- package/dist/gallery/cli.js +0 -157
- package/dist/gallery/library.d.ts +0 -124
- package/dist/gallery/library.js +0 -366
- package/dist/gallery/pages.d.ts +0 -94
- package/dist/gallery/pages.js +0 -148
- package/dist/gallery/server.d.ts +0 -21
- package/dist/gallery/server.js +0 -391
- package/dist/graph/migrate.d.ts +0 -23
- package/dist/graph/migrate.js +0 -58
- package/dist/mcp/library.d.ts +0 -12
- package/dist/mcp/library.js +0 -159
- package/shelf/index.json +0 -190
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"note": "replace every corner by a circular arc tangent to both segments (radius clamped to half the shorter segment)",
|
|
47
47
|
"params": {
|
|
48
48
|
"run_over": "detail",
|
|
49
|
-
"code": "const R =
|
|
49
|
+
"code": "const R = bend_radius;\nfor (let pr = 0; pr < nprims(0); pr++) {\n const ids = primpoints(0, pr); if (ids.length < 2) continue;\n const P = ids.map((i) => point(0, 'P', i)), out = [P[0]];\n for (let i = 1; i < P.length - 1; i++) {\n const u = sub(P[i - 1], P[i]), v = sub(P[i + 1], P[i]), lu = length(u), lv = length(v);\n if (R <= 0 || lu < 1e-9 || lv < 1e-9) { out.push(P[i]); continue; }\n const a = normalize(u), b = normalize(v), th = Math.acos(clamp(dot(a, b), -1, 1));\n if (th > PI - 1e-3 || th < 1e-3) { out.push(P[i]); continue; }\n let d = R / Math.tan(th / 2); d = Math.min(d, lu / 2, lv / 2); const r = d * Math.tan(th / 2);\n const t1 = add(P[i], mul(a, d)), t2 = add(P[i], mul(b, d)), c = add(P[i], mul(normalize(add(a, b)), r / Math.sin(th / 2)));\n const e1 = sub(t1, c), e2 = sub(t2, c), phi = PI - th, n = Math.max(2, Math.ceil(phi / radians(10)));\n for (let k = 0; k <= n; k++) { const s = k / n; out.push(add(c, mul(add(mul(e1, Math.sin((1 - s) * phi)), mul(e2, Math.sin(s * phi))), 1 / Math.sin(phi)))); }\n }\n out.push(P[P.length - 1]);\n addprim(0, 'polyline', out.map((p) => addpoint(0, p)));\n removeprim(0, pr, true);\n}"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"pipe": {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"in": ["support_pts"],
|
|
109
109
|
"note": "keep points on near-horizontal stretches above the floor; drop them to y = 0 with the stand height as scale",
|
|
110
110
|
"params": {
|
|
111
|
-
"code": "const t = v@tangent; const top = @P.y -
|
|
111
|
+
"code": "const t = v@tangent; const top = @P.y - radius; if (Math.abs(t.y) > 0.3 || top < 0.05) { removepoint(0, @ptnum); return; } v@scale = [radius * 1.2, top, radius * 1.2]; p@orient = [0, 0, 0, 1]; @P.y = 0;"
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
"stand": { "type": "box", "params": { "center": [0, 0.5, 0] } },
|
|
@@ -141,8 +141,8 @@
|
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
143
|
"output": "out",
|
|
144
|
+
"outputs": { "pipe_run": { "node": "out", "label": "Pipe run", "kind": "mesh", "tags": ["pipe", "industrial", "along-curve", "metal"] } },
|
|
144
145
|
"meta": {
|
|
145
|
-
"shelf_group": "props",
|
|
146
146
|
"watertight": true,
|
|
147
147
|
"pivot": "curve",
|
|
148
148
|
"inputs": ["curve"],
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"description": "Sandbag wall from x = 0 to x =
|
|
3
|
+
"description": "Sandbag wall from x = 0 to x = wall_length: rows of pillow-shaped bags in running bond, squashed onto each other, with random yaw, offset and tint. Pivot at the start of the wall, on the ground, centred in depth. Piece: sandbags (burlap). Every bag is closed.",
|
|
4
4
|
"params": {
|
|
5
|
-
"
|
|
5
|
+
"wall_length": { "type": "float", "default": 3, "min": 0.6, "max": 15, "desc": "length along X (m)" },
|
|
6
6
|
"rows": { "type": "int", "default": 5, "min": 1, "max": 10, "desc": "number of rows" },
|
|
7
7
|
"bag_length": { "type": "float", "default": 0.6, "min": 0.3, "max": 1.2, "desc": "bag length (m)" },
|
|
8
8
|
"bag_height": { "type": "float", "default": 0.16, "min": 0.06, "max": 0.4, "desc": "bag height (m)" },
|
|
9
9
|
"jitter": { "type": "float", "default": 0.5, "min": 0, "max": 1, "desc": "random yaw and offset (0 = neat)" },
|
|
10
10
|
"seed": { "type": "int", "default": 0, "min": 0, "max": 1000, "desc": "random seed" }
|
|
11
11
|
},
|
|
12
|
-
"vars": { "
|
|
12
|
+
"vars": { "wall_length": 3, "rows": 5, "bag_length": 0.6, "bag_height": 0.16, "jitter": 0.5, "seed": 0 },
|
|
13
13
|
"nodes": {
|
|
14
14
|
"block": { "type": "box", "params": { "divisions": [2, 1, 1] } },
|
|
15
15
|
"pillow": { "type": "subdivide", "in": ["block"], "params": { "levels": 2 } },
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"in": ["none"],
|
|
33
33
|
"params": {
|
|
34
34
|
"run_over": "detail",
|
|
35
|
-
"code": "const L =
|
|
35
|
+
"code": "const L = wall_length, bl = bag_length, bh = bag_height, bd = bl * 0.55, j = jitter, s = seed;\nfor (let r = 0; r < Math.round(rows); r++) {\n const off = r % 2 ? bl / 2 : 0, n = Math.max(1, Math.floor((L - off + 1e-6) / bl));\n for (let i = 0; i < n; i++) {\n const id = r * 100 + i;\n const q = addpoint(0, [off + bl * (i + 0.5) + (rand(id, s, 1) - 0.5) * 0.04 * j, bh * 0.5 + r * bh * 0.82, (rand(id, s, 2) - 0.5) * 0.06 * j]);\n setpointattrib(0, 'scale', q, [bl * (0.96 + 0.06 * rand(id, s, 3)), bh, bd]);\n setpointattrib(0, 'orient', q, quaternion(radians((rand(id, s, 4) - 0.5) * 12 * j), [0, 1, 0]));\n setpointattrib(0, 'tint', q, 0.85 + 0.25 * rand(id, s, 5));\n }\n}"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"bags": { "type": "copy_to_points", "in": ["squash", "bag_pts"] },
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"out": { "type": "attrib_delete", "in": ["paint"], "params": { "names": "tint scale orient copynum" } }
|
|
59
59
|
},
|
|
60
60
|
"output": "out",
|
|
61
|
+
"outputs": { "sandbag_wall": { "node": "out", "label": "Sandbag wall", "kind": "mesh", "tags": ["sandbags", "barrier", "cover", "wall"] } },
|
|
61
62
|
"meta": {
|
|
62
|
-
"shelf_group": "props",
|
|
63
63
|
"watertight": true,
|
|
64
64
|
"thumbnail_render": { "azimuth": 25, "elevation": 20 }
|
|
65
65
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"graph": "lineup",
|
|
3
|
+
"bake": {},
|
|
4
|
+
"title": "Props",
|
|
5
|
+
"description": "TopoTopo's props package: barrels, crates, pallets, sandbag walls and pipe runs.",
|
|
6
|
+
"tags": [
|
|
7
|
+
"built-in"
|
|
8
|
+
],
|
|
9
|
+
"links": [],
|
|
10
|
+
"created": "2026-10-28",
|
|
11
|
+
"name": "topotopo/props"
|
|
12
|
+
}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
{
|
|
2
|
+
"package": "topotopo/props",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"note": "first version",
|
|
5
|
+
"published": "2026-10-30T12:01:49.872Z",
|
|
6
|
+
"big": false,
|
|
7
|
+
"hash": "8bab4b0396af3dcad5d9cdca1d48a4dfc479e513b14ff2c2438013afb39bdd91",
|
|
8
|
+
"outputs": {
|
|
9
|
+
"barrel": {
|
|
10
|
+
"graph": "barrel",
|
|
11
|
+
"node": "out",
|
|
12
|
+
"label": "Barrel",
|
|
13
|
+
"kind": "mesh",
|
|
14
|
+
"tags": [
|
|
15
|
+
"barrel",
|
|
16
|
+
"container",
|
|
17
|
+
"wooden",
|
|
18
|
+
"prop"
|
|
19
|
+
],
|
|
20
|
+
"description": "Wooden barrel: a bulged body of faceted staves with a recessed lid, and metal hoops. Pivot at the centre of the base, axis Y. Pieces: barrel_body (wood), barrel_hoops (metal_dark). Every piece is closed.",
|
|
21
|
+
"sliders": {
|
|
22
|
+
"height": {
|
|
23
|
+
"type": "float",
|
|
24
|
+
"default": 0.9,
|
|
25
|
+
"min": 0.3,
|
|
26
|
+
"max": 2.5,
|
|
27
|
+
"desc": "height (m)"
|
|
28
|
+
},
|
|
29
|
+
"radius": {
|
|
30
|
+
"type": "float",
|
|
31
|
+
"default": 0.28,
|
|
32
|
+
"min": 0.1,
|
|
33
|
+
"max": 1.2,
|
|
34
|
+
"desc": "radius at the ends (m)"
|
|
35
|
+
},
|
|
36
|
+
"bulge": {
|
|
37
|
+
"type": "float",
|
|
38
|
+
"default": 0.14,
|
|
39
|
+
"min": 0,
|
|
40
|
+
"max": 0.35,
|
|
41
|
+
"desc": "extra radius at the middle, as a fraction of radius"
|
|
42
|
+
},
|
|
43
|
+
"staves": {
|
|
44
|
+
"type": "int",
|
|
45
|
+
"default": 18,
|
|
46
|
+
"min": 6,
|
|
47
|
+
"max": 48,
|
|
48
|
+
"desc": "number of staves (facets around)"
|
|
49
|
+
},
|
|
50
|
+
"hoops": {
|
|
51
|
+
"type": "int",
|
|
52
|
+
"default": 4,
|
|
53
|
+
"min": 0,
|
|
54
|
+
"max": 8,
|
|
55
|
+
"desc": "number of metal hoops"
|
|
56
|
+
},
|
|
57
|
+
"seed": {
|
|
58
|
+
"type": "int",
|
|
59
|
+
"default": 0,
|
|
60
|
+
"min": 0,
|
|
61
|
+
"max": 1000,
|
|
62
|
+
"desc": "random seed of the stave tint"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"inputs": []
|
|
66
|
+
},
|
|
67
|
+
"crate": {
|
|
68
|
+
"graph": "crate",
|
|
69
|
+
"node": "out",
|
|
70
|
+
"label": "Crate",
|
|
71
|
+
"kind": "mesh",
|
|
72
|
+
"tags": [
|
|
73
|
+
"crate",
|
|
74
|
+
"container",
|
|
75
|
+
"wooden",
|
|
76
|
+
"prop"
|
|
77
|
+
],
|
|
78
|
+
"description": "Wooden crate: plank walls with gaps on all six sides inside a frame of edge battens. Pivot at the centre of the base. Pieces: crate_planks (wood), crate_frame (wood_dark). Every piece is a closed box.",
|
|
79
|
+
"sliders": {
|
|
80
|
+
"width": {
|
|
81
|
+
"type": "float",
|
|
82
|
+
"default": 1,
|
|
83
|
+
"min": 0.3,
|
|
84
|
+
"max": 3,
|
|
85
|
+
"desc": "outer size along X (m)"
|
|
86
|
+
},
|
|
87
|
+
"height": {
|
|
88
|
+
"type": "float",
|
|
89
|
+
"default": 0.8,
|
|
90
|
+
"min": 0.3,
|
|
91
|
+
"max": 3,
|
|
92
|
+
"desc": "outer size along Y (m)"
|
|
93
|
+
},
|
|
94
|
+
"depth": {
|
|
95
|
+
"type": "float",
|
|
96
|
+
"default": 0.8,
|
|
97
|
+
"min": 0.3,
|
|
98
|
+
"max": 3,
|
|
99
|
+
"desc": "outer size along Z (m)"
|
|
100
|
+
},
|
|
101
|
+
"planks": {
|
|
102
|
+
"type": "int",
|
|
103
|
+
"default": 4,
|
|
104
|
+
"min": 2,
|
|
105
|
+
"max": 10,
|
|
106
|
+
"desc": "planks per face"
|
|
107
|
+
},
|
|
108
|
+
"frame_width": {
|
|
109
|
+
"type": "float",
|
|
110
|
+
"default": 0.08,
|
|
111
|
+
"min": 0.03,
|
|
112
|
+
"max": 0.15,
|
|
113
|
+
"desc": "edge batten width (m)"
|
|
114
|
+
},
|
|
115
|
+
"gap": {
|
|
116
|
+
"type": "float",
|
|
117
|
+
"default": 0.01,
|
|
118
|
+
"min": 0,
|
|
119
|
+
"max": 0.03,
|
|
120
|
+
"desc": "gap between planks (m)"
|
|
121
|
+
},
|
|
122
|
+
"seed": {
|
|
123
|
+
"type": "int",
|
|
124
|
+
"default": 0,
|
|
125
|
+
"min": 0,
|
|
126
|
+
"max": 1000,
|
|
127
|
+
"desc": "random seed of the plank tint"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"inputs": []
|
|
131
|
+
},
|
|
132
|
+
"lineup": {
|
|
133
|
+
"graph": "lineup",
|
|
134
|
+
"node": "lineup",
|
|
135
|
+
"label": "Props line-up",
|
|
136
|
+
"kind": "mesh",
|
|
137
|
+
"tags": [
|
|
138
|
+
"lineup",
|
|
139
|
+
"props"
|
|
140
|
+
],
|
|
141
|
+
"description": "TopoTopo's props package, its 5 outputs side by side at their defaults. The package's default output and its preview, from barrel to sandbag_wall along +X, 1 m apart.",
|
|
142
|
+
"sliders": {},
|
|
143
|
+
"inputs": []
|
|
144
|
+
},
|
|
145
|
+
"pallet": {
|
|
146
|
+
"graph": "pallet",
|
|
147
|
+
"node": "out",
|
|
148
|
+
"label": "Pallet",
|
|
149
|
+
"kind": "mesh",
|
|
150
|
+
"tags": [
|
|
151
|
+
"pallet",
|
|
152
|
+
"warehouse",
|
|
153
|
+
"wooden",
|
|
154
|
+
"prop"
|
|
155
|
+
],
|
|
156
|
+
"description": "Block pallet (EUR style): bottom boards, a 3 × 3 grid of blocks, cross boards and a top deck. Pivot at the centre of the base; deck boards run along X. Pieces: pallet_boards (wood_light), pallet_blocks (wood). Every piece is a closed box.",
|
|
157
|
+
"sliders": {
|
|
158
|
+
"width": {
|
|
159
|
+
"type": "float",
|
|
160
|
+
"default": 1.2,
|
|
161
|
+
"min": 0.6,
|
|
162
|
+
"max": 2.4,
|
|
163
|
+
"desc": "size along X (m), the deck board direction"
|
|
164
|
+
},
|
|
165
|
+
"depth": {
|
|
166
|
+
"type": "float",
|
|
167
|
+
"default": 0.8,
|
|
168
|
+
"min": 0.5,
|
|
169
|
+
"max": 2,
|
|
170
|
+
"desc": "size along Z (m)"
|
|
171
|
+
},
|
|
172
|
+
"deck_boards": {
|
|
173
|
+
"type": "int",
|
|
174
|
+
"default": 5,
|
|
175
|
+
"min": 3,
|
|
176
|
+
"max": 11,
|
|
177
|
+
"desc": "top deck boards"
|
|
178
|
+
},
|
|
179
|
+
"board_thickness": {
|
|
180
|
+
"type": "float",
|
|
181
|
+
"default": 0.022,
|
|
182
|
+
"min": 0.015,
|
|
183
|
+
"max": 0.05,
|
|
184
|
+
"desc": "board thickness (m)"
|
|
185
|
+
},
|
|
186
|
+
"block_height": {
|
|
187
|
+
"type": "float",
|
|
188
|
+
"default": 0.078,
|
|
189
|
+
"min": 0.04,
|
|
190
|
+
"max": 0.2,
|
|
191
|
+
"desc": "height of the blocks between the board layers (m)"
|
|
192
|
+
},
|
|
193
|
+
"seed": {
|
|
194
|
+
"type": "int",
|
|
195
|
+
"default": 0,
|
|
196
|
+
"min": 0,
|
|
197
|
+
"max": 1000,
|
|
198
|
+
"desc": "random seed of the board tint"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"inputs": []
|
|
202
|
+
},
|
|
203
|
+
"pipe_run": {
|
|
204
|
+
"graph": "pipe_run",
|
|
205
|
+
"node": "out",
|
|
206
|
+
"label": "Pipe run",
|
|
207
|
+
"kind": "mesh",
|
|
208
|
+
"tags": [
|
|
209
|
+
"pipe",
|
|
210
|
+
"industrial",
|
|
211
|
+
"along-curve",
|
|
212
|
+
"metal"
|
|
213
|
+
],
|
|
214
|
+
"description": "Pipe run along a polyline (input 0; without one, a default run that turns and rises): corners rounded into elbows of bend_radius, flanges at both ends and every flange_spacing metres, and floor stands under horizontal stretches. Pivot = the curve (the default run starts at the origin, 0.5 m up). Pieces: pipe (pipe_paint), pipe_flanges (steel), pipe_supports (metal_dark). Every piece is closed.",
|
|
215
|
+
"sliders": {
|
|
216
|
+
"radius": {
|
|
217
|
+
"type": "float",
|
|
218
|
+
"default": 0.08,
|
|
219
|
+
"min": 0.01,
|
|
220
|
+
"max": 0.6,
|
|
221
|
+
"desc": "pipe radius (m)"
|
|
222
|
+
},
|
|
223
|
+
"bend_radius": {
|
|
224
|
+
"type": "float",
|
|
225
|
+
"default": 0.35,
|
|
226
|
+
"min": 0,
|
|
227
|
+
"max": 3,
|
|
228
|
+
"desc": "elbow radius at the corners (m); 0 = mitred corners"
|
|
229
|
+
},
|
|
230
|
+
"flange_spacing": {
|
|
231
|
+
"type": "float",
|
|
232
|
+
"default": 2.5,
|
|
233
|
+
"min": 0,
|
|
234
|
+
"max": 20,
|
|
235
|
+
"desc": "distance between flange joints (m); 0 = only at the ends"
|
|
236
|
+
},
|
|
237
|
+
"segments": {
|
|
238
|
+
"type": "int",
|
|
239
|
+
"default": 14,
|
|
240
|
+
"min": 4,
|
|
241
|
+
"max": 48,
|
|
242
|
+
"desc": "sides of the pipe section"
|
|
243
|
+
},
|
|
244
|
+
"supports": {
|
|
245
|
+
"type": "bool",
|
|
246
|
+
"default": true,
|
|
247
|
+
"desc": "stands from y = 0 under horizontal stretches"
|
|
248
|
+
},
|
|
249
|
+
"support_spacing": {
|
|
250
|
+
"type": "float",
|
|
251
|
+
"default": 3,
|
|
252
|
+
"min": 0.5,
|
|
253
|
+
"max": 20,
|
|
254
|
+
"desc": "distance between stands (m)"
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"inputs": [
|
|
258
|
+
{
|
|
259
|
+
"index": 0,
|
|
260
|
+
"label": "pipe centre line (polyline); optional"
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
"sandbag_wall": {
|
|
265
|
+
"graph": "sandbag_wall",
|
|
266
|
+
"node": "out",
|
|
267
|
+
"label": "Sandbag wall",
|
|
268
|
+
"kind": "mesh",
|
|
269
|
+
"tags": [
|
|
270
|
+
"sandbags",
|
|
271
|
+
"barrier",
|
|
272
|
+
"cover",
|
|
273
|
+
"wall"
|
|
274
|
+
],
|
|
275
|
+
"description": "Sandbag wall from x = 0 to x = wall_length: rows of pillow-shaped bags in running bond, squashed onto each other, with random yaw, offset and tint. Pivot at the start of the wall, on the ground, centred in depth. Piece: sandbags (burlap). Every bag is closed.",
|
|
276
|
+
"sliders": {
|
|
277
|
+
"wall_length": {
|
|
278
|
+
"type": "float",
|
|
279
|
+
"default": 3,
|
|
280
|
+
"min": 0.6,
|
|
281
|
+
"max": 15,
|
|
282
|
+
"desc": "length along X (m)"
|
|
283
|
+
},
|
|
284
|
+
"rows": {
|
|
285
|
+
"type": "int",
|
|
286
|
+
"default": 5,
|
|
287
|
+
"min": 1,
|
|
288
|
+
"max": 10,
|
|
289
|
+
"desc": "number of rows"
|
|
290
|
+
},
|
|
291
|
+
"bag_length": {
|
|
292
|
+
"type": "float",
|
|
293
|
+
"default": 0.6,
|
|
294
|
+
"min": 0.3,
|
|
295
|
+
"max": 1.2,
|
|
296
|
+
"desc": "bag length (m)"
|
|
297
|
+
},
|
|
298
|
+
"bag_height": {
|
|
299
|
+
"type": "float",
|
|
300
|
+
"default": 0.16,
|
|
301
|
+
"min": 0.06,
|
|
302
|
+
"max": 0.4,
|
|
303
|
+
"desc": "bag height (m)"
|
|
304
|
+
},
|
|
305
|
+
"jitter": {
|
|
306
|
+
"type": "float",
|
|
307
|
+
"default": 0.5,
|
|
308
|
+
"min": 0,
|
|
309
|
+
"max": 1,
|
|
310
|
+
"desc": "random yaw and offset (0 = neat)"
|
|
311
|
+
},
|
|
312
|
+
"seed": {
|
|
313
|
+
"type": "int",
|
|
314
|
+
"default": 0,
|
|
315
|
+
"min": 0,
|
|
316
|
+
"max": 1000,
|
|
317
|
+
"desc": "random seed"
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
"inputs": []
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"default": {
|
|
324
|
+
"graph": "lineup",
|
|
325
|
+
"node": "lineup",
|
|
326
|
+
"kind": "mesh",
|
|
327
|
+
"tags": [
|
|
328
|
+
"lineup",
|
|
329
|
+
"props"
|
|
330
|
+
],
|
|
331
|
+
"description": "TopoTopo's props package, its 5 outputs side by side at their defaults. The package's default output and its preview, from barrel to sandbag_wall along +X, 1 m apart.",
|
|
332
|
+
"sliders": {},
|
|
333
|
+
"inputs": []
|
|
334
|
+
},
|
|
335
|
+
"topotopo": "0.4.0"
|
|
336
|
+
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"version": 1,
|
|
3
3
|
"description": "Park bench along X: wooden seat slats and an optional reclined backrest on cast-iron side frames (two, or three on long benches). The seat faces +Z. Pivot at the centre of the base. Pieces: bench_slats (wood), bench_frames (metal_dark). Every piece is closed.",
|
|
4
4
|
"params": {
|
|
5
|
-
"
|
|
5
|
+
"bench_length": { "type": "float", "default": 1.8, "min": 0.6, "max": 5, "desc": "length along X (m)" },
|
|
6
6
|
"seat_height": { "type": "float", "default": 0.45, "min": 0.25, "max": 0.8, "desc": "seat height (m)" },
|
|
7
7
|
"depth": { "type": "float", "default": 0.45, "min": 0.25, "max": 0.8, "desc": "seat depth along Z (m)" },
|
|
8
8
|
"slats": { "type": "int", "default": 5, "min": 2, "max": 10, "desc": "seat slats" },
|
|
9
9
|
"backrest": { "type": "bool", "default": true, "desc": "add the backrest" },
|
|
10
10
|
"seed": { "type": "int", "default": 0, "min": 0, "max": 1000, "desc": "random seed of the slat tint" }
|
|
11
11
|
},
|
|
12
|
-
"vars": { "
|
|
12
|
+
"vars": { "bench_length": 1.8, "seat_height": 0.45, "depth": 0.45, "slats": 5, "backrest": true, "seed": 0 },
|
|
13
13
|
"nodes": {
|
|
14
14
|
"none": { "type": "points", "params": { "positions": [] } },
|
|
15
15
|
"slat_pts": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"note": "seat slats, then three backrest slats tilted back by 15 degrees",
|
|
19
19
|
"params": {
|
|
20
20
|
"run_over": "detail",
|
|
21
|
-
"code": "const L =
|
|
21
|
+
"code": "const L = bench_length, sh = seat_height, D = depth, n = Math.round(slats), t = 0.035, g = 0.012;\nconst w = (D - (n - 1) * g) / n;\nconst add = (p, s, rot, k) => { const q = addpoint(0, p); setpointattrib(0, 'scale', q, s); setpointattrib(0, 'orient', q, quaternion(radians(rot), [1, 0, 0])); setpointattrib(0, 'tint', q, 0.85 + 0.25 * rand(k, seed)); };\nfor (let i = 0; i < n; i++) add([0, sh - t / 2, -D / 2 + w / 2 + i * (w + g)], [L, t, w], 0, i);\nif (backrest) {\n const a = radians(15);\n for (let i = 0; i < 3; i++) { const h = 0.12 + i * 0.13; add([0, sh + 0.02 + h * Math.cos(a), -D / 2 + 0.01 - h * Math.sin(a)], [L, 0.1, t], -15, 10 + i); }\n}"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"unit": { "type": "box" },
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"note": "per side frame: front leg + seat rail + back leg as one polyline, and the backrest upright",
|
|
40
40
|
"params": {
|
|
41
41
|
"run_over": "detail",
|
|
42
|
-
"code": "const L =
|
|
42
|
+
"code": "const L = bench_length, sh = seat_height, D = depth, a = radians(15);\nconst xs = L > 2.4 ? [-L / 2 + 0.12, 0, L / 2 - 0.12] : [-L / 2 + 0.12, L / 2 - 0.12];\nfor (const x of xs) {\n const P = [[x, 0.02, D / 2 - 0.06], [x, sh - 0.06, D / 2 - 0.04], [x, sh - 0.06, -D / 2 + 0.04], [x, 0.02, -D / 2 + 0.02]];\n addprim(0, 'polyline', P.map((p) => addpoint(0, p)));\n if (backrest) addprim(0, 'polyline', [addpoint(0, [x, sh - 0.06, -D / 2 + 0.04]), addpoint(0, [x, sh + 0.45 * Math.cos(a), -D / 2 - 0.45 * Math.sin(a)])]);\n}"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"frames": {
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"output": "out",
|
|
77
|
+
"outputs": { "bench": { "node": "out", "label": "Bench", "kind": "mesh", "tags": ["bench", "seating", "park", "street-furniture"] } },
|
|
77
78
|
"meta": {
|
|
78
|
-
"shelf_group": "props",
|
|
79
79
|
"watertight": true,
|
|
80
80
|
"thumbnail_render": { "azimuth": 30, "elevation": 20 }
|
|
81
81
|
}
|
|
@@ -129,5 +129,6 @@
|
|
|
129
129
|
"out": { "type": "normal", "in": ["paint"], "params": { "cusp_angle": 45 } }
|
|
130
130
|
},
|
|
131
131
|
"output": "out",
|
|
132
|
-
"
|
|
132
|
+
"outputs": { "bollard": { "node": "out", "label": "Bollard", "kind": "mesh", "tags": ["bollard", "barrier", "street-furniture"] } },
|
|
133
|
+
"meta": { "watertight": true, "thumbnail_render": { "elevation": 20 } }
|
|
133
134
|
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"note": "linear interpolation of the ends minus sag × a normalised catenary shape (1 at mid-span, 0 at the ends)",
|
|
32
32
|
"params": {
|
|
33
33
|
"run_over": "detail",
|
|
34
|
-
"code": "const A =
|
|
34
|
+
"code": "const A = start, B = end, n = Math.max(2, Math.round(segments)), k = 1.5, ck = Math.cosh(k), pts = [];\nfor (let i = 0; i <= n; i++) {\n const t = i / n, f = (Math.cosh(k * (2 * t - 1)) - ck) / (1 - ck);\n pts.push(addpoint(0, [A[0] + (B[0] - A[0]) * t, A[1] + (B[1] - A[1]) * t - sag * f, A[2] + (B[2] - A[2]) * t]));\n}\naddprim(0, 'polyline', pts);"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"wire": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"note": "one point per end above the ground, facing the other end; scale = pole height",
|
|
56
56
|
"params": {
|
|
57
57
|
"run_over": "detail",
|
|
58
|
-
"code": "const E = [
|
|
58
|
+
"code": "const E = [start, end];\nfor (let i = 0; i < 2; i++) {\n const p = E[i], o = E[1 - i];\n if (p[1] < 0.5) continue;\n const d = normalize([o[0] - p[0], 0, o[2] - p[2]]);\n const q = addpoint(0, [p[0], 0, p[2]]);\n setpointattrib(0, 'scale', q, [1, p[1] + 0.35, 1]);\n if (length(d) > 0.5) setpointattrib(0, 'orient', q, lookat(d, [0, 1, 0]));\n}"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
"pole_unit": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"in": ["none"],
|
|
87
87
|
"params": {
|
|
88
88
|
"run_over": "detail",
|
|
89
|
-
"code": "for (const p of [
|
|
89
|
+
"code": "for (const p of [start, end]) if (p[1] >= 0.5) addpoint(0, [p[0], p[1] - 0.12, p[2]]);"
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"insulator": {
|
|
@@ -122,8 +122,8 @@
|
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"output": "out",
|
|
125
|
+
"outputs": { "cable": { "node": "out", "label": "Cable", "kind": "mesh", "tags": ["cable", "power-line", "utility-pole", "street-furniture"] } },
|
|
125
126
|
"meta": {
|
|
126
|
-
"shelf_group": "props",
|
|
127
127
|
"watertight": true,
|
|
128
128
|
"thumbnail_render": { "azimuth": 15, "elevation": 12, "zoom": 1.2 }
|
|
129
129
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"description": "Fence along a curve (input 0; without one, a straight run of `
|
|
3
|
+
"description": "Fence along a curve (input 0; without one, a straight run of `run_length` along +X from the origin) in three styles: picket (white pointed pickets on two rails), plank (horizontal boards) and rail (three ranch rails). Posts at even spacing including both ends. Sits on the curve (pivot = the curve). Pieces: fence_posts, fence_infill (paint_white, wood or wood_dark by style).",
|
|
4
4
|
"params": {
|
|
5
|
-
"
|
|
5
|
+
"run_length": {
|
|
6
6
|
"type": "float",
|
|
7
7
|
"default": 6,
|
|
8
8
|
"min": 0.5,
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"seed": { "type": "int", "default": 0, "min": 0, "max": 1000, "desc": "random seed of the board tint" }
|
|
34
34
|
},
|
|
35
35
|
"vars": {
|
|
36
|
-
"
|
|
36
|
+
"run_length": 6,
|
|
37
37
|
"height": 1.1,
|
|
38
38
|
"style": "picket",
|
|
39
39
|
"post_spacing": 2,
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"curve_in": { "type": "input", "params": { "index": 0, "label": "curve to follow (polyline); optional" } },
|
|
45
45
|
"straight": {
|
|
46
46
|
"type": "line",
|
|
47
|
-
"params": { "origin": [0, 0, 0], "direction": [1, 0, 0], "length": "=
|
|
47
|
+
"params": { "origin": [0, 0, 0], "direction": [1, 0, 0], "length": "=run_length", "points": 2 }
|
|
48
48
|
},
|
|
49
49
|
"path": {
|
|
50
50
|
"type": "switch",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"type": "wrangle",
|
|
95
95
|
"in": ["picket_pts"],
|
|
96
96
|
"params": {
|
|
97
|
-
"code": "const t = [v@tangentu.x, 0, v@tangentu.z]; if (length(t) > 1e-6) p@orient = lookat(normalize(t), [0, 1, 0]); f@tint = 0.9 + 0.15 * rand(@ptnum,
|
|
97
|
+
"code": "const t = [v@tangentu.x, 0, v@tangentu.z]; if (length(t) > 1e-6) p@orient = lookat(normalize(t), [0, 1, 0]); f@tint = 0.9 + 0.15 * rand(@ptnum, seed);"
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
"pickets": { "type": "copy_to_points", "in": ["picket", "picket_orient"] },
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"plank_tint": {
|
|
129
129
|
"type": "wrangle",
|
|
130
130
|
"in": ["planks"],
|
|
131
|
-
"params": { "run_over": "prims", "code": "f@tint = 0.85 + 0.25 * rand(i@copynum,
|
|
131
|
+
"params": { "run_over": "prims", "code": "f@tint = 0.85 + 0.25 * rand(i@copynum, seed);" }
|
|
132
132
|
},
|
|
133
133
|
"rail_profile": {
|
|
134
134
|
"type": "curve",
|
|
@@ -179,8 +179,8 @@
|
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
181
|
"output": "out",
|
|
182
|
+
"outputs": { "fence": { "node": "out", "label": "Fence", "kind": "mesh", "tags": ["fence", "barrier", "garden", "along-curve"] } },
|
|
182
183
|
"meta": {
|
|
183
|
-
"shelf_group": "architecture",
|
|
184
184
|
"pivot": "curve",
|
|
185
185
|
"inputs": ["curve"],
|
|
186
186
|
"thumbnail_render": { "elevation": 25, "zoom": 1.3 }
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"note": "one arm leaving the pole 0.6 m below the top, curving up and out to the head",
|
|
50
50
|
"params": {
|
|
51
51
|
"run_over": "detail",
|
|
52
|
-
"code": "const H =
|
|
52
|
+
"code": "const H = height, L = arm_length, n = 10, pts = [];\nfor (let i = 0; i <= n; i++) { const t = i / n; pts.push(addpoint(0, [L * (1 - Math.cos(t * PI / 2)) * 0 + L * Math.sin(t * PI / 2) * 0.15 + L * 0.85 * t, H - 0.6 + 0.6 * Math.sin(t * PI / 2) + 0.12 * Math.sin(t * PI), 0])); }\naddprim(0, 'polyline', pts);"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"arm": {
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
"out": { "type": "attrib_delete", "in": ["paint"], "params": { "groups": "*" } }
|
|
167
167
|
},
|
|
168
168
|
"output": "out",
|
|
169
|
+
"outputs": { "lamp_post": { "node": "out", "label": "Lamp post", "kind": "mesh", "tags": ["lamp", "street-light", "lighting", "street-furniture"] } },
|
|
169
170
|
"meta": {
|
|
170
|
-
"shelf_group": "props",
|
|
171
171
|
"watertight": true,
|
|
172
172
|
"thumbnail_render": { "azimuth": 20, "elevation": 15 }
|
|
173
173
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "TopoTopo's street package, its 7 outputs side by side at their defaults. The package's default output and its preview, from bench to sign_post along +X, 1 m apart.",
|
|
3
|
+
"nodes": {
|
|
4
|
+
"bench": {"type":"topotopo/street/bench"},
|
|
5
|
+
"bench_at": {"type":"transform","in":["bench"],"params":{"translate":[0.9,0,0]}},
|
|
6
|
+
"bollard": {"type":"topotopo/street/bollard"},
|
|
7
|
+
"bollard_at": {"type":"transform","in":["bollard"],"params":{"translate":[2.925,0,0]}},
|
|
8
|
+
"cable": {"type":"topotopo/street/cable"},
|
|
9
|
+
"cable_at": {"type":"transform","in":["cable"],"params":{"translate":[4.155,0,0]}},
|
|
10
|
+
"fence": {"type":"topotopo/street/fence"},
|
|
11
|
+
"fence_at": {"type":"transform","in":["fence"],"params":{"translate":[15.304,0,0]}},
|
|
12
|
+
"lamp_post": {"type":"topotopo/street/lamp_post"},
|
|
13
|
+
"lamp_post_at": {"type":"transform","in":["lamp_post"],"params":{"translate":[22.51,0,0]}},
|
|
14
|
+
"road_strip": {"type":"topotopo/street/road_strip"},
|
|
15
|
+
"road_strip_at": {"type":"transform","in":["road_strip"],"params":{"translate":[36.809,0,0]}},
|
|
16
|
+
"sign_post": {"type":"topotopo/street/sign_post"},
|
|
17
|
+
"sign_post_at": {"type":"transform","in":["sign_post"],"params":{"translate":[50.358,0,0]}},
|
|
18
|
+
"lineup": {"type":"merge","in":["bench_at","bollard_at","cable_at","fence_at","lamp_post_at","road_strip_at","sign_post_at"]}
|
|
19
|
+
},
|
|
20
|
+
"output": "lineup",
|
|
21
|
+
"outputs": {"lineup":{"node":"lineup","label":"Street line-up","kind":"mesh","tags":["lineup","street"]}}
|
|
22
|
+
}
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"note": "copy each dash point sideways onto every lane boundary (local +X is the left of the direction of travel)",
|
|
108
108
|
"params": {
|
|
109
109
|
"run_over": "detail",
|
|
110
|
-
"code": "const n = Math.round(
|
|
110
|
+
"code": "const n = Math.round(lanes), W = width;\nfor (let i = 0; i < npoints(0); i++) {\n const P = point(0, 'P', i), q = point(0, 'orient', i), side = qrotate(q, [1, 0, 0]);\n for (let k = 1; k < n; k++) {\n const off = -W / 2 + k * W / n, p = addpoint(0, add(P, mul(side, off), [0, 0.01, 0]));\n setpointattrib(0, 'orient', p, q);\n }\n removepoint(0, i);\n}"
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
"dash": { "type": "box", "params": { "size": [0.12, 0.004, "=dash_length"], "center": [0, 0.002, 0] } },
|
|
@@ -203,8 +203,8 @@
|
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
205
|
"output": "out",
|
|
206
|
+
"outputs": { "road_strip": { "node": "out", "label": "Road", "kind": "mesh", "tags": ["road", "street", "asphalt", "sidewalk", "along-curve"] } },
|
|
206
207
|
"meta": {
|
|
207
|
-
"shelf_group": "terrain",
|
|
208
208
|
"pivot": "curve",
|
|
209
209
|
"inputs": ["curve"],
|
|
210
210
|
"thumbnail_render": { "elevation": 40 }
|
|
@@ -127,8 +127,8 @@
|
|
|
127
127
|
"out": { "type": "attrib_delete", "in": ["paint"], "params": { "groups": "*" } }
|
|
128
128
|
},
|
|
129
129
|
"output": "out",
|
|
130
|
+
"outputs": { "sign_post": { "node": "out", "label": "Street sign", "kind": "mesh", "tags": ["sign", "street-sign", "text", "street-furniture"] } },
|
|
130
131
|
"meta": {
|
|
131
|
-
"shelf_group": "props",
|
|
132
132
|
"watertight": true,
|
|
133
133
|
"thumbnail_render": { "azimuth": 20, "elevation": 10 }
|
|
134
134
|
}
|