%poster.jam
%v n d = n*d+v
(linear) (.mul .add).cvx .def
% d s z = z*s/(z+d)
(persp) (.dup 4 1 .roll .mul 3 1 .roll .add .div ).cvx .def
%v n d = d*n*n+v
(quad) (.exch .dup .mul .mul .add).cvx .def
%v n d = d*Sin(n) + v
(sin) (.exch .sin .mul .add).cvx .def
(cos) (.exch .cox .mul .add).cvx .def
%v n d k = k*(d^n)
(exp) (3 1 .roll .exch .exp .mul .add).cvx .def
(swdy) (sw dy .mul).cvx .def
(swdx) (sw dx .mul).cvx .def
%dx dy nsteps 3 0 9 swirl
(swirl) ( ((sStrandInit strand 2 .copy .translate).cvx .rept .pop .pop).cvx .dosave).cvx .def
%dx dy nsteps
(gSwirl) ( (gStrandInit strand 2 .copy .translate).cvx .rept .pop .pop).cvx .def
(csDx) 16 .def
(csDy) 16 .def
(linetest) ((strokeWidth) .exch .def (spinOffsetFactor) -23 .def
(swirlScale swirlspin).cvx .dosave).cvx .def
(doFocus) ((spinOffsetFactor) -22 .def (strokeWidth) .4 .def (swirlScale swirlspin).cvx .dosave).cvx .def
%seq5 hBorder seq5 returns origin to focus
(hBorder) (growSeq dx 2 .mul dy 2 .div .translate csBorder).cvx .def
(gStrandInit) (eStrand0).cvx .def
(growScale) 0.596758 .def
(growFinal) 16 .def
%grows to growFinal in 3 steps.
(growSeq) (
(gsLight) .4 .def
(gsBold) gsLight .def
(gs) growScale .def
(gsStep) 1 growScale .sub 3.0 .div .def
(gsBoldStep) 1.0 gsLight .sub 3.0 .div .def
(doOne) (
(dx) growFinal gs .mul .def
(dy) dx .def
(growDStep) swirlDy .neg gs .mul .def
gsBold .setstrokewidth strand
gsLight .setstrokewidth
growDStep 0 swirlNSteps 1 .sub gSwirl
gsBold .setstrokewidth strand
).cvx .def
%magic numbers Y=(fixHeight spinHeight .cvr .div 20 .mul) for focus
%X=(fixHeight spinHeight .cvr .div spinOffset .mul dx .sub) for focus
25.83053 -9.80595 .translate gStrandInit %space over zeroth leaf
(gsBold) gsBold gsBoldStep .add .def
(gs) gs gsStep .add .def doOne
dx 0 .translate (gsBold) gsBold gsBoldStep .add .def
(gs) gs gsStep .add .def doOne
dx 0 .translate (gsBold) gsBold gsBoldStep .add .def
(gs) gs gsStep .add .def doOne
).cvx .def
(eStrand0) (
(t0) (dx) .cvx .def
(t1) (dx) .cvx .def
(p0x) 0 .def
(p0y) 0 .def
(t0x) (p0x t0 .add) .cvx .def
(t0y) (p0y).cvx .def
(p1x) (2 dx .mul p0x .add).cvx .def
(p1y) (p0y dy .add).cvx .def
(t1x) (p1x t1 .sub).cvx .def
(t1y) (p1y) .cvx .def
).cvx .def
(stroke) (strand) .cvx .def
%xStep nSteps cToS Will go from c to s with xStep spacing in nSteps
(csBorder) (
(csDxStep) 3 .def
(csEStep) 5 .def
(csNSSteps) 3 .def
(gsLight) .4 .def
(gsBold) 1.5 .def
(slant) 1.0 .def
cToSFig
dx 0 .translate
(csDxStep) 4 .def (csEStep) 4 .def
(csNSSteps) 3 .def cToSFig
dx 0 .translate
(slant) .75 .def
(csDxStep) 4 .def (csEStep) 4 .def
(csNSSteps) 3 .def cToSFig
dx 0 .translate
(slant) .75 .def
(gsBold) 2.0 .def
(csDxStep) 5 .def (csEStep) 3 .def
(csNSSteps) 2 .def cToSFig
dx 0 .translate
(slant) .75 .def
(gsBold) 2.0 .def
(csDxStep) 6 .def (csEStep) 3 .def
(csNSSteps) 1 .def cToSFig
dx 0 .translate
(slant) .75 .def
(gsBold) 2.0 .def
(csDxStep) 7 .def (csEStep) 3 .def
(csNSSteps) 0 .def cToSFig
dx 0 .translate
(gsBold) 2.5 .def
csFigFinal
).cvx .def
(csDxStep) 3 .def
(csEStep) 5 .def
(csNSSteps) 3 .def
(gsLight) .4 .def
(gsBold) 1.5 .def
(csFigFinal) (
round .setstrokeend
gsBold .setstrokewidth
cStrandInit (slant) .75 .def divSpath .maskstroke
dx 1.2 .mul 0 .translate
cStrandInit0 (slant) .5 .def divSpath .maskstroke
).cvx .def
(cToSFig) (
round .setstrokeend
gsBold .setstrokewidth
cStrandInit divSpath .maskstroke
gsLight .setstrokewidth
csDxStep csEStep cToS
csDxStep 0 csNSSteps
(divSpath .maskstroke 2 .copy .translate).cvx .rept
.pop .pop
gsBold .setstrokewidth
divSpath .maskstroke
).cvx .def
(cToS) (
.dup
dx .dup .add .exch .div (dxCendStep) .exch .def
%xStep nSteps 0
0 .exch %xStep yStep nSteps on stack
cStrandInit (
divSpath .maskstroke 2 .copy .translate
(dxCend) dxCend dxCendStep .sub .def
).cvx .rept
.pop .pop
).cvx .def
(cSwirl) ( (divSpath .maskstroke 2 .copy .translate).cvx .rept .pop .pop).cvx .def
(sStrand0) (
(dx) 20 .def
(dy) 20 .def
(t0) (dy) .cvx .def
(t1) (dy) .cvx .def
(p0x) 0 .def
(p0y) 0 .def
(t0x) (p0x) .cvx .def
(t0y) (p0y t0 .sub).cvx .def
(p1x) (p0x dx .add).cvx .def
(p1y) (2 dy .mul .neg p0y .add).cvx .def
(t1x) (p1x) .cvx .def
(t1y) (p1y t1 .add).cvx .def
).cvx .def
(sStrand1) (
(dx) 40 .def
(dy) 40 .def
(t0) (60) .cvx .def
(t1) (t0) .cvx .def
(p0x) 0 .def
(p0y) 0 .def
(t0x) (p0x) .cvx .def
(t0y) (p0y t0 .sub).cvx .def
(p1x) (p0x dx .add).cvx .def
(p1y) (2 dy .mul .neg p0y .add).cvx .def
(t1x) (p1x) .cvx .def
(t1y) (p1y t1 .add).cvx .def
).cvx .def
(sStrand2) (
(dx) 40 .def
(dy) 20 .def
(t0) (40) .cvx .def
(t1) (t0) .cvx .def
(p0x) 0 .def
(p0y) 0 .def
(t0x) (p0x) .cvx .def
(t0y) (p0y t0 .sub).cvx .def
(p1x) (p0x dx .add).cvx .def
(p1y) (2 dy .mul .neg p0y .add).cvx .def
(t1x) (p1x) .cvx .def
(t1y) (p1y t1 .add).cvx .def
).cvx .def
(sStrandInit) (sStrand0).cvx .def
(abs) (.dup .mul .sqrt).cvx .def
(swirlWidth) (p0x p1x .sub abs swirlNSteps 1 .sub swirlDy .mul abs .add).cvx .def
(swirlHeight) (p0y p1y .sub abs swirlNSteps 1 .sub swirlDy .mul abs .add).cvx .def
(spinHeight) ( %for a 5 sided figure
(D5) (36 .cos .mul).cvx .def %short distance function
(closedD) (swirlHeight spinOffset .sub .dup .mul dx .dup .mul .add .sqrt).cvx .def %significant distance for closed figure
spinOffset closedD .gt
(spinOffset spinOffset D5 .add).cvx
(closedD closedD D5 .add).cvx
.ifelse
).cvx .def
(fixHeight) 57.0 .def
(swirlScale) (fixHeight spinHeight .cvr .div .dup .dup .scale strokeWidth .exch .div .setstrokewidth).cvx .def
(swirlNSteps) 9 .def
(swirlDy) -3 .def
(spinangle) 72 .def
(spinOffsetFactor) -2 .def
(spinOffset) (spinOffsetFactor swirlDy .mul).cvx .def
(swirlspin) ( (270 .rotate 360 spinangle abs .div (
( 0 spinOffset .translate 0 swirlDy swirlNSteps swirl ).cvx .dosave
spinangle .rotate ).cvx .rept
).cvx .dosave).cvx .def
(inch) (72 .mul).cvx .def
(setstrokes) (1 .setstrokewidth round .setstrokeend).cvx .def
(seq1) (
(m) .5 inch
(fixHeight) 124.0 .def
(sx) fixHeight 2 .div .75 inch .add .def
(sy) fixHeight 2 .div .4 inch .add .def
(sa) 0 .def
(spinOffsetFactor) -4 .def
sx sy .translate
4 (( sa .rotate swirlScale swirlspin).cvx .dosave
0 fixHeight .translate
(sa) sa 22.5 .sub .def
(spinOffsetFactor) spinOffsetFactor 2 .sub .def
).cvx .rept
(spinOffsetFactor) -11 .def
(swirlScale swirlspin).cvx .dosave
0 fixHeight .translate
(spinOffsetFactor) -13 .def
( -22.5 .rotate swirlScale swirlspin).cvx .dosave
).cvx .def
(seq2) (
(m) .5 inch
(fixHeight) 124.0 .def
(sx) fixHeight 2 .div .75 inch .add .def
(sy) fixHeight 2 .div .4 inch .add .def
(sa) 0 .def
(spinOffsetFactor) -6 .def
sx sy .translate
6 (( sa .rotate swirlScale swirlspin).cvx .dosave
0 fixHeight .translate
(sa) sa 22.5 .sub .def
(spinOffsetFactor) spinOffsetFactor 2 .sub .def
).cvx .rept
).cvx .def
(seq3) (
(m) .5 inch .def
(fixHeight) 72.0 .def
(strokeWidth) .5 .def
(step) 66 .def
(sx) 2 inch .def
(sy) 10.5 inch fixHeight 2 .div fixHeight .add .sub .def
(sa) 0 .def
(dsa) -36 .def
(doOne) ((sa .rotate swirlScale swirlspin).cvx .dosave).cvx .def
sx sy .translate
(spinOffsetFactor) -21 .def
doOne %focus
0 step .translate
(spinOffsetFactor) -23 .def
(sa) dsa .neg .def doOne %up
0 step 2 .mul .neg .translate
(spinOffsetFactor) -20 .def
(sa) dsa .def doOne %down
0 step .neg .translate
(spinOffsetFactor) -18 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -16 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -14 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -13 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -11 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -10 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -9 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -7 .def
(sa) sa dsa .add .def doOne
).cvx .def
(seq4) (
(fixHeight) .8 inch .def
(strokeWidth) .4 .def
(step) .9 fixHeight .mul .def
(sx) 1.5 inch .def
(sy) 10.75 inch fixHeight 2 .div fixHeight .add .sub .def
(sa) 0 .def
(dsa) -36 .def
(doOne) ((sa .rotate swirlScale swirlspin).cvx .dosave).cvx .def
sx sy .translate
(spinOffsetFactor) -22 .def
doOne %focus
0 step .translate
(spinOffsetFactor) -23 .def
(sa) dsa .neg .def doOne %up
0 step 2 .mul .neg .translate
(spinOffsetFactor) -21 .def
(sa) dsa .def doOne %down
0 step .neg .translate
(spinOffsetFactor) -19 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -18 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -16 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -15 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -14 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -13 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -11 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -10 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -9 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -8 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -7 .def
(sa) sa dsa .add .def doOne
).cvx .def
(seq5) ( sStrandInit
(fixHeight) .85 inch .def
(strokeWidth) .4 .def
(step) .9 fixHeight .mul .def
(sx) 120 .def
(sy) 10.9 inch fixHeight 2 .div fixHeight .add .sub .def
(sa) 0 .def
(dsa) -36 .def
(doOne) ((sa .rotate swirlScale swirlspin).cvx .dosave).cvx .def
sx sy .translate
(spinOffsetFactor) -22 .def
doOne %focus
0 step .translate
(spinOffsetFactor) -23 .def
(sa) dsa .neg .def doOne %up
0 step 2 .mul .neg .translate
(spinOffsetFactor) -21 .def
(sa) dsa .def doOne %down
0 step .neg .translate
(spinOffsetFactor) -19 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -18 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -16 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -15 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -14 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -13 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -11 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -10 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -9 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -8 .def
(sa) sa dsa .add .def doOne
0 step .neg .translate
(spinOffsetFactor) -7 .def
(sa) sa dsa .add .def doOne
0 step 12 .mul .translate %return to focus
).cvx .def
(cStrand0) (
(dx) 40 .def
(dy) 40 .def
(t0) (40) .cvx .def
(t1) (t0) .cvx .def
(p0x) 0 .def
(p0y) 0 .def
(t0x) (p0x) .cvx .def
(t0y) (p0y t0 .add).cvx .def
(p1x) (p0x dx .add).cvx .def
(p1y) (dy .neg).cvx .def
(t1x) (p1x) .cvx .def
(t1y) (p1y t1 .add).cvx .def
).cvx .def
(slant) 1 .def
(cStrandInit) (
(dx) 16 .def
(dxCend) dx .def
(dy) 16 .def
(t0) dy .def
(t1) t0 2 .mul .def
(p0x) dx .def
(p0y) 0 .def
(t0x) p0x dx .sub .def
(t0y) p0y .def
(p1x) dx p0x .add .def
(p1y) p0y dy .add .def
(t1x) p1x t1 .sub .def
(t1y) p1y .def
).cvx .def
(cStrandInit0) (
(dx) 16 .def
(dxCend) dx .neg .def
(dy) 16 .def
(t0) dy .def
(t1) t0 2 .mul .def
(p0x) dx .def
(p0y) 0 .def
(t0x) p0x dx .sub .def
(t0y) p0y .def
(p1x) dx p0x .add .def
(p1y) p0y dy .add .def
(t1x) p1x t1 .sub .def
(t1y) p1y .def
).cvx .def
(strand) (strandpath .maskstroke) .cvx .def
(mp) (p0x p0y .setcp t0x t0y .drawto t1x t1y .drawto p1x p1y .drawto).cvx .def
(strandpath) (p0x p0y .moveto t0x t0y t1x t1y p1x p1y .curveto).cvx .def
(divSpath) (
(dxSub) slant dx .mul 2.0 .div .def
(dySub) dy 2.0 .div .def
dxSub dx 2.0 .div .add dySub .moveto
dxSub dySub
dxSub 2.0 .div dySub 2.0 .div
0 0 .curveto
dxSub 2.0 .div .neg dySub 2.0 .div .neg
dxSub .neg dySub .neg
dxCend 2.0 .div dxSub .sub dySub .neg .curveto
).cvx .def