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.
- package/NOTICE +40 -10
- package/README.md +475 -111
- package/dist/cli.js +328 -133
- package/dist/config.d.ts +48 -0
- package/dist/config.js +170 -0
- package/dist/core/analysis.d.ts +5 -1
- package/dist/core/analysis.js +8 -3
- package/dist/core/bake.d.ts +16 -8
- package/dist/core/bake.js +165 -29
- package/dist/core/bevel.d.ts +3 -1
- package/dist/core/bevel.js +238 -97
- 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 +204 -4
- package/dist/core/heightfield.d.ts +27 -4
- package/dist/core/heightfield.js +54 -16
- package/dist/core/imageops.d.ts +6 -0
- package/dist/core/imageops.js +51 -0
- 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 +11 -0
- package/dist/core/materials.js +56 -0
- package/dist/core/noise.d.ts +9 -0
- package/dist/core/noise.js +10 -1
- package/dist/core/packed.js +11 -0
- package/dist/core/particles.d.ts +1 -1
- package/dist/core/particles.js +1 -1
- package/dist/core/polymerge.d.ts +21 -0
- package/dist/core/polymerge.js +327 -0
- package/dist/core/rbd.js +13 -1
- 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/scatter.d.ts +1 -1
- package/dist/core/scatter.js +1 -1
- package/dist/core/scene.d.ts +20 -0
- package/dist/core/scene.js +72 -0
- 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 +15 -2
- package/dist/core/snippet-lib.js +40 -14
- package/dist/core/solidify.d.ts +38 -0
- package/dist/core/solidify.js +356 -0
- package/dist/core/tangents.d.ts +54 -0
- package/dist/core/tangents.js +218 -0
- package/dist/core/texcoord.d.ts +4 -0
- package/dist/core/texcoord.js +14 -0
- 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 +32 -0
- package/dist/core/topology.js +238 -7
- package/dist/core/traceimage.d.ts +7 -0
- package/dist/core/traceimage.js +221 -0
- package/dist/core/tritri.d.ts +5 -0
- package/dist/core/tritri.js +120 -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 +15 -16
- package/dist/core/uv.js +36 -189
- 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 +127 -0
- package/dist/core/uvreport.js +372 -0
- 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 +95 -61
- 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 +5 -3
- package/dist/index.js +3 -2
- package/dist/inspect.d.ts +84 -1
- package/dist/inspect.js +271 -24
- package/dist/io/common.d.ts +33 -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 +355 -51
- 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 +149 -14
- 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 +816 -119
- package/dist/mcp/inputs.d.ts +12 -5
- package/dist/mcp/inputs.js +50 -13
- package/dist/mcp/server.js +70 -24
- package/dist/mcp/tools.d.ts +14 -7
- package/dist/mcp/tools.js +207 -108
- 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 +207 -83
- package/dist/nodes/beam.d.ts +1 -0
- package/dist/nodes/beam.js +201 -0
- package/dist/nodes/bevel.js +54 -5
- package/dist/nodes/cloth.js +2 -0
- package/dist/nodes/code.js +22 -10
- package/dist/nodes/curves.js +440 -93
- package/dist/nodes/flow.js +53 -33
- package/dist/nodes/generate.js +13 -39
- package/dist/nodes/heightfield.js +248 -77
- package/dist/nodes/imageops.d.ts +1 -0
- package/dist/nodes/imageops.js +203 -0
- package/dist/nodes/index.d.ts +4 -0
- package/dist/nodes/index.js +4 -0
- package/dist/nodes/material.js +91 -23
- package/dist/nodes/measure.js +45 -18
- package/dist/nodes/particles.js +2 -0
- package/dist/nodes/pcg.js +6 -5
- package/dist/nodes/procedural.js +4 -3
- package/dist/nodes/rbd.js +1 -1
- package/dist/nodes/remesh.js +71 -15
- package/dist/nodes/scene.d.ts +1 -0
- package/dist/nodes/scene.js +55 -0
- package/dist/nodes/sdf.js +10 -5
- package/dist/nodes/solid.js +20 -5
- package/dist/nodes/solidify.d.ts +1 -0
- package/dist/nodes/solidify.js +52 -0
- 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 +11 -3
- package/dist/nodes/util.d.ts +1 -1
- package/dist/nodes/uv.js +192 -174
- package/dist/nodes/wasmcall.js +6 -2
- 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 +44 -5
- package/dist/render/pbr.d.ts +28 -0
- package/dist/render/pbr.js +378 -0
- package/dist/render/preview.d.ts +69 -0
- package/dist/render/preview.js +26 -0
- package/dist/render/raster.d.ts +78 -7
- package/dist/render/raster.js +600 -145
- package/dist/render/texview.d.ts +7 -1
- package/dist/render/texview.js +34 -2
- 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/camera.js +1 -1
- package/dist/viewer/app/cooking.js +78 -0
- package/dist/viewer/app/embed.js +100 -0
- package/dist/viewer/app/export-popover.js +118 -16
- package/dist/viewer/app/grid.js +6 -2
- package/dist/viewer/app/guides.js +123 -1
- package/dist/viewer/app/keymap.js +7 -4
- package/dist/viewer/app/layers.js +5 -5
- package/dist/viewer/app/main.js +186 -53
- package/dist/viewer/app/markers.js +61 -1
- 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 +177 -53
- package/dist/viewer/app/scene.js +35 -6
- package/dist/viewer/app/select.js +5 -4
- package/dist/viewer/app/selection.js +1 -1
- package/dist/viewer/app/status.js +12 -15
- package/dist/viewer/app/style.css +66 -8
- package/dist/viewer/app/units.js +1 -1
- package/dist/viewer/app/vars.js +48 -1
- 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 +24 -11
- 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 +24 -7
- package/dist/viewer/server.js +289 -31
- package/dist/web/app/web.css +419 -0
- package/dist/web/app/web.js +188 -0
- package/dist/web/bake.d.ts +34 -0
- package/dist/web/bake.js +153 -0
- 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 -105
- package/dist/workspace.js +359 -375
- 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 +23 -29
- package/kernels/pkg-simd/README.md +23 -29
- 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 +23 -8
- package/dist/graph/migrate.d.ts +0 -23
- package/dist/graph/migrate.js +0 -58
- package/shelf/index.json +0 -190
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"in": ["none"],
|
|
23
23
|
"params": {
|
|
24
24
|
"run_over": "detail",
|
|
25
|
-
"code": "const S =
|
|
25
|
+
"code": "const S = size, H = height, n = Math.max(1, Math.round(blobs)), s = seed;\nfor (let i = 0; i < n; i++) {\n const a = TAU * (i / n + 0.3 * rand(i, s, 1)), d = n === 1 ? 0 : S * (0.12 + 0.18 * rand(i, s, 2)) * (i === 0 ? 0 : 1);\n const r = S * (0.22 + 0.12 * rand(i, s, 3)) * (i === 0 ? 1.25 : 1);\n const ry = Math.min(r, H * (i === 0 ? 0.62 : 0.5));\n const q = addpoint(0, [Math.cos(a) * d, ry * 0.75, Math.sin(a) * d]);\n setpointattrib(0, 'scale', q, [r, ry, r]);\n setpointattrib(0, 'orient', q, quaternion(radians(360 * rand(i, s, 5)), [0, 1, 0]));\n setpointattrib(0, 'tint', q, 0.8 + 0.35 * rand(i, s, 4));\n}"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"ball": { "type": "sphere", "params": { "type": "ico", "level": 1, "radius": 1 } },
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"output": "out",
|
|
66
|
-
"
|
|
66
|
+
"outputs": { "bush": { "node": "out", "label": "Bush", "kind": "mesh", "tags": ["bush", "foliage", "vegetation", "low-poly"] } }
|
|
67
67
|
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"note": "m = 0 at the base so it stays flat on the ground; the corners are pulled in a little",
|
|
32
32
|
"params": {
|
|
33
33
|
"run_over": "points",
|
|
34
|
-
"code": "f@m = clamp(@P.y / (0.12 *
|
|
34
|
+
"code": "f@m = clamp(@P.y / (0.12 * height), 0, 1);\nconst cx = Math.abs(@P.x) / (width / 2), cz = Math.abs(@P.z) / (depth / 2), k = 1 - 0.2 * Math.pow(cx * cz, 2);\n@P.x *= k; @P.z *= k;"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"rough": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"note": "strata: each layer is pushed in or out by its own random amount, with a slope inside the layer; the base stays flat",
|
|
54
54
|
"params": {
|
|
55
55
|
"run_over": "points",
|
|
56
|
-
"code": "const H =
|
|
56
|
+
"code": "const H = height, n = Math.max(0, Math.round(strata)), s = Math.min(width, depth);\nf@band = 0.5;\nif (n > 0) {\n const t = @P.y / H * n + 0.3 * noise([@P.x * 0.35, 0, @P.z * 0.35], seed), k = Math.floor(t), f = t - k;\n const off = ((rand(k, seed) - 0.5) * 0.14 + (f - 0.5) * 0.06) * s * (0.4 + roughness) * @m;\n const d = [@P.x / width, 0, @P.z / depth], l = Math.hypot(d[0], d[2]);\n if (l > 1e-6) @P = add(@P, mul(d, off / l));\n f@band = rand(k, seed, 7);\n}\nif (@m <= 0) @P.y = 0;"
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"facets": { "type": "normal", "in": ["ledges"], "params": { "cusp_angle": 30 } },
|
|
@@ -78,5 +78,6 @@
|
|
|
78
78
|
"out": { "type": "attrib_delete", "in": ["paint"], "params": { "names": "band m rest" } }
|
|
79
79
|
},
|
|
80
80
|
"output": "out",
|
|
81
|
-
"
|
|
81
|
+
"outputs": { "cliff_block": { "node": "out", "label": "Cliff block", "kind": "mesh", "tags": ["cliff", "rock", "mountain", "low-poly"] } },
|
|
82
|
+
"meta": { "watertight": true, "thumbnail_render": { "elevation": 20 } }
|
|
82
83
|
}
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"conifer": {
|
|
93
|
-
"type": "tree_lowpoly",
|
|
93
|
+
"type": "topotopo/nature/tree_lowpoly",
|
|
94
94
|
"params": { "height": 6, "style": "conifer", "canopy_radius": 1.7, "seed": 1 }
|
|
95
95
|
},
|
|
96
96
|
"conifer_id": {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"params": { "name": "variant_id", "class": "prim", "value": 0 }
|
|
100
100
|
},
|
|
101
101
|
"round": {
|
|
102
|
-
"type": "tree_lowpoly",
|
|
102
|
+
"type": "topotopo/nature/tree_lowpoly",
|
|
103
103
|
"params": { "height": 6, "style": "round", "canopy_radius": 1.9, "seed": 2 }
|
|
104
104
|
},
|
|
105
105
|
"round_id": {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"params": { "name": "variant_id", "class": "prim", "value": 1 }
|
|
109
109
|
},
|
|
110
110
|
"poplar": {
|
|
111
|
-
"type": "tree_lowpoly",
|
|
111
|
+
"type": "topotopo/nature/tree_lowpoly",
|
|
112
112
|
"params": { "height": 6, "style": "poplar", "canopy_radius": 1.5, "seed": 3 }
|
|
113
113
|
},
|
|
114
114
|
"poplar_id": {
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"seed": "=seed + 17"
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
|
-
"bush": { "type": "bush", "params": { "seed": 4 } },
|
|
153
|
+
"bush": { "type": "topotopo/nature/bush", "params": { "seed": 4 } },
|
|
154
154
|
"bushes_geo": { "type": "copy_to_points", "in": ["bush", "bush_xf"], "params": { "pack": true } },
|
|
155
155
|
"none": { "type": "points", "params": { "positions": [] } },
|
|
156
156
|
"bushes_on": { "type": "switch", "in": ["none", "bushes_geo"], "params": { "index": "=bushes ? 1 : 0" } },
|
|
@@ -162,8 +162,8 @@
|
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
"output": "out",
|
|
165
|
+
"outputs": { "forest_patch": { "node": "out", "label": "Forest", "kind": "instances", "tags": ["forest", "trees", "conifer", "vegetation", "scatter", "low-poly"] } },
|
|
165
166
|
"meta": {
|
|
166
|
-
"shelf_group": "terrain",
|
|
167
167
|
"pivot": "surface",
|
|
168
168
|
"inputs": ["surface"],
|
|
169
169
|
"thumbnail_render": { "elevation": 30 }
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"note": "two clump variants (prim attribute variant_id 0/1) of triangular blades: base on a small circle, tip leaning outwards",
|
|
46
46
|
"params": {
|
|
47
47
|
"run_over": "detail",
|
|
48
|
-
"code": "const H =
|
|
48
|
+
"code": "const H = height, n = Math.round(blades), w = Math.max(0.006, H * 0.05);\nfor (let v = 0; v < 2; v++) for (let i = 0; i < n; i++) {\n const s = seed * 7 + v * 101 + i, a = TAU * (i / n + 0.35 * rand(s, 1)), r = H * 0.06 * rand(s, 2);\n const h = H * (0.55 + 0.45 * rand(s, 3)), lean = spread * h * (0.4 + 0.6 * rand(s, 4));\n const dir = [Math.cos(a), 0, Math.sin(a)], side = [-Math.sin(a), 0, Math.cos(a)], base = [dir[0] * r, 0, dir[2] * r];\n const p0 = addpoint(0, add(base, mul(side, -w / 2))), p1 = addpoint(0, add(base, mul(side, w / 2)));\n const p2 = addpoint(0, add(base, [dir[0] * lean, h, dir[2] * lean]));\n const pr = addprim(0, 'poly', [p0, p1, p2]);\n setprimattrib(0, 'variant_id', pr, v);\n setprimattrib(0, 'tint', pr, 0.75 + 0.45 * rand(s, 5));\n}"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"clumps_name": {
|
|
@@ -108,8 +108,8 @@
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
"output": "out",
|
|
111
|
+
"outputs": { "grass_clumps": { "node": "out", "label": "Grass", "kind": "instances", "tags": ["grass", "foliage", "vegetation", "ground-cover", "scatter"] } },
|
|
111
112
|
"meta": {
|
|
112
|
-
"shelf_group": "terrain",
|
|
113
113
|
"pivot": "surface",
|
|
114
114
|
"inputs": ["surface"],
|
|
115
115
|
"thumbnail_render": { "elevation": 35, "zoom": 1.4 }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "TopoTopo's nature package, its 8 outputs side by side at their defaults. The package's default output and its preview, from bush to tree_lowpoly along +X, 1 m apart.",
|
|
3
|
+
"nodes": {
|
|
4
|
+
"bush": {"type":"topotopo/nature/bush"},
|
|
5
|
+
"bush_at": {"type":"transform","in":["bush"],"params":{"translate":[0.746,0,0]}},
|
|
6
|
+
"cliff_block": {"type":"topotopo/nature/cliff_block"},
|
|
7
|
+
"cliff_block_at": {"type":"transform","in":["cliff_block"],"params":{"translate":[4.508,0,0]}},
|
|
8
|
+
"forest_patch": {"type":"topotopo/nature/forest_patch"},
|
|
9
|
+
"forest_patch_at": {"type":"transform","in":["forest_patch"],"params":{"translate":[25.695,0,0]}},
|
|
10
|
+
"grass_clumps": {"type":"topotopo/nature/grass_clumps"},
|
|
11
|
+
"grass_clumps_at": {"type":"transform","in":["grass_clumps"],"params":{"translate":[45.36,0,0]}},
|
|
12
|
+
"log": {"type":"topotopo/nature/log"},
|
|
13
|
+
"log_at": {"type":"transform","in":["log"],"params":{"translate":[49.82,0,0]}},
|
|
14
|
+
"rock": {"type":"topotopo/nature/rock"},
|
|
15
|
+
"rock_at": {"type":"transform","in":["rock"],"params":{"translate":[52.531,0,0]}},
|
|
16
|
+
"scatter_rocks": {"type":"topotopo/nature/scatter_rocks"},
|
|
17
|
+
"scatter_rocks_at": {"type":"transform","in":["scatter_rocks"],"params":{"translate":[58.445,0,0]}},
|
|
18
|
+
"tree_lowpoly": {"type":"topotopo/nature/tree_lowpoly"},
|
|
19
|
+
"tree_lowpoly_at": {"type":"transform","in":["tree_lowpoly"],"params":{"translate":[65.564,0,0]}},
|
|
20
|
+
"lineup": {"type":"merge","in":["bush_at","cliff_block_at","forest_patch_at","grass_clumps_at","log_at","rock_at","scatter_rocks_at","tree_lowpoly_at"]}
|
|
21
|
+
},
|
|
22
|
+
"output": "lineup",
|
|
23
|
+
"outputs": {"lineup":{"node":"lineup","label":"Nature line-up","kind":"scene","tags":["lineup","nature"]}}
|
|
24
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": 1,
|
|
3
3
|
"description": "Felled log lying along X: a tapered trunk with ridged bark, light end grain and a few branch stubs. Pivot at the centre of the base (the log rests on y = 0). Pieces: log_trunk (bark, ends wood_end), log_stubs (bark). The trunk is closed.",
|
|
4
4
|
"params": {
|
|
5
|
-
"
|
|
5
|
+
"log_length": { "type": "float", "default": 2.4, "min": 0.4, "max": 8, "desc": "length along X (m)" },
|
|
6
6
|
"radius": { "type": "float", "default": 0.2, "min": 0.05, "max": 0.8, "desc": "radius at the thick end (m)" },
|
|
7
7
|
"taper": {
|
|
8
8
|
"type": "float",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"stubs": { "type": "int", "default": 3, "min": 0, "max": 10, "desc": "branch stubs" },
|
|
22
22
|
"seed": { "type": "int", "default": 0, "min": 0, "max": 1000, "desc": "random seed (bark noise, stubs)" }
|
|
23
23
|
},
|
|
24
|
-
"vars": { "
|
|
24
|
+
"vars": { "log_length": 2.4, "radius": 0.2, "taper": 0.2, "roughness": 0.12, "stubs": 3, "seed": 0 },
|
|
25
25
|
"nodes": {
|
|
26
26
|
"trunk": {
|
|
27
27
|
"type": "tube",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"axis": "x",
|
|
30
30
|
"radius": "=radius",
|
|
31
31
|
"radius_top": "=radius * (1 - taper)",
|
|
32
|
-
"height": "=
|
|
33
|
-
"rows": "=Math.max(2, Math.round(
|
|
32
|
+
"height": "=log_length",
|
|
33
|
+
"rows": "=Math.max(2, Math.round(log_length / radius))",
|
|
34
34
|
"cols": 14,
|
|
35
35
|
"caps": true,
|
|
36
36
|
"center": [0, "=radius", 0]
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"note": "stubs on the upper part of the trunk, pointing outwards",
|
|
75
75
|
"params": {
|
|
76
76
|
"run_over": "detail",
|
|
77
|
-
"code": "const L =
|
|
77
|
+
"code": "const L = log_length, R = radius;\nfor (let i = 0; i < Math.round(stubs); i++) {\n const t = 0.15 + 0.7 * rand(i, seed, 1), a = radians(-40 + 260 * rand(i, seed, 2));\n const x = -L / 2 + t * L, r = R * (1 - taper * t) * 0.85;\n const dir = [0, Math.sin(a), Math.cos(a)];\n const q = addpoint(0, [x, R + dir[1] * r, dir[2] * r]);\n setpointattrib(0, 'orient', q, dihedral([0, 1, 0], normalize([0.25 * (rand(i, seed, 3) - 0.5), dir[1], dir[2]])));\n setpointattrib(0, 'pscale', q, R * (0.45 + 0.3 * rand(i, seed, 4)));\n}"
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
"stub": {
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"out": { "type": "attrib_delete", "in": ["paint"], "params": { "names": "copynum", "groups": "ends" } }
|
|
111
111
|
},
|
|
112
112
|
"output": "out",
|
|
113
|
-
"
|
|
113
|
+
"outputs": { "log": { "node": "out", "label": "Log", "kind": "mesh", "tags": ["log", "deadwood", "wood", "low-poly"] } }
|
|
114
114
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"desc": "displacement as a fraction of the size"
|
|
12
12
|
},
|
|
13
13
|
"flatness": { "type": "float", "default": 0.65, "min": 0.2, "max": 1, "desc": "height / width" },
|
|
14
|
-
"
|
|
14
|
+
"level": {
|
|
15
15
|
"type": "int",
|
|
16
16
|
"default": 2,
|
|
17
17
|
"min": 1,
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"sink": { "type": "float", "default": 0, "min": 0, "max": 0.5, "desc": "part of the height below y = 0" },
|
|
22
22
|
"seed": { "type": "int", "default": 0, "min": 0, "max": 1000, "desc": "shape seed" }
|
|
23
23
|
},
|
|
24
|
-
"vars": { "size": 1, "roughness": 0.35, "flatness": 0.65, "
|
|
24
|
+
"vars": { "size": 1, "roughness": 0.35, "flatness": 0.65, "level": 2, "sink": 0, "seed": 0 },
|
|
25
25
|
"nodes": {
|
|
26
|
-
"ball": { "type": "sphere", "params": { "type": "ico", "level": "=
|
|
26
|
+
"ball": { "type": "sphere", "params": { "type": "ico", "level": "=level", "radius": "=size / 2" } },
|
|
27
27
|
"shape": {
|
|
28
28
|
"type": "noise_displace",
|
|
29
29
|
"in": ["ball"],
|
|
@@ -71,5 +71,6 @@
|
|
|
71
71
|
"out": { "type": "attrib_delete", "in": ["paint"], "params": { "names": "tint rest" } }
|
|
72
72
|
},
|
|
73
73
|
"output": "out",
|
|
74
|
-
"
|
|
74
|
+
"outputs": { "rock": { "node": "out", "label": "Rock", "kind": "mesh", "tags": ["rock", "stone", "boulder", "low-poly"] } },
|
|
75
|
+
"meta": { "watertight": true }
|
|
75
76
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"description": "Rocks scattered on a surface (input 0; without one, an 8 × 8 m ground patch at y = 0): the slope mask keeps faces flatter than max_slope, scatter by density with a minimum spacing, rocks aligned to the surface with random yaw, tilt and scale, overlaps pruned, then packed copies of three rock variants (
|
|
3
|
+
"description": "Rocks scattered on a surface (input 0; without one, an 8 × 8 m ground patch at y = 0): the slope mask keeps faces flatter than max_slope, scatter by density with a minimum spacing, rocks aligned to the surface with random yaw, tilt and scale, overlaps pruned, then packed copies of three rock variants (this package's rock output) sunk slightly into the ground. Output: packed instances (unpack for polygons); the input surface is not included. Pivot = the surface. Piece: rock (rock).",
|
|
4
4
|
"params": {
|
|
5
5
|
"density": {
|
|
6
6
|
"type": "float",
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"keep": { "type": "prune", "in": ["xf"], "params": { "mode": "overlap", "radius": 0.45 } },
|
|
79
|
-
"rock_a": { "type": "rock", "params": { "size": 1, "seed": 1, "sink": 0.15 } },
|
|
80
|
-
"rock_b": { "type": "rock", "params": { "size": 1, "seed": 2, "flatness": 0.5, "sink": 0.15 } },
|
|
79
|
+
"rock_a": { "type": "topotopo/nature/rock", "params": { "size": 1, "seed": 1, "sink": 0.15 } },
|
|
80
|
+
"rock_b": { "type": "topotopo/nature/rock", "params": { "size": 1, "seed": 2, "flatness": 0.5, "sink": 0.15 } },
|
|
81
81
|
"rock_c": {
|
|
82
|
-
"type": "rock",
|
|
82
|
+
"type": "topotopo/nature/rock",
|
|
83
83
|
"params": { "size": 1, "seed": 3, "flatness": 0.8, "roughness": 0.5, "sink": 0.15 }
|
|
84
84
|
},
|
|
85
85
|
"variants": { "type": "merge", "in": ["rock_a", "rock_b", "rock_c"] },
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
"output": "out",
|
|
98
|
+
"outputs": { "scatter_rocks": { "node": "out", "label": "Scattered rocks", "kind": "instances", "tags": ["rocks", "stone", "ground-cover", "scatter"] } },
|
|
98
99
|
"meta": {
|
|
99
|
-
"shelf_group": "terrain",
|
|
100
100
|
"pivot": "surface",
|
|
101
101
|
"inputs": ["surface"],
|
|
102
102
|
"thumbnail_render": { "elevation": 35 }
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"note": "one point per crown part: P, scale, orient, tint (cones stand on their point, blobs are centred on it)",
|
|
50
50
|
"params": {
|
|
51
51
|
"run_over": "detail",
|
|
52
|
-
"code": "const H =
|
|
52
|
+
"code": "const H = height, R = canopy_radius, s = seed, st = style;\nconst add = (p, sc, k) => { const q = addpoint(0, p); setpointattrib(0, 'scale', q, sc); setpointattrib(0, 'orient', q, quaternion(radians(360 * rand(k, s, 9)), [0, 1, 0])); setpointattrib(0, 'tint', q, 0.82 + 0.3 * rand(k, s, 8)); };\nif (st === 'conifer') {\n const n = 4, base = 0.18 * H;\n for (let i = 0; i < n; i++) {\n const t = i / n, r = R * (1 - 0.72 * t), y0 = base + (H - base) * t * 0.78, h = i === n - 1 ? H - y0 : (H - y0) * 0.55;\n add([0, y0, 0], [r, h, r], i);\n }\n} else if (st === 'poplar') {\n add([0, H - 0.36 * H, 0], [R * 0.5, 0.36 * H, R * 0.5], 0);\n add([R * 0.18, H * 0.5, R * 0.1], [R * 0.4, 0.2 * H, R * 0.4], 1);\n} else {\n const cy = Math.max(H * 0.3, H - R * 0.95) + 0.1 * R;\n add([0, cy, 0], [R * 0.8, R * 0.72, R * 0.8], 0);\n for (let i = 0; i < 5; i++) {\n const a = TAU * (i / 5 + 0.2 * rand(i, s, 1)), d = R * (0.42 + 0.15 * rand(i, s, 2)), r = R * (0.42 + 0.15 * rand(i, s, 3));\n add([Math.cos(a) * d, cy - 0.25 * R + 0.35 * R * rand(i, s, 4), Math.sin(a) * d], [r, r * 0.85, r], i + 1);\n }\n}"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"blob_ball": { "type": "sphere", "params": { "type": "ico", "level": 1, "radius": 1 } },
|
|
@@ -95,5 +95,6 @@
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
"output": "out",
|
|
98
|
-
"
|
|
98
|
+
"outputs": { "tree_lowpoly": { "node": "out", "label": "Tree", "kind": "mesh", "tags": ["tree", "conifer", "deciduous", "vegetation", "low-poly"] } },
|
|
99
|
+
"meta": { "watertight": true, "thumbnail_render": { "elevation": 15 } }
|
|
99
100
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"graph": "lineup",
|
|
3
|
+
"bake": {},
|
|
4
|
+
"title": "Nature",
|
|
5
|
+
"description": "TopoTopo's nature package: rocks and cliff blocks, low-poly trees, bushes and logs, and forests, grass clumps and scattered rocks that dress a surface.",
|
|
6
|
+
"tags": [
|
|
7
|
+
"built-in"
|
|
8
|
+
],
|
|
9
|
+
"links": [],
|
|
10
|
+
"created": "2026-10-28",
|
|
11
|
+
"name": "topotopo/nature"
|
|
12
|
+
}
|