Robocompass - A Robotic Geometry Box On 3D
Robocompass - A Robotic Geometry Box On 3D
Supported Commands
RoboCompass has 10 drawing commands and 12 helper commands. Drawing commands can be assigned labels and
referenced in other commands.
In effect, these commands can be combined in creative ways to produce all sorts of Geometrical constructions.
Drawing commands
https://www.robocompass.com/app 1/3
3/9/25, 12:08 PM Robocompass | A Robotic Geometry Box on 3D
Example:- pointtype('cross') Changes the point style from 'sphere' to 'cross'. Any
pointtype('cross') point command after this pointtype command will render a cross, if we want to go
back to 'sphere' just put another pointtype() command without any values
Example:- dash(3,4,7,8,0.5,0.6) Draws a dashed line, the 5th argument controls
the dash length and 0.6 (the last value) controls the gap. Using these 2 values we
dash(x1, y1, x2, y2, dashLength, can draw dotted lines as well. Like other robocompass commands, instead of
dashGapLength) giving 4 values directly, we can either give a 2 points or any expression that
resolves to 4 coordinates similar to dash(A, C, 1.2, 0.5) where A, C are point
labels
Example:- stroke(a,D,E, 3) Changes the thickness of the shapes refered by the
stroke(labels of shape, thickness)
labels. The thickness must be greater than 0 and there is no upper limit
Example:- reverse(a) Reverses the coordinates of the shape. This will be useful in
building complex tessellations. Generally used inside polygon(reverse(L), 3,7,8,1)
reverse(labels of shape)
, The L here could be a part or a line or any shape. You can also give more than
one shape as argument
Example:- plot("sin(x)") or A=plot("tan(x)",2,10) where A is the label. The min
and max values after expression are optional By default the plot covers the entire
graphsheet area. As in other functions, variables can be defined elsewhere and
plot("expression") refereed inside the expression. All geometric transformations like
rotate,translate,dilate and clipping operations (and, or) can be performed on the
resultant plot. Implicit equations such as "x^2+y^2=r^2 are not supported.
However you can give equations such as "y=2*x" or "x=2y".
Example:- para("2*sin(t)","3*cos*(t)") or A=para("2*sin(t)","3*cos*
(t)",0,6.29,0.1) where A is the label. The expressions must have "t" as parameter.
para("expression1","expression2") The min and max and step values after expressions are optional. pos command
can be used to get a point at a particular point in graph like pos(p,0.2) where p is
p=plot("some exp") or p=para("some exp")
Whenever a point is expected in an expression, use either point(2, 3), its label or a
helper command which calculates and returns a point. Similarly wherever a line is
expected give the label of a line or the label of two points.
General rule
For example arc(A, B, point(2, 1), 50, 40) uses the distance from A to B and
draws the arc from point(2, 1).
Note:- instead of point(2, 1) use 'C' if there is a point labeled C.
dist(point1, point2) Calculates the distance between two points. Give a dist(C)if C is a line (i.e. segment)
X(point) Gives the X coordinate of a point A. A= X(point(2,1))
Y(point) Gives the Y coordinate of a point A. B= Y(point(1,2))
Returns the point at a given index. If a polygon A has 4 points, pos(A, 3) returns the
pos(polygon or line or arc,
third point, Similarly if a line's label is B a index of 2 returns the end point. Example:-
index)
pos(B, 2)
Intersects any two objects (except points).Example G=point(intersect(D, E)) By default
intersect(object1, object2,
returns the first intersecting point, for second and third intersecting point, give 2 or 3
index=1)
respectively. For example this intersect(D, E, 2) gives the second intersecting point.
Reflects the object by a given line. Example:- reflect(D, A) where D is the label of
reflect(object, line)
point to reflect and A is the reflecting line
rotate(object, angle, Rotates the object by a given degree. By default, the rotation is with respect to origin
withrespectTo=point(0, 0)) (0, 0), which can be optionally overridden by giving the parameter withrespectPoint.
https://www.robocompass.com/app 2/3
3/9/25, 12:08 PM Robocompass | A Robotic Geometry Box on 3D
translate(object, x, y, Translates the object by given x, y with respect to origin or by given withRespectTo
withrespectTo=point(0, 0)) parameter. translate(arc(2, 3, 3, 0, 180), 2, 3, point(2, 1)) or translate(G, 2, 4)
dilate(object, scaleFactor,
Dilates the object by a given scaleFactor parameter.dilate(point(3, 1), 2)
withRespectTo=point(0, 0))
Projects the input point on the line and returns the projected point. Example:-project(A,
project(point1, line)
line(0, 0, 1, 0)) projects the point A on the given line.
interpolate(point1, point2,
Example:- interpolate(A, B, 0.5) A ratio of 0.5 returns the midpoint of A, B
ratio)
Example:- hide(A, B, C, D) hides objects A, B, C, D. To show again use show(A, B, C,
hide(comma separated labels)
D)
Transformations can be applied on multiple objects simultaneously by creating a
group(comma separated group. For example to rotate both a arc 'A' and a polygon 'B' together, use C=group(A,
objects) B) and then D=rotate(C, 120) where C is the label of the group. Groups can also be
nested.
A variety of shapes can be created by applying Boolean operations on simple shapes.
These shapes can be tessellated by transformation commands.
For example and(A, B, C) creates a polygonal region common (intersection) to A, B, C
Boolean operations - and, or, where A, B, C can be an arc or a polygon.
diff Similarly, or(A, E, polygon(0, 0, 2, 3, 4, 1)) and diff(A, B) create union and difference
of the given regions respectively. Regions with interior holes are not supported
(resulting from an xor operation), but the same result can be created by combining
multiple polygons using the group command.
text("String") text("String", x- Example: text("Hello World!")
coordinate, y-coordinate) Example: text("Hello World!", 3, 3)
Note:
All standard Math functions like sin, cos, tan, asin, acos, atan, log, sqrt, max, min are supported.
Trignometric functions uses degrees as unit.
https://www.robocompass.com/app 3/3