Next: , Previous: Functions for VRR types, Up: Scheme



6.4 Creation of objects

There are several definitions of functions for object creation (called also constructors). All return a proxy for the created object. They are usually named by a pattern make-SUBTYPE, they need different arguments, so they are described separately. obj constructors must be called in a meta-transaction and are n-parent-less, go constructors must be called in a transaction and their g-parent is g-root of the page of the current transaction.


(make-document)
-> document
A constructor for obj document.


(make-page)
-> page
A constructor for obj page.


(make-common-document name)
string -> document
A modified constructor for obj document. The newly created document is named by name and connected under the universe.


(make-common-page name doc)
string document -> page
A modified constructor for obj page. The newly created page is named by name and connected under the doc.


(coords x y)
real real -> hanger
A constructor for a free hanger (also known as a mouse-click). The created hanger coordinates are (x, y).


(coords-c p)
complex -> hanger
A constructor for a free hanger (also known as a mouse-click). The created hanger coordinates are ((real-part p), (imag-part p)).


(make-point h)
hanger -> go
A point constructor. The created GO's point anchor is hung on the h hanger.


(make-segment h1 h2)
hanger hanger -> go
A segment constructor. The created GO's start anchor is hung on the h1 hanger, the end anchor is hung on the h2 hanger.


(make-ellipse-by-center-2-radii-rotation c r1 r2 rot)
hanger real real real -> go
A constructor for the appropriate go. The created GO's center anchor is hung on the c hanger. r1 is used as the major radius of the ellipse. r2 is used as the minor radius of the ellipse. Radii must be positive. rot (must be between 0 and mathscheman0) is used as the rotation the of ellipse, where zero rotation means that the major axis is horizontal.


(make-ellipse-by-2-foci-point f1 f2 p)
hanger hanger hanger -> go
A constructor for the appropriate go. The created GO's focus-1 anchor is hung on hanger f1, anchor focus-2 is hung on hanger f2, anchor point (representing any point on the ellipse) is hung on hanger p.


(make-ellipse-by-3-points-smallest p1 p2 p3)
hanger hanger hanger -> go
A constructor for the appropriate go. The created GO's anchors point-1, point-2 and point-3 are hung on hangers p1, p2 and p3, respectively. The created ellipse is the smallest (in area) ellipse containing the three points represented by the anchors.


(make-ellipse-by-3-points-rotation-eccentricity p1 p2 p3 rot ecc)
hanger hanger hanger real real -> go
A constructor for the appropriate go. The created GO's anchors point-1, point-2 and point-3 are hung on hangers p1, p2 and p3, respectively. rot (must be between 0 and mathscheman1) is used as the rotation of the ellipse, where zero rotation means that the major axis is horizontal. ecc (must be between 0 and 1) is used as the eccentricity of the ellipse.


(make-ellipse-by-center-point-rotation-eccentricity c p rot ecc)
hanger hanger real real -> go
A constructor for the appropriate go. The created GO's anchor center is hung on the c hanger, the point anchor is hung on the p hanger (representing any point on the ellipse). rot (must be between 0 and mathscheman2) is used as the rotation of the ellipse, where zero rotation means that the major axis is horizontal. ecc (must be between 0 and 1) is used as the eccentricity of the ellipse.


(make-elarc-by-center-2-radii-rotation-2-angles c r1 r2 rot a1 a2 style)
hanger real real real real real symbol -> go
An alternative constructor for go ellipse-by-center-2-radii-rotation, modified to creation of arcs. The arguments share the semantics with the function make-ellipse-by-center-2-radii-rotation and the additional arguments a1, a2 and style are the arc information (see Elliptic arcs).


(make-elarc-by-3-points-smallest p1 p2 p3 style)
hanger hanger hanger symbol -> go
An alternative constructor for go ellipse-by-3-points-smallest, modified to creation of arcs. The arguments share the semantics with function make-ellipse-by-3-points-smallest and the additional argument style is arc information (See Elliptic arcs).


(make-quadratic-bezier p1 p2 p3)
hanger hanger hanger -> go
A constructor for the appropriate go. The created GO's anchors controlpoint-1, controlpoint-2 and controlpoint-3 are hung on hangers p1, p2 and p3, respectively. The created bezier is non-rational, i.e. all weights are set to 1.


(make-quadratic-rational-bezier p1 w1 p2 w2 p3 w3)
hanger real hanger real hanger real -> go
An alternative go constructor for quadratic-bezier, the created bezier is rational. The arguments share the semantics with function make-quadratic-bezier, the additional arguments are weights of the control points.


(make-cubic-bezier p1 p2 p3 p4)
hanger hanger hanger hanger -> go
A constructor for the appropriate go. The created GO's anchors controlpoint-1, controlpoint-2, controlpoint-3 and controlpoint-4 are hung on hangers p1, p2, p3 and p4, respectively. The created bezier is non-rational, i.e. all weights are set to 1.


(make-cubic-rational-bezier p1 w1 p2 w2 p3 w3 p4 w4)
hanger real hanger real hanger real hanger real -> go
An alternative go constructor for cubic-bezier, the created bezier is rational. The arguments share the semantics with the function make-cubic-bezier, the additional arguments are weights of the control points.


(make-tex-text h str)
hanger string -> go
A constructor for the appropriate go. The created GO's anchor point is hung on hanger h, str is used as the TeX source text.


(make-text h str font-family font-style font-size)
hanger string string string real -> go
A constructor for the appropriate go. The created GO's anchor point is hung on hanger h. str is used as the text source. font-family is the desired font name. font-style is the variant (for example, "regular" or "bold"). font-size is the size of the font in millimeters.


(make-parametric-point go p)
go real -> go
A constructor for the appropriate go. The created GO's anchor curve is hung on curve hanger of go, p is used as the position parameter on that curve.


(make-parametric-point-on-hanger h p)
hanger real -> go
Alternative constructor for go parametric-point. The created GO's anchor curve is hung on hanger h (which must be curve hanger), p is used as position on that curve.


(make-intersection g1 g2 p)
go go real -> go
A constructor for the appropriate go. The created GO's anchors curve-1 and curve-2 are hung on curve hangers of g2 and g2, respectively. If there are more intersections of that curves, the one closest to the p position on the first curve is used.


(make-intersection-on-hanger h1 h2 p)
hanger hanger real -> go
An alternative constructor for go parametric-point. The created GO's anchors curve-1 and curve-2 are hung on hangers h1 and h2 (which must be curve hangers), respectively. If there are more intersections of that curves, the one closest to the p position on the first curve is used.


(make-decorator-point h n radius rot)
hanger natural real real ->
A constructor for the appropriate go. The created GO's anchor decorator-point is hung on hanger h. n, radius and rot are used as the number of vertices, radius and rotation, respectively.


(make-decorator-arrow g p arrow-length rot)
go real real real ->
A constructor for the appropriate go. The created GO's anchor curve is hung on curve hanger of go. p is used as the position parameter on that curve. arrow-length and rot are used as the arrow length and rotation, respectively. The rotation is interpreted as the deviation from the tangent of the curve.


(make-decorator-arrow-on-hanger h p arrow-length rot)
hanger real real real ->
An alternative constructor for go decorator-arrow. The created GO's anchor curve is hung on hanger h (which must be a curve hanger). p is used as the position parameter on that curve. arrow-length and rot are used as the arrow length and rotation, respectively. The rotation is interpreted as the deviation from the tangent of the curve.


(make-group)
-> go
A constructor for the appropriate go.


(make-path)
-> go
A constructor for the appropriate go.

For some functions, there are aliases (shortened versions):

Function alias Function full name
make-ellipse/c2rr make-ellipse-by-center-2-radii-rotation
make-ellipse/2fp make-ellipse-by-2-foci-point
make-ellipse/3ps make-ellipse-by-3-points-smallest
make-ellipse/3pre make-ellipse-by-3-points-rotation-eccentricity
make-ellipse/cpres make-ellipse-by-center-point-rotation-eccentricity
make-elarc/c2rr2a make-elarc-by-center-2-radii-rotation-2-angles
make-elarc/3ps make-elarc-by-3-points-smallest
make-bezier/2 make-quadratic-bezier
make-bezier/2r make-quadratic-rational-bezier
make-bezier/3 make-cubic-bezier
make-bezier/3r make-cubic-rational-bezier