Repository navigation
Object Reference
- ArcPolygon
- AnimatedBoundary
- Union
- Difference
- Intersection
- Exclusion
- ImageMobject
- ImageSequence
- Matrix
- DecimalMatrix
- IntegerMatrix
- BarChart
- SampleSpace
- Graph
- DiGraph
- PictureInPicture
- Point
- Line
- Arrow
- DoubleArrow
- DashedLine
- ArcBetweenPoints
- CurvedArrow
- CurvedDoubleArrow
- Angle
- RightAngle
- Triangle
- SurroundingRectangle
- BackgroundRectangle
- Brace
- Elbow
- Annulus
- AnnularSector
- RegularPolygram
- ConvexHull
- Polyhedron
- ConvexHull3D
- Icosahedron
- Dodecahedron
- RoundedRectangle
- ImplicitFunction
- ArrowVectorField
- StreamLines
- TracedPath
- Polyline
- Polygon
- RegularPolygon
- Star
- Rectangle
- Square
- Circle
- Ellipse
- Arc
- Sector
- Bezier
- FunctionGraph
- PolarGraph
- ParametricCurve
- PointOnCurve
- Tangent
- Group
- Text
- MathTex
- DecimalNumber
- Sphere
- Cube
- Cuboid
- Cone
- Cylinder
- Torus
- Surface
All 71 supported object types are listed below. Fields marked required must be supplied in addition to id and type. Optional fields may be omitted; the engine applies its per-type defaults. Constraints shown here come from the structural schema; compilation also checks dimensions, geometry and references.
Each example is a single object to append to a space’s objects array. Most examples use plane2d; spatial solids explicitly use space3d. These choices demonstrate valid usage rather than an exhaustive compatibility matrix.
For examples with references, start with this document and append one example at a time. Use space3d instead of plane2d and omit the helper objects for the solid examples. Image examples need actual files at their source URLs when rendered in a browser.
{
"version": 1,
"duration": 5,
"spaces": [
{
"name": "s",
"type": "plane2d",
"objects": [
{
"id": "l",
"type": "Line",
"from": [
0,
0
],
"to": [
2,
1
]
},
{
"id": "first",
"type": "Square",
"size": 2
},
{
"id": "second",
"type": "Square",
"size": 2,
"position": [
1,
0
]
},
{
"id": "source",
"type": "Point",
"at": [
"t",
"sin(t)"
]
}
]
}
]
}Join successive vertices with signed circular arcs. Supply one angle per edge; zero produces a straight edge.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
points |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items); 3–128 items |
angles |
No | array of (number or string; length ≥ 1; length ≤ 2000); 3–128 items |
{
"id": "object",
"type": "ArcPolygon",
"points": [
[
0,
0
],
[
1,
0
],
[
0,
1
]
],
"angles": [
0,
0.5,
0
]
}Draw a repeating stroke window over a referenced continuous path. Colors cycle over time; set document duration for playback.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
target |
Yes | string; qualified object reference |
period |
No | number; > 0 |
colors |
No | array of (string; six-digit hex color); 1–32 items |
timeWidth |
No | number; ≤ 1; > 0 |
{
"id": "object",
"type": "AnimatedBoundary",
"target": "s.l"
}Combine closed planar operands, preserving disconnected components and holes.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
operands |
Yes | array of (string; qualified object reference); 2–32 items |
{
"id": "object",
"type": "Union",
"operands": [
"s.first",
"s.second"
]
}Subtract subsequent operands from the first closed planar operand.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
operands |
Yes | array of (string; qualified object reference); 2–32 items |
{
"id": "object",
"type": "Difference",
"operands": [
"s.first",
"s.second"
]
}Keep the area common to the closed planar operands. An empty result is valid.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
operands |
Yes | array of (string; qualified object reference); 2–32 items |
{
"id": "object",
"type": "Intersection",
"operands": [
"s.first",
"s.second"
]
}Keep regions covered by an odd number of closed planar operands (symmetric difference).
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
operands |
Yes | array of (string; qualified object reference); 2–32 items |
{
"id": "object",
"type": "Exclusion",
"operands": [
"s.first",
"s.second"
]
}Place a raster image in plane2d. source is a browser-resolved URL; supply a real image asset when rendering.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
source |
Yes | string; length ≥ 1; length ≤ 2000000; supported raster URL |
width |
No | number or string; length ≥ 1; length ≤ 2000 |
height |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "ImageMobject",
"source": "./test.png"
}Select raster frames from document time using fps, start and loop. Browser playback requires all referenced image assets.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
sources |
Yes | array of (string; length ≥ 1; length ≤ 2000000; supported raster URL); 1–128 items |
fps |
No | number; > 0 |
start |
No | number; ≥ 0 |
loop |
No | boolean |
width |
No | number or string; length ≥ 1; length ≤ 2000 |
height |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "ImageSequence",
"sources": [
"./a.png",
"./b.png"
]
}Lay out entries as KaTeX labels between brackets in plane2d. Entries are a rectangular matrix.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
entries |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–32 items); 1–32 items |
cellWidth |
No | number; > 0 |
cellHeight |
No | number; > 0 |
decimals |
No | integer; ≥ 0; ≤ 12 |
{
"id": "object",
"type": "Matrix",
"entries": [
[
"x",
"y"
]
]
}Lay out numeric/expression entries with a configurable decimal count in plane2d.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
entries |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–32 items); 1–32 items |
cellWidth |
No | number; > 0 |
cellHeight |
No | number; > 0 |
decimals |
No | integer; ≥ 0; ≤ 12 |
{
"id": "object",
"type": "DecimalMatrix",
"entries": [
[
1,
2
]
]
}Lay out numeric/expression entries rounded for display with zero decimal places.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
entries |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–32 items); 1–32 items |
cellWidth |
No | number; > 0 |
cellHeight |
No | number; > 0 |
decimals |
No | integer; ≥ 0; ≤ 12 |
{
"id": "object",
"type": "IntegerMatrix",
"entries": [
[
1,
2
]
]
}Create signed bars with optional labels in plane2d. Axes are authored separately.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
values |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–256 items |
labels |
No | array of (string); 1–256 items |
barWidth |
No | number; > 0 |
gap |
No | number; ≥ 0 |
{
"id": "object",
"type": "BarChart",
"values": [
1,
2
]
}Divide a rectangle horizontally into probability regions. Positive probabilities must sum to one; labels are optional.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
probabilities |
Yes | array of (number; > 0); 1–128 items |
labels |
No | array of (string); 1–128 items |
width |
No | number; > 0 |
height |
No | number; > 0 |
{
"id": "object",
"type": "SampleSpace",
"probabilities": [
0.5,
0.5
]
}Create an undirected graph using circle, line or explicit vertex positions in plane2d.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
vertices |
Yes | array of (string ; identifier); 1–128 items |
edges |
Yes | array of (array of (string ; identifier); exactly 2 items); 0–2048 items |
layout |
No | "circle" or "line" |
radius |
No | number; > 0 |
positions |
No | map to (array of (number); exactly 2 items) |
labels |
No | boolean |
{
"id": "object",
"type": "Graph",
"vertices": [
"a",
"b"
],
"edges": [
[
"a",
"b"
]
]
}Create a directed graph with arrowed edges using circle, line or explicit positions in plane2d.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
vertices |
Yes | array of (string ; identifier); 1–128 items |
edges |
Yes | array of (array of (string ; identifier); exactly 2 items); 0–2048 items |
layout |
No | "circle" or "line" |
radius |
No | number; > 0 |
positions |
No | map to (array of (number); exactly 2 items) |
labels |
No | boolean |
{
"id": "object",
"type": "DiGraph",
"vertices": [
"a",
"b"
],
"edges": [
[
"a",
"b"
]
]
}Display another space in a CSS-pixel rectangle relative to the player’s top-left. A self-space inset does not recursively create more insets.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
space |
Yes | string ; identifier |
x |
Yes | number |
y |
Yes | number |
width |
Yes | number; > 0 |
height |
Yes | number; > 0 |
{
"id": "object",
"type": "PictureInPicture",
"space": "s",
"x": 0,
"y": 0,
"width": 200,
"height": 100
}Place a point at native coordinates; optionally bind a coordinate to a draggable parameter.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
at |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
drag |
No | object: parameter: string ; identifier; coordinate?: integer; ≥ 0; ≤ 2; min?: number; max?: number |
{
"id": "object",
"type": "Point",
"at": [
0,
0
]
}Draw a straight segment between native endpoints.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
from |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
to |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
{
"id": "object",
"type": "Line",
"from": [
0,
0
],
"to": [
1,
1
]
}Draw a segment with an arrowhead at its end.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
from |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
to |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
{
"id": "object",
"type": "Arrow",
"from": [
0,
0
],
"to": [
1,
1
]
}Draw a segment with arrowheads at both endpoints.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
from |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
to |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
{
"id": "object",
"type": "DoubleArrow",
"from": [
0,
0
],
"to": [
1,
1
]
}Draw a segment using world-space dash lengths. dashRatio sets the drawn fraction of each dash period.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
from |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
to |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
dashLength |
No | number or string; length ≥ 1; length ≤ 2000 |
dashRatio |
No | number; > 0 |
{
"id": "object",
"type": "DashedLine",
"from": [
0,
0
],
"to": [
1,
1
]
}Connect endpoints with a circular arc using a signed sweep angle.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
from |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
to |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
angle |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "ArcBetweenPoints",
"from": [
0,
0
],
"to": [
1,
1
]
}Draw an endpoint-defined circular arc with an end arrowhead.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
from |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
to |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
angle |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "CurvedArrow",
"from": [
0,
0
],
"to": [
1,
1
]
}Draw an endpoint-defined circular arc with arrowheads at both ends.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
from |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
to |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
angle |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "CurvedDoubleArrow",
"from": [
0,
0
],
"to": [
1,
1
]
}Mark the angle between rays from vertex toward from and to. otherAngle selects the alternative angle.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
from |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
vertex |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
to |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
otherAngle |
No | boolean |
{
"id": "object",
"type": "Angle",
"from": [
1,
0
],
"vertex": [
0,
0
],
"to": [
0,
1
]
}Mark perpendicular rays with a square corner. Nonperpendicular or degenerate rays are rejected.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
from |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
vertex |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
to |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
size |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "RightAngle",
"from": [
1,
0
],
"vertex": [
0,
0
],
"to": [
0,
1
]
}Create an equilateral triangle using its circumradius.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Triangle"
}Follow a referenced 2D point/path’s bounds with padding. Measured text and group bounds are unsupported.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
target |
Yes | string; qualified object reference |
padding |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "SurroundingRectangle",
"target": "s.l"
}Follow a referenced 2D point/path’s bounds with a filled rectangle. Declare it before the foreground object.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
target |
Yes | string; qualified object reference |
padding |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "BackgroundRectangle",
"target": "s.l"
}Place a brace on a side of referenced 2D point/path bounds. depth controls its extension.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
target |
Yes | string; qualified object reference |
side |
No | "left" or "right" or "top" or "bottom" |
padding |
No | number or string; length ≥ 1; length ≤ 2000 |
depth |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Brace",
"target": "s.l"
}Draw an L-shaped corner with a width and angle.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
width |
No | number or string; length ≥ 1; length ≤ 2000 |
angle |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Elbow"
}Create a ring with a preserved hole. Radii must satisfy 0 < innerRadius < radius.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
innerRadius |
No | number or string; length ≥ 1; length ≤ 2000 |
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Annulus"
}Create part of a ring. Radii must satisfy 0 < innerRadius < radius; use a nonzero sweep of at most one turn.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
innerRadius |
No | number or string; length ≥ 1; length ≤ 2000 |
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
startAngle |
No | number or string; length ≥ 1; length ≤ 2000 |
angle |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "AnnularSector"
}Connect regularly spaced vertices using step. This is stroke-only geometry; disconnected cycles cannot be morphed as one continuous path.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
sides |
Yes | integer; ≥ 3; ≤ 512 |
step |
Yes | integer; ≥ 1; ≤ 511 |
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "RegularPolygram",
"sides": 5,
"step": 2
}Compute a planar convex hull, discarding interior and duplicate points.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
points |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items); 3–2048 items |
{
"id": "object",
"type": "ConvexHull",
"points": [
[
0,
0
],
[
2,
0
],
[
0,
2
],
[
0.2,
0.2
]
]
}Build a closed spatial shell from vertices and indexed planar convex faces. Invalid, open or degenerate shells are rejected.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
points |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items); 4–2048 items |
faces |
Yes | array of (array of (integer; ≥ 0); 3–128 items); 4–4096 items |
{
"id": "object",
"type": "Polyhedron",
"points": [
[
0,
0,
0
],
[
1,
0,
0
],
[
0,
1,
0
],
[
0,
0,
1
]
],
"faces": [
[
0,
1,
2
],
[
0,
1,
3
],
[
0,
2,
3
],
[
1,
2,
3
]
]
}Compute a spatial convex hull from noncoplanar points; coplanar faces are merged.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
points |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items); 4–64 items |
{
"id": "object",
"type": "ConvexHull3D",
"points": [
[
0,
0,
0
],
[
1,
0,
0
],
[
0,
1,
0
],
[
0,
0,
1
]
]
}Create the regular 20-face solid using its circumradius.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Icosahedron"
}Create the regular 12-face solid using its circumradius.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Dodecahedron"
}Create a rectangle with rounded corners; corner size must fit its dimensions.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
width |
No | number or string; length ≥ 1; length ≤ 2000 |
height |
No | number or string; length ≥ 1; length ≤ 2000 |
cornerRadius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "RoundedRectangle"
}Sample the zero contour of expression over explicit x/y ranges using marching squares. Disconnected contours remain separate.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
expression |
Yes | string |
xRange |
Yes | array of (number); exactly 2 items |
yRange |
Yes | array of (number); exactly 2 items |
resolution |
No | integer; ≥ 4; ≤ 256 |
{
"id": "object",
"type": "ImplicitFunction",
"expression": "x^2+y^2-1",
"xRange": [
-2,
2
],
"yRange": [
-2,
2
]
}Sampling uses Cartesian coordinates, including in polar spaces. Defaults: spacing 1, lengthScale 0.6, maxLength 0.8 × spacing. Without zRange, 3D sampling lies on z=0. At most 4096 arrows are generated; zero/non-finite vectors are skipped.
Sample a Cartesian vector field on a bounded grid. In space3d use three expressions and zRange for a volume; lengthScale and maxLength control arrows.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
expressions |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
xRange |
Yes | array of (number); exactly 2 items |
yRange |
Yes | array of (number); exactly 2 items |
zRange |
No | array of (number); exactly 2 items |
spacing |
No | number; > 0 |
lengthScale |
No | number or string; length ≥ 1; length ≤ 2000 |
maxLength |
No | number; > 0 |
{
"id": "object",
"type": "ArrowVectorField",
"expressions": [
"-y",
"x"
],
"xRange": [
-1,
1
],
"yRange": [
-1,
1
]
}The field is frozen at the current scene time and integrated with fourth-order Runge–Kutta. Defaults are step 0.04 and 256 steps, with at most 100000 total integration steps. Integration stops at stationary or non-finite results.
Integrate a Cartesian vector field from each seed using bounded numerical steps. Separate streams remain separate strokes.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
expressions |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
seeds |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items); 1–256 items |
step |
No | number; > 0 |
steps |
No | integer; ≥ 1; ≤ 2048 |
{
"id": "object",
"type": "StreamLines",
"expressions": [
"-y",
"x"
],
"seeds": [
[
1,
0
]
]
}Current parameter overrides apply to every historical sample; this does not record mouse-gesture history. Destination object/group/space transforms apply after trace generation.
Sample a referenced point’s historical positions deterministically. start establishes its initial time; duration optionally limits the trailing history window.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
point |
Yes | string; qualified object reference |
start |
No | number; ≥ 0 |
duration |
No | number; > 0 |
samples |
No | integer; ≥ 8; ≤ 2048 |
{
"id": "object",
"type": "TracedPath",
"point": "s.source"
}Join vertices with open line segments.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
points |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items); 2–10000 items |
{
"id": "object",
"type": "Polyline",
"points": [
[
0,
0
],
[
1,
1
]
]
}Join vertices into a closed polygon.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
points |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items); 3–10000 items |
{
"id": "object",
"type": "Polygon",
"points": [
[
0,
0
],
[
1,
0
],
[
0,
1
]
]
}Create a regular polygon from side count and circumradius.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
sides |
Yes | integer; ≥ 3; ≤ 512 |
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "RegularPolygon",
"sides": 5
}Alternate outer and inner radii around the specified number of tips.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
tips |
Yes | integer; ≥ 2; ≤ 256 |
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
innerRadius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Star",
"tips": 5
}Create a centered rectangle with width and height.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
width |
No | number or string; length ≥ 1; length ≤ 2000 |
height |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Rectangle"
}Create a centered square with side length size.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
size |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Square"
}Create a sampled circle with radius.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Circle"
}Create a sampled ellipse with independent x/y radii.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
radiusX |
No | number or string; length ≥ 1; length ≤ 2000 |
radiusY |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Ellipse"
}Create an open circular arc using startAngle and signed angle.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
startAngle |
No | number or string; length ≥ 1; length ≤ 2000 |
angle |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Arc"
}Create a filled-capable circular sector bounded by an arc and radial edges.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
startAngle |
No | number or string; length ≥ 1; length ≤ 2000 |
angle |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Sector"
}Create chained cubic Bezier segments. Use 3n+1 control points for n segments.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
points |
Yes | array of (array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items); 4–10000 items |
{
"id": "object",
"type": "Bezier",
"points": [
[
0,
0
],
[
0,
1
],
[
1,
1
],
[
1,
0
]
]
}Plot Cartesian y = expression(x). Optional domain limits the graph; Canvas can adapt sampling to the current viewport.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
expression |
Yes | string |
domain |
No | array of (number); exactly 2 items |
samples |
No | integer; ≥ 8; ≤ 2048 |
{
"id": "object",
"type": "FunctionGraph",
"expression": "sin(x)",
"domain": [
-1,
1
]
}Plot radius = expression(theta). Domain is an angular interval in radians.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
expression |
Yes | string |
domain |
No | array of (number); exactly 2 items |
samples |
No | integer; ≥ 8; ≤ 2048 |
{
"id": "object",
"type": "PolarGraph",
"expression": "cos(theta)",
"domain": [
0,
6
]
}Evaluate coordinate expressions in u over a domain. Expression count follows the containing space’s native dimension.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
expressions |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); 1–3 items |
domain |
No | array of (number); exactly 2 items |
samples |
No | integer; ≥ 8; ≤ 2048 |
{
"id": "object",
"type": "ParametricCurve",
"expressions": [
"u",
"u^2"
],
"domain": [
0,
1
]
}Place a point at normalized sampled arc length on a continuous curve. Optionally bind that parameter for dragging.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
curve |
Yes | string; qualified object reference |
parameter |
Yes | number or string; length ≥ 1; length ≤ 2000 |
drag |
No | object: parameter: string ; identifier; coordinate?: integer; ≥ 0; ≤ 2; min?: number; max?: number |
{
"id": "object",
"type": "PointOnCurve",
"curve": "s.l",
"parameter": 0.5
}Estimate a tangent to a continuous curve at normalized sampled arc length.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
curve |
Yes | string; qualified object reference |
parameter |
Yes | number or string; length ≥ 1; length ≤ 2000 |
length |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Tangent",
"curve": "s.l",
"parameter": 0.5
}Group qualified child IDs for inherited transforms/style behavior. Each child has at most one parent; cycles are invalid.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
children |
Yes | array of (string; qualified object reference); 1–10000 items |
{
"id": "object",
"type": "Group",
"children": [
"s.l"
]
}Render plain text at position. Text is not interpreted as HTML.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
text |
Yes | string; length ≤ 10000 |
{
"id": "object",
"type": "Text",
"text": "hello"
}Render a KaTeX expression at position. Escape backslashes in JSON, for example "\frac{1}{2}".
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
text |
Yes | string; length ≤ 10000 |
{
"id": "object",
"type": "MathTex",
"text": "x^2"
}Render a scalar expression as a decimal label with configurable precision.
Example space: plane2d.
| Field | Required | Type and structural constraints |
|---|---|---|
value |
Yes | number or string; length ≥ 1; length ≤ 2000 |
decimals |
No | integer; ≥ 0; ≤ 12 |
{
"id": "object",
"type": "DecimalNumber",
"value": 1
}Create a sphere with radius.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Sphere"
}Create a cube with side length size.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
size |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Cube"
}Create a box with width, height and depth.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
width |
No | number or string; length ≥ 1; length ≤ 2000 |
height |
No | number or string; length ≥ 1; length ≤ 2000 |
depth |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Cuboid"
}Create a cone centered on the z axis using radius and height.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
height |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Cone"
}Create a cylinder centered on the z axis using radius and height.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
height |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Cylinder"
}Create a torus around the z axis using major radius and tubeRadius.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
radius |
No | number or string; length ≥ 1; length ≤ 2000 |
tubeRadius |
No | number or string; length ≥ 1; length ≤ 2000 |
{
"id": "object",
"type": "Torus"
}Sample three coordinate expressions in u and v to create a triangulated surface. resolution specifies the two grid dimensions.
Example space: space3d.
| Field | Required | Type and structural constraints |
|---|---|---|
expressions |
Yes | array of (number or string; length ≥ 1; length ≤ 2000); exactly 3 items |
uRange |
Yes | array of (number); exactly 2 items |
vRange |
Yes | array of (number); exactly 2 items |
resolution |
No | array of (integer; ≥ 2; ≤ 128); exactly 2 items |
{
"id": "object",
"type": "Surface",
"expressions": [
"u",
"v",
"u*v"
],
"uRange": [
-1,
1
],
"vRange": [
-1,
1
]
}- Installation and development
- Browser quick start
- Scene documents
- Objects and expressions
- Document field reference
- Complete object reference
- Animation
- All animations and events
- Interaction and multiple views
- Browser player API
- Headless evaluation and validation
- Integration and lifecycle
- Features and limitations
- Publishing Webnim
- Troubleshooting
- Reference files