The Viewer

Moving Around

You can rotate around the object by clicking and dragging.

You can pan around by holding down shift and then clicking and dragging, or drag the object around with two fingers if you're on mobile.

You can zoom in using your mouse's scroll wheel, two fingers on a trackpad, or by pinching and expanding on mobile.

Centering and Downloading

You can use the button to center the screen.

You can use the button to download a png screenshot of your object.

The Editor

The editor allows you to write and modify formulas for objects in real-time.

Correctness

The indicator shows you the status of the editor. When it's red, it means that something about what you've typed in doesn't make sense to the parser. When it's green, it means that the parser has understood the changes you've made.

The Language

Please note that a valid program consists of any-or-no settings, followed by a range declaration, followed by one or more axis declarations (of which only x, y, and z are allowed).

The language used in the editor has the following features:

# resolution 50

A setting. The available settings are:

/* .... */

A comment.

{ u | 0 <= u <= PI }

{ u, v | 0<=u<=PI, 0<=v<=1 }

A range declaration. The identifiers declared before the "|" symbol must match the identifiers referenced afterwards. The range is split into "steps" using the #resolution setting. When two ranges are declared, the "steps" of the first range are nested in the steps of the second range, and lines are drawn accordingly.

x = 1

An axis declaration. You can declare x, y, and z axes. These do not function like normal variable assignments.

cos(...), sin(...), atan(...)

Functions. Only these are supported at the moment.

+ - / * () ^

Arithmetic operators. These follow correct order of operations.

PI, π

Pi calculated using JS Math.Pi.

<=, >=, <, >

Comparison operators.

0, 255, 1000

Whole numbers.

0.5, 20.8, 92.0007

Decimals.

-255, -1000

Negative numbers.

-0.5, -20.8, -92.0007

Negative decimals.

Contact

Feel free to contact me if you have any questions.

nikokozak at gmail dot com