0% found this document useful (0 votes)
24 views3 pages

Robocompass - A Robotic Geometry Box On 3D

RoboCompass is a tool that provides 10 drawing commands and 12 helper commands for creating geometrical constructions in 3D. It allows users to define points, lines, arcs, and various shapes, as well as perform transformations and calculations. The document includes examples for each command to illustrate their usage and functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

Robocompass - A Robotic Geometry Box On 3D

RoboCompass is a tool that provides 10 drawing commands and 12 helper commands for creating geometrical constructions in 3D. It allows users to define points, lines, arcs, and various shapes, as well as perform transformations and calculations. The document includes examples for each command to illustrate their usage and functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

3/9/25, 12:08 PM Robocompass | A Robotic Geometry Box on 3D

× Print

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

Command Purpose and Examples

point(x, y) Example:- point(3, 4) or A=point(3, 4) where A is the label.


Example:- line(0,0,-2,5) or C=line(A, B) where A, B are point labels.
line(x1, y1, x2, y2)
Length can be optionally given as line(A, B, 3) where 3 is length of segment.
Example:- arc(point(2, 2), 3, 40, 20)Uses point(2, 2) as origin, 3 as radius and
starts the arc from 40 degrees adding another 20 degree in an anticlockwise
arc(originPoint, radius, angleFrom,
direction. A negative value for "upto" parameter will move clockwise.
upto)
To copy a line, give the first parameter as line or two points as shown here
arc(point1, point2, originPoint, angleFrom, upto)
Example:- A=perp(line(1, 2, 3, 4), point(1, 2)) draws a perpendicular line to a
perp(line, passThroughPoint,
given line(1, 2, 3, 4) passing through point(1, 2). The last optional parameter of
length=10)
perp command is the length of the perpendicular line which defaults to 10
parallel(line, passThroughPoint,
Example:- parallel(line(1, 2, 3, 4), point(1, 2))
length=10)
Example:- angle(A, B, 45, 1) The two points A and B defines the base line.The
angle(point1, point2, degrees) ratio is an optional parameter which controls the position of the protractor. A
value of 0 places it at A, 1 at B and 0.5 in the middle.
polygon(comma separated points) Example:- polygon(A, B, C) draws a triangle where A, B, C are points
Example:- findangle(A, B) finds the angle between two lines A, B or a polygon
findangle(2 lines or a polygon) findangle(C) (C is the label of polygon, in this case the method returns the first
angle)
Fills the interior of shapes A,B.The shapes can be an arc, polygon or another fill.
fill(A, B) The command accepts any number of shapes. fill(A), fill(arc(0, 0, 3, 0, 360), D,
polygon(2, 3, 4, 6, 1, 0))
Traces the curve passing through the given points. trace(point(0, 0), point(1,
trace(comma separated points)
sin(30)), point(1, sin(60)), point(1, sin(120)), B)
Example:- part(a,D,E,2) or A=part(a,intersect(a,b,1), point(2,3)) where A is the
label of the shape to take part from. The shape 'a' in the example refers to a
polygon or line or arc. The 2 points given after the shape needs to be on the shape
(ie if it is arc, then the point must be on arc's perimeter, the same is true for
polygon, the points must be on one of the lines of the polygon. The part command
part(shape to extract from, 2 points extracts 2 shapes, so we can specify an optional partIndex (either 1 or 2) and the
on shape, optional part Index) point to get the desired part as shown here. part(a,intersect(a,b,1), point(2,3), 2)
The last value 2 extracts the second part. You can only give either 1 or 2 as part
index. The returned part which is stored in 'A' can then be used to build further
complex shape used for tessllations. For example polygon(2,4,6,7,A,10,12) In this
example a new polygon will be created by using points 2,4,6,7 and points from
the 'A' part commands that follow them
Example:- fade(a,D,E, 0.4) The fade factor(last) value which must be between 0
fade(labels of shape, fade factor)
to 1 which controls how much the objects should fade in or out

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.

Useful Commands for calculations

Command Purpose and Examples

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

You might also like