В текущей версии интерпретатора поддерживаются:
Операторы присваивания и вызова [один оператор в строке].
Объявление составных построений [sub ... end sub].
Вызов составных построений в других составных построениях.
Выполнение циклов [for ... end for].
Измерители, элементы оформления [линии-выноски, размерные знаки, штриховки, заливки, стрелки].
Вывод пространственных координат точек [Z, !cout3D].
Не поддерживаются:
Вложенные операторы [ sub1 (sub2 (...)) ].
Вложенные циклы [for ... for ... end for ... end for].
Условный оператор [!if].
Списки.
Объектно-ориентированные объявления [операторы new и .].
Модификаторы стиля [через :].
Специальные символы
(Специальные символы: αβγδεζηθικλμνξοπρστυφχψω ∀∃∈∉∋∩∪∞∅°∠ ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ ≅≈≠≡⊂⊃⊄⊥)
Программа
O=pxy(0,0) // center of c1 Q=O // center of c2 R1=50 // radius of c1 R2=40 // X-radius of c2 H=70 // difference of heights of c1 and c2 pos=0 // angular shift of c2 in [0:1), 0=0 rad, 0.5=PI rad Ry=40 // Y-radius of c2 for elliptical shape c1=ccx(O,R1: : c_1, 20, R1) c2=ccx(Q,R2: : c_2, 20, R2) // center may be at no c1-center point c2y=ccx(Q,Ry: thin) // basical points and lines v=vr(O) P=psp(c2,0.25) p=hrd(P,20) P0=pab(p,v) p=@hrd(P0,H) P=pab(p,v) h0=hr(P0) h=hr(P) // transformations // trot - rotate c1 by pos-angle Z0=@psp(c1,0) Z1=@psp(c2,pos) trot = trsim (O,Z0:O,Z1) // tofs - shift rotated circle to center of c2 tofs = trofs (O:Q) // tsca - strength c2 into ellipse // non-uniform scale needs 3 points - Q, top and left LFT = @psp(c2,0) // point of c2 and ellipse TPC = @psp(c2,0.25) // point of c2 TPE = @psp(c2y,0.25) // point of ellipse tsca = traff (Q,LFT,TPC:Q,LFT,TPE) // common affine transform for (24) index in [0:1) // get N points of c1 i=psp(c1,index) W$=i z(i,0) v =@vr(i) A$ = pab(h0,v) j = trobj(trot,i) // rotate for POS-angle j = trobj(tofs,j) // move to c2-center j = trobj(tsca,j) // scale v =@vr(j) z(j,H) B$ = pab(h,v) s1$ = sab(i,j:true,thin) s2$ = sab(A$,B$:true,thin) pl = pline(0) plinpadd(pl,i) plinpadd(pl,j) plins(pl) !cout3d(pl) end for nav(0,50:)
Графические команды
-- Точки
point = PXY (X, Y [,W]: [caption, cap-X, cap-Y])
point = PAB (line-a, line-b: [caption, cap-X, cap-Y])
point = PSP (obj, position| point-a, point-b, position: [caption, cap-X, cap-Y])
point-ideal = PIDEAL (line: [caption, cap-X, cap-Y])
point-real-part = PRE (complex-point: [caption, cap-X, cap-Y])
point-image-part-as-real = PIM (complex-point: [caption, cap-X, cap-Y])
point-real-and-image-part-as-real = PIM1 (complex-point: [caption, cap-X, cap-Y])
point-as-sum = PADD (point-a, point-b: [caption, cap-X, cap-Y])
point-as-difference = PSUB (point-a, point-b: [caption, cap-X, cap-Y])
point = PP (X: x^0-coef, x^1-coef, x^2-coef, ...: [caption, cap-X, cap-Y])
-- Прямые
line = SXY (X1, Y1, X2, Y2: [extension] [,style] [,color]: [caption, cap-X, cap-Y])
line = SAB (point-A, point-B: : [caption, cap-X, cap-Y])
line = SPA (line, point: : [caption, cap-X, cap-Y])
line = SOA (line, point: : [caption, cap-X, cap-Y])
line = SPF (point, angle, negative, line-to: : [caption, cap-X, cap-Y])
line = SKB (k-coeff, b-coeff [, x-flag]: : [caption, cap-X, cap-Y])
line = SABC (a-coeff, b-coeff, c-coeff: : [caption, cap-X, cap-Y])
arrow = ARROW (point-A, point-B: [style] [, color])
ls = LS (point-A, point-B: [length])
-- Окружности и дуги
circle = CCX (center-point, point|line|circle|V, diameterFlag: [style]: [caption, cap-X, cap-Y])
[circle, center-point] = CXYV (center-X, center-Y, V, diameter0flag: : [caption, cap-X, cap-Y])
[circle, center-point] = C2P (point-a, point-b: : [caption, cap-X, cap-Y])
[circle, center-point] = C3P (point-a, point-b, point-c: : [caption, cap-X, cap-Y])
[point-a, point-b] = PAC (line, circle: [caption, cap-X, cap-Y]: [caption, cap-X, cap-Y])
point-b = PAC2ND (line, circle, point-a: [caption, cap-X, cap-Y]: [caption, cap-X, cap-Y])
point-b = PAC2DIR (line, circle, point-a: [caption, cap-X, cap-Y]: [caption, cap-X, cap-Y])
[point-a, point-b] = P2C (circle-a, circle-b: [caption, cap-X, cap-Y]: [caption, cap-X, cap-Y])
point-b = P2C2ND (circle-a, circle-b, point-a: [caption, cap-X, cap-Y]: [caption, cap-X, cap-Y])
point-b = P2C2DIR (circle-a, circle-b, point-a: [caption, cap-X, cap-Y]: [caption, cap-X, cap-Y])
[line-a, line-b] = SCP (circle, point: : [caption, cap-X, cap-Y])
[line-a, point-a, line-b, point-b] = SCP (circle, external-point: : [caption, cap-X, cap-Y])
[arc, center-point] = A3P (point-a, point-b, point-c: : [style] [, color])
[arc, point-from, point-to] = APRA (center-point, radius, angle-from, angle-to: [style] [, color])
-- Кривые второго порядка
-- Полилинии
polyline = PLINE (code: [style] [, color])
PLINPADD (polyline, point-a [, point-b] [, point-c])
PLINS (polyline)
PLINZ (polyline)
SHADOW (polyline)
SECTION (polyline)
-- Линейки и измерители
value = MDX(point-a, point-b)
value = MDY(point-a, point-b)
value = MD(point, point-to|line|circle)
ruler = VR (x)
ruler = VRD (point, distance [, negative])
ruler = HR (y)
ruler = HRD (point, distance [, negative])
ruler = RD (line, distance [, negative])
obj = DL (point-a, point-b, pos-X, pos-Y: [caption, cap-X, cap-Y])
-- Преобразователи
T-object = TROFS (P-old: P-new)
T-object = TRMV (P1-old, P2-old | SEG-old: P1-new, P2-new | SEG-new)
T-object = TRSIM (P1-old, P2-old | SEG-old: P1-new, P2-new | SEG-new)
T-object = TRAFF (P1-old, P2-old, P3-old: P1-new, P2-new, P3-new)
T-object = TRMIR (point | line)
T-object = TRROD (line, point-old, point-new)
T-object = TRINV (circle)
[object, ...] = TROBJ (T-object, object, ...)
[object, ...] = TROBI (T-object, object, ...)
-- Системы координат начертательной геометрии
[axis, O] = CS12 (x, y)
[axis, O] = CS23 (x, y)
-- Разное
[x, y] = XY (point)
CAP (obj, caption [, cap-X, cap-Y])
CAPS (obj1, ...: caption-1 [, cap1-X, cap1-Y]: ...)
!ERASE (o1, o2, ...)
!RECSET (fname, max-recursion-depth)
!COUT (var1|precision-coeff|multiplier, var2|precision-coeff|multiplier, ...)
obj = LEADER (obj: [caption, cap-X, cap-Y])
/Пусто/