Paint marbling is a process of dropping colored paints onto a liquid bath and raking (combing) them to create intricate designs. Based on my mathematical theory of marbling, Jürgen Gilg, Manuel Luque, and I have created the pst-marble software to enable anyone with an internet browser to create their own digital marbled designs.
Pst-marble (and documentation) is a CTAN package for the LaTeX document system. If you have LaTeX and CTAN installed on your computing device, then you can create marblings locally. https://www.latex-project.org/get/ has the downloads and instructions for installing LaTeX and CTAN on GNU/Linux, MacOS, and Windows.
For those with a web-browser, it is easy to create marblings online. Papeeria.com provides an online LaTeX workbench with free and paid accounts. The marbling example files will render in less than one minute; so a free account is sufficient for exploring. If you create more complicated designs, you can upgrade to a paid Papeeria account or install LaTeX and CTAN on a (larger) computing device.
Returning to the Nonpareil.tex code: After
the \psMarble line there are several sections bounded by
curly braces { and }.
The colors=
section accepts RGB colors in three formats.
The percent symbol %
is the comment character
in .tex files. Text to the right of %
is
ignored to the end-of-line. Try commenting out some color
lines, then click on Papeeria's Compile button; you should
see fewer colors in the resulting marbling PDF.
The actions=
section in Nonpareil.tex
specifies the marbling design through a sequence of numbers
(arguments) and commands separated by whitespace. The system
is a bit unusual in that the command is to the right of its
arguments. The leftmost two arguments to most of the commands
are the x and y coordinates of the center of the
marbling action. 0 0
for the first two
arguments specifies the center of the design. The
visible x and y for a square image are from -500 to
+500; but the virtual tank is infinite in size.
Comment out four lines of the actions=
section so that
it looks like this; then Compile:
0 0 48 colors 25 concentric-rings % 90 [-150 450] 100 750 31 rake % -90 [-150 450] 100 750 31 rake % 180 [ 25 50 0 tines ] 30 200 31 rake % 0 230 shift
You should now see concentric colored rings in the PDF viewer.
These are produced by concentric-rings
command:
These 25 rings are centered in the PDF and have a value of 48 for
thickness. The colors
argument refers to the color
sequence from the colors=
section. It can be replaced
by a literal color sequence; for instance:
Next, uncomment the first two rake
lines so that
the actions=
section looks like this;
then Compile:
0 0 48 colors 25 concentric-rings 90 [-150 450] 100 750 31 rake -90 [-150 450] 100 750 31 rake % 180 [ 25 50 0 tines ] 30 200 31 rake % 0 230 shift
"90 [-150 450] 100 750 31 rake
" rakes two tines from
left to right.
"-90 [-150 450] 100 750 31 rake
" rakes two tines from
right to left. The tine tracks are distinct from the previous two
because they are rotated 180 degrees. It is important to offset the
tines so that rakes in opposite direction do not cancel each other
out. You can see this cancellation by changing [-150
450]
to [-300 300]
in both lines.
Raking left and right increases the number of color bands. The next step will rake downward with 25 tines. While we could specify their positions as 25 numbers between brackets, pst-marble offers a utility for generating evenly spaced tines:
[2 600 -150 tines]
is equivalent to
[-150 450]
. For the 25 tine rake, uncomment
the rake
line in actions=
so that it looks like this;
then Compile:
0 0 48 colors 25 concentric-rings 90 [-150 450] 100 750 31 rake -90 [-150 450] 100 750 31 rake 180 [ 25 50 0 tines ] 30 200 31 rake % 0 230 shift
The top quarter of the marbling is less densely threaded than the rest of the marbling. This is because, by raking downward without a compensating upward raking, the whole design has been moved downward. To recenter it pst-marble offers:
Uncommenting the shift
line will center the nonpareil
design; the value 230 was arrived at by trial and error:
0 0 48 colors 25 concentric-rings 90 [-150 450] 100 750 31 rake -90 [-150 450] 100 750 31 rake 180 [ 25 50 0 tines ] 30 200 31 rake 0 230 shift
The nonpareil design is common in marbling, and is the basis for
more complicated designs as well. You can easily alter the
appearance by changing the actions=
code.
The pst-marble reference card gives brief
descriptions of all the actions=
commands. The next
installment in this tutorial series
explains how to rake curves.
I am a guest and not a member of the MIT Computer Science and Artificial Intelligence Laboratory.
My actions and comments do not reflect in any way on MIT. | ||
Topological Computer Graphics | ||
agj @ alum.mit.edu | Go Figure! |