nodra
Back to home
Cheatsheet for versionv0.5.0
COMMAND LINE / REFERENCECHEATSHEET

CLI cheatsheet.

01VALIDATE

nodra validate

A structural and evaluation check for CI or a quick sanity check before a real eval. Exits 0 only if all of these are true:

  • The graph parses.
  • There are no duplicate node Ids.
  • The graph has a GeometryOutputNode.
  • Every edge points to existing nodes and valid ports.
  • The port types on both ends of every edge match.
  • Evaluate() does not throw.

Writes no files. Several GeometryOutputNodes only produce a warning, since just the first is used.

USAGE
nodra validate [<graph.ndr>|-] [--json]
EXAMPLE
$ nodra validate graph.ndr
OPTIONS
[<graph.ndr>|-]Graph file. Omit it or pass - to read the graph from standard input.
--jsonPrint the result as JSON: ok, nodes, edges, errors and warnings. Without it, warnings and errors are printed as [warn] and [error] lines, followed by OK and the node and edge counts.
02EVAL

nodra eval

Evaluates the graph and prints the number of points and primitives and the bounds of the result. With --out it also exports the mesh as OBJ, or as STL when the file name ends in .stl. Fails with exit code 1 if the graph evaluates to no geometry.

USAGE
nodra eval [<graph.ndr>|-] [--out <mesh.obj|mesh.stl>] [--scale S] [--y-up] [--json] [--geometry]
EXAMPLE
$ nodra eval graph.ndr --out mesh.obj
OPTIONS
[<graph.ndr>|-]Graph file. Omit it or pass - to read the graph from standard input.
--out <file>Export the mesh to this file. A .stl extension writes STL (faces only, fails if the geometry has none); anything else writes OBJ.
--scale SSTL only: multiplies the exported size by S, which must be a positive number. Default 1. Slicers read the units as mm.
--y-upSTL only: keep Nodra's Y-up orientation. By default the STL is rotated to Z up, as slicers expect.
--jsonPrint the result as JSON: ok, points, primitives, bounds, outFile and, for STL, scale, zUp and size. Failures are reported as { ok: false, error }.
--geometryWith --json, also include the full geometry: points, normals, uvs and primitives. Can be large; use --out for big meshes.
03RENDER

nodra render

Renders a quick PNG preview of the graph result, no visual editor required.

USAGE
nodra render <graph.ndr> --out <preview.png>
EXAMPLE
$ nodra render graph.ndr --out preview.png
OPTIONS
--out <file>Output PNG file.
[render options]Camera, size and color settings, see Render options below.
04BATCH

nodra batch

Evaluates many graphs in one run, one at a time, writing each one's outputs as soon as it is done. How it behaves:

  • A failing graph is reported and skipped (unless --fail-fast).
  • The exit code is 1 if any graph failed.
  • Outputs are named after the graph file; for a folder input, by its path inside the folder, mirrored under --out-dir.
  • Without --mesh, --render or --maps nothing is written and graphs are only evaluated.
USAGE
nodra batch <graph|folder>... [--list <paths.txt>|-] [--recursive] [--pattern GLOB] [--out-dir <folder>] [--mesh obj|gltf] [--render] [--maps] [--fail-fast] [--json] [render options]
EXAMPLE
$ nodra batch graphs/ --recursive --out-dir out --mesh gltf
OPTIONS
<graph|folder>...One or more graph files or folders. A path that does not exist is reported as a failed graph.
--list <paths.txt>|-Read graph paths from a text file, one per line (empty lines and lines starting with # are ignored), or from standard input with -.
--recursiveAlso look inside subfolders of the given folders.
--pattern GLOBWhich files to pick from the given folders. Default: *.ndr.
--out-dir <folder>Folder for all outputs. Required with --mesh, --render or --maps. Files with the same name from different folders get a _2, _3 suffix.
--mesh obj|gltfWrite each graph's mesh as <name>.obj or <name>.gltf into --out-dir.
--renderWrite a <name>.png preview for each graph into --out-dir, using the render options.
--mapsAlso export the graph's terrain maps into --out-dir, as <name>_... files. A graph without geometry still passes if it wrote maps.
--fail-fastStop after the first failing graph; the rest are skipped.
--jsonPrint one JSON report instead of per-graph lines: ok, total, failed, skipped and, for each graph, file, ok, error, warnings, points, primitives, milliseconds and outputs.
05BENCH

nodra bench

Measures one cold Evaluate() against N warm re-Evaluate()s on the same (hash-unchanged) Graph instance - the gap is what Graph's calculation-memory cache is actually buying. Prints the cold time and the min, average and max of the warm runs.

USAGE
nodra bench <graph.ndr> [--iterations N]
EXAMPLE
$ nodra bench graph.ndr --iterations 20
OPTIONS
<graph.ndr>The graph to measure. Required, and must be the first argument.
--iterations NNumber of warm re-evaluations to run. Default 20; with 0 only the cold time is printed.
06EXPORT MAPS

nodra export-maps

Writes a graph's terrain outputs (HeightfieldOutputNode / SplatmapOutputNode) at full resolution. Prints one line per written file. Fails with exit code 1 if the graph has no wired, enabled HeightfieldOutput or SplatmapOutput node.

USAGE
nodra export-maps [<graph.ndr>|-] --out-dir <folder> [--prefix P] [--tiles CxR] [--overlap N] [--json]
EXAMPLE
$ nodra export-maps terrain.ndr --out-dir maps --tiles 2x2
OPTIONS
[<graph.ndr>|-]Graph file. Omit it or pass - to read the graph from standard input.
--out-dir <folder>Required. Folder for the written maps; it is created if missing.
--prefix PPrefix added to every output file name. Empty by default.
--tiles CxRExport in tiles: C columns by R rows (e.g. 4x4). Each tile's file name gets a _x{column}_z{row} suffix.
--overlap NOverlap between neighbouring tiles, in cells. Default 32, must be 0 or more. Used together with --tiles.
--jsonPrint the result as JSON: { ok, files: [{ path, description }] } on success, or { ok: false, error } on failure.
07LIST NODES

nodra list-nodes

Lists every node type that a graph file can contain, plus the fields each type has. The list is read from the node definitions themselves, so it always matches what graph files actually accept.

USAGE
nodra list-nodes [--json]
EXAMPLE
$ nodra list-nodes --json
OPTIONS
--jsonMachine-readable output.
RENDER OPTIONSSHARED BY RENDERING COMMANDS
--size WxH | --width W --height HImage size as WxH (e.g. 1920x1080), or set --width and --height separately. Each side is 1 to 16384 pixels. Default: 640x480.
--yaw DEGCamera rotation around the vertical axis, in degrees.
--pitch DEGCamera tilt up or down, in degrees.
--distance DDistance from the camera to the model. Must be a positive number.
--background COLORBackground color: #RRGGBB, #RGB, or r,g,b with every component from 0 to 1.
--color COLORModel color, in the same formats as --background.
TYPICAL WORKFLOWVALIDATE → EVAL → RENDER
NODRA CLI  /  GRAPH.NDR
# Validate the graph
$ nodra validate graph.ndr

# Evaluate and export the mesh
$ nodra eval graph.ndr --out mesh.obj

# Render a PNG preview
$ nodra render graph.ndr --out preview.png