FluxGeo Syntax is the exact, editable language used by the ScriptBlock system and the desktop Input Bar. A ScriptBlock groups durable sliders, scalar expressions, user-defined scalar functions, generated loops, and generated-group styles into one source document.
Use the canonical brace form for all new work:
script Example {
T = Slider(0, 10, 0, 0.1)
Art = pointcloud for i in -20..20 {
P_i = (i, sin(i + T))
}
style Art {
pointSize = 2
visible = true
}
}
Braces define blocks; indentation is cosmetic. Zero indentation is valid, regular indentation is recommended, and tabs or spaces do not change meaning. Braces inside strings and comments do not define blocks. FluxGeo retains the exact submitted source formatting for editing, diagnostics, and save/load.
Running a ScriptBlock
Open Run Script... from the CLI panel, paste a complete script Name { ... } wrapper, and choose Run. Desktop compact mode runs on Enter; the expanded editor uses Enter for new lines and Ctrl+Enter to run.
Brace-scoped blocks
Script wrappers, generated loops, and style blocks use braces. A missing closing brace produces a structural diagnostic. Legacy script Name:, loop-colon, and inline style-colon forms remain compatibility syntax where the parser still accepts them; they are not the recommended form and all examples in this guide use braces.
Scalars and expressions
Scalar expressions support +, -, *, /, %, and ^, plus comparisons <, <=, >, >=, ==, and !=. Logical operators are !, &&, and ||. Boolean values are numeric: true is 1 and false is 0.
if(condition, whenTrue, whenFalse) is lazy: only the selected branch is evaluated. Likewise, && and || short-circuit. Trigonometric functions use radians. The evaluator provides isfinite, isnan, and isvalid checks.
SafeDivide(a, b) = if(b != 0, a / b, 0)
SafeDivide(4, 0)
SafeDivide(4, 0) returns 0 without evaluating 4 / 0.
Do not use and, or, not, ?:, or if ... then ... else; those are not v1.4-beta forms.
Natural math notation
The command line, expression fields, and plot dialogs accept everyday mathematical writing. The forms below are covered by the regression suite and the CLI reference. The examples are command-line and expression-field input. Inside ScriptBlocks, write * explicitly, as the examples above do.
Implicit multiplication
A number or a bracket next to a name, or a bracket next to a bracket, multiplies. A multi-letter word is split into a product only when one of its letters already names something, such as a Slider or the bound variable x.
You type
It means
2x+3
2*x+3
ax
a*x, when a is a Slider
2sin(x)
2*sin(x)
a(x+1)
a*(x+1)
(x+1)(x-1)
(x+1)*(x-1)
2ab+1
2*a*b+1, when a exists; the prompt asks for b
A multi-letter word whose letters name nothing is one new name: zz+1 offers one Slider called zz, not z*z. Spaces around operators and brackets are cleaned up. For vector expressions, the CLI reference still recommends explicit *, because compact forms such as tv are not guaranteed.
Powers and bare function names
You type
It means
cos^2(x)
(cos(x))^2
cos²x
(cos(x))^2
sin^2x+cos^2x
sin(x)^2 + cos(x)^2
cos ^ 2 ( x )
(cos(x))^2: spaces are cleaned up
cos x
cos(x): a bare function takes the next term
cos 2x
cos(2x)
cos x^2
cos(x^2)
sin x cos x
sin(x)*cos(x)
A bare function name needs a space or brackets: cosx and cos2x stay ordinary names.
cos^-1 x reads as a power, not an inverse. For inverse functions use asin, acos, and atan, or the aliases arcsin, arccos, and arctan.
Trigonometric functions use radians, so cos 30° is the cosine of 30 degrees.
Missing names and Sliders
An unknown name opens the Create Sliders prompt instead of creating a partial object. Accepting it creates the Sliders and retries the command, and one undo removes both.
m = sqrt(a) asks for a. A bare value line such as 3+4 or sqrt(a) is stored in a new, automatically named scalar.
A bare name that already exists, or a bare comparison, only reports; it creates nothing.
Built-in functions, objects, and commands are never offered as Sliders: m = cos + 1 and m = sqrt(A), where A is a point, are refused.
Booleans are never offered as numeric Slider inputs.
In a plot, a new Slider whose name differs from an existing Slider only in case is refused.
Equations, plots, and user functions
These user functions from the command line are separate from the ScriptBlock functions described below.
You type
It means
x^2+y^2=4
a bare equation plots as an implicit curve
Implicit(x^2+y^2=4)
the same curve, written as a command
e1 = x^2+y^2=9
names the curve e1
h = Plot(sin(x) - 3*x)
a named function plot
f(x) = sin(x) - 3*x
a user function, read in radians
Plot(f(x))
plots f
c = f(30°)
0.5: an angle passes in radians
A bare equation becomes an implicit plot only when its left side is not a label or a function signature. y = sin(x) and f(x) = x^2 keep their existing meaning, and Plot(...) draws an explicit curve.
A one-variable f(x) = … also creates a linked graph of f, shown as one Algebra row. Multi-parameter definitions such as g(x, y) = x^2 + y stay plain functions. A defined name is not silently redefined.
A user function can be called in numbers, points, and lists. A number passes as its value, and an angle passes in radians.
Booleans and checkboxes
You type
It means
b = true
a checkbox in the Algebra view
t = α > 90°
follows the angle α
c = b && t
combines two Booleans
k = 2*t
a Boolean reads as 1 or 0
SetConditionToShowObject(P, b)
shows P only while b is true
The canvas checkbox tool shows a Boolean on the drawing, where a press toggles it. A Boolean whose condition cannot be evaluated is undefined, not false.
Measures, roots, and mixed numbers
You type
It means
a = angle(A, B, C)
a live angle measure
r = radius(c)
the radius of a circle or arc
p = perimeter(s)
the perimeter of a shape
m = slope(l)
the slope of a line
d = distance(A, B)
the distance between two objects
e = dot(u, v)
the dot product of two vectors
w = mixed(5,3,7)
5 3/7, stored as 38/7
R = ∛(-8)
-2
Odd roots of negative numbers are real: ∛(-8), √[3](-8), and \sqrt[3]{-8} give -2. Even roots of negative numbers, and typed powers such as (-8)^(1/3), stay NaN. A mixed number needs whole-number parts with 0 ≤ n < d, and a minus sign goes in front: -mixed(5,3,7).
Matrices and expression fields
Each scalar matrix field accepts a literal, a direct Slider, or an expression. Missing names are created through one prompt, and the transformation is one undo step.
Expression fields show a 2D preview while you type fractions, roots, and powers. Keypad templates place the caret inside the new box.
The completion list is a helper. Ctrl+Space opens it, and it also opens by itself after two letters. Nothing is highlighted until Down or Up. Tab takes the highlighted row, or the top one. With nothing highlighted, Enter runs the line as typed. Esc keeps the list closed for the current word.
Sliders and animation
Both positional and named Slider forms are supported:
T = Slider(0, 120, 0, 0.05)
T = Slider(
min=0,
max=120,
value=0,
step=0.05,
speed=1,
direction=forward,
mode=bounce
)
direction is forward or backward. mode is stop, wrap, or bounce; the parser also accepts the verified compatibility aliases both, both-directions, and loop. Sliders expose inline Algebra play/pause and speed controls. Script-created Sliders start paused. A Slider at a stop mode ends at its boundary; wrap loops to the other boundary; bounce reverses direction.
Slider values and dependent numeric variables, points, and generated clouds update through their dependency bindings. Slider definitions and values persist through save/load.
Conditions and safe expressions
Use comparisons and short-circuit logic to keep generated samples finite. A where clause rejects a tuple before its point output is emitted. Put division guards in the condition or use lazy if for a bounded result.
User-defined scalar functions
Square(x) = x^2
Scale(x) = x * T
SafeDivide(a, b) = if(b != 0, a / b, 0)
User functions return scalar values only, require at least one parameter, and use exact argument counts. Parameters are local. Nested calls are supported, but define callees before callers; forward references, recursion, silent redefinition, zero-argument functions, and point-valued returns are rejected. Function names and calls are case-sensitive, while collisions with built-ins, constants, and booleans are rejected case-insensitively.
For dense animated clouds, calculate shared intermediate values as loop-local variables. Repeated nested function calls are readable, but results are not automatically memoized per sample.
Readable, but it repeats the work at every sample:
Ranges are inclusive integer ranges. One or two indices are supported, with optional integer step. If the start is greater than the end, the implicit step is -1; explicit descending steps must be negative.
Curve = for i in -20..20 step 2 {
yValue = i^2
P_i = (i, yValue)
}
SafeGrid = pointcloud for i in -5..5, j in -5..5 where j != 0 {
ratio = i / j
P_i_j = (i, ratio)
}
Loop-local scalar assignments and expression-point assignments are evaluated sequentially for each tuple. External sliders and scalars may be referenced. A loop-local assignment is parsed as one physical line; keep each local assignment on one line when the expression itself spans multiple tokens. The body can contain multiple statements separated by lines or semicolons.
where, step, and loop-local values
where belongs to the loop header and is evaluated from the loop indices plus external scalar/Slider and function bindings. It runs before the body-local scalar values are computed, so it cannot read ratio, height, or another name assigned inside the body. The filter is useful for safe index conditions such as j != 0; body-local safety belongs in if.
for versus pointcloud for versus objects for
Art = for i in -20..20 {
P_i = (i, i^2)
}
Art = pointcloud for i in -20..20 {
P_i = (i, i^2)
}
Art = objects for i in -20..20 {
P_i = (i, i^2)
}
for: automatic representation. Expression-only point output resolves to a compact virtual point cloud; real-object statements resolve to a materialized generated group.
pointcloud for: one compact virtual cloud, no individual scene Points, efficient rendering, sample-aware hover/context information, and empty holes where where filters remove tuples. Virtual samples are not ordinary Point snapping targets and do not create individual DAG nodes.
objects for: one owner group with real generated child objects, ObjectIds, normal selection/snapping/references/dependencies, and child ownership retained by the group.
Verified aliases are cloud for pointcloud and materialized for objects. v1.4-beta has no Materialize command, no Explode command, and no virtual-sample snapping.
Styling generated outputs
style Art {
color = rgba(80, 160, 255, 0.75)
opacity = 0.75
pointSize = 2
visible = true
}
Static colors support rgb(r,g,b), rgba(r,g,b,a), #RRGGBB, and #RRGGBBAA. Supported generated-group properties are color, opacity, pointSize, and visible. There is no per-sample styling syntax; labels is intentionally rejected by the generated-group style applicator. Unsupported properties produce a diagnostic. Object Properties is the preferred interactive styling workflow; style blocks are convenient for self-contained scripts.
Scripts browser and editor
The Scripts section in the Algebra/Object Browser lists ScriptBlocks, status, revision, source preview, dependencies, and artifacts. Use Edit to open the editor. Editing happens in a transient draft, so typing never changes the last successful construction.
Apply, Revert, Undo, and Redo
Apply replaces a ScriptBlock atomically. Revert Draft discards unapplied edits. Closing a dirty editor asks for confirmation. If Apply fails, the previous successful construction remains intact. One Undo restores that previous successful script version; one Redo reapplies the new version.
Save/load behavior
Project save/load restores ScriptBlock source and its attached artifacts. Loading does not rerun the script and does not add an extra undo entry. Exact source formatting, including comments and whitespace, is retained for later editing.
Reserved names
The application rejects user scalar function names and parameters that collide with built-ins, constants, booleans, or the explicit core command-reserved set below. Built-in and reserved collisions are checked case-insensitively. The larger command-catalog and representation lists are included as authoritative names to avoid in scripts; they are syntax/dispatch tokens, not all hard-rejected by the scalar-function registry. A user function must also be defined before it is called and cannot be silently redefined.
arcsin, arccos, arctan normalize to their a... counterparts. The parser also recognizes asec, acsc, and acot as function identifiers; do not rely on those three as callable v1.4-beta evaluator functions.
Explicit function-reserved command tokens
slider, point, line, segment, circle, polygon, style, for, plot, delete
E(j) = ... is rejected because E matches the reserved constant e without regard to case. Prefer descriptive names such as Eta, RadiusTerm, AngleTerm, OutX, and OutY; avoid relying on one-letter function names.
Limits and current restrictions
Compact virtual point clouds are limited to 250,000 samples.
Materialized generated groups are limited to 10,000 children.
User scalar call depth is limited to 64 nested calls; recursion is rejected.
Script source is capped at 1 MiB by the analysis scanner.
Materialized membership cannot depend dynamically on a Slider or external scalar in where; choose a static membership condition or use a virtual cloud.
Point-cloud loops accept loop-local scalar and expression-point statements. Real-object statements require automatic or materialized representation.
Troubleshooting
Reserved name: if the diagnostic says function name E is reserved, rename it to Eta.
Unknown function: define called functions earlier in the same script; forward references are not resolved.
Unknown style target: this can be a cascading error when an earlier object or group failed to create.
Empty or malformed brace block: provide both the opening and closing braces and at least one body statement.
Multiline loop-local expression: keep the assignment on one physical line; the generated-body parser splits statements at newlines.
Point cloud versus real Points: use objects for when real child objects are needed.
Failed Apply: the previous successful construction is preserved; correct the diagnostic and Apply again.
Dense animation: compute shared intermediate values once as loop-local scalars to avoid repeated nested function evaluation.
A word read as one unknown name: a multi-letter word none of whose letters names anything becomes one new Slider. Write * between names, such as 2*a*b, or define the names first.
Complete examples
Beginner · virtual
Animated wave curve
Purpose: learn one Slider, one loop-local value, and a compact animated cloud.
Creates: one Slider and 201 mathematical samples in a virtual point cloud.
Copyable script
script AnimatedWave {
T = Slider(min=0, max=6.28318, value=0, step=0.05, speed=1, direction=forward, mode=wrap)
Wave = pointcloud for i in -100..100 {
xValue = i / 10
yValue = sin(xValue + T)
P_i = (xValue, yValue)
}
}
Expected result: press play on T; the wave moves through the cloud while the sample count stays fixed. Use Object Properties to adjust point size and color.
Try changing:step, the phase term, or the range. Troubleshooting: if the script is valid but nothing animates, use the Algebra play control; scripts start paused.
Intermediate · virtual
Safe reciprocal field
Purpose: combine two indices, a where filter, and lazy if.
Creates: a virtual 41×41 field with the zero-denominator row removed.
Copyable script
script SafeReciprocal {
Field = pointcloud for i in -20..20, j in -20..20 where j != 0 {
ratio = i / j
height = if(abs(ratio) < 10, ratio, 0)
P_i_j = (i / 4, height)
}
}
Expected result: the middle row is empty, while large reciprocal values are clipped safely to zero. Hover a sample to inspect its virtual index context.
Try changing: the abs(ratio) threshold or the coordinate scale. Troubleshooting: keep j != 0 in the header; body-local ratio is not available to where.
Intermediate · real objects
Real generated parabola points
Purpose: see the difference between a virtual cloud and real generated children.
Creates: one owning generated group with 21 real Point children.
Copyable script
script RealParabolaPoints {
RealPoints = objects for i in -10..10 {
P_i = (i, i^2 / 10)
}
}
Expected result: each child has a real ObjectId and participates in normal generated-object selection, snapping, references, and dependencies. The group remains the owner.
Try changing: the range or the divisor. Troubleshooting: use objects for; pointcloud for intentionally creates no ordinary scene Points.
Advanced · virtual
Optimized ParametricWarp
Purpose: animate a dense parametric field while sharing expensive intermediate values.
Creates: 81 × 361 = 29,241 mathematical samples in one compact cloud; no real Point children.
Expected result: animate with T and scale live with S. Rendering uses internal viewport culling/LOD. Object Properties remains available for presentation changes.
Performance note: the loop-local form avoids repeating nested function work and was measured faster in the project’s dense-cloud profiling; treat that as an optimization principle, not a universal benchmark.
Troubleshooting: if it exceeds the cloud limit after range changes, reduce one range or use a smaller sample grid.