% tikzlibraryflorilegium.code.tex -- florilegium's species in pure TikZ: \usetikzlibrary{florilegium}
% Copyright (c) 2026 Kevin Raymond. MIT License: see LICENSE or florilegium.sty.
%
% A species is a plant sampled from a genome: its body plan (lily, rose, pea, daisy,
% umbellifer ...), the visitor its flowers are for, then the flower, its cluster, the leaf
% and the fruit, each trait drawn from the plan's distribution in a fixed order. The
% tables are generated from florilegium-species.lua (tools/tikztables.lua) and drawn
% with pgf's own random generator, so that florilegium's Lua side, which replays that
% generator exactly, finds the same species for the same seed. pgfmath computes, TikZ
% draws, under pdfLaTeX or LuaLaTeX; nothing here needs Lua.
%
%   \florilegiumspecies{<seed>}{<role>}   seed 1..2147483646; role hero, spray, monocot or any
%   \florilegiumspecies[compound=palmate, leaflets=7]{<seed>}{<role>}   those traits fixed
%   \florilegiumtrait{<trait>}            a trait of the species last drawn, e.g. {plan}, {merosity}
%   \florilegiumvisitor{<seed>}{<role>}   a visitor: a butterfly, a bee, a snail ... (see below)
%   \florilegiumtracery{<seed>}{<role>}   a window of Gothic tracery (see below)
%   \florilegiumshell{<seed>}{<role>}     a shell: an ammonite, a scallop, a whelk ... (see below)

\ifdefined\ProvidesFile
  \ProvidesFile{tikzlibraryflorilegium.code.tex}[2026/11/17 v2.1.0 florilegium species in pure TikZ]
\fi

\input tikzlibraryflorilegium.tables.code.tex
\usepgflibrary{fpu}

% pgfmath's number scanner (pgfmathparser.code.tex, \pgfmath@parse@@number) looks up
% \csname pgfmath@base@<the number so far><next token>\endcsname after every number, to
% catch the base prefixes 0x and 0b; every distinct number thereby leaves a name behind,
% and under pdfLaTeX (fixed string pool) a few thousand parsed coordinates fill the pool.
% Here the lookup is made only when the number so far is 0 (the only case a prefix can
% follow), which changes nothing else. Applied only if that line is found as one of the
% two forms pgf has written it in: 3.1.10 looks up \pgfmath@number\pgfmath@token, 3.1.12
% \expandafter\pgfmath@number\expandafter\string\pgfmath@token (TeX Live 2026); each is
% replaced by the same line with the test around it. pgf's own fix (pgf-tikz/pgf#1489, after
% 3.1.12) tests the name with \unless\ifcsname, which creates nothing: that line is left as
% it is, without a warning. Under another pgf nothing is changed either, and a page of plants
% may then fill pdfTeX's string pool.
% The change is florilegium's, made at load time in documents that load this library; pgf's
% files are not changed, and pgf's authors do not support it: report problems with it to
% florilegium. pgf itself, unmodified, is at https://ctan.org/pkg/pgf (LPPL 1.3c or GPL 2).
\def\flo@pgfpatch#1\csname pgfmath@base@\pgfmath@number\pgfmath@token\endcsname\relax#2\flo@pgfpatch@end{%
  \def\flo@tmp{#2}%
  \ifx\flo@tmp\pgfutil@empty\else
    \flo@pgfpatch@b#2\flo@pgfpatch@end
    \expandafter\flo@pgfpatch@c\expandafter{\flo@tmpb}{#1}%
  \fi}
\def\flo@pgfpatch@b#1\csname pgfmath@base@\pgfmath@number\pgfmath@token\endcsname\relax\flo@pgfpatch@end{\def\flo@tmpb{#1}}
\def\flo@pgfpatch@c#1#2{\def\pgfmath@parse@@number{#2%
  \csname pgfmath@base@\ifx\pgfmath@number\pgfmath@char@zero0\pgfmath@token\else-\fi\endcsname\relax#1}}
% pgf 3.1.12's form of the same line
\def\flo@pgfpatchs#1\csname pgfmath@base@\expandafter\pgfmath@number\expandafter\string\pgfmath@token\endcsname\relax#2\flo@pgfpatch@end{%
  \def\flo@tmp{#2}%
  \ifx\flo@tmp\pgfutil@empty\else
    \flo@pgfpatchs@b#2\flo@pgfpatch@end
    \expandafter\flo@pgfpatchs@c\expandafter{\flo@tmpb}{#1}%
  \fi}
\def\flo@pgfpatchs@b#1\csname pgfmath@base@\expandafter\pgfmath@number\expandafter\string\pgfmath@token\endcsname\relax\flo@pgfpatch@end{\def\flo@tmpb{#1}}
\def\flo@pgfpatchs@c#1#2{\def\pgfmath@parse@@number{#2%
  \csname pgfmath@base@\ifx\pgfmath@number\pgfmath@char@zero0\expandafter\string\pgfmath@token\else-\fi\endcsname\relax#1}}
% pgf's fixed form: \flo@tmp is left nonempty if the scanner has it. Kept out of the
% conditionals below, since TeX counts an \ifcsname in a skipped branch as an \if.
\def\flo@pgffixed#1\unless\ifcsname pgfmath@base@#2\flo@pgfpatch@end{\def\flo@tmp{#2}}
\def\flo@pgffixedtest{\expandafter\flo@pgffixed\pgfmath@parse@@number
  \unless\ifcsname pgfmath@base@\flo@pgfpatch@end}
\let\flo@tmp\pgfutil@empty
\ifdefined\pgfmath@parse@@number
  \expandafter\flo@pgfpatch\pgfmath@parse@@number
    \csname pgfmath@base@\pgfmath@number\pgfmath@token\endcsname\relax\flo@pgfpatch@end
  \ifx\flo@tmp\pgfutil@empty
    \expandafter\flo@pgfpatchs\pgfmath@parse@@number
      \csname pgfmath@base@\expandafter\pgfmath@number\expandafter\string\pgfmath@token\endcsname\relax\flo@pgfpatch@end
  \fi
  \ifx\flo@tmp\pgfutil@empty
    \flo@pgffixedtest
  \fi
\fi
% none of the three forms, or no scanner by that name: say so under pdfTeX, whose string
% pool is fixed (LuaTeX's grows)
\ifx\flo@tmp\pgfutil@empty\ifdefined\directlua\else
  \pgfutil@packagewarning{florilegium}{pgf \pgfversion's number scanner is not in a form
    this library knows, so it is left as it is; a page of plants may then fill pdfTeX's
    string pool (TeX capacity exceeded, pool size)}%
\fi\fi

% ---------------------------------------------------------------- traits
\def\flo@set#1#2{\expandafter\edef\csname flo@v@#1\endcsname{#2}}
\def\flo@get#1{\csname flo@v@#1\endcsname}
\let\florilegiumtrait\flo@get

% ---------------------------------------------------------------- one draw
% each leaves its value in \flo@val; the four kinds match florilegium-species.lua
\def\flo@C#1{\edef\flo@val{#1}}
\def\flo@I#1#2{\pgfmathrandominteger\flo@val{#1}{#2}}
\def\flo@R#1#2{\pgfmathparse{#1+#2*rnd}\let\flo@val\pgfmathresult}
% a weighted choice: #2 is {value}{cumulative weight} pairs, #1 the total
\def\flo@W#1#2{\pgfmathrandominteger\flo@k{1}{#1}\flo@Wscan#2\flo@stop}
\def\flo@Wscan#1#2{%
  \ifnum\flo@k>#2\relax
    \expandafter\flo@Wscan
  \else
    \def\flo@val{#1}\expandafter\flo@Wgobble
  \fi}
\def\flo@Wgobble#1\flo@stop{}
% the distribution for the value of an earlier trait #1, from the macros \flo@d@#2@<value>
\def\flo@BY#1#2{%
  \edef\flo@key{flo@d@#2@\flo@get{#1}}%
  \ifcsname\flo@key\endcsname\else\edef\flo@key{flo@d@#2@_}\fi
  \csname\flo@key\endcsname}
% draw trait #1 with distribution #2, keep it (or the value it is fixed to), and log it if asked
\def\flo@T#1#2{#2\ifcsname flo@fix@#1\endcsname\edef\flo@val{\csname flo@fix@#1\endcsname}\fi
  \flo@set{#1}{\flo@val}\flo@logT{#1}}

% ---------------------------------------------------------------- a genome of your own
% Traits fixed by name ([compound=palmate, leaflets=7]), the rest sampled. A fixed trait
% still takes its draw, then its value is the fixed one, and a trait that depends on it
% follows it, as florilegium-species.lua's M.fixes and M.sample do. A trait the genome
% lacks, or a value no plan (or kind) can draw, is an error: \flo@<ns>ok@<trait> holds its
% names, the range of a number, and whether that number is real (the tables). \flo@fixns is
% empty for a species, v for a visitor; clade and group follow from the plan and the kind.
% A whole number is kept as one (7.0 and 07 as 7), as Lua keeps it. After an error the
% species or visitor is sampled without any of the traits, and so is the rest of the pic
% (\flo@o@traits emptied), as the Lua engine draws it.
\newif\ifflo@fixbad
\def\flo@fixset#1#2{\def\flo@fixns{#1}\def\flo@fixlist{}\flo@fixbadfalse
  \edef\flo@tmp{\noexpand\pgfkeys{/florilegium/fix,#2}}\flo@tmp
  \ifflo@fixbad\flo@fixclear\let\flo@o@traits\pgfutil@empty\fi}
\def\flo@fixclear{\pgfutil@for\flo@t:=\flo@fixlist\do{\ifx\flo@t\pgfutil@empty\else
  \expandafter\let\csname flo@\flo@fixns fix@\flo@t\endcsname\flo@undefined\fi}\def\flo@fixlist{}}
\pgfkeys{/florilegium/fix/.is family, /florilegium/fix/.unknown/.code={%
  \edef\flo@fixval{#1}%
  \flo@fixcheck{\pgfkeyscurrentname}{#1}%
  \expandafter\let\csname flo@\flo@fixns fix@\pgfkeyscurrentname\endcsname\flo@fixval
  \edef\flo@fixlist{\flo@fixlist,\pgfkeyscurrentname}}}
\def\flo@tns{t}\def\flo@kns{k}
\def\flo@fixwhat{\ifx\flo@fixns\pgfutil@empty a species\else\ifx\flo@fixns\flo@tns a window of tracery\else
  \ifx\flo@fixns\flo@kns a shell\else a visitor\fi\fi\fi}
\def\flo@fixcheck#1#2{%
  \ifcsname flo@\flo@fixns ok@#1\endcsname
    \expandafter\expandafter\expandafter\flo@fixcheck@\csname flo@\flo@fixns ok@#1\endcsname{#1}{#2}%
  \else
    \flo@fixbadtrue
    \pgfutil@packageerror{florilegium}{\flo@fixwhat\space has no trait `#1'}{docs/traits.md (and the
      manual, florilegium-doc.pdf) lists every trait and what it may be. Press return to
      draw it as sampled, without the traits.}%
  \fi}
% #1 the names, #2 #3 the range of a number (empty if none), #4 1 for a real number, #5 the
% trait, #6 its value
\def\flo@fixcheck@#1#2#3#4#5#6{%
  \def\flo@tmp{#6}%
  \ifx\flo@tmp\pgfutil@empty\pgfutil@in@false\else\pgfutil@in@{,#6,}{,#1,}\fi
  \ifpgfutil@in@\else
    \flo@yesfalse
    \def\flo@t{#2}%
    \ifx\flo@t\pgfutil@empty\else\ifx\flo@tmp\pgfutil@empty\else
      \flo@isnum{#6}%
      \ifflo@yes
        \pgfmathparse{and(and((#6)>=(#2),(#6)<=(#3)),or(#4==1,(#6)==int(#6)))}%
        \ifdim\pgfmathresult pt>0pt \else\flo@yesfalse\fi
      \fi
    \fi\fi
    \ifflo@yes
      \ifnum#4=1 \else\pgfmathtruncatemacro\flo@fixval{#6}\fi
    \else
      \flo@fixbadtrue
      \def\flo@tmp{#1}%
      \ifx\flo@t\pgfutil@empty\def\flo@fixmsg{one of #1}%
      \else
        \ifnum#4=1 \def\flo@fixmsg{a number from #2 to #3}\else\def\flo@fixmsg{a whole number from #2 to #3}\fi
        \ifx\flo@tmp\pgfutil@empty\else\edef\flo@fixmsg{one of #1, or \flo@fixmsg}\fi
      \fi
      \pgfutil@packageerror{florilegium}{#5=#6 cannot be drawn: #5 is \flo@fixmsg}{Press
        return to draw it as sampled, without the traits.}%
    \fi
  \fi}
% \ifflo@yes when #1 is a plain decimal number, as florilegium-species.lua's M.fixes reads
% one: a minus sign first or none, digits with at most one point among them, and at least
% one digit (no +, exponent, hexadecimal or expression)
\newif\ifflo@numpt \newif\ifflo@numdig \newif\ifflo@numfirst
\def\flo@isnum#1{\flo@yestrue\flo@numptfalse\flo@numdigfalse\flo@numfirsttrue
  \flo@isnum@#1\flo@stop\ifflo@numdig\else\flo@yesfalse\fi}
\def\flo@isnum@#1{\ifx#1\flo@stop\expandafter\pgfutil@gobble\else
  \if-\noexpand#1\ifflo@numfirst\else\flo@yesfalse\fi
  \else\if.\noexpand#1\ifflo@numpt\flo@yesfalse\fi\flo@numpttrue
  \else\pgfutil@in@{#1}{0123456789}\ifpgfutil@in@\flo@numdigtrue\else\flo@yesfalse\fi\fi\fi
  \flo@numfirstfalse\fi\flo@isnum@}

% ---------------------------------------------------------------- a log of the choices
% \florilegiumspecieslogtrue collects "trait=value" for the species last drawn in
% \florilegiumspecieslog (for tools/tikzcheck.lua)
\newif\ifflorilegiumspecieslog
\def\flo@logT#1{\ifflorilegiumspecieslog\edef\florilegiumspecieslog{\florilegiumspecieslog\space#1=\flo@val}\fi}

% ---------------------------------------------------------------- a species
% Lehmer's generator answers seeds 1, 2, 3 ... with nearly proportional first values,
% so the first two are thrown away, as in florilegium-species.lua (M.WARM)
% A seed is a whole number from 1 to 2147483646, as pgf's generator takes it (pgfmanual,
% "a pseudo-random integer between 1 and 2^31 - 1"); another is an error and seed 1 is drawn,
% as the Lua engine does (\flo@badseed: #1 a macro holding the seed)
\def\flo@badseed#1{\pgfutil@packageerror{florilegium}{A seed is a whole number from 1 to
  2147483646, not #1}{Press return to draw seed 1}\def#1{1}}
\def\flo@seedcheck{\ifnum\pgfmath@rnd@z<1 \flo@seedreset\else
  \ifnum\pgfmath@rnd@z>2147483646 \flo@seedreset\fi\fi}
\def\flo@seedreset{\flo@badseed\flo@seedval\pgfmathsetseed{1}}
% \ifflo@roleok when #2 names a role in the table #1 (flo@role@ or flo@vrole@). \ifcsname
% stops a name at the first unexpandable token, so rose\relax would pass as rose: a role
% that passes is expanded (\flo@rq) and looked up again as a string
\newif\ifflo@roleok
\def\flo@isrole#1#2{\flo@roleokfalse
  \ifcsname #1#2\endcsname
    \protected@edef\flo@rq{#2}%
    \ifcsname #1\detokenize\expandafter{\flo@rq}\endcsname\flo@roleoktrue\fi
  \fi}
\def\florilegiumspecies{\pgfutil@ifnextchar[\flo@sample@species{\flo@sample@species[]}}
\def\flo@sample@species[#1]#2#3{%
  \flo@fixset{}{#1}%
  \flo@sample@plan{#2}{#3}%
  \flo@planfixcheck
  \ifflo@planbad
    \flo@fixclear\let\flo@o@traits\pgfutil@empty
    \edef\flo@tmp{\noexpand\flo@sample@plan{\flo@get{seed}}{\flo@get{role}}}\flo@tmp
  \fi
  \flo@set{plan}{\flo@val}\flo@logT{plan}%
  \csname flo@plan@\flo@val\endcsname
  \flo@fixclear}
% the seed, the role and the plan, into \flo@val
\def\flo@sample@plan#1#2{%
  \pgfmathsetseed{#1}\edef\flo@seedval{#1}\flo@seedcheck
  \pgfmathgeneratepseudorandomnumber\pgfmathgeneratepseudorandomnumber
  \flo@set{seed}{\flo@seedval}%
  \edef\florilegiumspecieslog{seed=\flo@seedval}%
  \flo@isrole{flo@role@}{#2}%
  \ifflo@roleok\flo@set{role}{\flo@rq}\else
    \flo@roleerror{#2}%
    \flo@set{role}{any}%
  \fi
  \csname flo@role@\flo@get{role}\endcsname
  \ifcsname flo@fix@plan\endcsname\edef\flo@val{\flo@fix@plan}\fi}
\def\flo@roleerror#1{\pgfutil@packageerror{florilegium}{No plant has the role `#1'}{A plant's
  role is hero, spray, monocot, any, or a body plan (rose, lily, pea, fern, ...); see
  docs/species.md. Press return to draw one of role any}}
\def\flo@vroleerror#1{\pgfutil@packageerror{florilegium}{No visitor has the role `#1'}{A
  visitor's role is bee, butterfly, moth, bird, beetle, fly, leaf, stem, perch, any, or a kind
  (ladybird, snail, ...); see docs/species.md. Press return to draw one of role any}}
% A fixed value that the plan's kind of plant cannot draw, as florilegium-species.lua's
% M.refused finds it: a name only the fern draws (\flo@fernonly@<trait>) on a flowering
% plant, or on a fern a leaf tip, edge or outline its frond has no table entry for
% (\flo@fernok@<trait>). The first, in the order the traits are drawn, is an error; the
% species is then sampled as without traits, and so is the rest of the pic. \flo@val is
% the plan.
\newif\ifflo@planbad
\def\flo@planfixcheck{\flo@planbadfalse
  \edef\flo@tmp{\noexpand\pgfutil@in@{,\flo@val,}{\flo@fernplans}}\flo@tmp
  \ifpgfutil@in@\def\flo@pffern{1}\else\def\flo@pffern{0}\fi
  \pgfutil@for\flo@pft:=\flo@traits\do{\ifflo@planbad\else
    \ifcsname flo@fix@\flo@pft\endcsname\flo@planfixone\fi\fi}}
\def\flo@planfixone{\edef\flo@pfv{\csname flo@fix@\flo@pft\endcsname}%
  \ifnum\flo@pffern=1
    \ifcsname flo@fernok@\flo@pft\endcsname
      \edef\flo@tmp{\noexpand\pgfutil@in@{,\flo@pfv,}{,\csname flo@fernok@\flo@pft\endcsname,}}\flo@tmp
      \ifpgfutil@in@\else
        \flo@planbadtrue
        \pgfutil@packageerror{florilegium}{\flo@pft=\flo@pfv\space is a flowering plant's; a
          fern's \flo@pft\space is one of \csname flo@fernok@\flo@pft\endcsname}{Press return
          to draw it as sampled, without the traits.}%
      \fi
    \fi
  \else
    \ifcsname flo@fernonly@\flo@pft\endcsname
      \expandafter\expandafter\expandafter\flo@planfixfl\csname flo@fernonly@\flo@pft\endcsname
    \fi
  \fi}
\def\flo@planfixfl#1#2{%
  \edef\flo@tmp{\noexpand\pgfutil@in@{,\flo@pfv,}{,#1,}}\flo@tmp
  \ifpgfutil@in@
    \flo@planbadtrue
    \pgfutil@packageerror{florilegium}{\flo@pft=\flo@pfv\space is a fern's; a flowering plant's
      \flo@pft\space is one of #2}{Press return to draw it as sampled, without the traits.}%
  \fi}

% ---------------------------------------------------------------- a visitor
% A visitor (a butterfly, a bee, a snail ...) is sampled as a plant is, its kind first,
% then its traits, into a namespace of its own: plants and visitors share trait names.
%
%   \florilegiumvisitor[<traits>]{<seed>}{<role>}   role: a flower's visitor (bee, butterfly, moth, bird,
%                                         beetle, fly), one off the flowers (leaf, stem, perch),
%                                         any, or a kind (ladybird)
%   \florilegiumvisitortrait{<trait>}     a trait of the visitor last drawn, e.g. {kind}, {spots}
\def\flo@xset#1#2{\expandafter\edef\csname flo@x@#1\endcsname{#2}}
\def\flo@xget#1{\csname flo@x@#1\endcsname}
\let\florilegiumvisitortrait\flo@xget
\def\flo@VT#1#2{#2\ifcsname flo@vfix@#1\endcsname\edef\flo@val{\csname flo@vfix@#1\endcsname}\fi
  \flo@xset{#1}{\flo@val}\flo@logT{#1}}
\def\flo@VBY#1#2{%
  \edef\flo@key{flo@d@#2@\flo@xget{#1}}%
  \ifcsname\flo@key\endcsname\else\edef\flo@key{flo@d@#2@_}\fi
  \csname\flo@key\endcsname}
\def\florilegiumvisitor{\pgfutil@ifnextchar[\flo@sample@visitor{\flo@sample@visitor[]}}
\def\flo@sample@visitor[#1]#2#3{%
  \flo@fixset{v}{#1}%
  \pgfmathsetseed{#2}\edef\flo@seedval{#2}\flo@seedcheck
  \pgfmathgeneratepseudorandomnumber\pgfmathgeneratepseudorandomnumber
  \flo@xset{seed}{\flo@seedval}%
  \edef\florilegiumspecieslog{seed=\flo@seedval}%
  \flo@isrole{flo@vrole@}{#3}%
  \ifflo@roleok\flo@xset{role}{\flo@rq}\else
    \flo@vroleerror{#3}%
    \flo@xset{role}{any}%
  \fi
  \csname flo@vrole@\flo@xget{role}\endcsname
  \ifcsname flo@vfix@kind\endcsname\edef\flo@val{\flo@vfix@kind}\fi
  \flo@xset{kind}{\flo@val}\flo@logT{kind}%
  \csname flo@vkind@\flo@val\endcsname
  \flo@fixclear}

% ---------------------------------------------------------------- tracery (board #5237)
% A window of Gothic tracery sampled from its genome (florilegium-species.lua's tracery
% family, the tables' \flo@trole@<role> and \flo@tkind@<kind>), as a species is: the kind
% first (window, headpiece, arcade, rose, foil), then its traits in \flo@ttraits order.
%   \florilegiumtracery{<seed>}{<role>}   role headpiece, window, frame, rose, ornament, any, or a kind
%   \florilegiumtracery[period=perpendicular, lights=5]{<seed>}{<role>}   those traits fixed
%   \florilegiumtracerytrait{<trait>}     a trait of the window last drawn, e.g. {kind}, {arch}
\def\flo@tset#1#2{\expandafter\edef\csname flo@t@#1\endcsname{#2}}
\def\flo@tget#1{\csname flo@t@#1\endcsname}
\let\florilegiumtracerytrait\flo@tget
\def\flo@TT#1#2{#2\ifcsname flo@tfix@#1\endcsname\edef\flo@val{\csname flo@tfix@#1\endcsname}\fi
  \flo@tset{#1}{\flo@val}\flo@logT{#1}}
\def\flo@TBY#1#2{%
  \edef\flo@key{flo@d@#2@\flo@tget{#1}}%
  \ifcsname\flo@key\endcsname\else\edef\flo@key{flo@d@#2@_}\fi
  \csname\flo@key\endcsname}
\def\florilegiumtracery{\pgfutil@ifnextchar[\flo@sample@tracery{\flo@sample@tracery[]}}
\def\flo@sample@tracery[#1]#2#3{%
  \flo@fixset{t}{#1}%
  \pgfmathsetseed{#2}\edef\flo@seedval{#2}\flo@seedcheck
  \pgfmathgeneratepseudorandomnumber\pgfmathgeneratepseudorandomnumber
  \flo@tset{seed}{\flo@seedval}%
  \edef\florilegiumspecieslog{seed=\flo@seedval}%
  \flo@isrole{flo@trole@}{#3}%
  \ifflo@roleok\flo@tset{role}{\flo@rq}\else
    \flo@troleerror{#3}%
    \flo@tset{role}{any}%
  \fi
  \csname flo@trole@\flo@tget{role}\endcsname
  \ifcsname flo@tfix@kind\endcsname\edef\flo@val{\flo@tfix@kind}\fi
  \flo@tset{kind}{\flo@val}\flo@logT{kind}%
  \csname flo@tkind@\flo@val\endcsname
  \flo@fixclear}
\def\flo@troleerror#1{\pgfutil@packageerror{florilegium}{No tracery has the role `#1'}{A
  window's role is headpiece, window, frame, rose, ornament, any, or a kind (arcade, foil);
  see docs/species.md. Press return to draw one of role any}}

% ---------------------------------------------------------------- shells (board #5335)
% A shell sampled from its genome (florilegium-species.lua's shell family, the tables'
% \flo@krole@<role> and \flo@kkind@<kind>), as a visitor is: the kind first (ammonite,
% nautilus, scallop, cockle, mussel, clam, oyster, whelk, turret, topshell, cowrie), which
% fixes its group (planispiral, bivalve, gastropod), then its traits in \flo@ktraits order.
% Its namespace is k (\flo@k@, \flo@kfix@, \flo@kok@), since the library's h names are taken.
%   \florilegiumshell{<seed>}{<role>}   role margin, ornament, planispiral, bivalve, gastropod, any, or a kind
%   \florilegiumshell[kind=scallop, ribs=18]{<seed>}{<role>}   those traits fixed
%   \florilegiumshelltrait{<trait>}     a trait of the shell last drawn, e.g. {kind}, {ribs}
\def\flo@kset#1#2{\expandafter\edef\csname flo@k@#1\endcsname{#2}}
\def\flo@kget#1{\csname flo@k@#1\endcsname}
\let\florilegiumshelltrait\flo@kget
\def\flo@KT#1#2{#2\ifcsname flo@kfix@#1\endcsname\edef\flo@val{\csname flo@kfix@#1\endcsname}\fi
  \flo@kset{#1}{\flo@val}\flo@logT{#1}}
\def\flo@KBY#1#2{%
  \edef\flo@key{flo@d@#2@\flo@kget{#1}}%
  \ifcsname\flo@key\endcsname\else\edef\flo@key{flo@d@#2@_}\fi
  \csname\flo@key\endcsname}
\def\florilegiumshell{\pgfutil@ifnextchar[\flo@sample@shell{\flo@sample@shell[]}}
\def\flo@sample@shell[#1]#2#3{%
  \flo@fixset{k}{#1}%
  \pgfmathsetseed{#2}\edef\flo@seedval{#2}\flo@seedcheck
  \pgfmathgeneratepseudorandomnumber\pgfmathgeneratepseudorandomnumber
  \flo@kset{seed}{\flo@seedval}%
  \edef\florilegiumspecieslog{seed=\flo@seedval}%
  \flo@isrole{flo@krole@}{#3}%
  \ifflo@roleok\flo@kset{role}{\flo@rq}\else
    \flo@kroleerror{#3}%
    \flo@kset{role}{any}%
  \fi
  \csname flo@krole@\flo@kget{role}\endcsname
  \ifcsname flo@kfix@kind\endcsname\edef\flo@val{\flo@kfix@kind}\fi
  \flo@kset{kind}{\flo@val}\flo@logT{kind}%
  \csname flo@kkind@\flo@val\endcsname
  \flo@fixclear}
\def\flo@kroleerror#1{\pgfutil@packageerror{florilegium}{No shell has the role `#1'}{A
  shell's role is margin, ornament, planispiral, bivalve, gastropod, any, or a kind (scallop,
  whelk, ...); see docs/traits.md. Press return to draw one of role any}}

% ================================================================ drawing
% Everything below draws through pgf's basic layer (\pgfpathmoveto, \pgfpathcurveto,
% \pgfusepath ...), with every control point computed here, one random draw per line, so
% that florilegium's Lua side can follow it step for step (florilegium-native.lua). A drawing
% works in local units (written as pt) that one \pgftransformscale maps to its size;
% line widths are absolute, as in florilegium-ink.lua.

% ---------------------------------------------------------------- loops and draws
\newcount\flo@i \newcount\flo@j \newcount\flo@n \newcount\flo@m \newcount\flo@p \newcount\flo@tdi
% \flo@loop{name}{\count}{from}{to}{body}: an ungrouped loop; each loop site has its own name
\def\flo@loop#1#2#3#4#5{%
  \expandafter\def\csname flo@b@#1\endcsname{#5}%
  #2=\numexpr#3\relax
  \flo@loop@{#1}#2{#4}}
\def\flo@loop@#1#2#3{%
  \ifnum#2>\numexpr#3\relax\expandafter\pgfutil@gobble\else\expandafter\pgfutil@firstofone\fi
  {\csname flo@b@#1\endcsname\advance#2 by1 \flo@loop@{#1}#2{#3}}}
% one draw each, so that the order of draws is the order of these lines (Lua mirrors it)
\def\flo@rnd#1{\pgfmathparse{rnd}\let#1\pgfmathresult}
\def\flo@range#1#2#3{\pgfmathparse{#2+(#3-(#2))*rnd}\let#1\pgfmathresult}
\def\flo@sym#1#2{\pgfmathparse{(#2)*rand}\let#1\pgfmathresult}
\def\flo@int#1#2#3{\pgfmathrandominteger#1{#2}{#3}}
\def\flo@calc#1#2{\pgfmathparse{#2}\let#1\pgfmathresult}
\def\flo@drawseed#1{\pgfmathsetseed{#1}\pgfmathgeneratepseudorandomnumber\pgfmathgeneratepseudorandomnumber}

% ---------------------------------------------------------------- points and paths
\def\flo@P#1#2{\pgfqpoint{#1pt}{#2pt}}
\def\flo@put#1#2#3{\expandafter\edef\csname flo@X#1\endcsname{#2}\expandafter\edef\csname flo@Y#1\endcsname{#3}}
\def\flo@x#1{\csname flo@X#1\endcsname}
\def\flo@y#1{\csname flo@Y#1\endcsname}
% control points of a closed Catmull-Rom curve through points 1..#1 (tension 1/6),
% kept in flo@A/B (first) and flo@C/D (second control point of the segment from i)
\def\flo@smoothprep#1{%
  \edef\flo@N{\the\numexpr#1\relax}%
  \flo@loop{sp}\flo@i{1}{\flo@N}{%
    \edef\flo@ia{\the\numexpr\ifnum\flo@i=1 \flo@N\else\flo@i-1\fi\relax}%
    \edef\flo@ib{\the\numexpr\ifnum\flo@i=\flo@N\space 1\else\flo@i+1\fi\relax}%
    \edef\flo@ic{\the\numexpr\ifnum\flo@ib=\flo@N\space 1\else\flo@ib+1\fi\relax}%
    \edef\flo@xi{\flo@x{\the\flo@i}}\edef\flo@yi{\flo@y{\the\flo@i}}%
    \edef\flo@xa{\flo@x\flo@ia}\edef\flo@ya{\flo@y\flo@ia}%
    \edef\flo@xb{\flo@x\flo@ib}\edef\flo@yb{\flo@y\flo@ib}%
    \edef\flo@xc{\flo@x\flo@ic}\edef\flo@yc{\flo@y\flo@ic}%
    \flo@calc\flo@t{\flo@xi+(\flo@xb-(\flo@xa))/6}\expandafter\let\csname flo@A\the\flo@i\endcsname\flo@t
    \flo@calc\flo@t{\flo@yi+(\flo@yb-(\flo@ya))/6}\expandafter\let\csname flo@B\the\flo@i\endcsname\flo@t
    \flo@calc\flo@t{\flo@xb-(\flo@xc-(\flo@xi))/6}\expandafter\let\csname flo@C\the\flo@i\endcsname\flo@t
    \flo@calc\flo@t{\flo@yb-(\flo@yc-(\flo@yi))/6}\expandafter\let\csname flo@D\the\flo@i\endcsname\flo@t}}
% the path of the curve prepared last
\def\flo@smoothpath{%
  \pgfpathmoveto{\flo@P{\flo@x1}{\flo@y1}}%
  \flo@loop{spp}\flo@i{1}{\flo@N}{%
    \edef\flo@ib{\the\numexpr\ifnum\flo@i=\flo@N\space 1\else\flo@i+1\fi\relax}%
    \pgfpathcurveto{\flo@P{\csname flo@A\the\flo@i\endcsname}{\csname flo@B\the\flo@i\endcsname}}%
      {\flo@P{\csname flo@C\the\flo@i\endcsname}{\csname flo@D\the\flo@i\endcsname}}%
      {\flo@P{\flo@x\flo@ib}{\flo@y\flo@ib}}}%
  \pgfpathclose}
% a closed blob around (#1,#2), radii #3 #4, six points; draws 6 numbers
\def\flo@blob#1#2#3#4{%
  \flo@loop{blob}\flo@j{1}{6}{%
    \flo@range\flo@t{0.7}{1.3}%
    \flo@calc\flo@bx{#1+(#3)*\flo@t*cos(60*\the\flo@j)}%
    \flo@calc\flo@by{#2+(#4)*\flo@t*sin(60*\the\flo@j)}%
    \flo@put{\the\flo@j}{\flo@bx}{\flo@by}}%
  \flo@smoothprep{6}\flo@smoothpath}
% a tapered streak from (#1,#2) (width #5) to (#3,#4), bowed sideways by #6
\def\flo@streak#1#2#3#4#5#6{%
  \flo@calc\flo@sa{#1-(#5)/2}\flo@calc\flo@sb{#1+(#5)/2}%
  \flo@calc\flo@sm{(#1+#3)/2+(#6)}\flo@calc\flo@sn{(#2+#4)/2}%
  \pgfpathmoveto{\flo@P{\flo@sa}{#2}}%
  \pgfpathcurveto{\flo@P{\flo@sa}{#2}}{\flo@P{\flo@sm}{\flo@sn}}{\flo@P{#3}{#4}}%
  \pgfpathcurveto{\flo@P{\flo@sm}{\flo@sn}}{\flo@P{\flo@sb}{#2}}{\flo@P{\flo@sb}{#2}}%
  \pgfpathclose}

% ---------------------------------------------------------------- color
% tone #2 (0 darkest, 1 palest) of the ink's ramp, or of the accent's when #3 is flo@accent
\def\flo@tone#1#2#3{%
  \def\flo@tmp{#3}\def\flo@tmpb{flo@accent}%
  \ifx\flo@tmp\flo@tmpb\let\flo@savedramp\flo@rampname\def\flo@rampname{flo@aramp}%
    \flo@vtone{#1}{#2}\let\flo@rampname\flo@savedramp
  \else\flo@vtone{#1}{#2}\fi}
% the document's ink and accent (florilegium.sty defines them), else florilegium's own;
% read again by every drawing, so a \definecolor{ink} later in the document counts. The
% tone ramp is computed from the ink when it changes (\flo@ramp, below).
\def\flo@colors{%
  \pgfutil@ifundefined{\string\color@ink}{\definecolor{flo@ink}{HTML}{2456C4}}{\colorlet{flo@ink}{ink}}%
  \pgfutil@ifundefined{\string\color@accent}{\definecolor{flo@accent}{HTML}{B4662F}}{\colorlet{flo@accent}{accent}}%
  \extractcolorspecs{flo@ink}{\flo@cmodel}{\flo@cspec}\convertcolorspec{\flo@cmodel}{\flo@cspec}{rgb}\flo@crgb
  \ifx\flo@crgb\flo@rampfor\else\global\let\flo@rampfor\flo@crgb\flo@ramp{flo@ramp}\fi
  \extractcolorspecs{flo@accent}{\flo@cmodel}{\flo@cspec}\convertcolorspec{\flo@cmodel}{\flo@cspec}{rgb}\flo@crgb
  \ifx\flo@crgb\flo@arampfor\else\global\let\flo@arampfor\flo@crgb\flo@ramp{flo@aramp}\fi
  \def\flo@rampname{flo@ramp}}
\def\flo@rampfor{}\def\flo@arampfor{}\def\flo@rampname{flo@ramp}

% #2 pairs of leaflets on a rachis above a short petiole, sized to peak mid-rachis, the
% upper turned further forward, none longer than #3 and short enough that neighbors barely
% overlap, then a terminal leaflet (odd-pinnate) or, where \flo@ptend is 1, a tendril,
% often forked, each branch coiling its own way (even-pinnate); along +y, length 1; #1 the
% leaf on the page in pt
\def\flo@pinnate#1#2#3{%
  \edef\flo@plpt{#1}\edef\flo@pk{#2}\edef\flo@pl{#3}%
  % the leaflets' half-width \flo@plw (as \flo@sshape@ has it): the largest pmax is as wide
  % as 0.9 of the gap between pairs; a terminal leaflet 1.1 times as long ends the rachis,
  % pairs from 0.2 to 0.03 below it
  \flo@calc\flo@plw{max(0.035,min(0.6,0.5/\flo@get{leafaspect}))}%
  \ifnum\flo@ptend=1
    \def\flo@pend{0.92}\flo@calc\flo@pgap{0.68/max(1,\flo@pk-1)}%
    \flo@calc\flo@pmax{min(\flo@pl,0.45*\flo@pgap/\flo@plw)}%
  \else
    \flo@calc\flo@pmax{min(\flo@pl,0.3465/(max(1,\flo@pk-1)*\flo@plw+0.495))}%
    \flo@calc\flo@pterm{min(\flo@pl,1.1*\flo@pmax)}\flo@calc\flo@pend{1-\flo@pterm}%
    \flo@calc\flo@pgap{(\flo@pend-0.23)/max(1,\flo@pk-1)}%
  \fi
  \pgfpathmoveto{\flo@P00}\pgfpathlineto{\flo@P0\flo@pend}\pgfusepath{stroke}%
  \flo@loop{pin}\flo@j{1}{\flo@pk}{%
    \flo@calc\flo@v{0.2+\flo@pgap*(\the\flo@j-1)}%
    \flo@calc\flo@ll{\flo@pmax*(0.72+0.28*sin(180*(\the\flo@j-0.5)/\flo@pk))}%
    \flo@loop{pinside}\flo@n{0}{1}{%
      \flo@range\flo@ang{50}{68}\flo@calc\flo@ang{\flo@ang-14*(\the\flo@j-1)/\flo@pk}\flo@sym\flo@dv{0.015}%
      \begin{pgfscope}%
        \flo@calc\flo@t{\flo@v+\flo@dv}\pgftransformshift{\flo@P0\flo@t}%
        \ifnum\flo@n=0 \pgftransformrotate{\flo@ang}\else\pgftransformrotate{-\flo@ang}\fi
        \pgftransformscale{\flo@ll}\flo@calc\flo@vl@u{\flo@plpt*\flo@ll/28.45276}%
        \flo@range\flo@tp{\flo@lt-0.07}{\flo@lt+0.07}\flo@sleaflet\flo@tp
      \end{pgfscope}}}%
  \ifnum\flo@ptend=1
    \flo@tone{flo@c}{0.22}{flo@ink}\pgfsetstrokecolor{flo@c}\pgfsetlinewidth{0.25pt}%
    \flo@chance{0.4}\ifflo@yes\def\flo@tdn{2}\else\def\flo@tdn{1}\fi
    \flo@loop{ten}\flo@tdi{1}{\flo@tdn}{%
      \begin{pgfscope}\pgftransformshift{\flo@P0\flo@pend}%
        \ifnum\flo@tdn=1 \flo@sym\flo@t{15}\else\flo@range\flo@t{10}{30}\ifnum\flo@tdi=2 \flo@calc\flo@t{-\flo@t}\fi\fi
        \pgftransformrotate{\flo@t}%
        \flo@range\flo@t{0.35}{0.55}\flo@vcurl\flo@t\flo@smoothopen{45}\pgfusepath{stroke}%
      \end{pgfscope}}%
  \else
    \begin{pgfscope}%
      \pgftransformshift{\flo@P0\flo@pend}\pgftransformscale{\flo@pterm}%
      \flo@calc\flo@vl@u{\flo@plpt*\flo@pterm/28.45276}\flo@sleaflet\flo@lt
    \end{pgfscope}%
  \fi}
% twice divided: two or three pairs of pinnae, themselves odd-pinnate, the lowest the
% longest with the most pinnules, and a terminal pinna: a feathery triangle (an
% umbellifer's leaf); #1 the leaf on the page in pt
\def\flo@bipinnate#1{%
  \edef\flo@bpt{#1}\def\flo@ptend{0}%
  \flo@calc\flo@bk{int(min(3,max(2,(\flo@get{leaflets}+1)/3)))}\flo@calc\flo@bl{int(min(7,max(3,\flo@get{leaflets})))}%
  \flo@calc\flo@lt{\flo@lt+0.06}%
  \pgfpathmoveto{\flo@P00}\pgfpathlineto{\flo@P0{0.7}}\pgfusepath{stroke}%
  \flo@loop{bip}\flo@m{1}{\flo@bk}{%
    \flo@calc\flo@bv{0.16+0.44*(\the\flo@m-1)/max(1,\flo@bk-1)}%
    \flo@calc\flo@bs{0.48*(1-0.5*(\the\flo@m-1)/\flo@bk)}%
    \flo@calc\flo@bpn{int(max(2,\flo@bl-\the\flo@m+1))}%
    \flo@loop{bipside}\flo@p{0}{1}{%
      \flo@range\flo@bang{48}{64}\flo@calc\flo@bang{\flo@bang-12*(\the\flo@m-1)/\flo@bk}%
      \begin{pgfscope}%
        \pgftransformshift{\flo@P0\flo@bv}%
        \ifnum\flo@p=0 \pgftransformrotate{\flo@bang}\else\pgftransformrotate{-\flo@bang}\fi
        \pgftransformscale{\flo@bs}\flo@calc\flo@t{\flo@bpt*\flo@bs}%
        \flo@pinnate\flo@t\flo@bpn{0.4}%
      \end{pgfscope}}}%
  \begin{pgfscope}%
    \pgftransformshift{\flo@P0{0.66}}\pgftransformscale{0.34}\flo@calc\flo@t{\flo@bpt*0.34}%
    \flo@calc\flo@bpn{int(max(2,\flo@bl-\flo@bk))}\flo@pinnate\flo@t\flo@bpn{0.4}%
  \end{pgfscope}}
% #2 leaflets from the tip of a petiole, spread wider the more there are, the center one
% the largest, drawn from the outside in; #1 the leaf on the page in pt
\def\flo@palmate#1#2{%
  \edef\flo@plpt{#1}\edef\flo@pk{#2}\flo@range\flo@pp{0.3}{0.38}%
  \pgfpathmoveto{\flo@P00}\pgfpathlineto{\flo@P0\flo@pp}\pgfusepath{stroke}%
  \flo@calc\flo@hs{min(135,20*\flo@pk-10)}%
  \flo@loop{palm}\flo@n{1}{\flo@pk}{%
    \ifodd\flo@n\edef\flo@pj{\the\numexpr(\flo@n+1)/2\relax}\else\edef\flo@pj{\the\numexpr\flo@pk+1-\flo@n/2\relax}\fi
    \flo@calc\flo@f{(\flo@pj-(\flo@pk+1)/2)/max(1,(\flo@pk-1)/2)}%
    \flo@sym\flo@dv{6}\flo@calc\flo@ang{-\flo@f*\flo@hs+\flo@dv}\flo@calc\flo@ll{(1-\flo@pp)*(1-0.45*\flo@f*\flo@f)}%
    \begin{pgfscope}%
      \pgftransformshift{\flo@P0\flo@pp}\pgftransformrotate{\flo@ang}\pgftransformscale{\flo@ll}%
      \flo@calc\flo@vl@u{\flo@plpt*\flo@ll/28.45276}%
      \flo@range\flo@tp{\flo@lt-0.06}{\flo@lt+0.06}\flo@sleaflet\flo@tp
    \end{pgfscope}}}
% three leaflets, two to the sides and a larger one at the end on a short stalk of its own;
% #1 the leaf on the page in pt
\def\flo@trifoliate#1{%
  \edef\flo@plpt{#1}\flo@range\flo@pp{0.3}{0.4}\flo@range\flo@pst{0}{0.1}%
  \flo@calc\flo@t{\flo@pp+\flo@pst}\pgfpathmoveto{\flo@P00}\pgfpathlineto{\flo@P0\flo@t}\pgfusepath{stroke}%
  \flo@loop{tri}\flo@n{0}{2}{%
    \ifnum\flo@n<2
      \flo@range\flo@ang{48}{68}\ifnum\flo@n=1 \flo@calc\flo@ang{-\flo@ang}\fi
      \flo@calc\flo@ll{0.8*(1-\flo@pp)}\edef\flo@pv{\flo@pp}%
    \else\def\flo@ang{0}\flo@calc\flo@ll{1-\flo@pp-\flo@pst}\flo@calc\flo@pv{\flo@pp+\flo@pst}\fi
    \begin{pgfscope}%
      \pgftransformshift{\flo@P0\flo@pv}\pgftransformrotate{\flo@ang}\pgftransformscale{\flo@ll}%
      \flo@calc\flo@vl@u{\flo@plpt*\flo@ll/28.45276}%
      \flo@range\flo@tp{\flo@lt-0.06}{\flo@lt+0.06}\flo@sleaflet\flo@tp
    \end{pgfscope}}}

% ---------------------------------------------------------------- stems, buds, fruits
\newcount\flo@ka \newcount\flo@kb \newcount\flo@kc
% a tapered stem from (#1,#2) to (#3,#4), bowed sideways by #5, widths #6 to #7
\def\flo@taper#1#2#3#4#5#6#7{%
  \flo@calc\flo@ta{#1-(#6)/2}\flo@calc\flo@tb{#1+(#6)/2}%
  \flo@calc\flo@tc{#3-(#7)/2}\flo@calc\flo@td{#3+(#7)/2}%
  \flo@calc\flo@tx{(2*(#1)+(#3))/3+(#5)}\flo@calc\flo@ty{(2*(#2)+(#4))/3}%
  \flo@calc\flo@tu{((#1)+2*(#3))/3+(#5)}\flo@calc\flo@tv{((#2)+2*(#4))/3}%
  \flo@calc\flo@te{\flo@tx-(#6)/2}\flo@calc\flo@tf{\flo@tu-(#7)/2}%
  \flo@calc\flo@tg{\flo@tu+(#7)/2}\flo@calc\flo@th{\flo@tx+(#6)/2}%
  \pgfpathmoveto{\flo@P\flo@ta{#2}}%
  \pgfpathcurveto{\flo@P\flo@te\flo@ty}{\flo@P\flo@tf\flo@tv}{\flo@P\flo@tc{#4}}%
  \pgfpathlineto{\flo@P\flo@td{#4}}%
  \pgfpathcurveto{\flo@P\flo@tg\flo@tv}{\flo@P\flo@th\flo@ty}{\flo@P\flo@tb{#2}}%
  \pgfpathclose}
% a thin stalk (a stroke) from (#1,#2) to (#3,#4), bowed by #5
\def\flo@stalk#1#2#3#4#5{%
  \flo@calc\flo@tx{((#1)+(#3))/2+(#5)}\flo@calc\flo@ty{((#2)+(#4))/2}%
  \pgfpathmoveto{\flo@P{#1}{#2}}\pgfpathcurveto{\flo@P\flo@tx\flo@ty}{\flo@P\flo@tx\flo@ty}{\flo@P{#3}{#4}}%
  \pgfusepath{stroke}}
% the fruit along +y, length 1, in v1.3's hand, by the species' fruit; \flo@fu its cm per
% unit (for line widths). A hip is flora's bud turned over in the accent, its sepals a
% crown on top; a capsule the bud upright with pale seams; pods, mericarps and achenes
% flora's leaflet blade; a pappus a seed clock (flora.seedhead's rays and tufts)
\def\flo@fruit{%
  \edef\flo@fr{\flo@get{fruit}}\def\flo@vf@tone{}%
  \def\flo@tmp{hip}\ifx\flo@fr\flo@tmp
    \begin{pgfscope}\def\flo@rampname{flo@aramp}\def\flo@vf@tone{0.36}%
      \pgftransformshift{\flo@P0{1}}\pgftransformrotate{180}\flo@vbud\flo@fu\end{pgfscope}%
  \else\def\flo@tmp{capsule}\ifx\flo@fr\flo@tmp
    \begin{pgfscope}\def\flo@vf@tone{0.38}\flo@vbud\flo@fu
      \def\flo@twa{0.025}\def\flo@twb{0.004}%
      \flo@vfill{white}{0.55}{0}{\flo@vtaper{-0.06}{0.15}{-0.1}{0.4}{-0.08}{0.7}{-0.02}{0.95}}%
      \flo@vfill{white}{0.4}{0}{\flo@vtaper{0.06}{0.15}{0.1}{0.4}{0.08}{0.7}{0.02}{0.95}}\end{pgfscope}%
  \else\def\flo@tmp{pappus}\ifx\flo@fr\flo@tmp
    \begin{pgfscope}\pgftransformshift{\flo@P0{0.5}}\flo@vclock\end{pgfscope}%
  \else
    % a pod (silique), a round pod (silicle), paired mericarps, or a seed: leaflet blades
    \def\flo@vl@tone{}\edef\flo@vl@u{\flo@fu}%
    \def\flo@tmp{silique}\ifx\flo@fr\flo@tmp
      \def\flo@vl@W{0.07}\flo@range\flo@vl@tone{0.3}{0.4}\flo@vleaflet
    \else\def\flo@tmp{silicle}\ifx\flo@fr\flo@tmp
      \begin{pgfscope}\pgftransformscale{0.6}\def\flo@vl@W{0.32}\flo@range\flo@vl@tone{0.42}{0.52}\flo@vleaflet\end{pgfscope}%
    \else\def\flo@tmp{schizocarp}\ifx\flo@fr\flo@tmp
      \begin{pgfscope}\pgftransformscale{0.7}\pgftransformrotate{12}\def\flo@vl@W{0.18}\flo@vleaflet\end{pgfscope}%
      \begin{pgfscope}\pgftransformscale{0.7}\pgftransformrotate{-12}\def\flo@vl@W{0.18}\flo@vleaflet\end{pgfscope}%
    \else
      \begin{pgfscope}\pgftransformscale{0.55}\def\flo@vl@W{0.22}\flo@range\flo@vl@tone{0.12}{0.2}\flo@vleaflet\end{pgfscope}%
    \fi\fi\fi
  \fi\fi\fi}
% a seed clock (flora.seedhead), radius 1 around the origin: hairline rays, each ending
% in a tuft, a gap where seeds have gone, a small dark head
\def\flo@vclock{%
  \flo@int\flo@cn{18}{26}\flo@range\flo@gone{0}{360}\flo@spk={}%
  \flo@loop{clk}\flo@Gc{1}{\flo@cn}{%
    \flo@sym\flo@t{0.3}\flo@calc\flo@a{360*(\the\flo@Gc+\flo@t)/\flo@cn}%
    \flo@rnd\flo@t\flo@calc\flo@t{abs(mod(\flo@a-\flo@gone+540,360)-180)<30 && \flo@t<0.7 ? 0 : 1}%
    \flo@range\flo@L{0.72}{0.86}%
    \ifdim\flo@t pt>0.5pt
      \flo@calc\flo@xa{0.1*cos(\flo@a)}\flo@calc\flo@ya{0.1*sin(\flo@a)}%
      \flo@calc\flo@xb{\flo@L*cos(\flo@a)}\flo@calc\flo@yb{\flo@L*sin(\flo@a)}%
      \edef\flo@tmp{\noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@xa}{\flo@ya}}\noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xb}{\flo@yb}}}%
      \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}%
      \flo@loop{tft}\flo@Gd{-2}{2}{%
        \flo@calc\flo@b{\flo@a+18*\the\flo@Gd}%
        \flo@calc\flo@xa{\flo@xb+0.16*cos(\flo@b)}\flo@calc\flo@ya{\flo@yb+0.16*sin(\flo@b)}%
        \edef\flo@tmp{\noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@xb}{\flo@yb}}\noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xa}{\flo@ya}}}%
        \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
    \fi}%
  \flo@vtone{flo@c}{0.16}\flo@vstroke{flo@c}{0.22}{0.85}{0}{\the\flo@spk}%
  \flo@vtone{flo@c}{0.12}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.13pt}}}

% ================================================================ plants in v1.3's manner
% The plant pics draw in centimeters, as florilegium-grow.lua lays out the margin, so that
% stems, leaves and flowers keep v1.3's sizes whatever the plant's height. A plant is a wavy
% main stem (a tapered ribbon), leaves at its nodes, branches that arc out to flowers,
% clusters, buds and curls, and its own inflorescence at the top. Several plants from one
% root are drawn a layer at a time (a pale ghost, stems, leaves, sprays, flowers), so that a
% flower lies over the next plant's leaves, as in the margin.
\newcount\flo@Ga \newcount\flo@Gb \newcount\flo@Gc \newcount\flo@Gd \newcount\flo@Np \newcount\flo@Ge \newcount\flo@Gf
\newif\ifflo@draw
% the layers, numbered as in florilegium-grow.lua; \flo@at{layer}: draw on that layer's walk
\def\flo@Lghost{1}\def\flo@Lstem{2}\def\flo@Lleaf{3}\def\flo@Lairy{4}\def\flo@Lbloom{5}
\def\flo@layer{0}
\def\flo@at#1{\ifnum\flo@layer=#1 \flo@drawtrue\else\flo@drawfalse\fi}

% ---------------------------------------------------------------- one stream per organ
% An organ draws from a stream of its own, started from one number of the plant's layout
% stream, which then goes on where it left off: what an organ draws never moves the layout,
% and each walk of a plant (one per layer) lays it out the same. The new state is the
% layout's, half the generator's cycle away; pgf's own seed parser stops at 16383.
\def\flo@seedorgan{\pgfmathgeneratepseudorandomnumber
  \edef\flo@os{\the\numexpr\ifnum\pgfmath@rnd@z>1073741823 \pgfmath@rnd@z-1073741823\else\pgfmath@rnd@z+1073741823\fi\relax}}
\def\flo@drawstate#1{\xdef\pgfmath@rnd@z{#1}\pgfmathgeneratepseudorandomnumber\pgfmathgeneratepseudorandomnumber}
\def\flo@organ#1{\let\flo@savez\pgfmath@rnd@z\flo@drawstate\flo@os
  \begin{pgfscope}#1\end{pgfscope}\global\let\pgfmath@rnd@z\flo@savez}

% ---------------------------------------------------------------- stems (flora.stem)
% an open Catmull-Rom curve through points 1..#1 of flo@X/Y (ink.smooth, open)
\def\flo@smoothopen#1{%
  \edef\flo@N{\the\numexpr#1\relax}%
  \pgfpathmoveto{\flo@P{\flo@x1}{\flo@y1}}%
  \flo@loop{so}\flo@i{1}{\flo@N-1}{%
    \edef\flo@ia{\the\numexpr\ifnum\flo@i=1 1\else\flo@i-1\fi\relax}%
    \edef\flo@ib{\the\numexpr\flo@i+1\relax}%
    \edef\flo@ic{\the\numexpr\ifnum\flo@ib=\flo@N\space\flo@N\else\flo@ib+1\fi\relax}%
    \flo@calc\flo@ca{\flo@x{\the\flo@i}+(\flo@x\flo@ib-(\flo@x\flo@ia))/6}%
    \flo@calc\flo@cb{\flo@y{\the\flo@i}+(\flo@y\flo@ib-(\flo@y\flo@ia))/6}%
    \flo@calc\flo@cc{\flo@x\flo@ib-(\flo@x\flo@ic-(\flo@x{\the\flo@i}))/6}%
    \flo@calc\flo@cd{\flo@y\flo@ib-(\flo@y\flo@ic-(\flo@y{\the\flo@i}))/6}%
    \pgfpathcurveto{\flo@P\flo@ca\flo@cb}{\flo@P\flo@cc\flo@cd}{\flo@P{\flo@x\flo@ib}{\flo@y\flo@ib}}}}
% flora.stem: along points 1..#1 of flo@X/Y (cm), full width #2 at the start to #3 at the
% end, tone #4: a filled ribbon, or a stroke where that would be under 0.7 bp wide
\def\flo@vstem#1#2#3#4{%
  \edef\flo@sn{\the\numexpr#1\relax}%
  \flo@calc\flo@t{((#2)+(#3))/2*28.3465}%
  \flo@vtone{flo@c}{#4}%
  \ifdim\flo@t pt<0.7pt
    \flo@vstroke{flo@c}{\flo@t}{1}{0}{\flo@smoothopen\flo@sn}%
  \else
    \flo@normals\flo@sn
    \def\flo@acc{0}\expandafter\def\csname flo@S1\endcsname{0}%
    \flo@loop{vsa}\flo@kb{2}{\flo@sn}{%
      \edef\flo@ia{\the\numexpr\flo@kb-1\relax}%
      \flo@calc\flo@acc{\flo@acc+veclen(\flo@x{\the\flo@kb}-(\flo@x\flo@ia),\flo@y{\the\flo@kb}-(\flo@y\flo@ia))}%
      \expandafter\let\csname flo@S\the\flo@kb\endcsname\flo@acc}%
    \flo@loop{vsr}\flo@kb{1}{\flo@sn}{%
      \flo@calc\flo@w{((#2)+((#3)-(#2))*\csname flo@S\the\flo@kb\endcsname/\flo@acc)/2}%
      \flo@calc\flo@xl{\flo@x{\the\flo@kb}+\csname flo@NX\the\flo@kb\endcsname*\flo@w}%
      \flo@calc\flo@yl{\flo@y{\the\flo@kb}+\csname flo@NY\the\flo@kb\endcsname*\flo@w}%
      \flo@calc\flo@xr{\flo@x{\the\flo@kb}-\csname flo@NX\the\flo@kb\endcsname*\flo@w}%
      \flo@calc\flo@yr{\flo@y{\the\flo@kb}-\csname flo@NY\the\flo@kb\endcsname*\flo@w}%
      \expandafter\let\csname flo@RX\the\flo@kb\endcsname\flo@xl\expandafter\let\csname flo@RY\the\flo@kb\endcsname\flo@yl
      \expandafter\let\csname flo@QX\the\flo@kb\endcsname\flo@xr\expandafter\let\csname flo@QY\the\flo@kb\endcsname\flo@yr}%
    \flo@loop{vso}\flo@kb{1}{\flo@sn}{%
      \flo@put{\the\flo@kb}{\csname flo@RX\the\flo@kb\endcsname}{\csname flo@RY\the\flo@kb\endcsname}%
      \flo@put{\the\numexpr2*\flo@sn+1-\flo@kb\relax}{\csname flo@QX\the\flo@kb\endcsname}{\csname flo@QY\the\flo@kb\endcsname}}%
    \flo@smoothprep{\the\numexpr2*\flo@sn\relax}\flo@vfill{flo@c}{1}{0}{\flo@smoothpath}%
  \fi}
% a stem along the cubic \flo@bxa,\flo@bya .. \flo@bxd,\flo@byd, widths #1 to #2 (cm), tone
% 0.07: ink.taper's two Béziers, or a stroke where under 0.7 bp
\def\flo@cubicstem#1#2{%
  \flo@calc\flo@t{((#1)+(#2))/2*28.3465}\flo@vtone{flo@c}{0.07}%
  \ifdim\flo@t pt<0.7pt
    \flo@vstroke{flo@c}{\flo@t}{1}{0}{\pgfpathmoveto{\flo@P\flo@bxa\flo@bya}%
      \pgfpathcurveto{\flo@P\flo@bxb\flo@byb}{\flo@P\flo@bxc\flo@byc}{\flo@P\flo@bxd\flo@byd}}%
  \else
    \edef\flo@twa{#1}\edef\flo@twb{#2}%
    \flo@vfill{flo@c}{1}{0}{\flo@vtaper\flo@bxa\flo@bya\flo@bxb\flo@byb\flo@bxc\flo@byc\flo@bxd\flo@byd}%
  \fi}

% ---------------------------------------------------------------- branches (flora.branch_path)
% from the stem point (#1,#2), whose stem runs along (#3,#4), to (#5,#6), arriving along
% (#7,#8): it leaves along the stem (or against it, if the target lies behind) turned 28..48
% degrees toward the target. One draw. The cubic: \flo@bxa,\flo@bya .. \flo@bxd,\flo@byd
\def\flo@branchpath#1#2#3#4#5#6#7#8{%
  \flo@calc\flo@dx{(#5)-(#1)}\flo@calc\flo@dy{(#6)-(#2)}\flo@calc\flo@d{veclen(\flo@dx,\flo@dy)}%
  \flo@calc\flo@t{(#3)*\flo@dx+(#4)*\flo@dy<-0.3*\flo@d ? -1 : 1}%
  \flo@calc\flo@tx{\flo@t*(#3)}\flo@calc\flo@ty{\flo@t*(#4)}%
  \flo@range\flo@turn{28}{48}%
  \flo@calc\flo@turn{(\flo@tx*\flo@dy-\flo@ty*\flo@dx>0 ? 1 : -1)*\flo@turn}%
  \flo@calc\flo@ox{\flo@tx*cos(\flo@turn)-\flo@ty*sin(\flo@turn)}%
  \flo@calc\flo@oy{\flo@tx*sin(\flo@turn)+\flo@ty*cos(\flo@turn)}%
  \edef\flo@bxa{#1}\edef\flo@bya{#2}\edef\flo@bxd{#5}\edef\flo@byd{#6}%
  \flo@calc\flo@bxb{(#1)+\flo@ox*\flo@d*0.45}\flo@calc\flo@byb{(#2)+\flo@oy*\flo@d*0.45}%
  \flo@calc\flo@bxc{(#5)-(#7)*\flo@d*0.4}\flo@calc\flo@byc{(#6)-(#8)*\flo@d*0.4}}
% the point at #1 on that cubic, \flo@cx,\flo@cy, and the direction there in degrees, \flo@ca
\def\flo@cubicat#1{%
  \flo@calc\flo@cu{1-(#1)}\edef\flo@cv{#1}%
  \flo@calc\flo@cwa{\flo@cu*\flo@cu*\flo@cu}\flo@calc\flo@cwb{3*\flo@cu*\flo@cu*\flo@cv}%
  \flo@calc\flo@cwc{3*\flo@cu*\flo@cv*\flo@cv}\flo@calc\flo@cwd{\flo@cv*\flo@cv*\flo@cv}%
  \flo@calc\flo@cx{\flo@cwa*\flo@bxa+\flo@cwb*\flo@bxb+\flo@cwc*\flo@bxc+\flo@cwd*\flo@bxd}%
  \flo@calc\flo@cy{\flo@cwa*\flo@bya+\flo@cwb*\flo@byb+\flo@cwc*\flo@byc+\flo@cwd*\flo@byd}%
  \flo@calc\flo@cwa{\flo@cu*\flo@cu}\flo@calc\flo@cwb{2*\flo@cu*\flo@cv}\flo@calc\flo@cwc{\flo@cv*\flo@cv}%
  \flo@calc\flo@dx{\flo@cwa*(\flo@bxb-\flo@bxa)+\flo@cwb*(\flo@bxc-\flo@bxb)+\flo@cwc*(\flo@bxd-\flo@bxc)}%
  \flo@calc\flo@dy{\flo@cwa*(\flo@byb-\flo@bya)+\flo@cwb*(\flo@byc-\flo@byb)+\flo@cwc*(\flo@byd-\flo@byc)}%
  \flo@calc\flo@ca{atan2(\flo@dy,\flo@dx)}}

% ---------------------------------------------------------------- flowers, buds, clusters
% one flower of the species at the origin, diameter #1 cm, at stage #2: below 0.3 a bud,
% above 1.15 its fruit, opening in between, past its best above 1 (paler and a little
% smaller as it fades). How it is seen follows its form and how it is held (\flo@bview):
% face on, at a tilt, from behind with its calyx, or in profile (bells, urns, tubes,
% trumpets, and flat-faced tubes held sideways)
\def\flo@bloom#1#2{%
  \edef\flo@bd{#1}\edef\flo@bst{#2}\flo@stone\flo@bview
  \ifdim\flo@bst pt<0.3pt
    \flo@calc\flo@oarg{0.55*\flo@bd}%
    \begin{pgfscope}\ifx\flo@vw\flo@Vface\else\pgftransformrotate{\flo@bturn}\fi
      \pgftransformscale{\flo@oarg}\flo@vbud\flo@oarg\end{pgfscope}%
  \else\ifdim\flo@bst pt>1.15pt
    \flo@calc\flo@fu{0.35*\flo@bd}%
    \begin{pgfscope}\pgftransformscale{\flo@fu}\flo@fruit\end{pgfscope}%
  \else
    \flo@sym\flo@t{30}\flo@calc\flo@bd{\flo@bd*min(1,0.55+(\flo@bst-0.3)*0.9)}%
    \ifdim\flo@bst pt>1pt \flo@calc\flo@bd{\flo@bd*(1-0.8*(\flo@bst-1))}\fi
    \begin{pgfscope}\ifx\flo@vw\flo@Vface\else\pgftransformrotate{\flo@bturn}\fi
      \ifdim\flo@bst pt>1pt \flo@calc\flo@lift{1-(1-\flo@lift)*(1-3*(\flo@bst-1))}\fi
      \ifx\flo@vw\flo@Vtube
        \flo@calc\flo@oarg{0.8*\flo@bd}\pgftransformscale{\flo@oarg}\flo@vtube\flo@oarg{}%
      \else\ifx\flo@vw\flo@Vtrumpet
        \flo@calc\flo@oarg{0.62*\flo@bd}\pgftransformscale{\flo@oarg}\flo@vtube\flo@oarg{lilytube}%
      \else\ifx\flo@vw\flo@Vturk
        \flo@calc\flo@oarg{0.42*\flo@bd}\pgftransformscale{\flo@oarg}\flo@vturkscap\flo@oarg
      \else\ifx\flo@vw\flo@Vsalver
        \pgftransformscale{\flo@bd}\flo@vsalver\flo@bd
      \else\ifx\flo@vw\flo@Vpea
        \flo@calc\flo@oarg{0.8*\flo@bd}\pgftransformscale{\flo@oarg}%
        \ifdim\flo@bturn pt<0pt \pgftransformxscale{-1}\fi\flo@vpea\flo@oarg
      \else\ifx\flo@vw\flo@Vlips
        \let\flo@oarg\flo@bd\pgftransformscale{\flo@oarg}%
        \ifdim\flo@bturn pt<0pt \pgftransformxscale{-1}\fi\flo@vlips\flo@oarg
      \else\ifx\flo@vw\flo@Vorchid
        \flo@upright\flo@calc\flo@oarg{0.4*\flo@t}\pgftransformrotate{\flo@oarg}%
        \flo@range\flo@oarg{0.75}{0.95}\pgftransformxscale{\flo@oarg}%
        \pgftransformscale{\flo@bd}\flo@vorchid\flo@bd
      \else\ifx\flo@vw\flo@Vspur
        \flo@calc\flo@oarg{0.75*\flo@bd}\pgftransformscale{\flo@oarg}\flo@vaquilegia\flo@oarg
      \else
        \def\flo@ys{1}%
        \ifx\flo@vw\flo@Vtilt\flo@range\flo@ys{0.5}{0.7}\fi
        \ifx\flo@vw\flo@Vback\flo@range\flo@ys{0.55}{0.75}\flo@calc\flo@lift{1-(1-\flo@lift)*0.85}\fi
        \ifdim\flo@ys pt<1pt
          \flo@calc\flo@oarg{0.12*\flo@bd}\pgftransformshift{\flo@P0\flo@oarg}\pgftransformyscale{\flo@ys}\fi
        \def\flo@tmp{iris}\ifx\flo@fm\flo@tmp\flo@upright\flo@calc\flo@t{0.6*\flo@t}\fi
        \pgftransformrotate{\flo@t}%
        \ifx\flo@fm\flo@tmp\flo@range\flo@oarg{0.72}{1}\pgftransformxscale{\flo@oarg}\fi
        \pgftransformscale{\flo@bd}%
        \flo@calc\flo@oarg{\flo@bd*28.45276}\flo@sflower\flo@oarg
        \ifx\flo@vw\flo@Vback\flo@vcalyx\fi
      \fi\fi\fi\fi\fi\fi\fi\fi
    \end{pgfscope}%
  \fi\fi}
% how a flower of the species is seen, \flo@vw: face (held erect), tilt (sideways), back
% (nodding), lily (a lily held sideways or nodding: flora's lily is drawn at a tilt
% already), tube (bells, urns, tubes and trumpets, always in profile), salver (a
% flat-faced tube held sideways or nodding), pea or lips (pea and two-lipped flowers,
% always in profile, their upper side toward the way they turn), orchid (face on, upright on
% the page, \flo@upright, leaning a little) or spur (a columbine held
% sideways or nodding, in profile); and how far it turns from its stalk,
% \flo@bturn degrees: a little for an erect tube, 50 to 80 when held sideways, 100 to 140
% when it nods, toward \flo@bside (1 its stalk's left, -1 its right; empty: one draw);
% in a head (\flo@bfan 1), where each flower already points away from the center, 5 to 25
% stand the current frame upright on the page (+y up), keeping its origin, its scale (the
% geometric mean of its axes') and its handedness: for flowers with an up and a down, an
% iris or an orchid, whichever way their stalk points. (No determinant: pgfmath overflows
% above 16384.) Its temporaries (\flo@ura to \flo@ury) are its own.
\def\flo@upright{%
  \pgfgettransformentries\flo@ura\flo@urb\flo@urc\flo@urd\flo@urx\flo@ury
  \flo@calc\flo@urp{veclen(\flo@ura,\flo@urb)}\flo@calc\flo@urq{veclen(\flo@urc,\flo@urd)}%
  \flo@calc\flo@urs{sqrt(\flo@urp)*sqrt(\flo@urq)}%
  \flo@calc\flo@urt{(\flo@ura/\flo@urp)*(\flo@urd/\flo@urq)-(\flo@urb/\flo@urp)*(\flo@urc/\flo@urq)}%
  \ifdim\flo@urt pt<0pt \flo@calc\flo@ura{-\flo@urs}\else\let\flo@ura\flo@urs\fi
  \pgfsettransformentries\flo@ura{0}{0}\flo@urs\flo@urx\flo@ury}
\def\flo@Vface{face}\def\flo@Vtilt{tilt}\def\flo@Vback{back}\def\flo@Vlily{lily}\def\flo@Vtube{tube}
\def\flo@Vturk{turk}\def\flo@Vtrumpet{trumpet}\def\flo@Vsalver{salver}\def\flo@Vpea{pea}\def\flo@Vlips{lips}\def\flo@Vorchid{orchid}\def\flo@Vspur{spur}\def\flo@Oerect{erect}\def\flo@Onod{nodding}\def\flo@bside{}
\def\flo@bfan{0}
\def\flo@bview{%
  \edef\flo@or{\flo@get{orient}}\edef\flo@fm{\flo@get{form}}\def\flo@bturn{0}%
  \ifx\flo@or\flo@Oerect\def\flo@vw{face}\else\ifx\flo@or\flo@Onod\def\flo@vw{back}\else\def\flo@vw{tilt}\fi
    \def\flo@tmp{lily}\ifx\flo@fm\flo@tmp\def\flo@vw{lily}%
      \ifdim\flo@get{reflex}pt<-40pt \def\flo@vw{turk}\else\ifdim\flo@get{cup}pt>0.6pt \def\flo@vw{trumpet}\fi\fi\fi
    \def\flo@tmp{salverform}\ifx\flo@fm\flo@tmp\def\flo@vw{salver}\fi\fi
  \def\flo@tmp{campanulate}\ifx\flo@fm\flo@tmp\def\flo@vw{tube}\fi
  \def\flo@tmp{urceolate}\ifx\flo@fm\flo@tmp\def\flo@vw{tube}\fi
  \def\flo@tmp{tubular}\ifx\flo@fm\flo@tmp\def\flo@vw{tube}\fi
  \def\flo@tmp{funnelform}\ifx\flo@fm\flo@tmp\def\flo@vw{tube}\fi
  \def\flo@tmp{papilionaceous}\ifx\flo@fm\flo@tmp\def\flo@vw{pea}\fi
  \def\flo@tmp{bilabiate}\ifx\flo@fm\flo@tmp\def\flo@vw{lips}\fi
  \def\flo@tmp{orchid}\ifx\flo@fm\flo@tmp\def\flo@vw{orchid}\fi
  \ifx\flo@or\flo@Oerect\else\def\flo@tmp{spurred}\ifx\flo@fm\flo@tmp\def\flo@vw{spur}\fi\fi
  \ifx\flo@or\flo@Oerect
    \ifx\flo@vw\flo@Vtube\flo@sym\flo@bturn{15}\fi
  \else
    \ifx\flo@bside\pgfutil@empty\flo@chance{0.5}\ifflo@yes\def\flo@bsd{1}\else\def\flo@bsd{-1}\fi
    \else\let\flo@bsd\flo@bside\fi
    \ifnum\flo@bfan=1 \flo@range\flo@t{5}{25}%
    \else\ifx\flo@or\flo@Onod\flo@range\flo@t{100}{140}\else\flo@range\flo@t{50}{80}\fi\fi
    \flo@calc\flo@bturn{\flo@bsd*\flo@t}%
  \fi}
% the calyx of a flower seen from behind, in its diameter-1 units: sepals radiating from
% the stalk, as many as its parts (three to six)
\def\flo@vcalyx{%
  \flo@calc\flo@bcn{int(max(3,min(6,\flo@get{merosity})))}\flo@range\flo@bca{0}{360}%
  \def\flo@twa{0.08}\def\flo@twb{0.004}\flo@vtone{flo@c}{0.1}%
  \flo@loop{bcx}\flo@ka{1}{\flo@bcn}{%
    \flo@sym\flo@t{8}\flo@calc\flo@a{\flo@bca+360*\the\flo@ka/\flo@bcn+\flo@t}%
    \flo@range\flo@t{0.26}{0.34}%
    \flo@calc\flo@xa{\flo@t*cos(\flo@a)}\flo@calc\flo@ya{\flo@t*sin(\flo@a)}%
    \flo@calc\flo@xb{0.4*\flo@xa-0.06*\flo@ya}\flo@calc\flo@yb{0.4*\flo@ya+0.06*\flo@xa}%
    \flo@calc\flo@xc{0.75*\flo@xa-0.04*\flo@ya}\flo@calc\flo@yc{0.75*\flo@ya+0.04*\flo@xa}%
    \flo@vfill{flo@c}{0.95}{0}{\flo@vtaper{0}{0}\flo@xb\flo@yb\flo@xc\flo@yc\flo@xa\flo@ya}}%
  \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.05pt}}}
% the species' corolla in profile, from its base at the origin toward +y, about 1 long:
% a bell, an urn, a tube or a trumpet (#2 empty: the species' form; salvertube: a flat-faced
% flower's tube), drawn as flora's bell is (body and lobed rim one shape, mottle, streaks
% along it, a shaded side, a pooled edge), bent a little, stamens that stand out, its sepals at the base; #1 cm per unit,
% tone \flo@vf@tone (empty: drawn). Its half-width at v (0 base, 1 the rim's sinuses) is
% \flo@tua+\flo@tub*v^\flo@tuc+\flo@tuw*sin(180*min(1,v/0.92)^0.85)+\flo@tuh*(1-(1-v)^2.5)+\flo@tue*v^6:
% a bell has a shoulder (\flo@tuh) and a flaring rim (\flo@tue), its lobes barely past it
\def\flo@vtube#1#2{%
  \edef\flo@tufm{#2}\ifx\flo@tufm\pgfutil@empty\edef\flo@tufm{\flo@get{form}}\fi
  \def\flo@tua{0.1}\def\flo@tub{0.24}\def\flo@tuc{1.3}\def\flo@tuw{0}\def\flo@tue{0}\def\flo@tuh{0}%
  \def\flo@tuL{0.85}\def\flo@tut{0.14}\def\flo@tusep{1}%
  \flo@range\flo@tuf{0.06}{0.12}\flo@calc\flo@tun{int(\flo@get{merosity}/2+1.5)}\ifnum\flo@tun=1 \def\flo@tun{0}\fi\flo@sym\flo@tubd{0.08}%
  \def\flo@tmp{campanulate}\ifx\flo@tufm\flo@tmp
    \def\flo@tua{0.06}\def\flo@tub{0}\def\flo@tuh{0.26}\def\flo@tue{0.07}\flo@calc\flo@tuf{0.35*\flo@tuf}\fi
  \def\flo@tmp{urceolate}\ifx\flo@tufm\flo@tmp
    \def\flo@tua{0.09}\def\flo@tub{0}\def\flo@tuw{0.25}\def\flo@tuL{0.8}\def\flo@tut{0.08}\def\flo@tuf{0.07}\fi
  \def\flo@tmp{tubular}\ifx\flo@tufm\flo@tmp
    \def\flo@tua{0.07}\def\flo@tub{0.07}\def\flo@tuc{1.5}\def\flo@tuw{0.025}\def\flo@tue{0.035}%
    \def\flo@tuL{0.95}\def\flo@tut{0.08}\def\flo@tuf{0.05}\flo@calc\flo@tubd{1.8*\flo@tubd}\fi
  \def\flo@tmp{funnelform}\ifx\flo@tufm\flo@tmp
    \def\flo@tua{0.05}\def\flo@tub{0.4}\def\flo@tuc{2.4}\def\flo@tuL{0.85}\def\flo@tut{0.1}\def\flo@tuf{0.1}\fi
  \def\flo@tmp{lilytube}\ifx\flo@tufm\flo@tmp
    \def\flo@tua{0.045}\def\flo@tub{0.32}\def\flo@tuc{2.8}\def\flo@tuL{0.95}\def\flo@tut{0.16}\def\flo@tuf{0.08}\def\flo@tun{4}\fi
  \def\flo@tmp{salvertube}\ifx\flo@tufm\flo@tmp
    \def\flo@tua{0.035}\def\flo@tub{0.02}\def\flo@tuc{1}\def\flo@tuL{0.55}\def\flo@tun{0}\fi
  \def\flo@tmp{liptube}\ifx\flo@tufm\flo@tmp
    \def\flo@tua{0.04}\def\flo@tub{0.06}\def\flo@tuc{1.6}\let\flo@tuL\flo@lpL\def\flo@tun{0}\let\flo@tubd\flo@lpb
    \def\flo@tusep{0}\fi
  \def\flo@tmp{aqcup}\ifx\flo@tufm\flo@tmp
    \def\flo@tua{0.12}\def\flo@tub{0.04}\def\flo@tuc{1}\def\flo@tuL{0.32}\def\flo@tut{0.08}\def\flo@tusep{0}\fi
  \edef\flo@t{\flo@get{apex}}\def\flo@tutk{0.7}%
  \def\flo@tmp{rounded}\ifx\flo@t\flo@tmp\def\flo@tutk{1}\flo@calc\flo@tut{0.7*\flo@tut}\fi
  \def\flo@tmp{emarginate}\ifx\flo@t\flo@tmp\def\flo@tutk{1}\flo@calc\flo@tut{0.7*\flo@tut}\fi
  % the outline: the right side up, the lobes along the rim from right to left, the left down;
  % a large one's sides waver as a petal's edge does
  \ifdim#1pt>0.45pt \flo@vfbm\def\flo@tuwob{0.015}\else\def\flo@tuwob{0}\fi
  \flo@loop{tur}\flo@kb{0}{10}{%
    \flo@calc\flo@v{\the\flo@kb/10}\flo@turad\flo@v\flo@calc\flo@tuy{\flo@tuL*\flo@v}%
    \flo@calc\flo@xa{\flo@tur+\flo@tubd*\flo@v*\flo@v}%
    \ifdim\flo@tuwob pt>0pt \flo@calc\flo@tuwx{\flo@v*6}\flo@vwave\flo@tuwx\flo@calc\flo@xa{\flo@xa+\flo@tuwob*\flo@wv*\flo@v}\fi
    \flo@put{\the\numexpr\flo@kb+1\relax}\flo@xa\flo@tuy}%
  \flo@calc\flo@tuR{\flo@tur+\flo@tuf}\def\flo@tuk{11}%
  \ifnum\flo@tun>0
    \flo@loop{tut}\flo@kc{1}{\flo@tun}{%
      \flo@calc\flo@v{1-2*(\the\flo@kc-1)/(\flo@tun-1)}%
      \flo@sym\flo@t{0.03}\flo@calc\flo@xa{\flo@tuR*\flo@v+\flo@tubd+\flo@t}%
      \flo@sym\flo@t{0.02}\flo@calc\flo@ya{\flo@tuL+\flo@tut*(1-0.55*\flo@v*\flo@v)+\flo@t}%
      \edef\flo@tuk{\the\numexpr\flo@tuk+1\relax}\flo@put\flo@tuk\flo@xa\flo@ya
      \ifnum\flo@kc<\flo@tun
        \flo@calc\flo@xa{\flo@tuR*0.85*(\flo@v-1/(\flo@tun-1))+\flo@tubd}%
        \flo@sym\flo@t{0.015}\flo@calc\flo@ya{\flo@tuL+0.025+\flo@t}%
        \edef\flo@tuk{\the\numexpr\flo@tuk+1\relax}\flo@put\flo@tuk\flo@xa\flo@ya
      \fi}%
  \fi
  \flo@loop{tul}\flo@kb{0}{10}{%
    \flo@calc\flo@v{(10-\the\flo@kb)/10}\flo@turad\flo@v\flo@calc\flo@tuy{\flo@tuL*\flo@v}\flo@calc\flo@tur{\flo@tubd*\flo@v*\flo@v-\flo@tur}%
    \ifdim\flo@tuwob pt>0pt \flo@calc\flo@tuwx{\flo@v*6+40}\flo@vwave\flo@tuwx\flo@calc\flo@tur{\flo@tur+\flo@tuwob*\flo@wv*\flo@v}\fi
    \edef\flo@tuk{\the\numexpr\flo@tuk+1\relax}\flo@put\flo@tuk\flo@tur\flo@tuy}%
  \flo@smoothprepT\flo@tuk\flo@tutk\flo@keep{tb}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@tuq{0.3}{0.4}\else\edef\flo@tuq{\flo@vf@tone}\fi
  \flo@vtone{flo@c}{\flo@tuq}\flo@vfill{flo@c}{1}{0}{\flo@kept{tb}}%
  \ifdim#1pt>0.15pt
    \begin{pgfscope}\flo@kept{tb}\pgfusepath{clip}%
      \flo@calc\flo@tuqa{\flo@tuq-0.2}\flo@calc\flo@tuqb{\flo@tuq+0.2}\flo@calc\flo@tuy{\flo@tuL+0.2}%
      \ifdim#1pt>0.45pt \flo@vmottle{-0.5}{0}{0.5}\flo@tuy{10}{0.12}\flo@tuqa\flo@tuqb{10}%
      \else\flo@vmottle{-0.5}{0}{0.5}\flo@tuy{5}{0.12}\flo@tuqa\flo@tuqb{0}\fi
      % the far side in shadow, deepening toward its edge, the shade's edge following the
      % body's curve (at 0.12 and 0.6 of its half-width)
      \flo@chance{0.5}\ifflo@yes\def\flo@sd{1}\else\def\flo@sd{-1}\fi
      \flo@calc\flo@xc{2*\flo@sd}\flo@vtone{flo@c}{0.12}\flo@calc\flo@yc{\flo@tuL+\flo@tut+0.1}%
      \flo@tushade{0.12}{0.2}\flo@tushade{0.6}{0.16}%
      % streaks along the body, white and dark by turns
      \def\flo@twa{0.02}\def\flo@twb{0.012}%
      \flo@loop{tus}\flo@ka{-2}{2}{%
        \flo@calc\flo@f{\the\flo@ka/2.5}%
        \flo@turad{0.05}\flo@calc\flo@xa{\flo@f*\flo@tur*0.9+\flo@tubd*0.0025}\flo@calc\flo@ya{0.05*\flo@tuL}%
        \flo@turad{0.4}\flo@calc\flo@xb{\flo@f*\flo@tur*0.9+\flo@tubd*0.16}\flo@calc\flo@yb{0.4*\flo@tuL}%
        \flo@turad{0.75}\flo@calc\flo@xc{\flo@f*\flo@tur*0.9+\flo@tubd*0.5625}\flo@calc\flo@yc{0.75*\flo@tuL}%
        \flo@sym\flo@t{0.03}\flo@calc\flo@xd{\flo@f*\flo@tuR*0.95+\flo@tubd+\flo@t}\flo@calc\flo@yd{\flo@tuL+0.06}%
        \ifodd\flo@ka
          \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{0.3}{1}{\flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}%
        \else\flo@vfill{white}{0.55}{0}{\flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}\fi}%
      \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{1.5*(#1)}\flo@vstroke{flo@c}{\flo@t}{0.3}{1}{\flo@kept{tb}}%
    \end{pgfscope}%
  \fi
  \flo@vtone{flo@c}{0.08}\flo@vstroke{flo@c}{0.18}{0.35}{0}{\flo@kept{tb}}%
  % stamens that stand out of the mouth
  \edef\flo@t{\flo@get{stamens}}\def\flo@tmp{exserted}%
  \ifx\flo@t\flo@tmp\ifnum\flo@tun>0
    \flo@loop{tum}\flo@ka{-1}{1}{%
      \flo@calc\flo@xa{\the\flo@ka*0.02+0.36*\flo@tubd}\flo@calc\flo@ya{0.6*\flo@tuL}%
      \flo@sym\flo@t{0.02}\flo@calc\flo@xb{\the\flo@ka*0.08+1.2*\flo@tubd+\flo@t}%
      \flo@range\flo@t{0.18}{0.32}\flo@calc\flo@yb{\flo@tuL+\flo@t}%
      \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{0.25}{0.85}{0}{\pgfpathmoveto{\flo@P\flo@xa\flo@ya}\pgfpathlineto{\flo@P\flo@xb\flo@yb}}%
      \flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P\flo@xb\flo@yb}{0.018pt}}}%
  \fi\fi
  % the sepals, hugging the base (a two-lipped flower's calyx is its own)
  \ifnum\flo@tusep=1
    \def\flo@twa{0.07}\def\flo@twb{0.004}\flo@vtone{flo@c}{0.1}%
    \flo@loop{tuc}\flo@ka{-1}{1}{%
      \flo@sym\flo@t{0.03}%
      \flo@calc\flo@xa{\the\flo@ka*0.04}\flo@calc\flo@xb{\the\flo@ka*0.07}%
      \flo@calc\flo@xd{\the\flo@ka*(\flo@tua+0.07)+\flo@t}\flo@calc\flo@xc{0.9*\flo@xd}%
      \flo@vfill{flo@c}{0.95}{0}{\flo@vtaper\flo@xa{-0.03}\flo@xb{0.06}\flo@xc{0.14}\flo@xd{0.22}}}%
    \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P0{-0.02}}{0.05pt}}%
  \fi}
% the half-width of \flo@vtube's body at #1 (0..1): \flo@tur
\def\flo@turad#1{%
  \edef\flo@tur{\flo@tua}%
  \ifdim#1pt>0pt
    \ifdim\flo@tub pt>0pt \flo@calc\flo@tur{\flo@tur+\flo@tub*pow(#1,\flo@tuc)}\fi
    \ifdim\flo@tuw pt>0pt \flo@calc\flo@tur{\flo@tur+\flo@tuw*sin(180*pow(min(1,(#1)/0.92),0.85))}\fi
    \ifdim\flo@tuh pt>0pt \flo@calc\flo@tur{\flo@tur+\flo@tuh*(1-pow(1-(#1),2.5))}\fi
    \ifdim\flo@tue pt>0pt \flo@calc\flo@tur{\flo@tur+\flo@tue*pow(#1,6)}\fi
  \fi}
% \flo@vtube's shade from #1 of the half-width on the side \flo@sd out to \flo@xc, opacity #2
% (multiplied), in \flo@c
\def\flo@tushade#1#2{%
  \flo@calc\flo@xa{\flo@sd*(#1)*\flo@tua}%
  \flo@vfill{flo@c}{#2}{1}{\pgfpathmoveto{\flo@P\flo@xa{-0.1}}%
    \flo@loop{tsh}\flo@kb{0}{10}{%
      \flo@calc\flo@v{\the\flo@kb/10}\flo@turad\flo@v
      \flo@calc\flo@xa{\flo@sd*(#1)*\flo@tur+\flo@tubd*\flo@v*\flo@v}\flo@calc\flo@ya{\flo@tuL*\flo@v}%
      \pgfpathlineto{\flo@P\flo@xa\flo@ya}}%
    \flo@calc\flo@xa{\flo@sd*(#1)*\flo@tuR+\flo@tubd}%
    \pgfpathlineto{\flo@P\flo@xa\flo@yc}\pgfpathlineto{\flo@P\flo@xc\flo@yc}\pgfpathlineto{\flo@P\flo@xc{-0.1}}\pgfpathclose}}
% a flat-faced tube (salverform) held sideways: a slender tube, its face at a tilt on top,
% in diameter-1 units; #1 the diameter in cm
\def\flo@vsalver#1{%
  \edef\flo@sva{#1}\flo@vtube\flo@sva{salvertube}%
  \flo@range\flo@t{0.3}{0.45}%
  \begin{pgfscope}\pgftransformshift{\flo@P0{0.55}}\pgftransformyscale{\flo@t}\flo@sym\flo@t{30}\pgftransformrotate{\flo@t}%
    \flo@calc\flo@oarg{\flo@sva*28.45276}\flo@sflower\flo@oarg\end{pgfscope}}
% a pea flower in profile (papilionaceous), in \flo@vtube's units: its base at the origin,
% toward +y, about 1 long, its standard on the +x side (the upper side: \flo@bloom
% mirrors it). Flora's petals: the standard broad and notched, raised and bent back, the
% keel a pointed boat that curves up to its beak, the near wing over it, a toothed calyx
% in front; #1 cm per unit
\def\flo@vpea#1{%
  \edef\flo@pvu{#1}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@pvq{0.3}{0.4}\else\edef\flo@pvq{\flo@vf@tone}\fi
  \def\flo@vp@ns{}\def\flo@vp@heart{0}%
  % the standard
  \flo@range\flo@pva{8}{28}\flo@range\flo@pvl{0.55}{0.7}\flo@range\flo@pvw{0.75}{0.95}%
  \begin{pgfscope}\pgftransformshift{\flo@P{0.04}{0.2}}\flo@calc\flo@t{-90-\flo@pva}\pgftransformrotate{\flo@t}%
    \pgftransformscale{\flo@pvl}\pgftransformxscale{\flo@pvw}%
    \def\flo@vp@pointed{0}\def\flo@vp@W{0.5}\def\flo@vp@bend{}\def\flo@vp@heart{1}%
    \def\flo@vp@notchp{0.8}\def\flo@vp@notchk{1.4}\edef\flo@vp@tone{\flo@pvq}%
    \flo@calc\flo@vp@u{\flo@pvu*\flo@pvl}\flo@vpetal
    % guides: dark lines from its base
    \edef\flo@t{\flo@get{guides}}\def\flo@tmp{none}%
    \ifx\flo@t\flo@tmp\else\ifdim\flo@vp@u pt>0.12pt
      \flo@vtone{flo@c}{0.06}\def\flo@twb{0.004}%
      \flo@loop{pvg}\flo@ka{-2}{2}{%
        \flo@sym\flo@t{0.03}\flo@calc\flo@f{\the\flo@ka*0.1+\flo@t}\flo@range\flo@len{0.3}{0.45}%
        \flo@calc\flo@len{\flo@len*(1-1.5*\flo@f*\flo@f)}\def\flo@twa{0.04}%
        \flo@calc\flo@xa{0.2*\flo@f}\flo@calc\flo@xb{0.6*\flo@f}\flo@calc\flo@xc{0.9*\flo@f}\flo@calc\flo@xd{1.1*\flo@f}%
        \flo@calc\flo@yb{0.35*\flo@len+0.05}\flo@calc\flo@yc{0.7*\flo@len+0.05}\flo@calc\flo@yd{\flo@len+0.05}%
        \flo@vfill{flo@c}{0.45}{1}{\flo@vtaper\flo@xa{0.05}\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}}%
    \fi\fi
  \end{pgfscope}%
  % the keel, paler
  \flo@range\flo@pvk{0.58}{0.68}\flo@range\flo@t{8}{16}%
  \begin{pgfscope}\pgftransformshift{\flo@P{-0.03}{0.2}}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@pvk}%
    \def\flo@vp@pointed{1}\def\flo@vp@W{0.12}\flo@range\flo@vp@bend{0.22}{0.32}%
    \flo@calc\flo@vp@tone{\flo@pvq+0.12}\flo@calc\flo@vp@u{\flo@pvu*\flo@pvk}\flo@vpetal\end{pgfscope}%
  % the near wing, along the keel
  \flo@range\flo@pvn{0.44}{0.52}\flo@range\flo@t{0}{8}%
  \begin{pgfscope}\pgftransformshift{\flo@P{0.02}{0.21}}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@pvn}%
    \def\flo@vp@pointed{0}\def\flo@vp@W{0.26}\flo@range\flo@vp@bend{0}{0.08}\def\flo@vp@notchp{0}\def\flo@vp@ns{3}%
    \flo@calc\flo@vp@tone{\flo@pvq-0.03}\flo@calc\flo@vp@u{\flo@pvu*\flo@pvn}\flo@vpetal\end{pgfscope}%
  \flo@vcup\flo@pvu{0.9}}
% the calyx of a flower in profile: a cup, three of its five teeth seen, from the
% origin toward +y, about 0.27 long times #2; #1 cm per unit
\def\flo@vcup#1#2{%
  \edef\flo@cuy{#2}%
  \flo@calc\flo@ya{0.08*\flo@cuy}\flo@calc\flo@yb{0.17*\flo@cuy}\flo@calc\flo@yc{0.2*\flo@cuy}%
  \flo@put1{0.03}{-0.03}\flo@put2{0.068}\flo@ya\flo@put3{0.085}\flo@yb
  \flo@sym\flo@t{0.02}\flo@calc\flo@yd{0.25*\flo@cuy+\flo@t}\flo@put4{0.11}\flo@yd
  \flo@put5{0.055}\flo@yc
  \flo@sym\flo@t{0.02}\flo@calc\flo@yd{0.27*\flo@cuy+\flo@t}\flo@put6{0.013}\flo@yd
  \flo@put7{-0.03}\flo@yc
  \flo@sym\flo@t{0.02}\flo@calc\flo@yd{0.26*\flo@cuy+\flo@t}\flo@put8{-0.08}\flo@yd
  \flo@calc\flo@yd{0.15*\flo@cuy}\flo@put9{-0.085}\flo@yd\flo@calc\flo@yd{0.06*\flo@cuy}\flo@put{10}{-0.064}\flo@yd
  \flo@put{11}{-0.03}{-0.03}%
  \flo@smoothprepT{11}{0.7}\flo@keep{cup}%
  \flo@vtone{flo@c}{0.12}\flo@vfill{flo@c}{0.95}{0}{\flo@kept{cup}}%
  \ifdim#1pt>0.15pt
    \def\flo@twa{0.03}\def\flo@twb{0.004}\flo@calc\flo@yb{0.08*\flo@cuy}\flo@calc\flo@yc{0.14*\flo@cuy}\flo@calc\flo@yd{0.22*\flo@cuy}%
    \flo@vfill{white}{0.4}{0}{\flo@vtaper{0.034}{0.01}{0.055}\flo@yb{0.068}\flo@yc{0.085}\flo@yd}%
    \flo@vtone{flo@c}{0.06}\flo@vstroke{flo@c}{0.18}{0.4}{0}{\flo@kept{cup}}%
  \fi
  \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P0{-0.02}}{0.045pt}}}
% a two-lipped flower in profile (bilabiate), in \flo@vtube's units, its hood on the +x
% side: flora's petals, a broad lower lip that spreads forward and droops, with the
% species' guides on it, and a hood that arches forward over the mouth, stamens under it
% when they stand out; then the tube and the calyx (\flo@vtube's liptube, as long as
% \flo@lpL); #1 cm per unit
\def\flo@vlips#1{%
  \edef\flo@lpu{#1}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@lpq{0.3}{0.4}\else\edef\flo@lpq{\flo@vf@tone}\fi
  \flo@range\flo@lpL{0.55}{0.68}\flo@sym\flo@lpb{0.06}%
  \def\flo@vp@ns{}\def\flo@vp@heart{0}\def\flo@vp@pointed{0}%
  % the lower lip
  \flo@range\flo@lpa{35}{55}\flo@range\flo@lpl{0.3}{0.4}%
  \begin{pgfscope}\flo@calc\flo@xa{\flo@lpb-0.05}\flo@calc\flo@ya{\flo@lpL-0.03}\pgftransformshift{\flo@P\flo@xa\flo@ya}%
    \pgftransformrotate{\flo@lpa}\pgftransformscale{\flo@lpl}%
    \def\flo@vp@W{0.42}\flo@range\flo@vp@bend{-0.25}{-0.1}\def\flo@vp@notchp{0.6}\def\flo@vp@notchk{1.4}\def\flo@vp@ns{5}%
    \flo@calc\flo@vp@tone{\flo@lpq+0.05}\flo@calc\flo@vp@u{\flo@lpu*\flo@lpl}\flo@vpetal
    \edef\flo@t{\flo@get{guides}}%
    \ifdim\flo@vp@u pt>0.1pt
      \def\flo@tmp{dots}\ifx\flo@t\flo@tmp
        \flo@spk={}%
        \flo@loop{lpd}\flo@ka{1}{7}{%
          \flo@sym\flo@xa{0.22}\flo@range\flo@ya{0.12}{0.55}\flo@range\flo@r{0.025}{0.045}%
          \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xa}{\flo@ya}}{\flo@r pt}}%
          \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
        \flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{0.7}{1}{\the\flo@spk}\fi
      \def\flo@tmp{lines}\ifx\flo@t\flo@tmp
        \flo@vtone{flo@c}{0.06}\def\flo@twa{0.035}\def\flo@twb{0.004}%
        \flo@loop{lpg}\flo@ka{-1}{1}{%
          \flo@sym\flo@t{0.03}\flo@calc\flo@f{\the\flo@ka*0.12+\flo@t}\flo@range\flo@len{0.35}{0.5}%
          \flo@calc\flo@xb{0.5*\flo@f}\flo@calc\flo@xc{0.8*\flo@f}\flo@calc\flo@xd{\flo@f}%
          \flo@calc\flo@yb{0.35*\flo@len+0.05}\flo@calc\flo@yc{0.7*\flo@len+0.05}\flo@calc\flo@yd{\flo@len+0.05}%
          \flo@vfill{flo@c}{0.5}{1}{\flo@vtaper{0}{0.05}\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}}\fi
    \fi
  \end{pgfscope}%
  % the hood
  \flo@range\flo@lpa{-80}{-68}\flo@range\flo@lph{0.36}{0.44}%
  \begin{pgfscope}\flo@calc\flo@xa{\flo@lpb+0.05}\flo@calc\flo@ya{\flo@lpL-0.04}\pgftransformshift{\flo@P\flo@xa\flo@ya}%
    \pgftransformrotate{\flo@lpa}\pgftransformscale{\flo@lph}%
    \def\flo@vp@W{0.26}\flo@range\flo@vp@bend{-1.1}{-0.85}\def\flo@vp@notchp{0.4}\def\flo@vp@notchk{1}\def\flo@vp@ns{3}%
    \edef\flo@vp@tone{\flo@lpq}\flo@calc\flo@vp@u{\flo@lpu*\flo@lph}\flo@vpetal\end{pgfscope}%
  % stamens that stand out, under the hood
  \edef\flo@t{\flo@get{stamens}}\def\flo@tmp{exserted}%
  \ifx\flo@t\flo@tmp
    \flo@loop{lps}\flo@ka{0}{1}{%
      \flo@calc\flo@xa{\flo@lpb+0.02}\flo@calc\flo@ya{\flo@lpL}%
      \flo@range\flo@t{0.1}{0.2}\flo@calc\flo@xb{\flo@xa+\flo@t+0.04*\the\flo@ka}%
      \flo@range\flo@t{0.3}{0.42}\flo@calc\flo@yb{\flo@ya+\flo@t-0.05*\the\flo@ka}%
      \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{0.25}{0.85}{0}{\pgfpathmoveto{\flo@P\flo@xa\flo@ya}\pgfpathlineto{\flo@P\flo@xb\flo@yb}}%
      \flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P\flo@xb\flo@yb}{0.018pt}}}%
  \fi
  \flo@vtube\flo@lpu{liptube}\flo@vcup\flo@lpu{1.1}}
% the species' flower diameter on the page, cm, times #1
\def\flo@fdiam#1{\flo@calc\flo@fd{min(2.8,0.7+0.032*\flo@get{size})*(#1)}}
% v1.3's blossoms: two to five flowers of the species on curved stalks from the origin,
% diameter #1, the stage #2 of the first to open; a bud at the fork
\def\flo@blossoms#1#2{%
  \edef\flo@bfd{#1}\edef\flo@bst{#2}\edef\flo@oo{\flo@get{openorder}}%
  \flo@int\flo@bn{2}{4}\ifnum\flo@get{count}>9 \edef\flo@bn{\the\numexpr\flo@bn+1\relax}\fi
  \flo@loop{blsm}\flo@Gc{1}{\flo@bn}{%
    \flo@calc\flo@f{\the\flo@Gc-(\flo@bn+1)/2}%
    \flo@sym\flo@t{10}\flo@calc\flo@a{\flo@f*38+\flo@t}%
    \flo@range\flo@t{0.55}{0.95}\flo@calc\flo@dd{\flo@bfd*\flo@t}%
    \ifnum\flo@Gc>1 \flo@range\flo@t{0.85}{1.1}\flo@calc\flo@dd{\flo@dd*\flo@t}\fi
    \flo@calc\flo@xx{\flo@dd*sin(\flo@a)}\flo@calc\flo@yy{\flo@dd*cos(\flo@a)}%
    \flo@calc\flo@ya{0.4*\flo@dd}\flo@calc\flo@xb{0.6*\flo@xx}\flo@calc\flo@yb{0.7*\flo@yy}%
    \flo@vtone{flo@c}{0.1}\flo@vstroke{flo@c}{0.35}{1}{0}{\pgfpathmoveto{\flo@P00}%
      \pgfpathcurveto{\flo@P0\flo@ya}{\flo@P\flo@xb\flo@yb}{\flo@P\flo@xx\flo@yy}}%
    \def\flo@tmp{center}%
    \ifx\flo@oo\flo@tmp\flo@calc\flo@t{\flo@bst-0.3*abs(\flo@f)/max(1,(\flo@bn-1)/2)}%
    \else\flo@calc\flo@t{\flo@bst-0.3*(1-abs(\flo@f)/max(1,(\flo@bn-1)/2))}\fi
    \flo@range\flo@s{0.8}{1.05}\flo@calc\flo@s{\flo@bfd*\flo@s}%
    \begin{pgfscope}\pgftransformshift{\flo@P\flo@xx\flo@yy}%
      \ifdim\flo@a pt<0pt \def\flo@bside{1}\else\def\flo@bside{-1}\fi\flo@bloom\flo@s\flo@t\end{pgfscope}}%
  \flo@chance{0.6}\ifflo@yes
    \flo@sym\flo@t{50}\flo@calc\flo@s{0.45*\flo@bfd}%
    \let\flo@oarg\flo@s\begin{pgfscope}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@oarg}\flo@stone\flo@vbud\flo@oarg\end{pgfscope}%
  \fi}
% v1.3's budding spray: two to four buds of the species on stalks, diameter #1
\def\flo@budding#1{%
  \edef\flo@bfd{#1}\flo@int\flo@bn{2}{4}\flo@stone
  \flo@loop{bud}\flo@Gc{1}{\flo@bn}{%
    \flo@sym\flo@t{10}\flo@calc\flo@a{(\the\flo@Gc-(\flo@bn+1)/2)*34+\flo@t}%
    \flo@range\flo@t{0.5}{0.85}\flo@calc\flo@dd{\flo@bfd*\flo@t}%
    \flo@calc\flo@xx{\flo@dd*sin(\flo@a)}\flo@calc\flo@yy{\flo@dd*cos(\flo@a)}%
    \flo@calc\flo@ya{0.4*\flo@dd}\flo@calc\flo@xb{0.6*\flo@xx}\flo@calc\flo@yb{0.7*\flo@yy}%
    \flo@vtone{flo@c}{0.1}\flo@vstroke{flo@c}{0.35}{1}{0}{\pgfpathmoveto{\flo@P00}%
      \pgfpathcurveto{\flo@P0\flo@ya}{\flo@P\flo@xb\flo@yb}{\flo@P\flo@xx\flo@yy}}%
    \flo@range\flo@s{0.45}{0.6}\flo@calc\flo@s{\flo@bfd*\flo@s}\flo@calc\flo@t{-0.6*\flo@a}%
    \let\flo@oarg\flo@s
    \begin{pgfscope}\pgftransformshift{\flo@P\flo@xx\flo@yy}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@oarg}%
      \flo@vbud\flo@oarg\end{pgfscope}}}
% flora.umbel: rays fanning upward, each ending in an umbellet of starry florets, bracts at
% the base; reach #1 cm, stage #2 (buds: dots; fruit: paired seeds)
\def\flo@umbelunit#1#2{%
  \edef\flo@R{#1}\edef\flo@bst{#2}\flo@stone
  \flo@calc\flo@nr{int(max(8,min(13,\flo@get{count}+3)))}%
  \flo@calc\flo@ns{int(max(5,min(8,\flo@get{rays}/2)))}%
  \ifx\flo@vf@tone\pgfutil@empty\def\flo@tlo{0.25}\def\flo@thi{0.42}%
  \else\flo@calc\flo@tlo{min(0.5,\flo@vf@tone-0.05)}\flo@calc\flo@thi{min(0.62,\flo@vf@tone+0.05)}\fi
  \flo@loop{umr}\flo@Gc{1}{\flo@nr}{%
    \flo@sym\flo@t{4}\flo@calc\flo@a{90+(\the\flo@Gc-(\flo@nr+1)/2)*(110/\flo@nr)+\flo@t}%
    \flo@range\flo@t{0.78}{1}\flo@calc\flo@L{\flo@R*\flo@t*(1-0.15*abs(\flo@a-90)/55)}%
    \flo@calc\flo@ex{\flo@L*cos(\flo@a)}\flo@calc\flo@ey{\flo@L*sin(\flo@a)}%
    \flo@calc\flo@xa{0.15*\flo@ex}\flo@calc\flo@ya{0.5*\flo@ey}\flo@calc\flo@xb{0.6*\flo@ex}\flo@calc\flo@yb{0.95*\flo@ey}%
    \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{0.25}{0.9}{0}{\pgfpathmoveto{\flo@P00}%
      \pgfpathcurveto{\flo@P\flo@xa\flo@ya}{\flo@P\flo@xb\flo@yb}{\flo@P\flo@ex\flo@ey}}%
    \flo@loop{ums}\flo@Gd{1}{\flo@ns}{%
      \flo@sym\flo@t{5}\flo@calc\flo@b{\flo@a+(\the\flo@Gd-(\flo@ns+1)/2)*16+\flo@t}%
      \flo@range\flo@t{0.12}{0.2}\flo@calc\flo@l{\flo@R*\flo@t}%
      \flo@calc\flo@fx{\flo@ex+\flo@l*cos(\flo@b)}\flo@calc\flo@fy{\flo@ey+\flo@l*sin(\flo@b)}%
      \flo@vtone{flo@c}{0.14}\flo@vstroke{flo@c}{0.18}{0.85}{0}{\pgfpathmoveto{\flo@P\flo@ex\flo@ey}\pgfpathlineto{\flo@P\flo@fx\flo@fy}}%
      \flo@range\flo@t{0.035}{0.05}\flo@calc\flo@r{\flo@R*\flo@t}%
      \flo@range\flo@t{\flo@tlo}{\flo@thi}%
      \begin{pgfscope}\pgftransformshift{\flo@P\flo@fx\flo@fy}%
        \ifdim\flo@bst pt>1.15pt
          \flo@calc\flo@t{\flo@b-90}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@r}%
          \flo@vtone{flo@c}{0.16}\flo@vfill{flo@c}{1}{0}{\pgfpathellipse{\flo@P{-0.35}{0.9}}{\flo@P{0.32}0}{\flo@P0{0.9}}%
            \pgfpathellipse{\flo@P{0.35}{0.9}}{\flo@P{0.32}0}{\flo@P0{0.9}}}%
        \else\ifdim\flo@bst pt<0.3pt
          \flo@vtone{flo@c}{0.2}\flo@calc\flo@t{0.45*\flo@r}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{\flo@t pt}}%
        \else
          \edef\flo@vf@tone{\flo@t}\def\flo@vf@star{1}\let\flo@oarg\flo@r\pgftransformscale{\flo@oarg}\flo@vfloret\flo@oarg{5}%
        \fi\fi
      \end{pgfscope}}}%
  \flo@loop{umb}\flo@Gc{-1}{1}{%
    \flo@sym\flo@t{10}\flo@calc\flo@a{\the\flo@Gc*40+\flo@t+180}\flo@range\flo@s{0.15}{0.22}\flo@calc\flo@s{\flo@R*\flo@s}%
    \begin{pgfscope}\pgftransformrotate{\flo@a}\pgftransformscale{\flo@s}%
      \def\flo@vl@W{0.06}\def\flo@vl@tone{}\edef\flo@vl@u{\flo@s}\flo@vleaflet\end{pgfscope}}}
% flora's cyme turned raceme: an axis of #1 cm that bends toward its tip by #3 degrees, the
% species' flowers on pedicels up to #2 cm, alternating along it, the lowest open first and
% buds toward the tip; a coiled cyme when #3 is large. The stage of the oldest is \flo@ust
\def\flo@racemeunit#1#2#3{%
  \edef\flo@bst{\flo@ust}\edef\flo@L{#1}\edef\flo@ped{#2}%
  \flo@chance{0.5}\ifflo@yes\def\flo@side{1}\else\def\flo@side{-1}\fi
  \flo@range\flo@t{0.75}{1.25}\flo@calc\flo@turn{(#3)*\flo@t}%
  \flo@sym\flo@t{8}\flo@calc\flo@h{90+\flo@t}%
  \flo@put1{0}{0}\def\flo@xx{0}\def\flo@yy{0}\flo@calc\flo@ds{\flo@L/24}%
  \flo@loop{rcw}\flo@Gc{1}{24}{%
    \flo@calc\flo@v{(\the\flo@Gc-0.5)/24}%
    \flo@calc\flo@a{\flo@h+\flo@side*\flo@turn*\flo@v*\flo@v*sqrt(sqrt(\flo@v))}%
    \flo@calc\flo@xx{\flo@xx+\flo@ds*cos(\flo@a)}\flo@calc\flo@yy{\flo@yy+\flo@ds*sin(\flo@a)}%
    \flo@put{\the\numexpr\flo@Gc+1\relax}{\flo@xx}{\flo@yy}}%
  \flo@normals{25}%
  \flo@loop{rck}\flo@Gc{1}{25}{%
    \expandafter\edef\csname flo@AX\the\flo@Gc\endcsname{\flo@x{\the\flo@Gc}}%
    \expandafter\edef\csname flo@AY\the\flo@Gc\endcsname{\flo@y{\the\flo@Gc}}%
    \expandafter\edef\csname flo@AN\the\flo@Gc\endcsname{\csname flo@NX\the\flo@Gc\endcsname}%
    \expandafter\edef\csname flo@AM\the\flo@Gc\endcsname{\csname flo@NY\the\flo@Gc\endcsname}}%
  \flo@vstem{25}{0.03}{0.006}{0.1}%
  \flo@stone
  \flo@calc\flo@rfd{min(1.0,0.5+0.03*\flo@get{size})*0.8}%
  \ifdim#3pt>150pt \flo@calc\flo@rfd{min(0.32,\flo@rfd)}\fi
  \flo@int\flo@t{8}{12}\flo@calc\flo@rn{int(min(\flo@get{count},\flo@t))}%
  \flo@loop{rcf}\flo@Gc{1}{\flo@rn}{%
    \flo@calc\flo@v{\the\flo@Gc/\flo@rn}\flo@calc\flo@f{0.1+0.88*sqrt(\flo@v)*sqrt(sqrt(\flo@v))}%
    \flo@calc\flo@ri{int(max(2,min(25,floor(\flo@f*24+1.5))))}%
    \ifodd\flo@Gc\def\flo@sg{-1}\else\def\flo@sg{1}\fi
    \edef\flo@px{\csname flo@AX\flo@ri\endcsname}\edef\flo@py{\csname flo@AY\flo@ri\endcsname}%
    \edef\flo@pnx{\csname flo@AN\flo@ri\endcsname}\edef\flo@pny{\csname flo@AM\flo@ri\endcsname}%
    \flo@range\flo@t{0.8}{1.2}\flo@calc\flo@stalk{(\flo@ped*(1-\flo@f)+0.03*\flo@f)*\flo@t}%
    % the pedicel leans up the axis: 0.75 across, 0.65 along (the tangent is (ny,-nx))
    \flo@calc\flo@qx{\flo@px+(\flo@pnx*\flo@sg*0.75+\flo@pny*0.65)*\flo@stalk}%
    \flo@calc\flo@qy{\flo@py+(\flo@pny*\flo@sg*0.75-\flo@pnx*0.65)*\flo@stalk}%
    \ifdim\flo@stalk pt>0.03pt
      \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{0.25}{0.9}{0}{\pgfpathmoveto{\flo@P\flo@px\flo@py}\pgfpathlineto{\flo@P\flo@qx\flo@qy}}\fi
    \flo@calc\flo@t{\flo@bst+0.35-1.1*\flo@f}%
    \flo@range\flo@s{0.85}{1.15}\flo@calc\flo@s{\flo@rfd*(1-0.5*\flo@f)*\flo@s}%
    \flo@calc\flo@a{atan2(\flo@qy-\flo@py,\flo@qx-\flo@px)-90}%
    \begin{pgfscope}\pgftransformshift{\flo@P\flo@qx\flo@qy}\pgftransformrotate{\flo@a}%
      \ifdim\flo@f pt>0.86pt
        \flo@calc\flo@t{0.18*\flo@s}\flo@vtone{flo@c}{0.2}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{\flo@t pt}}%
      \else\let\flo@bside\flo@sg\flo@bloom\flo@s\flo@t\fi
    \end{pgfscope}}}
% flora's cyme, the forget-me-not's, as the species' coiled cyme: an axis of #1 cm that
% curls at its end like a scorpion's tail, the more the species coils (\flo@get{coil}),
% with the species' flowers crowding along it, on the outside of the coil (siderule same)
% or on alternate sides, smaller toward the coil, where they are buds: the lowest opens
% first. Often a second, shorter curl forks off, a little younger. The stage of the
% oldest is \flo@ust
\def\flo@curlunit#1{%
  \edef\flo@bst{\flo@ust}\flo@stone
  \flo@chance{0.5}\ifflo@yes\def\flo@side{1}\else\def\flo@side{-1}\fi
  \flo@sym\flo@t{10}\flo@calc\flo@h{90+\flo@t}%
  \flo@calc\flo@cfd{min(0.4,0.17+0.014*\flo@get{size})}%
  \flo@calc\flo@ccn{int(max(9,min(17,\flo@get{count}+2)))}%
  \flo@curl{0}{0}{#1}{0.026}{0}%
  \flo@chance{0.6}\ifflo@yes
    \flo@range\flo@t{0.25}{0.4}\flo@calc\flo@ci{int(37*\flo@t)}%
    \edef\flo@xa{\csname flo@AX\flo@ci\endcsname}\edef\flo@ya{\csname flo@AY\flo@ci\endcsname}%
    \edef\flo@t{\the\numexpr\flo@ci+1\relax}%
    \edef\flo@xb{\csname flo@AX\flo@t\endcsname}\edef\flo@yb{\csname flo@AY\flo@t\endcsname}%
    \flo@range\flo@t{30}{50}\flo@calc\flo@h{atan2(\flo@yb-\flo@ya,\flo@xb-\flo@xa)-\flo@side*\flo@t}%
    \flo@range\flo@t{0.45}{0.65}\flo@calc\flo@L{(#1)*\flo@t}%
    \flo@calc\flo@side{-\flo@side}\flo@calc\flo@ccn{int(max(6,\flo@ccn*0.7))}%
    \flo@curl\flo@xa\flo@ya\flo@L{0.018}{0.15}%
  \fi}
\def\flo@same{same}
% one curl of \flo@curlunit: from (#1,#2) heading \flo@h, length #3 cm, #4 cm wide at its
% base, its flowers #5 younger than the unit's oldest; points in flo@AX/AY, normals in
% flo@AN/AM
\def\flo@curl#1#2#3#4#5{%
  \edef\flo@xx{#1}\edef\flo@yy{#2}\edef\flo@cL{#3}\edef\flo@clate{#5}%
  \flo@range\flo@t{0.85}{1.15}\flo@calc\flo@turn{(100+170*\flo@get{coil})*\flo@t}%
  \flo@put1\flo@xx\flo@yy\flo@calc\flo@ds{\flo@cL/36}%
  \flo@loop{cuw}\flo@Gc{1}{36}{%
    \flo@calc\flo@v{(\the\flo@Gc-0.5)/36}%
    \flo@calc\flo@a{\flo@h+\flo@side*\flo@turn*\flo@v*\flo@v*sqrt(sqrt(\flo@v))}%
    \flo@calc\flo@xx{\flo@xx+\flo@ds*cos(\flo@a)}\flo@calc\flo@yy{\flo@yy+\flo@ds*sin(\flo@a)}%
    \flo@put{\the\numexpr\flo@Gc+1\relax}{\flo@xx}{\flo@yy}}%
  \flo@normals{37}%
  \flo@loop{cuk}\flo@Gc{1}{37}{%
    \expandafter\edef\csname flo@AX\the\flo@Gc\endcsname{\flo@x{\the\flo@Gc}}%
    \expandafter\edef\csname flo@AY\the\flo@Gc\endcsname{\flo@y{\the\flo@Gc}}%
    \expandafter\edef\csname flo@AN\the\flo@Gc\endcsname{\csname flo@NX\the\flo@Gc\endcsname}%
    \expandafter\edef\csname flo@AM\the\flo@Gc\endcsname{\csname flo@NY\the\flo@Gc\endcsname}}%
  \flo@vstem{37}{#4}{0.006}{0.1}%
  \edef\flo@csr{\flo@get{siderule}}%
  \flo@loop{cuf}\flo@Gc{1}{\flo@ccn}{%
    \flo@calc\flo@v{\the\flo@Gc/\flo@ccn}\flo@calc\flo@f{0.18+0.82*sqrt(\flo@v)*sqrt(sqrt(\flo@v))}%
    \flo@calc\flo@ri{int(max(2,min(37,floor(\flo@f*36+1.5))))}%
    \ifx\flo@csr\flo@same\flo@calc\flo@sg{-\flo@side}\else\ifodd\flo@Gc\def\flo@sg{-1}\else\def\flo@sg{1}\fi\fi
    \edef\flo@px{\csname flo@AX\flo@ri\endcsname}\edef\flo@py{\csname flo@AY\flo@ri\endcsname}%
    \edef\flo@pnx{\csname flo@AN\flo@ri\endcsname}\edef\flo@pny{\csname flo@AM\flo@ri\endcsname}%
    \flo@range\flo@t{0.7}{1.2}\flo@calc\flo@stalk{(0.1-0.08*\flo@f)*\flo@t}%
    \flo@calc\flo@qx{\flo@px+\flo@pnx*\flo@sg*\flo@stalk}\flo@calc\flo@qy{\flo@py+\flo@pny*\flo@sg*\flo@stalk}%
    \ifdim\flo@stalk pt>0.03pt
      \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{0.25}{0.9}{0}{\pgfpathmoveto{\flo@P\flo@px\flo@py}\pgfpathlineto{\flo@P\flo@qx\flo@qy}}\fi
    \flo@range\flo@s{0.85}{1.15}\flo@calc\flo@s{\flo@cfd*(1-0.74*\flo@f)*\flo@s}%
    \flo@calc\flo@t{\flo@bst+0.55-\flo@f-\flo@clate}%
    \flo@calc\flo@a{atan2(\flo@qy-\flo@py,\flo@qx-\flo@px)-90}%
    \begin{pgfscope}\pgftransformshift{\flo@P\flo@qx\flo@qy}\pgftransformrotate{\flo@a}%
      \ifdim\flo@f pt>0.8pt
        \flo@calc\flo@t{0.3*\flo@s}\flo@vtone{flo@c}{0.2}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{\flo@t pt}}%
      \else\let\flo@bside\flo@sg\flo@bloom\flo@s\flo@t\fi
    \end{pgfscope}}}
% ---------------------------------------------------------------- clusters
% The clusters below collect their flowers while they draw their stalks and draw them
% after (\flo@fadd, \flo@fdraw), so that no stalk crosses an open flower. A flower whose
% stage is below -0.25 is a bud too small to draw: a dot.
\def\flo@zset#1#2#3{\expandafter\edef\csname flo@Z#1@#2\endcsname{#3}}
\def\flo@z#1#2{\csname flo@Z#1@#2\endcsname}
% the species' flower at (#1,#2), turned #3 degrees, diameter #4 cm, stage #5; a flower
% that is held sideways or nods turns on toward the side it leans to
\def\flo@fat#1#2#3#4#5{%
  \begin{pgfscope}\pgftransformshift{\flo@P{#1}{#2}}\pgftransformrotate{#3}%
    \ifdim#5pt<-0.25pt
      \flo@calc\flo@t{0.3*(#4)}\flo@vtone{flo@c}{0.2}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{\flo@t pt}}%
    \else\ifdim#3pt<0pt \def\flo@bside{-1}\else\def\flo@bside{1}\fi\flo@bloom{#4}{#5}\fi
  \end{pgfscope}}
\def\flo@fadd#1#2#3#4#5{\edef\flo@fnum{\the\numexpr\flo@fnum+1\relax}%
  \flo@zset{fx}\flo@fnum{#1}\flo@zset{fy}\flo@fnum{#2}\flo@zset{fa}\flo@fnum{#3}%
  \flo@zset{fs}\flo@fnum{#4}\flo@zset{ft}\flo@fnum{#5}}
\def\flo@fdraw{\flo@loop{fdr}\flo@Gc{1}{\flo@fnum}{%
  \flo@fat{\flo@z{fx}{\the\flo@Gc}}{\flo@z{fy}{\the\flo@Gc}}{\flo@z{fa}{\the\flo@Gc}}%
    {\flo@z{fs}{\the\flo@Gc}}{\flo@z{ft}{\the\flo@Gc}}}}
% a stalk (a hairline) from (#1,#2) to (#3,#4)
\def\flo@hair#1#2#3#4{\flo@vtone{flo@c}{0.12}%
  \flo@vstroke{flo@c}{0.25}{0.9}{0}{\pgfpathmoveto{\flo@P{#1}{#2}}\pgfpathlineto{\flo@P{#3}{#4}}}}
% racemeunit's axis: #1 cm from the origin, bending toward its tip by about #2 degrees,
% #3 cm wide at its base; points 1..25 in flo@AX/AY, normals in flo@AN/AM; drawn
\def\flo@axis#1#2#3{%
  \flo@chance{0.5}\ifflo@yes\def\flo@side{1}\else\def\flo@side{-1}\fi
  \flo@range\flo@t{0.75}{1.25}\flo@calc\flo@turn{(#2)*\flo@t}%
  \flo@sym\flo@t{8}\flo@calc\flo@h{90+\flo@t}%
  \flo@put1{0}{0}\def\flo@xx{0}\def\flo@yy{0}\flo@calc\flo@ds{(#1)/24}%
  \flo@loop{axw}\flo@Gc{1}{24}{%
    \flo@calc\flo@v{(\the\flo@Gc-0.5)/24}%
    \flo@calc\flo@a{\flo@h+\flo@side*\flo@turn*\flo@v*\flo@v*sqrt(sqrt(\flo@v))}%
    \flo@calc\flo@xx{\flo@xx+\flo@ds*cos(\flo@a)}\flo@calc\flo@yy{\flo@yy+\flo@ds*sin(\flo@a)}%
    \flo@put{\the\numexpr\flo@Gc+1\relax}{\flo@xx}{\flo@yy}}%
  \flo@normals{25}%
  \flo@loop{axk}\flo@Gc{1}{25}{%
    \expandafter\edef\csname flo@AX\the\flo@Gc\endcsname{\flo@x{\the\flo@Gc}}%
    \expandafter\edef\csname flo@AY\the\flo@Gc\endcsname{\flo@y{\the\flo@Gc}}%
    \expandafter\edef\csname flo@AN\the\flo@Gc\endcsname{\csname flo@NX\the\flo@Gc\endcsname}%
    \expandafter\edef\csname flo@AM\the\flo@Gc\endcsname{\csname flo@NY\the\flo@Gc\endcsname}}%
  \flo@vstem{25}{#3}{0.006}{0.1}}
% the axis at \flo@clf (0..1): its point \flo@px,\flo@py, normal \flo@pnx,\flo@pny and
% heading \flo@ah (degrees); the tangent is (ny,-nx)
\def\flo@axisat{%
  \flo@calc\flo@ri{int(max(2,min(25,floor(\flo@clf*24+1.5))))}%
  \edef\flo@px{\csname flo@AX\flo@ri\endcsname}\edef\flo@py{\csname flo@AY\flo@ri\endcsname}%
  \edef\flo@pnx{\csname flo@AN\flo@ri\endcsname}\edef\flo@pny{\csname flo@AM\flo@ri\endcsname}%
  \flo@calc\flo@ah{atan2(-\flo@pnx,\flo@pny)}}
% a branch from (#1,#2) heading #3 degrees and turning by #4 along its length #5 cm, in
% #6 steps: points 1..#6+1 in flo@X/Y, its end \flo@xx,\flo@yy
\def\flo@walk#1#2#3#4#5#6{%
  \edef\flo@xx{#1}\edef\flo@yy{#2}\flo@put1\flo@xx\flo@yy\flo@calc\flo@ds{(#5)/(#6)}%
  \flo@loop{wlk}\flo@Gc{1}{#6}{%
    \flo@calc\flo@a{(#3)+(#4)*(\the\flo@Gc-0.5)/(#6)}%
    \flo@calc\flo@xx{\flo@xx+\flo@ds*cos(\flo@a)}\flo@calc\flo@yy{\flo@yy+\flo@ds*sin(\flo@a)}%
    \flo@put{\the\numexpr\flo@Gc+1\relax}{\flo@xx}{\flo@yy}}}

% flora's sprig as the species' forked cyme (a dichasium): a stalk that forks two ways,
% now and then three, \flo@get{depth}+1 times (three at most), a flower in every fork on a
% stalk of its own and at every tip, small bracts at the lower forks; the flower of the
% first fork opens first, the tips last. Reach about #1 cm
\def\flo@forkunit#1{%
  \edef\flo@bst{\flo@ust}\flo@stone\def\flo@fnum{0}%
  \flo@calc\flo@cld{int(min(3,\flo@get{depth}+1))}%
  \flo@calc\flo@clfd{min(0.45,0.16+0.012*\flo@get{size})}%
  \flo@sym\flo@t{8}\flo@calc\flo@t{90+\flo@t}\flo@calc\flo@s{(#1)*0.4}%
  \flo@zset{bx}{1}{0}\flo@zset{by}{1}{0}\flo@zset{bh}{1}{\flo@t}\flo@zset{bl}{1}{\flo@s}%
  \flo@zset{bw}{1}{0.024}\flo@zset{bv}{1}{0}\def\flo@cln{1}%
  \flo@loop{fk}\flo@Gd{1}{\flo@cln}{%
    \edef\flo@clh{\flo@z{bh}{\the\flo@Gd}}\edef\flo@cll{\flo@z{bl}{\the\flo@Gd}}%
    \edef\flo@clw{\flo@z{bw}{\the\flo@Gd}}\edef\flo@clv{\flo@z{bv}{\the\flo@Gd}}%
    \flo@sym\flo@clb{20}%
    \flo@walk{\flo@z{bx}{\the\flo@Gd}}{\flo@z{by}{\the\flo@Gd}}\flo@clh\flo@clb\flo@cll{6}%
    \edef\flo@clx{\flo@xx}\edef\flo@cly{\flo@yy}%
    \flo@calc\flo@clwe{0.72*\flo@clw}\flo@vstem{7}\flo@clw\flo@clwe{0.1}%
    \flo@calc\flo@clh{\flo@clh+\flo@clb}%
    \flo@sym\flo@t{0.05}\flo@calc\flo@clt{\flo@bst-0.3*\flo@clv+\flo@t}%
    \flo@range\flo@t{0.85}{1.1}\flo@calc\flo@cls{\flo@clfd*(1-0.1*\flo@clv)*\flo@t}%
    \flo@calc\flo@t{\flo@clh-90}%
    \ifnum\flo@clv<\flo@cld
      % a fork: a bract, two or three branches, the flower between them on its stalk
      \ifnum\flo@clv<2 \flo@chance{0.4}\ifflo@yes
        \flo@chance{0.5}\ifflo@yes\def\flo@sg{1}\else\def\flo@sg{-1}\fi
        \flo@range\flo@a{40}{70}\flo@calc\flo@a{\flo@clh-90+\flo@sg*\flo@a}%
        \flo@range\flo@s{0.35}{0.55}\flo@calc\flo@s{\flo@cll*\flo@s}%
        \begin{pgfscope}\pgftransformshift{\flo@P\flo@clx\flo@cly}\pgftransformrotate{\flo@a}\pgftransformscale{\flo@s}%
          \def\flo@vl@W{0.14}\def\flo@vl@tone{}\edef\flo@vl@u{\flo@s}\flo@vleaflet\end{pgfscope}%
      \fi\fi
      \flo@chance{0.2}\ifflo@yes\def\flo@clk{3}\else\def\flo@clk{2}\fi
      \flo@loop{fkk}\flo@n{1}{\flo@clk}{%
        \ifnum\flo@clk=2 \flo@range\flo@a{16}{34}\ifnum\flo@n=1 \flo@calc\flo@a{-\flo@a}\fi
        \else\flo@range\flo@a{22}{36}\flo@calc\flo@a{(\the\flo@n-2)*\flo@a}\fi
        \edef\flo@cln{\the\numexpr\flo@cln+1\relax}%
        \flo@zset{bx}\flo@cln\flo@clx\flo@zset{by}\flo@cln\flo@cly
        \flo@calc\flo@t{\flo@clh+\flo@a}\flo@zset{bh}\flo@cln\flo@t
        \flo@range\flo@t{0.62}{0.8}\flo@calc\flo@t{\flo@cll*\flo@t}\flo@zset{bl}\flo@cln\flo@t
        \flo@zset{bw}\flo@cln\flo@clwe
        \flo@zset{bv}\flo@cln{\the\numexpr\flo@clv+1\relax}}%
      \flo@calc\flo@xa{\flo@clx+0.22*\flo@cll*cos(\flo@clh)}\flo@calc\flo@ya{\flo@cly+0.22*\flo@cll*sin(\flo@clh)}%
      \flo@hair\flo@clx\flo@cly\flo@xa\flo@ya
      \flo@calc\flo@t{\flo@clh-90}\flo@fadd\flo@xa\flo@ya\flo@t\flo@cls\flo@clt
    \else
      \flo@fadd\flo@clx\flo@cly\flo@t\flo@cls\flo@clt
    \fi}%
  \flo@fdraw}

% a panicle: a raceme whose branches are racemes, an axis of #1 cm bending a little, its
% branches on alternate sides, shorter toward the top, each ending in a flower with one to
% three more on short stalks along it (one more on the lower branches when the species
% branches twice); the lowest open first
\def\flo@panicleunit#1{%
  \edef\flo@bst{\flo@ust}\edef\flo@clL{#1}\flo@stone\def\flo@fnum{0}%
  \flo@calc\flo@clfd{min(0.34,0.15+0.01*\flo@get{size})}%
  \flo@axis\flo@clL{30}{0.026}%
  \flo@calc\flo@clm{int(max(3,min(7,\flo@get{count}/4+1)))}%
  \flo@chance{0.5}\ifflo@yes\def\flo@clsg{1}\else\def\flo@clsg{-1}\fi
  \flo@loop{pan}\flo@Gd{1}{\flo@clm}{%
    \flo@sym\flo@t{0.03}\flo@calc\flo@clf{0.1+0.66*(\the\flo@Gd-1)/max(1,\flo@clm-1)+\flo@t}%
    \flo@axisat\flo@calc\flo@clsg{-\flo@clsg}%
    \flo@range\flo@clang{40}{58}\flo@calc\flo@clh{\flo@ah+\flo@clsg*\flo@clang}%
    \flo@range\flo@t{0.8}{1.2}\flo@calc\flo@cll{\flo@clL*0.42*(1-0.7*\flo@clf)*\flo@t}%
    \flo@calc\flo@clb{-\flo@clsg*0.55*\flo@clang}%
    \flo@walk\flo@px\flo@py\flo@clh\flo@clb\flo@cll{8}\flo@normals{9}%
    \flo@calc\flo@t{\flo@bst+0.2-0.9*\flo@clf}\flo@calc\flo@cls{\flo@clfd*(1-0.3*\flo@clf)}%
    \flo@calc\flo@a{\flo@clh+\flo@clb-90}\flo@fadd\flo@xx\flo@yy\flo@a\flo@cls\flo@t
    \flo@int\flo@clk{1}{3}%
    \ifnum\flo@get{depth}=2 \ifdim\flo@clf pt<0.45pt \edef\flo@clk{\the\numexpr\flo@clk+1\relax}\fi\fi
    \flo@loop{pnl}\flo@n{1}{\flo@clk}{%
      \flo@calc\flo@v{0.3+0.5*(\the\flo@n-1)/max(1,\flo@clk-1)}%
      \flo@calc\flo@clq{int(1+floor(\flo@v*8+0.5))}%
      \ifodd\flo@n\def\flo@sg{1}\else\def\flo@sg{-1}\fi
      \edef\flo@xa{\flo@x\flo@clq}\edef\flo@ya{\flo@y\flo@clq}%
      \edef\flo@clnx{\csname flo@NX\flo@clq\endcsname}\edef\flo@clny{\csname flo@NY\flo@clq\endcsname}%
      \flo@range\flo@t{0.1}{0.18}%
      \flo@calc\flo@xb{\flo@xa+(\flo@clnx*\flo@sg*0.8+\flo@clny*0.6)*\flo@t}%
      \flo@calc\flo@yb{\flo@ya+(\flo@clny*\flo@sg*0.8-\flo@clnx*0.6)*\flo@t}%
      \flo@hair\flo@xa\flo@ya\flo@xb\flo@yb
      \flo@calc\flo@t{\flo@bst+0.3-0.9*\flo@clf-0.25*(1-\flo@v)}%
      \flo@calc\flo@s{\flo@clfd*(0.9-0.3*\flo@clf)}%
      \flo@calc\flo@a{atan2(\flo@yb-\flo@ya,\flo@xb-\flo@xa)-90}%
      \flo@fadd\flo@xb\flo@yb\flo@a\flo@s\flo@t}%
    \flo@vstem{9}{0.012}{0.005}{0.12}}%
  \edef\flo@xa{\csname flo@AX25\endcsname}\edef\flo@ya{\csname flo@AY25\endcsname}%
  \def\flo@clf{1}\flo@axisat\flo@calc\flo@a{\flo@ah-90}%
  \flo@calc\flo@t{\flo@bst-0.6}\flo@calc\flo@s{0.6*\flo@clfd}\flo@fadd\flo@xa\flo@ya\flo@a\flo@s\flo@t
  \flo@fdraw}

% a thyrse: a raceme of small cymes, as a lilac's: an axis of #1 cm, at each node a pair
% of short stalks, each ending in a flower between two younger ones, shorter toward the
% top, where there are only buds; the lowest open first
\def\flo@thyrseunit#1{%
  \edef\flo@bst{\flo@ust}\edef\flo@clL{#1}\flo@stone\def\flo@fnum{0}%
  \flo@calc\flo@clfd{min(0.42,0.15+0.012*\flo@get{size})}%
  \flo@axis\flo@clL{20}{0.028}%
  \flo@calc\flo@clm{int(max(6,min(11,\flo@get{count}/2.5)))}%
  \flo@loop{thy}\flo@Gd{1}{\flo@clm}{%
    \flo@calc\flo@clf{0.08+0.84*(\the\flo@Gd-1)/max(1,\flo@clm-1)}%
    \flo@axisat
    \flo@loop{thys}\flo@n{0}{1}{%
      \ifnum\flo@n=0 \def\flo@sg{1}\else\def\flo@sg{-1}\fi
      \flo@range\flo@clang{45}{65}\flo@calc\flo@clh{\flo@ah+\flo@sg*\flo@clang}%
      \flo@range\flo@t{0.8}{1.2}\flo@calc\flo@cll{\flo@clL*0.17*(1-0.75*\flo@clf)*\flo@t}%
      \flo@calc\flo@xa{\flo@px+\flo@cll*cos(\flo@clh)}\flo@calc\flo@ya{\flo@py+\flo@cll*sin(\flo@clh)}%
      \flo@hair\flo@px\flo@py\flo@xa\flo@ya
      \flo@calc\flo@clt{\flo@bst+0.3-1.0*\flo@clf}\flo@calc\flo@cls{\flo@clfd*(1-0.4*\flo@clf)}%
      \ifdim\flo@clf pt<0.8pt
        \flo@loop{thyc}\flo@m{0}{1}{%
          \ifnum\flo@m=0 \def\flo@t{1}\else\def\flo@t{-1}\fi
          \flo@range\flo@a{30}{50}\flo@calc\flo@a{\flo@clh+\flo@t*\flo@a}%
          \flo@calc\flo@xb{\flo@xa+0.55*\flo@cll*cos(\flo@a)}\flo@calc\flo@yb{\flo@ya+0.55*\flo@cll*sin(\flo@a)}%
          \flo@hair\flo@xa\flo@ya\flo@xb\flo@yb
          \flo@calc\flo@t{\flo@clt-0.2}\flo@calc\flo@s{0.85*\flo@cls}\flo@calc\flo@a{\flo@a-90}%
          \flo@fadd\flo@xb\flo@yb\flo@a\flo@s\flo@t}%
      \fi
      \flo@calc\flo@xa{\flo@xa+0.15*\flo@cll*cos(\flo@clh)}\flo@calc\flo@ya{\flo@ya+0.15*\flo@cll*sin(\flo@clh)}%
      \flo@calc\flo@a{\flo@clh-90}\flo@fadd\flo@xa\flo@ya\flo@a\flo@cls\flo@clt}}%
  \edef\flo@xa{\csname flo@AX25\endcsname}\edef\flo@ya{\csname flo@AY25\endcsname}%
  \def\flo@clf{1}\flo@axisat\flo@calc\flo@a{\flo@ah-90}%
  \flo@calc\flo@t{\flo@bst-0.75}\flo@calc\flo@s{0.6*\flo@clfd}\flo@fadd\flo@xa\flo@ya\flo@a\flo@s\flo@t
  \flo@fdraw}

% a corymb: stalks from along a short axis, the lower the longer, that bring their
% flowers up to one flat top #1 cm high; the outermost open first, the middle last
\def\flo@corymbunit#1{\ifdim#1pt=0pt \else\flo@corymbunit@{#1}\fi}% none at length 0 (its width divides)
\def\flo@corymbunit@#1{%
  \edef\flo@bst{\flo@ust}\edef\flo@clL{#1}\flo@stone\def\flo@fnum{0}%
  \flo@calc\flo@clfd{min(0.6,0.3*\flo@fd)}%
  \flo@calc\flo@clm{int(max(3,min(9,min(\flo@get{count},2.6/\flo@clfd))))}%
  \flo@calc\flo@clW{\flo@clL*0.7}\flo@calc\flo@cltop{\flo@clL*0.92}\flo@calc\flo@cla{\flo@clL*0.5}%
  \flo@sym\flo@t{0.06}\flo@calc\flo@yc{0.35*\flo@cla}\flo@calc\flo@yd{0.7*\flo@cla}%
  \flo@vtone{flo@c}{0.1}%
  \flo@vstroke{flo@c}{0.5}{1}{0}{\pgfpathmoveto{\flo@P00}\pgfpathcurveto{\flo@P\flo@t\flo@yc}{\flo@P\flo@t\flo@yd}{\flo@P0\flo@cla}}%
  \flo@chance{0.5}\ifflo@yes\def\flo@clsg{1}\else\def\flo@clsg{-1}\fi
  \flo@loop{cor}\flo@Gd{1}{\flo@clm}{%
    \flo@calc\flo@v{(\the\flo@Gd-1)/max(1,\flo@clm-1)}%
    \flo@calc\flo@clsg{-\flo@clsg}%
    \flo@calc\flo@ya{\flo@cla*(0.12+0.88*\flo@v)}%
    \flo@range\flo@t{0.75}{1}\flo@calc\flo@xb{\flo@clsg*\flo@clW*(1-0.85*\flo@v)*\flo@t}%
    \flo@sym\flo@t{0.08}\flo@calc\flo@yb{\flo@cltop-0.32*\flo@xb*\flo@xb/\flo@clW+\flo@t}%
    \flo@calc\flo@xc{0.55*\flo@xb}\flo@calc\flo@yc{\flo@ya+0.25*(\flo@yb-\flo@ya)}%
    \flo@calc\flo@xd{0.95*\flo@xb}\flo@calc\flo@yd{\flo@yb-0.45*(\flo@yb-\flo@ya)}%
    \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{0.3}{0.9}{0}{\pgfpathmoveto{\flo@P0\flo@ya}%
      \pgfpathcurveto{\flo@P\flo@xc\flo@yc}{\flo@P\flo@xd\flo@yd}{\flo@P\flo@xb\flo@yb}}%
    \flo@calc\flo@t{\flo@bst-0.35*\flo@v}\flo@range\flo@s{0.85}{1.1}\flo@calc\flo@s{\flo@clfd*\flo@s}%
    \flo@calc\flo@a{-20*\flo@xb/\flo@clW}\flo@fadd\flo@xb\flo@yb\flo@a\flo@s\flo@t}%
  \flo@vtone{flo@c}{0.12}\flo@sym\flo@xb{0.04}%
  \flo@vstroke{flo@c}{0.3}{0.9}{0}{\pgfpathmoveto{\flo@P0\flo@cla}\pgfpathlineto{\flo@P\flo@xb\flo@cltop}}%
  \flo@calc\flo@t{\flo@bst-0.42}\flo@calc\flo@s{0.9*\flo@clfd}\def\flo@a{0}%
  \flo@fadd\flo@xb\flo@cltop\flo@a\flo@s\flo@t
  \flo@fdraw}

% a spike: flowers without stalks crowding an axis of #1 cm, alternately left, right and
% in front, smaller toward the tip, which is all buds; the lowest open first
\def\flo@spikeunit#1{%
  \edef\flo@bst{\flo@ust}\flo@stone\def\flo@fnum{0}%
  \flo@calc\flo@clfd{min(0.5,0.2+0.014*\flo@get{size})}%
  \flo@axis{#1}{14}{0.03}%
  \flo@calc\flo@clm{int(max(14,min(30,\flo@get{count}+4)))}%
  \flo@loop{spk}\flo@Gd{1}{\flo@clm}{%
    \flo@sym\flo@t{0.01}\flo@calc\flo@clf{0.06+0.92*(\the\flo@Gd-1)/max(1,\flo@clm-1)+\flo@t}%
    \flo@axisat
    \flo@range\flo@t{0.85}{1.1}\flo@calc\flo@s{\flo@clfd*(1-0.45*\flo@clf)*\flo@t}%
    \flo@calc\flo@t{\flo@bst+0.35-1.2*\flo@clf}%
    \flo@calc\flo@clk{int(mod(\the\flo@Gd,3))}%
    \ifnum\flo@clk=0
      \flo@sym\flo@a{10}\flo@calc\flo@a{\flo@ah-90+\flo@a}%
      \flo@fadd\flo@px\flo@py\flo@a\flo@s\flo@t
    \else
      \ifnum\flo@clk=1 \def\flo@sg{1}\else\def\flo@sg{-1}\fi
      \flo@range\flo@a{30}{55}\flo@calc\flo@a{\flo@ah-90+\flo@sg*\flo@a}%
      \flo@calc\flo@xa{\flo@px+\flo@pnx*\flo@sg*0.42*\flo@s}\flo@calc\flo@ya{\flo@py+\flo@pny*\flo@sg*0.42*\flo@s}%
      \flo@fadd\flo@xa\flo@ya\flo@a\flo@s\flo@t
    \fi}%
  \flo@fdraw}

% a simple umbel: rays from one point, about #1 cm long, fanning upward to a dome, each
% ending in a flower; the outermost open first (or the middle, as the species has it);
% bracts at the base
\def\flo@umbelsunit#1{%
  \edef\flo@bst{\flo@ust}\edef\flo@clL{#1}\flo@stone\def\flo@fnum{0}\edef\flo@oo{\flo@get{openorder}}%
  \flo@calc\flo@clfd{min(0.8,0.24+0.02*\flo@get{size})}%
  \flo@calc\flo@clm{int(max(4,min(12,\flo@get{count})))}%
  \flo@range\flo@clang{50}{75}%
  \flo@loop{ums}\flo@Gd{1}{\flo@clm}{%
    \ifodd\flo@Gd\edef\flo@clk{\the\numexpr(\flo@Gd+1)/2\relax}\else\edef\flo@clk{\the\numexpr\flo@clm+1-\flo@Gd/2\relax}\fi
    \flo@calc\flo@clf{(\flo@clk-(\flo@clm+1)/2)/max(1,(\flo@clm-1)/2)}%
    \flo@sym\flo@t{5}\flo@calc\flo@a{90+\flo@clf*\flo@clang+\flo@t}%
    \flo@range\flo@t{0.88}{1.05}\flo@calc\flo@clR{\flo@clL*\flo@t*(1-0.12*abs(\flo@clf))}%
    \flo@calc\flo@xb{\flo@clR*cos(\flo@a)}\flo@calc\flo@yb{\flo@clR*sin(\flo@a)}%
    \flo@calc\flo@xc{0.15*\flo@xb}\flo@calc\flo@yc{0.5*\flo@yb}\flo@calc\flo@xd{0.6*\flo@xb}\flo@calc\flo@yd{0.95*\flo@yb}%
    \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{0.25}{0.9}{0}{\pgfpathmoveto{\flo@P00}%
      \pgfpathcurveto{\flo@P\flo@xc\flo@yc}{\flo@P\flo@xd\flo@yd}{\flo@P\flo@xb\flo@yb}}%
    \def\flo@tmp{center}%
    \ifx\flo@oo\flo@tmp\flo@calc\flo@t{\flo@bst-0.35*abs(\flo@clf)}\else\flo@calc\flo@t{\flo@bst-0.35*(1-abs(\flo@clf))}\fi
    \flo@sym\flo@s{0.05}\flo@calc\flo@t{\flo@t+\flo@s}%
    \flo@range\flo@s{0.85}{1.1}\flo@calc\flo@s{\flo@clfd*\flo@s}\flo@calc\flo@a{\flo@a-90}%
    \flo@fadd\flo@xb\flo@yb\flo@a\flo@s\flo@t}%
  \flo@loop{umsb}\flo@Gd{-1}{1}{%
    \flo@sym\flo@t{10}\flo@calc\flo@a{\the\flo@Gd*40+\flo@t+180}\flo@range\flo@s{0.12}{0.18}\flo@calc\flo@s{\flo@clL*\flo@s}%
    \begin{pgfscope}\pgftransformrotate{\flo@a}\pgftransformscale{\flo@s}%
      \def\flo@vl@W{0.06}\def\flo@vl@tone{}\edef\flo@vl@u{\flo@s}\flo@vleaflet\end{pgfscope}}%
  \flo@fdraw}

% a head: many small flowers packed into a ball at the end of a stalk of #1 cm, as a
% clover's, each pointing away from its center; the outermost open first
\def\flo@headunit#1{%
  \edef\flo@bst{\flo@ust}\edef\flo@clL{#1}\flo@stone\def\flo@fnum{0}\def\flo@bfan{1}%
  \flo@axis\flo@clL{18}{0.024}%
  \def\flo@clf{1}\flo@axisat
  \flo@range\flo@t{0.9}{1.1}\flo@calc\flo@clr{(0.26+0.006*\flo@get{count})*\flo@t}%
  \flo@calc\flo@clx{\flo@px+0.75*\flo@clr*\flo@pny}\flo@calc\flo@cly{\flo@py-0.75*\flo@clr*\flo@pnx}%
  \flo@calc\flo@clm{int(max(18,min(34,\flo@get{count}+6)))}%
  \flo@loop{hd}\flo@Gd{1}{\flo@clm}{%
    \edef\flo@clk{\the\numexpr\flo@clm+1-\flo@Gd\relax}%
    \flo@calc\flo@v{sqrt(\flo@clk/\flo@clm)}\flo@calc\flo@a{137.508*\flo@clk}%
    \flo@calc\flo@xa{\flo@clx+0.8*\flo@clr*\flo@v*cos(\flo@a)}\flo@calc\flo@ya{\flo@cly+0.72*\flo@clr*\flo@v*sin(\flo@a)}%
    \flo@range\flo@t{0.9}{1.1}\flo@calc\flo@s{\flo@clr*0.65*(0.7+0.3*\flo@v)*\flo@t}%
    \flo@calc\flo@t{\flo@bst-0.45*(1-\flo@v)}\flo@calc\flo@a{\flo@a-90}%
    \flo@fadd\flo@xa\flo@ya\flo@a\flo@s\flo@t}%
  \flo@fdraw\def\flo@bfan{0}}

% catkins: two to four hanging from a short twig of #1 cm, each a stalk that bends over
% and a tapering tassel of overlapping scales with anthers at their tips, short and tight
% while young; in fruit, the fruit instead
\def\flo@catkinunit#1{%
  \edef\flo@bst{\flo@ust}\edef\flo@clL{#1}\flo@stone
  \flo@sym\flo@t{10}\flo@calc\flo@clh{90+\flo@t}\flo@sym\flo@clb{15}%
  \flo@walk{0}{0}\flo@clh\flo@clb\flo@clL{6}%
  \flo@loop{ckt}\flo@Gc{1}{7}{%
    \expandafter\edef\csname flo@AX\the\flo@Gc\endcsname{\flo@x{\the\flo@Gc}}%
    \expandafter\edef\csname flo@AY\the\flo@Gc\endcsname{\flo@y{\the\flo@Gc}}}%
  \flo@vstem{7}{0.028}{0.016}{0.1}%
  \flo@int\flo@clm{2}{4}%
  \flo@calc\flo@clw{0.11+0.02*\flo@get{size}}\flo@calc\flo@clwe{0.4*\flo@clw}%
  \ifx\flo@vf@tone\pgfutil@empty\def\flo@clt{0.4}\else\edef\flo@clt{\flo@vf@tone}\fi
  \flo@loop{ck}\flo@Gd{1}{\flo@clm}{%
    \edef\flo@clq{\the\numexpr8-\flo@Gd\relax}%
    \edef\flo@xa{\csname flo@AX\flo@clq\endcsname}\edef\flo@ya{\csname flo@AY\flo@clq\endcsname}%
    \ifodd\flo@Gd\def\flo@sg{1}\else\def\flo@sg{-1}\fi
    \flo@range\flo@t{40}{80}\flo@calc\flo@clhd{\flo@clh+\flo@clb+\flo@sg*\flo@t}%
    \ifdim\flo@bst pt>1.15pt
      \flo@calc\flo@xb{\flo@xa+0.25*cos(\flo@clhd)}\flo@calc\flo@yb{\flo@ya+0.25*sin(\flo@clhd)}%
      \flo@hair\flo@xa\flo@ya\flo@xb\flo@yb
      \def\flo@fu{0.3}\flo@calc\flo@a{\flo@clhd-90}%
      \begin{pgfscope}\pgftransformshift{\flo@P\flo@xb\flo@yb}\pgftransformrotate{\flo@a}\pgftransformscale{\flo@fu}%
        \flo@fruit\end{pgfscope}%
    \else
      % the stalk bends over and down, on the side it leans to, swaying a little
      \ifnum\flo@sg=1 \def\flo@cltg{270}\else\def\flo@cltg{-90}\fi
      \flo@range\flo@t{0.7}{1.1}\flo@calc\flo@cll{\flo@clL*2.2*\flo@t*min(1,0.45+0.6*\flo@bst)}%
      \flo@sym\flo@clph{180}\flo@calc\flo@clr{\flo@clhd-\flo@cltg}%
      \flo@put1\flo@xa\flo@ya\edef\flo@xx{\flo@xa}\edef\flo@yy{\flo@ya}\flo@calc\flo@ds{\flo@cll/18}%
      \flo@loop{ckw}\flo@Gc{1}{18}{%
        \flo@calc\flo@v{(\the\flo@Gc-0.5)/18}%
        \flo@calc\flo@a{\flo@cltg+\flo@clr*(1-min(1,\flo@v*3))+7*sin(360*\flo@v+\flo@clph)}%
        \flo@calc\flo@xx{\flo@xx+\flo@ds*cos(\flo@a)}\flo@calc\flo@yy{\flo@yy+\flo@ds*sin(\flo@a)}%
        \flo@put{\the\numexpr\flo@Gc+1\relax}{\flo@xx}{\flo@yy}}%
      \flo@vtone{flo@c}{0.1}\flo@vstroke{flo@c}{0.4}{1}{0}{\flo@smoothopen{5}}%
      % the tassel along points 4..19: a ribbon, then a scale and an anther at each point
      \flo@loop{ckc}\flo@Gc{4}{19}{%
        \edef\flo@clq{\the\numexpr\flo@Gc-3\relax}%
        \flo@zset{cx}\flo@clq{\flo@x{\the\flo@Gc}}\flo@zset{cy}\flo@clq{\flo@y{\the\flo@Gc}}}%
      \flo@loop{ckd}\flo@Gc{1}{16}{\flo@put{\the\flo@Gc}{\flo@z{cx}{\the\flo@Gc}}{\flo@z{cy}{\the\flo@Gc}}}%
      \flo@normals{16}%
      \flo@loop{cke}\flo@Gc{1}{16}{%
        \flo@zset{cn}{\the\flo@Gc}{\csname flo@NX\the\flo@Gc\endcsname}%
        \flo@zset{cm}{\the\flo@Gc}{\csname flo@NY\the\flo@Gc\endcsname}}%
      \flo@calc\flo@clsa{0.3*\flo@clwe}\flo@calc\flo@clsb{0.1*\flo@clwe}\flo@vstem{16}\flo@clsa\flo@clsb{0.12}%
      % scales on either side by turns, each leaning down and out over the next, lit on one
      % side and shaded on the other, an anther at its tip; the paper shows between them
      \flo@calc\flo@t{\flo@clt+0.06}\flo@vtone{flo@cka}\flo@t\flo@calc\flo@t{\flo@clt-0.06}\flo@vtone{flo@ckb}\flo@t
      \flo@vtone{flo@c}{0.16}%
      \flo@loop{cks}\flo@Gc{2}{16}{%
        \ifodd\flo@Gc\def\flo@sg{1}\else\def\flo@sg{-1}\fi
        \flo@calc\flo@v{(\the\flo@Gc-1)/15}\flo@calc\flo@s{\flo@clw*0.5*(1-0.55*\flo@v)}%
        \edef\flo@xa{\flo@z{cx}{\the\flo@Gc}}\edef\flo@ya{\flo@z{cy}{\the\flo@Gc}}%
        \edef\flo@clnx{\flo@z{cn}{\the\flo@Gc}}\edef\flo@clny{\flo@z{cm}{\the\flo@Gc}}%
        \flo@calc\flo@cldx{0.91*\flo@clny+0.42*\flo@sg*\flo@clnx}\flo@calc\flo@cldy{0.42*\flo@sg*\flo@clny-0.91*\flo@clnx}%
        \flo@calc\flo@xb{\flo@xa+\flo@sg*0.35*\flo@s*\flo@clnx}\flo@calc\flo@yb{\flo@ya+\flo@sg*0.35*\flo@s*\flo@clny}%
        \flo@calc\flo@clsl{min(1.04*\flo@s,max(0.75*\flo@s,1.1*\flo@ds))}%
        \flo@calc\flo@xc{\flo@clsl*\flo@cldx}\flo@calc\flo@yc{\flo@clsl*\flo@cldy}%
        \flo@calc\flo@xd{-0.65*\flo@s*\flo@cldy}\flo@calc\flo@yd{0.65*\flo@s*\flo@cldx}%
        \ifnum\flo@sg=1 \def\flo@tmp{flo@cka}\else\def\flo@tmp{flo@ckb}\fi
        \flo@vfill\flo@tmp{0.95}{0}{\pgfpathellipse{\flo@P\flo@xb\flo@yb}{\flo@P\flo@xc\flo@yc}{\flo@P\flo@xd\flo@yd}}%
        \flo@range\flo@t{0.008}{0.014}%
        \flo@calc\flo@xc{\flo@xb+\flo@xc}\flo@calc\flo@yc{\flo@yb+\flo@yc}%
        \flo@vfill{flo@c}{0.9}{0}{\pgfpathcircle{\flo@P\flo@xc\flo@yc}{\flo@t pt}}}%
    \fi}}
% a tendril as a climber grows one, each its own: from the origin along +y it runs out a
% little bent, then coils to one side, tighter toward its tip, by its own amount, from a
% loose hook to two and a half turns (most about one). #1 its size: the run is 0.2 to
% 0.9 of it, the coil starts 0.18 to 0.35 of it in radius and closes to 0.12 to 0.45 of
% that. Points 1..45 in flo@X/Y
\newcount\flo@Gt
\def\flo@vcurl#1{%
  \edef\flo@tds{#1}%
  \flo@chance{0.5}\ifflo@yes\def\flo@tdh{1}\else\def\flo@tdh{-1}\fi
  \flo@range\flo@t{0.2}{0.9}\flo@calc\flo@tdd{\flo@tds*\flo@t/8}\flo@sym\flo@tdb{4}%
  \flo@rnd\flo@t\flo@calc\flo@tdT{\flo@tdh*(4+21*\flo@t*sqrt(\flo@t))}%
  \flo@range\flo@t{0.18}{0.35}\flo@calc\flo@tdr{\flo@tds*\flo@t}\flo@range\flo@tdq{0.12}{0.45}%
  \def\flo@tda{90}\def\flo@tdx{0}\def\flo@tdy{0}\flo@put1{0}{0}%
  \flo@loop{tdf}\flo@Gt{1}{8}{%
    \flo@calc\flo@tda{\flo@tda+\flo@tdb}%
    \flo@calc\flo@tdx{\flo@tdx+\flo@tdd*cos(\flo@tda)}\flo@calc\flo@tdy{\flo@tdy+\flo@tdd*sin(\flo@tda)}%
    \flo@put{\the\numexpr\flo@Gt+1\relax}\flo@tdx\flo@tdy}%
  \flo@loop{tdc}\flo@Gt{1}{36}{%
    \flo@calc\flo@tda{\flo@tda+\flo@tdT}%
    \flo@calc\flo@t{\flo@tdr*pow(\flo@tdq,\the\flo@Gt/36)*abs(\flo@tdT)*0.0174533}%
    \flo@calc\flo@tdx{\flo@tdx+\flo@t*cos(\flo@tda)}\flo@calc\flo@tdy{\flo@tdy+\flo@t*sin(\flo@tda)}%
    \flo@put{\the\numexpr\flo@Gt+9\relax}\flo@tdx\flo@tdy}}
% a climber's tendril on a stalk of its own, size #1 cm: \flo@vcurl, tapered as
% flora.tendril
\def\flo@vtendril#1{%
  \flo@calc\flo@t{1.6*(#1)}\flo@vcurl\flo@t
  \flo@vstem{45}{0.022}{0.004}{0.12}}

% ---------------------------------------------------------------- room
% Which 5 mm cells are taken, kept per walk: a leaf or a branch goes only where the cells
% under it are mostly free, as florilegium-grow.lua's leaves and branches go on its grid.
\newcount\flo@Oi \newcount\flo@Oj \newcount\flo@On \newcount\flo@Ot
% mark (#1 = 1) or count (#1 = 0: \flo@On taken of \flo@Ot) the cells whose centers lie in
% the disc at (#2,#3), radius #4 cm (at least 3 mm)
\def\flo@room#1#2#3#4{%
  \pgfmathtruncatemacro\flo@ox{(#2)*10+1000}\pgfmathtruncatemacro\flo@oy{(#3)*10+1000}%
  \pgfmathtruncatemacro\flo@or{max(3,(#4)*10)}%
  \flo@On=0 \flo@Ot=0
  \flo@loop{rmi}\flo@Oi{(\flo@ox-\flo@or-2)/5}{(\flo@ox+\flo@or-2)/5}{%
    \flo@loop{rmj}\flo@Oj{(\flo@oy-\flo@or-2)/5}{(\flo@oy+\flo@or-2)/5}{%
      \ifnum\numexpr(5*\flo@Oi+2-\flo@ox)*(5*\flo@Oi+2-\flo@ox)+(5*\flo@Oj+2-\flo@oy)*(5*\flo@Oj+2-\flo@oy)\relax
          >\numexpr\flo@or*\flo@or\relax
      \else\ifnum#1=1
        \expandafter\let\csname flo@rm\flo@roomid @\the\flo@Oi @\the\flo@Oj\endcsname\relax
      \else
        \advance\flo@Ot by1
        \ifcsname flo@rm\flo@roomid @\the\flo@Oi @\the\flo@Oj\endcsname\advance\flo@On by1 \fi
      \fi\fi}}}
% the share of the disc (#1,#2), radius #3, already taken: \flo@taken
\def\flo@takenat#1#2#3{\flo@room0{#1}{#2}{#3}%
  \ifnum\flo@Ot=0 \def\flo@taken{0}\else\flo@calc\flo@taken{\the\flo@On/\the\flo@Ot}\fi}

% ---------------------------------------------------------------- the inflorescence in place
% the species' inflorescence as florilegium-grow.lua's motifs, \flo@kind: solitary, umbel
% (umbels, corymbs, forked cymes: a fan), raceme (racemes, spikes, panicles, thyrses,
% coiled cymes: along an axis), head, catkin, or blossoms (the rest)
\def\flo@kindof{%
  \edef\flo@if{\flo@get{inflo}}\def\flo@kind{blossoms}%
  \def\flo@tmp{solitary}\ifx\flo@if\flo@tmp\def\flo@kind{solitary}\fi
  \def\flo@tmp{cumbel}\ifx\flo@if\flo@tmp\def\flo@kind{umbel}\fi
  \def\flo@tmp{umbel}\ifx\flo@if\flo@tmp\def\flo@kind{umbel}\fi
  \def\flo@tmp{corymb}\ifx\flo@if\flo@tmp\def\flo@kind{umbel}\fi
  \def\flo@tmp{dichasium}\ifx\flo@if\flo@tmp\def\flo@kind{umbel}\fi
  \def\flo@tmp{raceme}\ifx\flo@if\flo@tmp\def\flo@kind{raceme}\fi
  \def\flo@tmp{spike}\ifx\flo@if\flo@tmp\def\flo@kind{raceme}\fi
  \def\flo@tmp{panicle}\ifx\flo@if\flo@tmp\def\flo@kind{raceme}\fi
  \def\flo@tmp{thyrse}\ifx\flo@if\flo@tmp\def\flo@kind{raceme}\fi
  \def\flo@tmp{monochasium}\ifx\flo@if\flo@tmp\def\flo@kind{raceme}\fi
  \def\flo@tmp{head}\ifx\flo@if\flo@tmp\def\flo@kind{head}\fi
  \def\flo@tmp{catkin}\ifx\flo@if\flo@tmp\def\flo@kind{catkin}\fi}
\def\flo@Kumbel{umbel}\def\flo@Kraceme{raceme}\def\flo@Kblossoms{blossoms}\def\flo@Khead{head}\def\flo@Kcatkin{catkin}
% the room it takes at (#1,#2), axis #3 degrees, #4 times its size: a disc at
% \flo@udx,\flo@udy of radius \flo@udr (nominal sizes, no draws)
\def\flo@unitdisc#1#2#3#4{%
  \flo@kindof\flo@fdiam{#4}\def\flo@uo{0}\flo@calc\flo@udr{0.5*\flo@fd}%
  \ifx\flo@kind\flo@Kumbel\flo@calc\flo@uo{0.69*(#4)}\flo@calc\flo@udr{0.86*(#4)}\fi
  \ifx\flo@kind\flo@Kraceme\flo@calc\flo@uo{0.95*(#4)}\flo@calc\flo@udr{0.75*(#4)}\fi
  \ifx\flo@kind\flo@Kblossoms\flo@calc\flo@uo{0.5*\flo@fd}\flo@calc\flo@udr{0.8*\flo@fd}\fi
  \ifx\flo@kind\flo@Khead\flo@calc\flo@uo{0.8*(#4)}\flo@calc\flo@udr{0.5*(#4)}\fi
  \ifx\flo@kind\flo@Kcatkin\flo@calc\flo@uo{0.2*(#4)}\flo@calc\flo@udr{0.9*(#4)}\fi
  \flo@calc\flo@udx{(#1)+\flo@uo*cos(#3)}\flo@calc\flo@udy{(#2)+\flo@uo*sin(#3)}}
% The species' inflorescence at (#1,#2), its axis at #3 degrees, #4 times its size, opening
% #5 later than the plant's first flower (0..0.5); its room is marked. Draws: the stage,
% then its stream
\def\flo@unit#1#2#3#4#5{%
  \edef\flo@ux{#1}\edef\flo@uy{#2}\edef\flo@uax{#3}\flo@calc\flo@ua{(#3)-90}\edef\flo@uk{#4}\edef\flo@ulate{#5}%
  \flo@unitdisc\flo@ux\flo@uy\flo@uax\flo@uk\flo@calc\flo@t{0.85*\flo@udr}\flo@room1\flo@udx\flo@udy\flo@t
  \flo@sym\flo@t{0.08}\flo@calc\flo@ust{1.2*\flo@season-\flo@ulate+\flo@t+\flo@get{phenology}}%
  \flo@seedorgan
  \ifx\flo@kind\flo@Kumbel\def\flo@ul{4}\else\ifx\flo@kind\flo@Kraceme\def\flo@ul{4}\else\def\flo@ul{5}\fi\fi
  \flo@at\flo@ul
  \ifflo@draw\flo@organ{\pgftransformshift{\flo@P\flo@ux\flo@uy}\pgftransformrotate{\flo@ua}\flo@unitdraw\flo@uk}\fi}
\def\flo@unitdraw#1{%
  \flo@fdiam{#1}%
  \def\flo@tmp{solitary}\ifx\flo@if\flo@tmp\flo@bloom\flo@fd\flo@ust\else
  \def\flo@tmp{cumbel}\ifx\flo@if\flo@tmp
    \flo@range\flo@t{0.95}{1.35}\flo@calc\flo@t{\flo@t*(#1)}\flo@umbelunit\flo@t\flo@ust\else
  \flo@range\flo@t{1.5}{2.3}\flo@calc\flo@L{\flo@t*(#1)}%
  \def\flo@tmp{raceme}\ifx\flo@if\flo@tmp\flo@racemeunit\flo@L{0.3}{40}\else
  \def\flo@tmp{spike}\ifx\flo@if\flo@tmp\flo@spikeunit\flo@L\else
  \def\flo@tmp{panicle}\ifx\flo@if\flo@tmp\flo@panicleunit\flo@L\else
  \def\flo@tmp{thyrse}\ifx\flo@if\flo@tmp\flo@thyrseunit\flo@L\else
  \def\flo@tmp{monochasium}\ifx\flo@if\flo@tmp\flo@curlunit\flo@L\else
  \def\flo@tmp{catkin}\ifx\flo@if\flo@tmp\flo@calc\flo@L{0.3*\flo@L}\flo@catkinunit\flo@L\else
  \def\flo@tmp{dichasium}\ifx\flo@if\flo@tmp\flo@calc\flo@L{0.8*\flo@L}\flo@forkunit\flo@L\else
  \def\flo@tmp{corymb}\ifx\flo@if\flo@tmp\flo@calc\flo@L{0.75*\flo@L}\flo@corymbunit\flo@L\else
  \def\flo@tmp{umbel}\ifx\flo@if\flo@tmp\flo@calc\flo@L{0.55*\flo@L}\flo@umbelsunit\flo@L\else
  \def\flo@tmp{head}\ifx\flo@if\flo@tmp\flo@calc\flo@L{0.35*\flo@L}\flo@headunit\flo@L\else
  \flo@calc\flo@fd{0.85*\flo@fd}\flo@blossoms\flo@fd\flo@ust
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
% opening order down the plant: from the top (cymes, solitary flowers) or from below; #1
% the height on the plant (0..1): \flo@late
\def\flo@lateness#1{%
  \edef\flo@if{\flo@get{inflo}}\def\flo@below{0}%
  \def\flo@tmp{raceme}\ifx\flo@if\flo@tmp\def\flo@below{1}\fi
  \def\flo@tmp{spike}\ifx\flo@if\flo@tmp\def\flo@below{1}\fi
  \def\flo@tmp{catkin}\ifx\flo@if\flo@tmp\def\flo@below{1}\fi
  \ifnum\flo@below=1 \flo@calc\flo@late{0.4*(#1)}\else\flo@calc\flo@late{0.4*(1-(#1))}\fi}
% autumn: some leaves of a species whose leaves turn go copper (\flo@lc drawn before);
% spring: young leaves paler
\def\flo@autumnleaf{%
  \ifnum\flo@get{turns}=1 \flo@calc\flo@t{max(0,\flo@season-0.9)}%
    \ifdim\flo@lc pt<\flo@t pt \def\flo@rampname{flo@aramp}\fi\fi
  \ifdim\flo@season pt<0.5pt \flo@calc\flo@lift{0.3*(1-\flo@season/0.5)}\fi}

% ---------------------------------------------------------------- the main stem
% its x at height #1 (cm), into \flo@sx: from \flo@root at the root into its lane \flo@pc
% over the first 3 cm, waving \flo@pA either side of it
\def\flo@stemx#1{%
  \flo@calc\flo@sb{min(1,max(0,(#1)/3))}%
  \flo@calc\flo@sx{\flo@root+\flo@sb*\flo@sb*(3-2*\flo@sb)*(\flo@pc-\flo@root+\flo@pA*(0.62*sin(360*(#1)/\flo@plam+\flo@pph)+0.38*sin(766.8*(#1)/\flo@plam+\flo@pps)))}}
% and its direction there, \flo@tx,\flo@ty (\flo@sx as above)
\def\flo@stemtan#1{%
  \flo@stemx{(#1)+0.05}\let\flo@sxa\flo@sx\flo@stemx{(#1)-0.05}%
  \flo@calc\flo@t{veclen(\flo@sxa-\flo@sx,0.1)}%
  \flo@calc\flo@tx{(\flo@sxa-\flo@sx)/\flo@t}\flo@calc\flo@ty{0.1/\flo@t}%
  \flo@stemx{#1}}
\def\flo@drawstem{%
  \pgfmathtruncatemacro\flo@sn{max(2,\flo@pH/0.25+1)}% two points at least, under 2.5 mm
  \flo@loop{stp}\flo@Gd{1}{\flo@sn}{%
    \flo@calc\flo@t{\flo@pH*(\the\flo@Gd-1)/(\flo@sn-1)}\flo@stemx\flo@t
    \flo@put{\the\flo@Gd}{\flo@sx}{\flo@t}}%
  \flo@vstem\flo@sn\flo@pw{0.028}{0.07}}
\def\flo@markstem{%
  \pgfmathtruncatemacro\flo@msn{\flo@pH/0.6}%
  \flo@loop{mks}\flo@Gd{1}{\flo@msn}{%
    \flo@calc\flo@my{0.6*\the\flo@Gd-0.3}\flo@stemx\flo@my\flo@room1\flo@sx\flo@my{0.2}}}

% ---------------------------------------------------------------- a plant, in four passes
% A garden's walk takes every plant through four passes, as florilegium-grow.lua grows
% the margin: 1. stems and the inflorescence at each top, 2. leaves, 3. branches from the
% nodes, 4. more branches wherever there is room (three rounds). Each plant keeps its
% layout stream from pass to pass.
% the plant \flo@Ga's parameters and stream
\def\flo@plantsetup{%
  \flo@calc\flo@root{(\the\flo@Ga-2)*0.25}\flo@calc\flo@pc{(\the\flo@Ga-2)*0.35}%
  \ifnum\flo@Np=1 \def\flo@root{0}\def\flo@pc{0}\fi
  \ifnum\flo@Ga=1 \def\flo@pw{0.085}\else\def\flo@pw{0.065}\fi
  \edef\flo@pH{\csname flo@pp@H\the\flo@Ga\endcsname}%
  \edef\flo@tmp{\noexpand\florilegiumspecies[{\flo@o@traits}]{\csname flo@pp@s\the\flo@Ga\endcsname}{\csname flo@pp@r\the\flo@Ga\endcsname}}\flo@tmp
  \xdef\pgfmath@rnd@z{\csname flo@pp@w\the\flo@Ga\endcsname}}
\def\flo@plantsave{\expandafter\xdef\csname flo@pp@w\the\flo@Ga\endcsname{\pgfmath@rnd@z}}
% 1. the stem and the inflorescence at its top
\def\flo@passstem{%
  \flo@range\flo@pph{0}{360}\flo@range\flo@pps{0}{360}\flo@range\flo@plam{5}{8}%
  \expandafter\edef\csname flo@pp@f\the\flo@Ga\endcsname{{\flo@pph}{\flo@pps}{\flo@plam}}%
  \flo@markstem
  \flo@at\flo@Lstem\ifflo@draw\begin{pgfscope}\flo@drawstem\end{pgfscope}\fi
  \flo@lateness{1}\let\flo@topoff\flo@late
  \flo@stemtan\flo@pH\flo@calc\flo@a{atan2(\flo@ty,\flo@tx)}%
  \flo@unit\flo@sx\flo@pH\flo@a{1.15}\flo@topoff}
\def\flo@stemload{\expandafter\expandafter\expandafter\flo@stemload@\csname flo@pp@f\the\flo@Ga\endcsname}
\def\flo@stemload@#1#2#3{\def\flo@pph{#1}\def\flo@pps{#2}\def\flo@plam{#3}}
% 2. leaves at nodes up the stem (each node kept for pass 3), a rosette at the root, or a
% monocot's strap leaves; a monocot with alternate or whorled leaves (a lily's) carries
% them up the stem as a eudicot does
\def\flo@passleaves{%
  \flo@stemload\flo@Ge=0 \flo@leafcof
  \edef\flo@cl{\flo@get{clade}}\def\flo@tmp{monocot}%
  \ifx\flo@cl\flo@tmp
    \edef\flo@arr{\flo@get{arrangement}}%
    \def\flo@tmp{alternate}\ifx\flo@arr\flo@tmp\def\flo@cl{leafy}\fi
    \def\flo@tmp{whorled}\ifx\flo@arr\flo@tmp\def\flo@cl{leafy}\fi
    \def\flo@tmp{monocot}%
  \fi
  \ifx\flo@cl\flo@tmp\flo@monocotleaves\else\flo@eudicotleaves\fi
  \expandafter\edef\csname flo@nd@n\the\flo@Ga\endcsname{\the\flo@Ge}}
% how much longer than v1.3's the species' leaves are drawn, so that they carry about as
% much ink (\flo@leafc): compound leaves a third longer, so that their leaflets read as
% leaves; a narrow blade longer as it is narrower (v1.3's leaf is about 2.2 times as long
% as it is wide), up to 1.45 times. florilegium-grow.lua's leafc_of is the same
\def\flo@leafcof{\edef\flo@t{\flo@get{compound}}\def\flo@tmp{simple}%
  \ifx\flo@t\flo@tmp\flo@calc\flo@leafc{min(1.45,max(1,sqrt(\flo@get{leafaspect}/2.2)))}\else\def\flo@leafc{1.35}\fi}
\def\flo@eudicotleaves{%
  \edef\flo@arr{\flo@get{arrangement}}\def\flo@per{1}\def\flo@gap{1}\def\flo@leafk{1}%
  \def\flo@tmp{opposite}\ifx\flo@arr\flo@tmp\def\flo@per{2}\def\flo@gap{1.3}\fi
  \def\flo@tmp{whorled}\ifx\flo@arr\flo@tmp\def\flo@per{3}\def\flo@gap{1.4}\fi
  \def\flo@tmp{rosette}\ifx\flo@arr\flo@tmp\flo@rosette\def\flo@gap{1.6}\def\flo@leafk{0.4}\fi
  \flo@range\flo@ny{0.7}{1.3}\flo@chance{0.5}\ifflo@yes\def\flo@side{1}\else\def\flo@side{-1}\fi
  \flo@calc\flo@nlast{\flo@pH-1.6}%
  \flo@nodes}
\def\flo@nodes{%
  \ifdim\flo@ny pt<\flo@nlast pt
    \advance\flo@Ge by1 \flo@nodeleaves
    \flo@range\flo@t{1.2}{1.9}\flo@calc\flo@ny{\flo@ny+\flo@t*\flo@gap}%
    \expandafter\flo@nodes
  \fi}
% the node at \flo@ny: \flo@nx, \flo@nyy, the stem's direction (\flo@ntx,\flo@nty; \flo@ta
% degrees) and width \flo@nw there, the height on the plant \flo@u
\def\flo@nodeat{%
  \edef\flo@nyy{\flo@ny}\flo@calc\flo@u{\flo@nyy/\flo@pH}\edef\flo@u{\flo@u}%
  \flo@stemtan\flo@nyy\edef\flo@nx{\flo@sx}\edef\flo@ntx{\flo@tx}\edef\flo@nty{\flo@ty}%
  \flo@calc\flo@ta{atan2(\flo@nty,\flo@ntx)}\edef\flo@ta{\flo@ta}%
  \flo@calc\flo@nw{\flo@pw+(0.028-\flo@pw)*\flo@u}\edef\flo@nw{\flo@nw}}
% the leaves of a node (by the arrangement), sides alternating from node to node, smaller
% up the stem by the species' taper (the top's to the bottom's); every other opposite pair
% turned across the last (decussate) points toward the viewer and away, so it is drawn
% close to the stem and foreshortened (\flo@fore); a sheathing leaf's sheath follows the
% stem (\flo@lsd: its direction from the leaf's)
\def\flo@nodeleaves{%
  \flo@nodeat
  \flo@calc\flo@side{-1*(\flo@side)}\edef\flo@side{\flo@side}%
  \expandafter\edef\csname flo@nd@\the\flo@Ga @\the\flo@Ge\endcsname{{\flo@nyy}{\flo@side}}%
  \flo@loop{nl}\flo@Gb{1}{\flo@per}{%
    \ifnum\flo@Gb=2 \flo@calc\flo@ls{-1*(\flo@side)}\else\edef\flo@ls{\flo@side}\fi
    \flo@range\flo@t{35}{60}\ifnum\flo@Gb=3 \flo@range\flo@t{8}{20}\fi
    \ifnum\flo@per=2 \ifodd\flo@Ge\else\flo@calc\flo@t{0.55*\flo@t}\def\flo@fore{0.55}\fi\fi
    \flo@calc\flo@la{\flo@ta+\flo@ls*\flo@t}\flo@calc\flo@lsd{\flo@ta-\flo@la}%
    \flo@range\flo@t{0.85}{1.1}\flo@calc\flo@lf{2.6*(1-(1-\flo@get{taper})*\flo@u)*\flo@t*\flo@leafk*\flo@leafc*(\the\flo@Gb==3 ? 0.7 : 1)}%
    \flo@range\flo@t{0.05}{0.3}\flo@calc\flo@sbend{\flo@ls*\flo@t}%
    \flo@rnd\flo@lc
    \flo@seedorgan
    \flo@placeleaf\flo@nx\flo@nyy}}
\def\flo@fore{1}\def\flo@lsd{}
% a leaf of the species from (#1,#2) at \flo@la degrees, \flo@lf cm long, or shorter where
% its room is taken (three tries, each 3/4 of the last), or none; its stream \flo@os
\def\flo@placeleaf#1#2{%
  \edef\flo@lx{#1}\edef\flo@ly{#2}\def\flo@ok{0}%
  \flo@loop{plf}\flo@Gd{1}{3}{%
    \ifnum\flo@ok=0
      \flo@calc\flo@mx{\flo@lx+cos(\flo@la)*\flo@lf*\flo@fore*0.55}\flo@calc\flo@my{\flo@ly+sin(\flo@la)*\flo@lf*\flo@fore*0.55}%
      \flo@calc\flo@t{0.24*\flo@lf}\flo@takenat\flo@mx\flo@my\flo@t
      \ifdim\flo@taken pt<0.2pt \def\flo@ok{1}\else\flo@calc\flo@lf{0.75*\flo@lf}\fi
    \fi}%
  \ifdim\flo@lf pt<0.45pt \def\flo@ok{0}\fi
  \ifnum\flo@ok=1
    \flo@loop{plm}\flo@Gd{1}{3}{%
      \flo@calc\flo@t{(0.05+0.25*\the\flo@Gd)*\flo@lf*\flo@fore}%
      \flo@calc\flo@mx{\flo@lx+cos(\flo@la)*\flo@t}\flo@calc\flo@my{\flo@ly+sin(\flo@la)*\flo@t}%
      \flo@calc\flo@t{0.2*\flo@lf}\flo@room1\flo@mx\flo@my\flo@t}%
    \flo@at\flo@Lleaf\ifflo@draw\flo@organ{%
      \pgftransformshift{\flo@P\flo@lx\flo@ly}\flo@calc\flo@t{\flo@la-90}\pgftransformrotate{\flo@t}%
      \pgftransformscale{\flo@lf}\ifdim\flo@fore pt<1pt \pgftransformyscale{\flo@fore}\fi\flo@autumnleaf
      \ifx\flo@lsd\pgfutil@empty\else\flo@calc\flo@lsw{1.8*\flo@nw/\flo@lf}\fi
      \flo@calc\flo@oarg{\flo@lf*28.45276}\flo@leaf\flo@oarg}\fi
  \fi
  \def\flo@fore{1}\def\flo@lsd{}}
% basal leaves of a rosette: three to five, spread low
\def\flo@rosette{%
  \flo@int\flo@nb{3}{5}%
  \flo@loop{ros}\flo@Gb{1}{\flo@nb}{%
    \flo@calc\flo@f{(\the\flo@Gb-(\flo@nb+1)/2)/max(1,(\flo@nb-1)/2)}%
    \flo@sym\flo@t{8}\flo@calc\flo@la{90-62*\flo@f+\flo@t}%
    \flo@range\flo@lf{1.6}{2.3}\flo@range\flo@t{0.05}{0.3}\flo@calc\flo@sbend{(\flo@f<0 ? 1 : -1)*\flo@t}%
    \flo@calc\flo@lf{\flo@lf*\flo@leafc}%
    \flo@rnd\flo@lc\flo@seedorgan\flo@placeleaf\flo@root{0.1}}}
% a monocot (an iris's or a grass's leaves, or a rosette): three to five strap leaves
% arching from the root, two nodes up the stem
\def\flo@monocotleaves{%
  \flo@int\flo@nb{3}{5}%
  \flo@loop{mb}\flo@Gb{1}{\flo@nb}{%
    \flo@calc\flo@f{(\the\flo@Gb-(\flo@nb+1)/2)/max(1,(\flo@nb-1)/2)}%
    \flo@sym\flo@t{5}\flo@calc\flo@la{90-24*\flo@f+\flo@t}%
    \flo@range\flo@t{0.3}{0.46}\flo@calc\flo@lf{min(7,\flo@pH*\flo@t)*(1-0.25*abs(\flo@f))}%
    \flo@range\flo@t{0.1}{0.35}\flo@calc\flo@sbend{(\flo@f<0 ? -1 : 1)*\flo@t}%
    \flo@rnd\flo@lc\flo@seedorgan\flo@calc\flo@t{\flo@root+0.12*\flo@f}\flo@placeleaf\flo@t{0}}%
  \flo@chance{0.5}\ifflo@yes\def\flo@side{1}\else\def\flo@side{-1}\fi
  \def\flo@per{1}\def\flo@leafk{0.75}%
  \flo@range\flo@ny{0.22}{0.3}\flo@calc\flo@ny{\flo@ny*\flo@pH}\advance\flo@Ge by1 \flo@nodeleaves
  \flo@range\flo@ny{0.42}{0.52}\flo@calc\flo@ny{\flo@ny*\flo@pH}\advance\flo@Ge by1 \flo@nodeleaves}
% 3. branches from the nodes, where there is room
\def\flo@passbranches{%
  \flo@stemload
  \edef\flo@nnodes{\csname flo@nd@n\the\flo@Ga\endcsname}%
  \flo@loop{pbr}\flo@Ge{1}{\flo@nnodes}{%
    \expandafter\expandafter\expandafter\flo@nodeload\csname flo@nd@\the\flo@Ga @\the\flo@Ge\endcsname
    \flo@nodeat
    \flo@rnd\flo@t\flo@calc\flo@t{\flo@t<(\the\flo@Ge==1 ? 0.35 : 0.85) ? 1 : 0}%
    \ifdim\flo@t pt>0.5pt \flo@branch\fi}}
\def\flo@nodeload#1#2{\def\flo@ny{#1}\def\flo@side{#2}}
% a branch from the node, opposite its leaf: first what it carries (the inflorescence,
% buds, or a curl on a climber), then the freest of three places for it
\def\flo@branch{%
  \flo@lateness\flo@u\flo@rnd\flo@mk
  \edef\flo@hb{\flo@get{habit}}\def\flo@tmp{climbing}%
  \ifx\flo@hb\flo@tmp\def\flo@climb{1}\else\edef\flo@climb{\flo@get{tendrils}}\fi
  \ifnum\flo@filling=1 \flo@calc\flo@mk{\flo@mk*1.25-0.25}\fi
  \ifdim\flo@mk pt<0pt \def\flo@what{4}\flo@leafcof\flo@range\flo@lf{1.1}{2}\flo@calc\flo@lf{\flo@lf*\flo@leafc}%
  \else\ifdim\flo@mk pt<0.6pt \def\flo@what{1}\flo@range\flo@usc{0.7}{0.9}\let\flo@ulate\flo@late
  \else\ifdim\flo@mk pt<0.82pt \def\flo@what{2}%
  \else\ifnum\flo@climb=1 \def\flo@what{3}%
  \else\def\flo@what{1}\def\flo@usc{0.6}\flo@calc\flo@ulate{\flo@late+0.1}\fi\fi\fi\fi
  \def\flo@best{2}%
  \flo@loop{bca}\flo@Gd{1}{3}{%
    \flo@range\flo@t{1.4}{3.2}\flo@calc\flo@cd{\flo@t*(1-0.25*\flo@u)}%
    \flo@range\flo@t{25}{75}\flo@calc\flo@cg{90+\flo@side*\flo@t}%
    \flo@calc\flo@cbx{max(\flo@pxmin,min(\flo@pxmax,\flo@nx-\flo@cd*cos(\flo@cg)))}%
    \flo@calc\flo@cby{\flo@nyy+\flo@cd*sin(\flo@cg)}%
    \flo@calc\flo@cax{\flo@cbx-\flo@nx}\flo@calc\flo@cay{\flo@cby-\flo@nyy}\flo@calc\flo@t{veclen(\flo@cax,\flo@cay)}%
    \flo@calc\flo@cax{\flo@cax/\flo@t}\flo@calc\flo@cay{\flo@cay/\flo@t+0.6}\flo@calc\flo@t{veclen(\flo@cax,\flo@cay)}%
    \flo@calc\flo@cax{\flo@cax/\flo@t}\flo@calc\flo@cay{\flo@cay/\flo@t}\flo@calc\flo@caa{atan2(\flo@cay,\flo@cax)}%
    \ifcase\flo@what\or\flo@unitdisc\flo@cbx\flo@cby\flo@caa\flo@usc
    \or\flo@calc\flo@udx{\flo@cbx+0.35*\flo@cax}\flo@calc\flo@udy{\flo@cby+0.35*\flo@cay}\def\flo@udr{0.5}%
    \or\edef\flo@udx{\flo@cbx}\edef\flo@udy{\flo@cby}\def\flo@udr{0.35}%
    \or\flo@calc\flo@udx{\flo@cbx+0.5*\flo@lf*\flo@cax}\flo@calc\flo@udy{\flo@cby+0.5*\flo@lf*\flo@cay}%
      \flo@calc\flo@udr{0.32*\flo@lf}\fi
    \flo@takenat\flo@udx\flo@udy\flo@udr
    \ifdim\flo@taken pt<\flo@best pt
      \let\flo@best\flo@taken\let\flo@bx\flo@cbx\let\flo@by\flo@cby
      \let\flo@ax\flo@cax\let\flo@ay\flo@cay\let\flo@a\flo@caa
      \let\flo@bdx\flo@udx\let\flo@bdy\flo@udy\let\flo@bdr\flo@udr
    \fi}%
  \ifdim\flo@best pt<0.3pt \flo@branchto\fi}
% the branch to (\flo@bx,\flo@by), a leaflet or two along it, and what it carries
\def\flo@branchto{%
  \flo@branchpath\flo@nx\flo@nyy\flo@ntx\flo@nty\flo@bx\flo@by\flo@ax\flo@ay
  \flo@loop{bmk}\flo@Gd{1}{3}{\flo@calc\flo@t{0.25*\the\flo@Gd}\flo@cubicat\flo@t\flo@room1\flo@cx\flo@cy{0.15}}%
  \flo@calc\flo@w{min(0.7*\flo@nw,0.05)}\flo@calc\flo@wb{max(0.012,0.45*\flo@w)}%
  \flo@at\flo@Lstem\ifflo@draw\flo@cubicstem\flo@w\flo@wb\fi
  \ifdim\flo@d pt>1.2pt
    \ifdim\flo@d pt>2.2pt \def\flo@nl{2}\else\def\flo@nl{1}\fi
    \flo@loop{brl}\flo@Gb{1}{\flo@nl}{%
      \flo@calc\flo@t{0.25+0.3*\the\flo@Gb/\flo@nl}\flo@cubicat\flo@t
      \flo@range\flo@t{40}{60}\flo@calc\flo@la{\flo@ca+(\the\flo@Gb==1 ? -1 : 1)*\flo@side*\flo@t-90}%
      \flo@range\flo@lf{0.45}{0.75}%
      \flo@seedorgan
      \flo@at\flo@Lleaf\ifflo@draw\flo@organ{\pgftransformshift{\flo@P\flo@cx\flo@cy}\pgftransformrotate{\flo@la}%
        \pgftransformscale{\flo@lf}\def\flo@vl@W{}\def\flo@vl@tone{}\edef\flo@vl@u{\flo@lf}\flo@vleaflet}\fi}%
  \fi
  \ifcase\flo@what\or
    \flo@unit\flo@bx\flo@by\flo@a\flo@usc\flo@ulate
  \or
    \flo@calc\flo@t{0.85*\flo@bdr}\flo@room1\flo@bdx\flo@bdy\flo@t
    \flo@seedorgan
    \flo@at\flo@Lbloom\ifflo@draw\flo@organ{\pgftransformshift{\flo@P\flo@bx\flo@by}\flo@calc\flo@t{\flo@a-90}%
      \pgftransformrotate{\flo@t}\flo@fdiam{0.6}\flo@calc\flo@fd{min(1.1,\flo@fd)}\flo@budding\flo@fd}\fi
  \or
    \flo@calc\flo@t{0.85*\flo@bdr}\flo@room1\flo@bdx\flo@bdy\flo@t
    \flo@seedorgan
    \flo@at\flo@Lairy\ifflo@draw\flo@organ{\pgftransformshift{\flo@P\flo@bx\flo@by}\flo@calc\flo@t{\flo@a}%
      \pgftransformrotate{\flo@t}\flo@range\flo@oarg{0.3}{0.5}\flo@vtendril\flo@oarg}\fi
  \or
    \flo@calc\flo@t{0.85*\flo@bdr}\flo@room1\flo@bdx\flo@bdy\flo@t
    \flo@range\flo@t{0.05}{0.3}\flo@calc\flo@sbend{\flo@side*\flo@t}\flo@rnd\flo@lc
    \flo@seedorgan
    \flo@at\flo@Lleaf\ifflo@draw\flo@organ{\pgftransformshift{\flo@P\flo@bx\flo@by}\flo@calc\flo@t{\flo@a-90}%
      \pgftransformrotate{\flo@t}\pgftransformscale{\flo@lf}\flo@autumnleaf
      \flo@calc\flo@oarg{\flo@lf*28.45276}\flo@leaf\flo@oarg}\fi
  \fi}
% 4. more branches, from anywhere up the stem, while there is room: three rounds of a few
% tries for each plant in turn, as florilegium-grow.lua's branch loop fills the holes (the
% rounds count with \flo@Gf, which nothing inside them uses)
\def\flo@filling{0}
\def\flo@passfill{%
  \flo@stemload\def\flo@filling{1}%
  \flo@loop{pfl}\flo@Ge{1}{\flo@ftries}{%
    \flo@range\flo@ny{0.12}{0.93}\flo@calc\flo@ny{\flo@ny*\flo@pH}%
    \flo@chance{0.5}\ifflo@yes\def\flo@side{1}\else\def\flo@side{-1}\fi
    \flo@nodeat\flo@branch}%
  \def\flo@filling{0}}

% ---------------------------------------------------------------- pics
\newif\ifflo@ghost
\pgfkeys{/florilegium/.is family, /florilegium,
  seed/.store in=\flo@o@seed, role/.store in=\flo@o@role, size/.store in=\flo@o@size,
  draw/.store in=\flo@o@draw, season/.store in=\flo@o@season,
  plants/.store in=\flo@o@plants, width/.store in=\flo@o@width, ghost/.is if=flo@ghost,
  engine/.is choice, engine/auto/.code=\def\flo@o@engine{auto}, engine/lua/.code=\def\flo@o@engine{lua},
  engine/tikz/.code=\def\flo@o@engine{tikz}, scale/.store in=\flo@o@scale, traits/.store in=\flo@o@traits,
  seed=1, role=any, size=2cm, draw=, season=0.75, plants=, width=6cm, ghost=true, engine=auto, scale=1,
  traits=}
% engine=lua: florilegium-native.lua draws the pic straight into the picture with the same
% steps and random draws as this file's TikZ code, computed in doubles (the same plant,
% its numbers within a fraction of a point), and tells pgf how large it is: some fifty
% times faster. engine=tikz: pgfmath computes and TikZ draws, under any engine.
% engine=auto (the default): lua under LuaLaTeX when florilegium-native.lua can be
% found, tikz otherwise
\def\flo@lua{lua}\def\flo@auto{auto}
\ifdefined\directlua
  \edef\flo@autoengine{\directlua{
    local ok, f = pcall(kpse.find_file, "florilegium-native.lua", "lua")
    tex.sprint(ok and f and "lua" or "tikz")}}
\else
  \def\flo@autoengine{tikz}
\fi
\def\flo@nolua{\pgfutil@packagewarning{florilegium}{engine=lua needs LuaLaTeX; drawing in pure TikZ}%
  \global\let\flo@nolua\relax}
% the document's ink and accent as r,g,b for Lua (\flo@colors without the ramps, which
% Lua builds itself)
\def\flo@picrgb{%
  \pgfutil@ifundefined{\string\color@ink}{\definecolor{flo@ink}{HTML}{2456C4}}{\colorlet{flo@ink}{ink}}%
  \pgfutil@ifundefined{\string\color@accent}{\definecolor{flo@accent}{HTML}{B4662F}}{\colorlet{flo@accent}{accent}}%
  \extractcolorspecs{flo@ink}{\flo@cmodel}{\flo@cspec}\convertcolorspec{\flo@cmodel}{\flo@cspec}{rgb}\flo@picink
  \extractcolorspecs{flo@accent}{\flo@cmodel}{\flo@cspec}\convertcolorspec{\flo@cmodel}{\flo@cspec}{rgb}\flo@picacc}
% a seed as \pgfmathsetseed takes it: the expression's value, the digits before the point
% (a plain number stays as written)
\def\flo@intof#1#2{\pgfmathparse{#2}\expandafter\flo@intof@\pgfmathresult.\relax#1}
\def\flo@intof@#1.#2\relax#3{\def#3{#1}}
% a number for \directlua as TeX holds it, so that nothing but digits, a minus sign and a
% point reaches the Lua string: a whole number as pgf's generator reads a seed (a count
% register), a pgfmath result as a dimen
\def\flo@luanum#1{\count@=#1\relax\edef#1{\the\count@}}
\def\flo@luadim#1#2{\pgfmathparse{#2}\dimen@=\pgfmathresult pt\relax\edef#1{\pgf@sys@tonumber\dimen@}}
% the keys for Lua as the TikZ code reads them: the seeds as \pgfmathsetseed, the season
% and the scale as pgfmath's numbers, the plants as \flo@parseplants lists them
\def\flo@luapic#1#2{%
  \pgfkeys{/florilegium,#2}\flo@picrgb
  \flo@intof\flo@luaseed\flo@o@seed
  \ifnum\flo@luaseed<1 \flo@badseed\flo@luaseed\else\ifnum\flo@luaseed>2147483646 \flo@badseed\flo@luaseed\fi\fi
  \flo@luanum\flo@luaseed
  \def\flo@luakind{#1}\def\flo@t{visitor}\def\flo@tmp{tracery}\def\flo@tmpb{shell}%
  \ifx\flo@luakind\flo@t
    \flo@isrole{flo@vrole@}{\flo@o@role}\ifflo@roleok\else\flo@vroleerror{\flo@o@role}\def\flo@o@role{any}\fi
  \else\ifx\flo@luakind\flo@tmp
    \flo@isrole{flo@trole@}{\flo@o@role}\ifflo@roleok\else\flo@troleerror{\flo@o@role}\def\flo@o@role{any}\fi
  \else\ifx\flo@luakind\flo@tmpb
    \flo@isrole{flo@krole@}{\flo@o@role}\ifflo@roleok\else\flo@kroleerror{\flo@o@role}\def\flo@o@role{any}\fi
  \else
    \flo@isrole{flo@role@}{\flo@o@role}\ifflo@roleok\else\flo@roleerror{\flo@o@role}\def\flo@o@role{any}\fi
  \fi\fi\fi
  \ifx\flo@o@draw\pgfutil@empty\let\flo@luadraw\pgfutil@empty\else\flo@intof\flo@luadraw\flo@o@draw\flo@luanum\flo@luadraw\fi
  \flo@luadim\flo@luaseason\flo@o@season
  \flo@luadim\flo@luascale\flo@o@scale
  \let\flo@luaplants\pgfutil@empty
  \def\flo@t{plants}%
  \ifx\flo@luakind\flo@t
    \expandafter\flo@parseplants\expandafter{\flo@o@plants}%
    \flo@loop{lua}\flo@i{1}{\flo@Np}{%
      \edef\flo@luaplants{\flo@luaplants\csname flo@pp@s\the\flo@i\endcsname/\csname flo@pp@r\the\flo@i\endcsname,}}%
  \fi
  \pgfmathsetlength\pgf@x{\flo@o@size}\pgfmathsetlength\pgf@y{\flo@o@width}%
  \directlua{require("florilegium-native").tikz("#1", "\flo@luaseed",
    "\luaescapestring{\flo@o@role}", "\flo@luadraw", \number\pgf@x, \number\pgf@y,
    "\flo@luaseason", "\luaescapestring{\flo@luaplants}", "\ifflo@ghost true\else false\fi",
    "\flo@luascale", "\flo@picink", "\flo@picacc",
    "\ifcsname ver@tikzlibraryflorilegium.code.tex\endcsname\luaescapestring{\csname ver@tikzlibraryflorilegium.code.tex\endcsname}\fi",
    "\luaescapestring{\flo@o@traits}")}}
% #1 the pic's keys, #2 its kind for Lua, #3 the TikZ code
\def\flo@engine#1#2#3{\pgfkeys{/florilegium,#1}%
  \ifx\flo@o@engine\flo@auto\let\flo@o@engine\flo@autoengine\fi
  \ifx\flo@o@engine\flo@lua\ifdefined\directlua\flo@luapic{#2}{#1}\else\flo@nolua#3\fi\else#3\fi}
% sample the species, then reseed for the drawing (draw=, or the species seed + 1)
\def\flo@picsetup#1{%
  \pgfkeys{/florilegium,#1}\flo@colors\flo@intof\flo@o@seed\flo@o@seed
  \edef\flo@tmp{\noexpand\florilegiumspecies[{\flo@o@traits}]{\flo@o@seed}{\flo@o@role}}\flo@tmp
  \edef\flo@o@seed{\flo@get{seed}}\edef\flo@o@role{\flo@get{role}}% as the sampler settled them
  \ifx\flo@o@draw\pgfutil@empty
    \edef\flo@o@draw{\the\numexpr\ifnum\flo@o@seed=2147483646 1\else\flo@o@seed+1\fi\relax}\fi
  \flo@drawseed\flo@o@draw
  \pgfmathsetlength\pgf@x{\flo@o@size}\edef\flo@sizept{\pgf@sys@tonumber\pgf@x}}
% \pic {florilegium flower={seed=7, size=2cm}}: one flower face on, size its diameter
\tikzset{pics/florilegium flower/.style={code={\flo@engine{#1}{flower}{%
  \flo@picsetup{#1}%
  \pgftransformscale{\flo@sizept}%
  \flo@stone\flo@sflower\flo@sizept}}}}
% \pic {florilegium tracery={seed=7, role=window, size=4cm}}: a window of Gothic tracery
% centered on the origin with its sill on the x axis, size its width (the outermost molding
% included); role headpiece, window, frame, rose, ornament, any, or a kind
\tikzset{pics/florilegium tracery/.style={code={\flo@engine{#1}{tracery}{\flo@tracerypic{#1}}}}}
% \pic {florilegium shell={seed=3, role=margin, size=2cm}}: a shell size across at most,
% centered on the y axis with its base on the x axis; role margin, ornament, planispiral,
% bivalve, gastropod, any, or a kind
\tikzset{pics/florilegium shell/.style={code={\flo@engine{#1}{shell}{\flo@shellpic{#1}}}}}
% \pic {florilegium leaf={seed=7, size=4cm}}: one leaf from its base along +y, size its length
\tikzset{pics/florilegium leaf/.style={code={\flo@engine{#1}{leaf}{%
  \flo@picsetup{#1}%
  \pgftransformscale{\flo@sizept}%
  \flo@leaf\flo@sizept}}}}
% \pic {florilegium inflorescence={seed=7, role=borage, scale=1, season=0.75}}: the
% species' flowers as they grow together, from the origin along +y, as large as a margin's
% at scale 1 (a raceme's axis is then about 2 cm long); season as for a plant, the
% oldest flower's stage 1.2 times it
\tikzset{pics/florilegium inflorescence/.style={code={\flo@engine{#1}{inflorescence}{%
  \flo@picsetup{#1}%
  \pgfsetroundcap\pgfsetroundjoin\pgftransformscale{28.45276}%
  \flo@kindof\pgfmathparse{\flo@o@season}\let\flo@season\pgfmathresult\def\flo@ulate{0}%
  \flo@sym\flo@t{0.08}\flo@calc\flo@ust{1.2*\flo@season-\flo@ulate+\flo@t+\flo@get{phenology}}%
  \flo@unitdraw{\flo@o@scale}}}}}
% the list plants={seed/role, ...} into \flo@pp@s<k>, \flo@pp@r<k>, k = 1..\flo@Np: an
% empty item (a trailing comma) is skipped; an item without /role, and a fern (it grows
% from its crown: the fern pic), are errors and left out; a seed or a role the samplers
% would refuse is an error, and seed 1 or role any is drawn
\let\flo@endplants\relax\def\flo@endmark{\flo@endplants}
\def\flo@parseplants#1{\flo@Np=0 \flo@parseplant#1,\flo@endplants,%
  \ifnum\flo@Np=0 \pgfutil@packageerror{florilegium}{plants names no plant}{Write
    plants={3/rose, 17/umbellifer}. The pic is left out}\fi}
\def\flo@parseplant#1,{%
  \edef\flo@q{\zap@space#1 \@empty}%
  \ifx\flo@q\flo@endmark\else
    \ifx\flo@q\pgfutil@empty\else\expandafter\flo@parseplant@\flo@q/\flo@endplants/\relax\fi
    \expandafter\flo@parseplant
  \fi}
\def\flo@parseplant@#1/#2/#3\relax{%
  \def\flo@q{#2}\def\flo@tmp{#1}%
  \ifx\flo@q\flo@endmark
    \pgfutil@packageerror{florilegium}{A plant in plants is seed/role, not `#1'}{Write
      plants={3/rose, 17/umbellifer}. The plant `#1' is left out}%
  \else\ifx\flo@tmp\pgfutil@empty
    \pgfutil@packageerror{florilegium}{A plant in plants is seed/role, not `/#2'}{Write
      plants={3/rose, 17/umbellifer}. The plant `/#2' is left out}%
  \else\def\flo@tmp{fern}\ifx\flo@q\flo@tmp
    \pgfutil@packageerror{florilegium}{A fern grows from its crown, not on a stem: draw
      #1/fern with the fern pic}{\string\pic\space{florilegium fern={seed=#1}} draws it. The
      fern is left out of plants}%
  \else
    \advance\flo@Np by1
    \pgfmathtruncatemacro\flo@t{#1}%
    \ifnum\flo@t<1 \flo@badseed\flo@t\else\ifnum\flo@t>2147483646 \flo@badseed\flo@t\fi\fi
    \expandafter\let\csname flo@pp@s\the\flo@Np\endcsname\flo@t
    \flo@isrole{flo@role@}{#2}\ifflo@roleok\let\flo@t\flo@rq\else\flo@roleerror{#2}\def\flo@t{any}\fi
    \expandafter\let\csname flo@pp@r\the\flo@Np\endcsname\flo@t
  \fi\fi\fi}
% the plants \flo@pp.. from one root at the origin, the first \flo@gH cm tall, within
% \flo@gW cm; a pale flower of the first behind them when \flo@gghost is true. Walked once
% per layer: the ghost, stems, leaves, sprays, flowers
\def\flo@garden{%
  \pgfsetroundcap\pgfsetroundjoin
  \pgftransformscale{28.45276}%
  \pgfmathparse{\flo@o@season}\let\flo@season\pgfmathresult
  % heights, each plant's stream, the ghost: from the first plant's seed
  \flo@drawseed{\csname flo@pp@s1\endcsname}%
  \flo@loop{gl}\flo@Ga{1}{\flo@Np}{%
    \ifcase\flo@Ga\or\def\flo@t{1}\or\flo@range\flo@t{0.6}{0.72}\or\flo@range\flo@t{0.36}{0.48}%
    \else\flo@range\flo@t{0.5}{0.58}\fi
    \flo@calc\flo@t{\flo@gH*\flo@t}\expandafter\let\csname flo@pp@H\the\flo@Ga\endcsname\flo@t
    \flo@seedorgan\expandafter\let\csname flo@pp@z\the\flo@Ga\endcsname\flo@os}%
  \flo@range\flo@gx{0.35}{0.65}\flo@calc\flo@gx{\flo@gW*(\flo@gx-0.5)}%
  \flo@range\flo@gy{0.15}{0.3}\flo@calc\flo@gy{\flo@gH*\flo@gy}\flo@range\flo@gdiam{2.6}{3.2}%
  \flo@seedorgan\let\flo@gos\flo@os
  \flo@calc\flo@pxmin{-\flo@gW/2+0.7}\flo@calc\flo@pxmax{\flo@gW/2-0.7}%
  \ifnum\flo@Np=1 \def\flo@pA{0.5}\else\flo@calc\flo@pA{0.2*\flo@gW}\fi
  \flo@loop{glay}\flo@Gc{1}{5}{%
    \edef\flo@layer{\the\flo@Gc}\let\flo@roomid\flo@layer%
    \flo@loop{gw}\flo@Ga{1}{\flo@Np}{%
      \expandafter\let\csname flo@pp@w\the\flo@Ga\expandafter\endcsname\csname flo@pp@z\the\flo@Ga\endcsname}%
    \ifx\flo@gghost\flo@true
      \flo@calc\flo@t{0.25*\flo@gdiam}\flo@room1\flo@gx\flo@gy\flo@t
      \ifnum\flo@Gc=1
        \edef\flo@tmp{\noexpand\florilegiumspecies[{\flo@o@traits}]{\csname flo@pp@s1\endcsname}{\csname flo@pp@r1\endcsname}}\flo@tmp
        \let\flo@os\flo@gos
        % a plain flower of the species, as v1.3's ghosts are: no daisy disk, no lily
        \flo@organ{\def\flo@lift{0.62}\pgftransformshift{\flo@P\flo@gx\flo@gy}\flo@stone
          \flo@set{form}{rotate}\ifnum\flo@get{merosity}>6 \flo@set{merosity}{5}\fi
          \pgftransformscale{\flo@gdiam}\flo@calc\flo@oarg{\flo@gdiam*28.45276}\flo@sflower\flo@oarg}%
      \fi
    \fi
    \flo@loop{gps}\flo@Ga{1}{\flo@Np}{\flo@plantsetup\flo@passstem\flo@plantsave}%
    \flo@loop{gpl}\flo@Ga{1}{\flo@Np}{\flo@plantsetup\flo@passleaves\flo@plantsave}%
    \flo@loop{gpb}\flo@Ga{1}{\flo@Np}{\flo@plantsetup\flo@passbranches\flo@plantsave}%
    \flo@loop{gfr}\flo@Gf{1}{3}{%
      \flo@loop{gpf}\flo@Ga{1}{\flo@Np}{%
        \flo@plantsetup\pgfmathtruncatemacro\flo@ftries{\flo@pH/2}\flo@passfill\flo@plantsave}}}}
\def\flo@true{true}
% \pic {florilegium plant={seed=7, role=rose, size=14cm, width=6cm, season=0.75}}: one
% plant from its root, size its height, its branches reaching about width
\tikzset{pics/florilegium plant/.style={code={\flo@engine{#1}{plant}{%
  \flo@picsetup{#1}%
  \flo@calc\flo@gH{\flo@sizept/28.45276}%
  \edef\flo@t{\flo@get{clade}}\def\flo@tmp{fern}%
  \ifx\flo@t\flo@tmp\flo@ferncrown\else
  \flo@Np=1 \expandafter\edef\csname flo@pp@s1\endcsname{\flo@o@seed}%
  \expandafter\edef\csname flo@pp@r1\endcsname{\flo@o@role}%
  \def\flo@gghost{false}%
  \pgfmathsetlength\pgf@x{\flo@o@width}\flo@calc\flo@gW{\pgf@x/28.45276}%
  \flo@garden\fi}}}}
% \pic {florilegium fern={seed=7, size=8cm, season=0.75}}: a fern (role fern) as a margin
% grows one at its root, size its longest frond
\tikzset{pics/florilegium fern/.style={code={\flo@engine{#1,role=fern}{fern}{%
  \flo@picsetup{#1,role=fern}\flo@fernpic{#1}\flo@calc\flo@gH{\flo@sizept/28.45276}\flo@ferncrown}}}}
% a plan fixed to a flowering plant is an error, and the fern is drawn as sampled, without
% the traits, as M.tikz does
\def\flo@fernpic#1{\edef\flo@t{\flo@get{clade}}\def\flo@tmp{fern}%
  \ifx\flo@t\flo@tmp\else
    \pgfutil@packageerror{florilegium}{The fern pic draws a fern, and plan=\flo@get{plan}\space is a
      flowering plant's}{Press return to draw it as sampled, without the traits.}%
    \flo@picsetup{#1,role=fern,traits=}%
  \fi}
% \pic {florilegium plants={plants={3/rose, 17/umbellifer, 29/mustard}, size=20cm, width=6cm}}:
% plants from one root, like a margin's main stems; the first reaches size, the others
% 60-72% and 36-48% of it; a pale flower of the first behind them (ghost=false: none)
\tikzset{pics/florilegium plants/.style={code={\flo@engine{#1}{plants}{%
  \pgfkeys{/florilegium,#1}\flo@colors
  \expandafter\flo@parseplants\expandafter{\flo@o@plants}
  \pgfmathsetlength\pgf@x{\flo@o@size}\flo@calc\flo@gH{\pgf@x/28.45276}%
  \pgfmathsetlength\pgf@x{\flo@o@width}\flo@calc\flo@gW{\pgf@x/28.45276}%
  \edef\flo@gghost{\ifflo@ghost true\else false\fi}%
  \ifnum\flo@Np>0 \flo@garden\fi}}}}

% ================================================================ v1.3's hand
% florilegium-flora.lua's petal, heart and flower, line for line in pgfmath: the same
% outline (a blade with a noise-ragged edge), the same pale heart, watercolor mottle and
% specks, dark brush strokes, pooled rim, white streaks and veins, in ink's OKLCH tones.
% Only the random numbers differ: pgf's generator here (and in the Lua side that mirrors
% this file), mulberry32 in flora. Angles are degrees.

% colors: tone t of ink's ramp; the accent toward white (k >= 0) or darker (k < 0)
% (a ghost lifts every tone toward white: t + (1-t) lift, as ink.tone does)
\def\flo@vtone#1#2{%
  \ifx\flo@lift\flo@zero\pgfmathtruncatemacro\flo@ti{max(0,min(100,floor((#2)*100+0.5)))}%
  \else\pgfmathtruncatemacro\flo@ti{max(0,min(100,floor(((#2)+(1-(#2))*\flo@lift)*100+0.5)))}\fi
  \colorlet{#1}{\flo@rampname @\flo@ti}}
\def\flo@lift{0}\def\flo@zero{0}
\def\flo@vaccent#1#2{%
  \ifdim#2pt<0pt \pgfmathparse{100*(1+(#2))}\colorlet{#1}{flo@accent!\pgfmathresult!black}%
  \else\pgfmathparse{100*(1-(#2))}\colorlet{#1}{flo@accent!\pgfmathresult!white}\fi}
% fill or stroke a path (#4, #5) in a scope of its own: color, (width in bp,) opacity, multiply 0/1
% opacities in hundredths, as florilegium-ink.lua registers them (/floaNN): pgf makes a
% graphics state per distinct value, and five decimals would make thousands
\def\flo@op@q#1{\pgfmathparse{round((#1)*100)/100}\let\flo@opq\pgfmathresult}
\def\flo@vfill#1#2#3#4{\begin{pgfscope}\pgfsetfillcolor{#1}\flo@op@q{#2}\pgfsetfillopacity{\flo@opq}%
  \ifnum#3=1 \pgfsetblendmode{multiply}\fi#4\pgfusepath{fill}\end{pgfscope}}
\def\flo@vstroke#1#2#3#4#5{\begin{pgfscope}\pgfsetstrokecolor{#1}\pgfsetlinewidth{#2bp}%
  \flo@op@q{#3}\pgfsetstrokeopacity{\flo@opq}\ifnum#4=1 \pgfsetblendmode{multiply}\fi#5\pgfusepath{stroke}\end{pgfscope}}
% rng.chance(p): one draw, then \ifflo@yes
\newif\ifflo@yes
\newtoks\flo@spk \newtoks\flo@spa
% how often a round petal is notched at its tip, and how deeply (flora: 0.4, 1)
\def\flo@vp@notchp{0.4}\def\flo@vp@notchk{1}
\def\flo@chance#1{\pgfmathparse{rnd}\ifdim\pgfmathresult pt<#1pt \flo@yestrue\else\flo@yesfalse\fi}

% ---------------------------------------------------------------- noise (ink.noise1, ink.fbm1)
% three tables of 256 gradients, one draw each (rng.sym(1) = rand)
\def\flo@vfbm{%
  \flo@loop{fbmk}\flo@kc{1}{3}{%
    \flo@loop{fbmi}\flo@kb{0}{255}{%
      \pgfmathparse{rand}\expandafter\let\csname flo@G\the\flo@kc @\the\flo@kb\endcsname\pgfmathresult}}}
% the fractal noise at #1: \flo@wv
\def\flo@vwave#1{%
  \def\flo@wv{0}\def\flo@wa{1}\def\flo@wf{1}%
  \flo@loop{wave}\flo@kc{1}{3}{%
    \flo@calc\flo@wx{(#1)*\flo@wf+17*\the\flo@kc}%
    \pgfmathtruncatemacro\flo@wi{floor(\flo@wx)}\flo@calc\flo@wr{\flo@wx-\flo@wi}%
    % index mod 256 (\numexpr rounds, so floor(i/256) = round((i-128)/256); here i >= 17)
    \edef\flo@ga{\csname flo@G\the\flo@kc @\the\numexpr\flo@wi-256*((\flo@wi-128)/256)\relax\endcsname}%
    \edef\flo@gb{\csname flo@G\the\flo@kc @\the\numexpr\flo@wi+1-256*((\flo@wi-127)/256)\relax\endcsname}%
    \flo@calc\flo@wn{2*(\flo@ga*\flo@wr+(\flo@gb*(\flo@wr-1)-\flo@ga*\flo@wr)*\flo@wr*\flo@wr*(3-2*\flo@wr))}%
    \flo@calc\flo@wv{\flo@wv+\flo@wa*\flo@wn}\flo@calc\flo@wa{\flo@wa*0.5}\flo@calc\flo@wf{\flo@wf*2}}}

% ---------------------------------------------------------------- geometry (ink.taper, ink.blob)
% the left normal of (#1,#2) into #3 #4, (0,0) for a zero vector
\def\flo@nrm#1#2#3#4{\pgfmathparse{veclen(#1,#2)}\let\flo@nl\pgfmathresult
  \ifdim\flo@nl pt<0.00002pt \def#3{0}\def#4{0}\else\flo@calc#3{-(#2)/\flo@nl}\flo@calc#4{(#1)/\flo@nl}\fi}
% ink.taper: a closed tapered stroke along one cubic, widths \flo@twa at the start and
% \flo@twb at the end; #1..#8 the four points
\def\flo@vtaper#1#2#3#4#5#6#7#8{%
  \flo@calc\flo@da{#3-(#1)}\flo@calc\flo@db{#4-(#2)}\flo@nrm\flo@da\flo@db\flo@nax\flo@nay
  \flo@calc\flo@da{#5-(#1)}\flo@calc\flo@db{#6-(#2)}\flo@nrm\flo@da\flo@db\flo@nbx\flo@nby
  \flo@calc\flo@da{#7-(#3)}\flo@calc\flo@db{#8-(#4)}\flo@nrm\flo@da\flo@db\flo@ncx\flo@ncy
  \flo@calc\flo@da{#7-(#5)}\flo@calc\flo@db{#8-(#6)}\flo@nrm\flo@da\flo@db\flo@ndx\flo@ndy
  \flo@calc\flo@ha{\flo@twa/2}\flo@calc\flo@hb{(2*\flo@twa+\flo@twb)/6}%
  \flo@calc\flo@hc{(\flo@twa+2*\flo@twb)/6}\flo@calc\flo@hd{\flo@twb/2}%
  \flo@calc\flo@pa{#1+\flo@nax*\flo@ha}\flo@calc\flo@pb{#2+\flo@nay*\flo@ha}%
  \flo@calc\flo@pc{#3+\flo@nbx*\flo@hb}\flo@calc\flo@pd{#4+\flo@nby*\flo@hb}%
  \flo@calc\flo@pe{#5+\flo@ncx*\flo@hc}\flo@calc\flo@pf{#6+\flo@ncy*\flo@hc}%
  \flo@calc\flo@pg{#7+\flo@ndx*\flo@hd}\flo@calc\flo@ph{#8+\flo@ndy*\flo@hd}%
  \pgfpathmoveto{\flo@P\flo@pa\flo@pb}\pgfpathcurveto{\flo@P\flo@pc\flo@pd}{\flo@P\flo@pe\flo@pf}{\flo@P\flo@pg\flo@ph}%
  \flo@calc\flo@pg{#7-\flo@ndx*\flo@hd}\flo@calc\flo@ph{#8-\flo@ndy*\flo@hd}\pgfpathlineto{\flo@P\flo@pg\flo@ph}%
  \flo@calc\flo@pe{#5-\flo@ncx*\flo@hc}\flo@calc\flo@pf{#6-\flo@ncy*\flo@hc}%
  \flo@calc\flo@pc{#3-\flo@nbx*\flo@hb}\flo@calc\flo@pd{#4-\flo@nby*\flo@hb}%
  \flo@calc\flo@pa{#1-\flo@nax*\flo@ha}\flo@calc\flo@pb{#2-\flo@nay*\flo@ha}%
  \pgfpathcurveto{\flo@P\flo@pe\flo@pf}{\flo@P\flo@pc\flo@pd}{\flo@P\flo@pa\flo@pb}\pgfpathclose}
% ink.blob: #6 points around (#1,#2), radii #3 #4, roughness #5, into flo@X/Y 1..#6;
% draws 3 numbers, then one per point
\def\flo@vblob#1#2#3#4#5#6{%
  \flo@range\flo@bph{0}{360}\flo@range\flo@bpi{0}{360}\flo@range\flo@brot{0}{360}%
  \flo@loop{vblob}\flo@kb{0}{#6-1}{%
    \flo@calc\flo@ba{360*\the\flo@kb/(#6)}\flo@sym\flo@bs{1}%
    \flo@calc\flo@bk{1+(#5)*(0.6*sin(2*\flo@ba+\flo@bph)+0.4*sin(3*\flo@ba+\flo@bpi))+(#5)*0.5*\flo@bs}%
    \flo@calc\flo@bpx{(#3)*\flo@bk*cos(\flo@ba)}\flo@calc\flo@bpy{(#4)*\flo@bk*sin(\flo@ba)}%
    \flo@calc\flo@bx{(#1)+\flo@bpx*cos(\flo@brot)-\flo@bpy*sin(\flo@brot)}%
    \flo@calc\flo@by{(#2)+\flo@bpx*sin(\flo@brot)+\flo@bpy*cos(\flo@brot)}%
    \flo@put{\the\numexpr\flo@kb+1\relax}{\flo@bx}{\flo@by}}%
  \flo@smoothprep{#6}}
% flora's mottle inside the current clip: #5 blotches of about #6 over (#1,#2)-(#3,#4), dark
% tone #7, light #8, #9 specks
\def\flo@vmottle#1#2#3#4#5#6#7#8#9{%
  \flo@loop{vmot}\flo@ka{1}{#5}{%
    \flo@range\flo@mx{#1}{#3}\flo@range\flo@my{#2}{#4}\flo@range\flo@t{0.5}{1.4}\flo@calc\flo@mr{(#6)*\flo@t}%
    \flo@range\flo@t{0.5}{1}\flo@calc\flo@ms{\flo@mr*\flo@t}%
    \flo@vblob\flo@mx\flo@my\flo@mr\flo@ms{0.35}{7}%
    \flo@chance{0.6}%
    \ifflo@yes\flo@sym\flo@t{0.06}\flo@vtone{flo@c}{#7+\flo@t}\flo@range\flo@op{0.10}{0.22}%
      \flo@vfill{flo@c}{\flo@op}{1}{\flo@smoothpath}%
    \else\flo@sym\flo@t{0.06}\flo@vtone{flo@c}{#8+\flo@t}\flo@range\flo@op{0.12}{0.26}%
      \flo@vfill{flo@c}{\flo@op}{0}{\flo@smoothpath}\fi}%
  \ifnum#9>0
    \flo@spk={}%
    \flo@loop{vspk}\flo@ka{1}{#9}{%
      \flo@range\flo@mx{#1}{#3}\flo@range\flo@my{#2}{#4}\flo@range\flo@t{0.03}{0.08}\flo@calc\flo@mr{(#6)*\flo@t}%
      \flo@range\flo@ma{0}{180}%
      \flo@calc\flo@sc{\flo@mr*cos(\flo@ma)}\flo@calc\flo@ss{\flo@mr*sin(\flo@ma)}%
      \flo@calc\flo@xa{\flo@mx+\flo@sc}\flo@calc\flo@ya{\flo@my+\flo@ss}%
      \flo@calc\flo@xb{\flo@mx-0.6*\flo@ss}\flo@calc\flo@yb{\flo@my+0.6*\flo@sc}%
      \flo@calc\flo@xc{\flo@mx-\flo@sc}\flo@calc\flo@yc{\flo@my-\flo@ss}%
      \flo@calc\flo@xd{\flo@mx+0.6*\flo@ss}\flo@calc\flo@yd{\flo@my-0.6*\flo@sc}%
      \edef\flo@tmp{\noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@xa}{\flo@ya}}%
        \noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xb}{\flo@yb}}\noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xc}{\flo@yc}}%
        \noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xd}{\flo@yd}}\noexpand\pgfpathclose}%
      \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
    \flo@vtone{flo@c}{#7-0.08}\flo@range\flo@op{0.3}{0.5}\flo@vfill{flo@c}{\flo@op}{1}{\the\flo@spk}%
  \fi}

% ---------------------------------------------------------------- the petal (flora.petal)
% along +y, length 1, base at the origin. Set before: \flo@vp@pointed (0/1), \flo@vp@W
% (empty: drawn), \flo@vp@tone, \flo@vp@ns (empty: drawn), \flo@vp@heart (0/1),
% \flo@vp@u (cm per local unit, with no random part: level of detail and line width)
% half-width at #1: \flo@h
\def\flo@vhalf#1{%
  \ifnum\flo@vp@pointed=1
    \ifdim#1pt>0pt \flo@calc\flo@h{\flo@pW*2*pow(max(0,sin(180*pow(#1,0.8))),0.85)*(1-0.3*(#1))}\else\def\flo@h{0}\fi
  \else
    \ifdim#1pt<0.62pt
      \ifdim#1pt>0pt \flo@calc\flo@h{\flo@pW*(0.16+0.84*pow(sin(90*(#1)/0.62),1.3))}\else\flo@calc\flo@h{\flo@pW*0.16}\fi
    \else\flo@calc\flo@h{\flo@pW*sqrt(max(0,1-pow(((#1)-0.62)/0.38,2)))}\fi
  \fi}
% the edge at #1 on side #2 (1 left, -1 right): \flo@e
\def\flo@vedge#1#2{%
  \ifnum#2=1 \flo@calc\flo@t{(#1)*6}\else\flo@calc\flo@t{(#1)*6+40}\fi
  \flo@vwave\flo@t
  \flo@calc\flo@e{(\flo@vp@pointed==1 ? 0.012 : 0.03)*\flo@wv*(#1)}%
  \ifdim\flo@notch pt>0pt \ifdim#1pt>0.9pt
    \flo@calc\flo@e{\flo@e-\flo@notch*((#1)-0.9)*10*(1-((#1)-0.9)*10)}\fi\fi}
\def\flo@vpetal{%
  \ifx\flo@vp@W\pgfutil@empty
    \ifnum\flo@vp@pointed=1 \flo@range\flo@pW{0.15}{0.2}\else\flo@range\flo@pW{0.40}{0.48}\fi
  \else\edef\flo@pW{\flo@vp@W}\fi
  \ifx\flo@vp@bend\pgfutil@empty\flo@sym\flo@bend{0.08}\else\edef\flo@bend{\flo@vp@bend}\fi
  \edef\flo@tz{\flo@vp@tone}%
  \ifdim\flo@vp@u pt>0.45pt \def\flo@fine{1}\else\def\flo@fine{0}\fi
  \flo@vfbm
  \def\flo@notch{0}%
  \ifnum\flo@vp@pointed=0 \flo@chance{\flo@vp@notchp}\ifflo@yes\flo@range\flo@notch{0.03}{0.06}%
    \flo@calc\flo@notch{\flo@notch*\flo@vp@notchk}\fi\fi
  % the outline (ink.blade): spine (bend v^2, v), normals by central differences
  % a petal under 1.2 mm (vp@u in cm) is tiny: a coarser outline, no heart, mottle or
  % pooled rim (specks no printer resolves at that size), and at most five streaks
  \ifdim\flo@vp@u pt<0.12pt \def\flo@tiny{1}\else\def\flo@tiny{0}\fi
  \ifdim\flo@vp@u pt>0.5pt \def\flo@bn{28}\else\ifnum\flo@tiny=1 \def\flo@bn{8}\else\def\flo@bn{18}\fi\fi
  \flo@loop{bl}\flo@kb{0}{\flo@bn}{%
    \flo@calc\flo@v{\the\flo@kb/\flo@bn}%
    \flo@calc\flo@va{max(0,\the\flo@kb-1)/\flo@bn}\flo@calc\flo@vb{min(\flo@bn,\the\flo@kb+1)/\flo@bn}%
    \flo@calc\flo@da{\flo@bend*(\flo@vb*\flo@vb-\flo@va*\flo@va)}\flo@calc\flo@db{\flo@vb-\flo@va}%
    \flo@nrm\flo@da\flo@db\flo@nx\flo@ny
    \flo@vhalf\flo@v
    \flo@vedge\flo@v{1}\flo@calc\flo@ea{max(0,\flo@h+\flo@e)}%
    \flo@vedge\flo@v{-1}\flo@calc\flo@eb{max(0,\flo@h+\flo@e)}%
    \flo@calc\flo@cx{\flo@bend*\flo@v*\flo@v}%
    \flo@calc\flo@xl{\flo@cx+\flo@nx*\flo@ea}\flo@calc\flo@yl{\flo@v+\flo@ny*\flo@ea}%
    \flo@put{\the\numexpr\flo@kb+1\relax}{\flo@xl}{\flo@yl}%
    \ifnum\flo@kb>0 \ifnum\flo@kb<\flo@bn\space
      \flo@calc\flo@xr{\flo@cx-\flo@nx*\flo@eb}\flo@calc\flo@yr{\flo@v-\flo@ny*\flo@eb}%
      \flo@put{\the\numexpr2*\flo@bn+1-\flo@kb\relax}{\flo@xr}{\flo@yr}\fi\fi}%
  \flo@smoothprep{\the\numexpr2*\flo@bn\relax}%
  % keep the outline: blobs and strokes below overwrite flo@X/Y and the controls
  \flo@keepoutline
  \begin{pgfscope}%
    \flo@outlinepath\pgfusepath{clip}%
    \flo@vtone{flo@c}{\flo@tz}\flo@vfill{flo@c}{1}{0}{\pgfpathrectanglecorners{\flo@P{-1}{-0.1}}{\flo@P{1}{1.2}}}%
    \ifnum\flo@vp@heart=1 \ifnum\flo@tiny=0
      \flo@loop{vheart}\flo@ka{1}{8}{%
        \flo@calc\flo@t{\flo@pW*(0.25+0.1*\the\flo@ka)}\flo@calc\flo@ms{0.06+0.065*\the\flo@ka}%
        \flo@vblob{0}{0}\flo@t\flo@ms{0.28}{9}\flo@vfill{white}{0.1}{0}{\flo@smoothpath}}%
    \fi\fi
    \flo@calc\flo@xa{-\flo@pW*1.2}\flo@calc\flo@xb{\flo@pW*1.2}%
    \flo@calc\flo@ta{\flo@tz-0.2}\flo@calc\flo@tb{\flo@tz+0.2}%
    \ifnum\flo@vp@pointed=1 \def\flo@msz{0.06}\else\def\flo@msz{0.12}\fi
    \ifnum\flo@fine=1 \flo@vmottle\flo@xa{0.12}\flo@xb{1.05}{15}\flo@msz\flo@ta\flo@tb{12}%
    \else\ifnum\flo@tiny=0 \flo@vmottle\flo@xa{0.12}\flo@xb{1.05}{6}\flo@msz\flo@ta\flo@tb{0}\fi\fi
    % darker brush strokes running out from the base
    \ifnum\flo@fine=1
      \flo@int\flo@nk{5}{8}%
      \flo@loop{brush}\flo@ka{1}{\flo@nk}{%
        \flo@sym\flo@f{0.95}\flo@range\flo@va{0.15}{0.4}\flo@range\flo@vb{0.7}{1.0}%
        \flo@vhalf\flo@va\flo@calc\flo@xa{\flo@f*\flo@h*0.8+\flo@bend*\flo@va*\flo@va}%
        \flo@vhalf\flo@vb\flo@calc\flo@xb{\flo@f*\flo@h*0.9+\flo@bend*\flo@vb*\flo@vb}%
        \flo@range\flo@twa{0.03}{0.07}\def\flo@twb{0.005}%
        \flo@calc\flo@c{\flo@xa+(\flo@xb-\flo@xa)*0.3}\flo@calc\flo@d{\flo@va+(\flo@vb-\flo@va)*0.35}%
        \flo@calc\flo@cc{\flo@xb*0.95}\flo@calc\flo@dd{\flo@va+(\flo@vb-\flo@va)*0.7}%
        \flo@vtone{flo@c}{\flo@tz-0.25}\flo@range\flo@op{0.12}{0.25}%
        \flo@vfill{flo@c}{\flo@op}{1}{\flo@vtaper\flo@xa\flo@va\flo@c\flo@d\flo@cc\flo@dd\flo@xb\flo@vb}}%
    \fi
    % pooling: the outline restroked wide and soft, only its inner half shows
    \ifnum\flo@tiny=0
      \flo@vtone{flo@c}{0.08}\flo@calc\flo@t{1.6*\flo@vp@u}\flo@vstroke{flo@c}{\flo@t}{0.3}{1}{\flo@outlinepath}%
    \fi
    % white streaks lifted out, fanning from the base
    \ifx\flo@vp@ns\pgfutil@empty
      \ifnum\flo@vp@pointed=1 \flo@int\flo@ns{3}{5}\else\flo@int\flo@ns{9}{13}\fi
    \else\edef\flo@ns{\flo@vp@ns}\fi
    \ifnum\flo@tiny=1 \ifnum\flo@ns>5 \def\flo@ns{5}\fi\fi
    \flo@loop{wst}\flo@ka{1}{\flo@ns}{%
      \flo@sym\flo@t{0.05}\flo@calc\flo@f{(\the\flo@ka-0.5)/\flo@ns*2-1+\flo@t}%
      \ifnum\flo@vp@pointed=1 \flo@range\flo@t{0.4}{0.85}\else\flo@range\flo@t{0.35}{0.8}\fi
      \flo@calc\flo@len{\flo@t*(1-0.35*\flo@f*\flo@f)}%
      % (ns+1)//2: \numexpr rounds halves up, so it is ns/2 rounded
      \ifnum\flo@vp@pointed=1 \ifnum\flo@ka=\numexpr\flo@ns/2\relax
        \def\flo@f{0}\flo@range\flo@len{0.8}{0.92}\fi\fi
      \flo@vhalf\flo@len\flo@calc\flo@xb{\flo@f*\flo@h*0.85+\flo@bend*\flo@len*\flo@len}%
      \flo@calc\flo@t{\flo@len*0.5}\flo@vhalf\flo@t\flo@sym\flo@g{0.02}%
      \flo@calc\flo@mx{\flo@f*\flo@h*0.6+\flo@g+\flo@bend*\flo@len*\flo@len*0.3}%
      \ifnum\flo@vp@pointed=1 \def\flo@g{0.6}\else\def\flo@g{1}\fi
      \flo@range\flo@t{0.022}{0.045}\flo@calc\flo@twa{\flo@g*\flo@t}\def\flo@twb{0.002}%
      \flo@calc\flo@xa{\flo@f*0.03}\flo@calc\flo@c{\flo@mx*0.5}\flo@calc\flo@d{\flo@len*0.3}%
      \flo@calc\flo@dd{\flo@len*0.6}\flo@range\flo@op{0.55}{0.9}%
      \flo@vfill{white}{\flo@op}{0}{\flo@vtaper\flo@xa{0}\flo@c\flo@d\flo@mx\flo@dd\flo@xb\flo@len}}%
    % a few fine dark veins, following the petal
    \ifnum\flo@fine=1
      \flo@int\flo@nk{4}{7}%
      \flo@loop{vvein}\flo@ka{1}{\flo@nk}{%
        \flo@sym\flo@f{0.85}\flo@range\flo@va{0.2}{0.35}\flo@range\flo@vb{0.75}{0.95}%
        \flo@vhalf\flo@va\flo@calc\flo@xa{\flo@f*\flo@h*0.7+\flo@bend*\flo@va*\flo@va}%
        \flo@vhalf\flo@vb\flo@calc\flo@xb{\flo@f*\flo@h*0.9+\flo@bend*\flo@vb*\flo@vb}%
        \flo@calc\flo@c{\flo@xa+(\flo@xb-\flo@xa)*0.2}\flo@calc\flo@d{\flo@va+(\flo@vb-\flo@va)*0.4}%
        \flo@calc\flo@cc{\flo@xb*0.97}\flo@calc\flo@dd{\flo@va+(\flo@vb-\flo@va)*0.75}%
        \flo@vbezier\flo@xa\flo@va\flo@c\flo@d\flo@cc\flo@dd\flo@xb\flo@vb
        \flo@vtone{flo@c}{0.1}\flo@range\flo@op{0.18}{0.32}\flo@vstroke{flo@c}{0.15}{\flo@op}{1}{\flo@openpath}}%
    \fi
  \end{pgfscope}}
% the outline kept by \flo@keepoutline: its points and controls in flo@KX/KY/KA..KD
\def\flo@keepoutline{%
  \edef\flo@KN{\flo@N}%
  \flo@loop{keep}\flo@kb{1}{\flo@KN}{%
    \edef\flo@t{\the\flo@kb}%
    \expandafter\edef\csname flo@KX\flo@t\endcsname{\flo@x\flo@t}\expandafter\edef\csname flo@KY\flo@t\endcsname{\flo@y\flo@t}%
    \expandafter\edef\csname flo@KA\flo@t\endcsname{\csname flo@A\flo@t\endcsname}%
    \expandafter\edef\csname flo@KB\flo@t\endcsname{\csname flo@B\flo@t\endcsname}%
    \expandafter\edef\csname flo@KC\flo@t\endcsname{\csname flo@C\flo@t\endcsname}%
    \expandafter\edef\csname flo@KD\flo@t\endcsname{\csname flo@D\flo@t\endcsname}}}
\def\flo@outlinepath{%
  \pgfpathmoveto{\flo@P{\csname flo@KX1\endcsname}{\csname flo@KY1\endcsname}}%
  \flo@loop{olp}\flo@i{1}{\flo@KN}{%
    \edef\flo@ib{\the\numexpr\ifnum\flo@i=\flo@KN\space 1\else\flo@i+1\fi\relax}%
    \pgfpathcurveto{\flo@P{\csname flo@KA\the\flo@i\endcsname}{\csname flo@KB\the\flo@i\endcsname}}%
      {\flo@P{\csname flo@KC\the\flo@i\endcsname}{\csname flo@KD\the\flo@i\endcsname}}%
      {\flo@P{\csname flo@KX\flo@ib\endcsname}{\csname flo@KY\flo@ib\endcsname}}}%
  \pgfpathclose}
% ink.bezier3 sampled at 6 points, as an open smooth curve (ink.smooth, not closed): \flo@openpath
\def\flo@vbezier#1#2#3#4#5#6#7#8{%
  \flo@loop{bz}\flo@kb{0}{5}{%
    \flo@calc\flo@v{\the\flo@kb/5}\flo@calc\flo@t{1-\flo@v}%
    \flo@calc\flo@bx{\flo@t*\flo@t*\flo@t*(#1)+3*\flo@t*\flo@t*\flo@v*(#3)+3*\flo@t*\flo@v*\flo@v*(#5)+\flo@v*\flo@v*\flo@v*(#7)}%
    \flo@calc\flo@by{\flo@t*\flo@t*\flo@t*(#2)+3*\flo@t*\flo@t*\flo@v*(#4)+3*\flo@t*\flo@v*\flo@v*(#6)+\flo@v*\flo@v*\flo@v*(#8)}%
    \flo@put{\the\numexpr\flo@kb+1\relax}{\flo@bx}{\flo@by}}}
% an open Catmull-Rom curve through points 1..6 (ends repeated, tension 1/6)
\def\flo@openpath{%
  \pgfpathmoveto{\flo@P{\flo@x1}{\flo@y1}}%
  \flo@loop{opp}\flo@i{1}{5}{%
    \edef\flo@ia{\the\numexpr\ifnum\flo@i=1 1\else\flo@i-1\fi\relax}\edef\flo@ib{\the\numexpr\flo@i+1\relax}%
    \edef\flo@ic{\the\numexpr\ifnum\flo@i=5 6\else\flo@i+2\fi\relax}%
    \flo@calc\flo@pa{\flo@x{\the\flo@i}+(\flo@x\flo@ib-\flo@x\flo@ia)/6}\flo@calc\flo@pb{\flo@y{\the\flo@i}+(\flo@y\flo@ib-\flo@y\flo@ia)/6}%
    \flo@calc\flo@pc{\flo@x\flo@ib-(\flo@x\flo@ic-\flo@x{\the\flo@i})/6}\flo@calc\flo@pd{\flo@y\flo@ib-(\flo@y\flo@ic-\flo@y{\the\flo@i})/6}%
    \pgfpathcurveto{\flo@P\flo@pa\flo@pb}{\flo@P\flo@pc\flo@pd}{\flo@P{\flo@x\flo@ib}{\flo@y\flo@ib}}}}

% ---------------------------------------------------------------- the heart and the flower
% flora's heart: a white star of 2n streaks, a white disc, stamens, a copper eye; #1 = n
\def\flo@vheart#1{%
  \flo@loop{vh}\flo@ka{1}{2*(#1)}{%
    \flo@sym\flo@t{8}\flo@calc\flo@a{(\the\flo@ka-0.5)*360/(2*(#1))+\flo@t}%
    \flo@range\flo@len{0.24}{0.36}\def\flo@twa{0.06}\def\flo@twb{0.004}%
    \begin{pgfscope}\pgftransformrotate{\flo@a}%
      \flo@vfill{white}{0.85}{0}{\flo@vtaper{0}{0}{0.01}{0.1}{-0.01}{0.2}{0}\flo@len}\end{pgfscope}}%
  \flo@vfill{white}{0.9}{0}{\pgfpathcircle{\flo@P00}{0.13pt}}%
  \flo@vtone{flo@c}{0.1}\flo@vtone{flo@d}{0.05}%
  \flo@loop{vst}\flo@ka{1}{14}{%
    \flo@range\flo@a{0}{360}\flo@range\flo@r{0.05}{0.12}%
    \flo@calc\flo@dx{\flo@r*cos(\flo@a)}\flo@calc\flo@dy{\flo@r*sin(\flo@a)}%
    \flo@vstroke{flo@c}{0.2}{0.7}{0}{\pgfpathmoveto{\flo@P00}\pgfpathlineto{\flo@P\flo@dx\flo@dy}}%
    \flo@vfill{flo@d}{0.9}{0}{\pgfpathcircle{\flo@P\flo@dx\flo@dy}{0.008pt}}}%
  \flo@vaccent{flo@c}{-0.15}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.042pt}}%
  \flo@vaccent{flo@c}{0.3}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.022pt}}}
% flora's flower: #2 broad petals seen from the front, petal length 1; #1 the petal length
% in cm on the page (no random part); tone: \flo@vf@tone (empty: drawn as flora does)
\def\flo@vflower#1#2{%
  \edef\flo@vu{#1}%
  \ifdefined\flo@vf@pointed\edef\flo@vp@pointed{\flo@vf@pointed}\else\def\flo@vp@pointed{0}\fi
  \flo@range\flo@spin{0}{72}%
  \ifx\flo@vf@tone\pgfutil@empty
    \flo@chance{0.25}\ifflo@yes\flo@range\flo@tq{0.2}{0.28}\else\flo@range\flo@tq{0.3}{0.46}\fi
  \else\edef\flo@tq{\flo@vf@tone}\fi
  \edef\flo@np{#2}%
  \flo@loop{vfp}\flo@n{0}{\flo@np-1}{%
    \flo@sym\flo@t{6}\flo@calc\flo@a{\flo@spin+\the\flo@n*360/\flo@np+\flo@t}%
    \flo@range\flo@js{0.9}{1.06}\flo@sym\flo@t{0.04}\flo@calc\flo@tp{\flo@tq+\flo@t}%
    \begin{pgfscope}%
      \pgftransformrotate{\flo@a}\pgftransformscale{\flo@js}\pgftransformshift{\flo@P0{0.04}}%
      \ifdefined\flo@vf@W\edef\flo@vp@W{\flo@vf@W}\else\def\flo@vp@W{}\fi
      \ifdefined\flo@vf@ns\edef\flo@vp@ns{\flo@vf@ns}\else\def\flo@vp@ns{}\fi
      \def\flo@vp@bend{}\def\flo@vp@heart{1}\edef\flo@vp@tone{\flo@tp}\edef\flo@vp@u{\flo@vu}%
      \flo@vpetal
    \end{pgfscope}}%
  \begin{pgfscope}\pgftransformrotate{\flo@spin}\flo@vheart{\flo@np}\end{pgfscope}}
% \pic {florilegium v13 flower={seed=7, size=1.9cm}}: flora's flower in pure TikZ, size the
% petal length (a test of the port, against \florilegiumdraw{flower}{1.9})
\tikzset{pics/florilegium v13 flower/.style={code={\flo@engine{#1}{v13 flower}{%
  \flo@picsetup{#1}%
  \pgftransformscale{\flo@sizept}%
  \def\flo@vf@tone{}\flo@calc\flo@vs{\flo@sizept/28.45276}\flo@vflower\flo@vs{5}}}}}


% ---------------------------------------------------------------- the tone ramp (OKLCH)
% florilegium-ink.lua's ramp, computed here from the document's ink: 101 tones from the
% darkest navy to the palest mist at the ink's hue, lightness and chroma per stop, the hue
% drifting violet in the darks and cyan in the lights. OKLCH is Oklab in polar form; Oklab
% and its matrices are Bjorn Ottosson's ("A perceptual color space for image processing",
% 2020, public domain). Computed once per ink with pgf's floating point unit (pgfmath's
% fixed point keeps too few digits of pow for colors), defined globally.
\newif\ifflo@ingamut
\def\flo@srgbdec#1#2{\ifdim#2pt>0.04045pt \flo@calc#1{pow(((#2)+0.055)/1.055,2.4)}\else\flo@calc#1{(#2)/12.92}\fi}
\def\flo@srgbenc#1#2{\ifdim#2pt>0.0031308pt \flo@calc#1{1.055*pow(#2,1/2.4)-0.055}\else\flo@calc#1{12.92*(#2)}\fi}
% a cube root: pow, then two Newton steps (pow is good to about 3e-4 here)
\def\flo@cbrt#1#2{\ifdim#2pt=0pt \def#1{0}\else
  \flo@calc#1{(#2)<0 ? -pow(-(#2),1/3) : pow(#2,1/3)}%
  \flo@calc#1{#1-(#1*#1*#1-(#2))/(3*#1*#1)}\flo@calc#1{#1-(#1*#1*#1-(#2))/(3*#1*#1)}\fi}
% OKLCH (#1,#2,#3 in degrees) -> \flo@or \flo@og \flo@ob, \ifflo@ingamut
\def\flo@oklch#1#2#3{%
  \flo@calc\flo@oA{(#2)*cos(#3)}\flo@calc\flo@oB{(#2)*sin(#3)}%
  \flo@calc\flo@ol{pow((#1)+0.3963377774*\flo@oA+0.2158037573*\flo@oB,3)}%
  \flo@calc\flo@om{pow((#1)-0.1055613458*\flo@oA-0.0638541728*\flo@oB,3)}%
  \flo@calc\flo@os{pow((#1)-0.0894841775*\flo@oA-1.2914855480*\flo@oB,3)}%
  \flo@calc\flo@or{4.0767416621*\flo@ol-3.3077115913*\flo@om+0.2309699292*\flo@os}%
  \flo@calc\flo@og{-1.2684380046*\flo@ol+2.6097574011*\flo@om-0.3413193965*\flo@os}%
  \flo@calc\flo@ob{-0.0041960863*\flo@ol-0.7034186147*\flo@om+1.7076147010*\flo@os}%
  \flo@ingamuttrue
  \ifdim\flo@or pt<-0.0001pt \flo@ingamutfalse\fi\ifdim\flo@or pt>1.0001pt \flo@ingamutfalse\fi
  \ifdim\flo@og pt<-0.0001pt \flo@ingamutfalse\fi\ifdim\flo@og pt>1.0001pt \flo@ingamutfalse\fi
  \ifdim\flo@ob pt<-0.0001pt \flo@ingamutfalse\fi\ifdim\flo@ob pt>1.0001pt \flo@ingamutfalse\fi}
% the stops: t, L, C, hue drift
\def\flo@stops{{0}{0.25}{0.105}{6},{0.18}{0.35}{0.150}{3},{0.38}{0.47}{0.175}{0},%
  {0.58}{0.60}{0.145}{-3},{0.80}{0.77}{0.080}{-6},{1}{0.92}{0.030}{-8}}
% the ramp of \flo@crgb, as colors #1@0 .. #1@100
\def\flo@ramp#1{%
  \def\flo@rampto{#1}%
  \begingroup\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}%
  \expandafter\flo@rampin\flo@crgb\relax
  \endgroup}
\def\flo@rampin#1,#2,#3\relax{%
  % the ink in OKLCH: its hue, and its chroma against the default ink's (0.175)
  \flo@srgbdec\flo@ir{#1}\flo@srgbdec\flo@ig{#2}\flo@srgbdec\flo@ib{#3}%
  \flo@calc\flo@t{0.4122214708*\flo@ir+0.5363325363*\flo@ig+0.0514459929*\flo@ib}\flo@cbrt\flo@il\flo@t
  \flo@calc\flo@t{0.2119034982*\flo@ir+0.6806995451*\flo@ig+0.1073969566*\flo@ib}\flo@cbrt\flo@im\flo@t
  \flo@calc\flo@t{0.0883024619*\flo@ir+0.2817188376*\flo@ig+0.6299787005*\flo@ib}\flo@cbrt\flo@is\flo@t
  \flo@calc\flo@iA{1.9779984951*\flo@il-2.4285922050*\flo@im+0.4505937099*\flo@is}%
  \flo@calc\flo@iB{0.0259040371*\flo@il+0.7827717662*\flo@im-0.8086757660*\flo@is}%
  % a gray (chroma under 1e-4) has no hue: hue 0 and a gray ramp, as florilegium-ink.lua; the
  % hue from a and b times 1000, since fpu's atan2 snaps to an axis while |y| < 0.001
  \flo@calc\flo@t{veclen(\flo@iA,\flo@iB)}%
  \ifdim\flo@t pt<0.0001pt \def\flo@hue{0}\def\flo@ck{0}\else
    \flo@calc\flo@hue{atan2(1000*\flo@iB,1000*\flo@iA)}%
    \flo@calc\flo@ck{max(0.15,min(1.3,veclen(\flo@iA,\flo@iB)/0.175))}%
  \fi
  \flo@loop{ramp}\flo@ka{0}{100}{%
    \flo@calc\flo@rt{\the\flo@ka/100}%
    \def\flo@rs{0}%
    \expandafter\flo@rampseg\flo@stops,\relax,
    \flo@calc\flo@ru{(\flo@rt-\flo@sa)/(\flo@sb-\flo@sa)}%
    \flo@calc\flo@rL{\flo@La+(\flo@Lb-\flo@La)*\flo@ru}%
    \flo@calc\flo@rC{(\flo@Ca+(\flo@Cb-\flo@Ca)*\flo@ru)*\flo@ck}%
    \flo@calc\flo@rh{\flo@hue+\flo@da+(\flo@db-\flo@da)*\flo@ru}%
    \flo@oklch\flo@rL\flo@rC\flo@rh
    \ifflo@ingamut\else
      % the largest chroma in gamut: bisection
      \def\flo@lo{0}\let\flo@hi\flo@rC
      \flo@loop{bis}\flo@kb{1}{14}{%
        \flo@calc\flo@mid{(\flo@lo+\flo@hi)/2}\flo@oklch\flo@rL\flo@mid\flo@rh
        \ifflo@ingamut\let\flo@lo\flo@mid\else\let\flo@hi\flo@mid\fi}%
      \flo@oklch\flo@rL\flo@lo\flo@rh
    \fi
    \flo@calc\flo@t{max(0,min(1,\flo@or))}\flo@srgbenc\flo@cr\flo@t
    \flo@calc\flo@t{max(0,min(1,\flo@og))}\flo@srgbenc\flo@cg\flo@t
    \flo@calc\flo@t{max(0,min(1,\flo@ob))}\flo@srgbenc\flo@cb\flo@t
    \xglobal\definecolor{\flo@rampto @\the\flo@ka}{rgb}{\flo@cr,\flo@cg,\flo@cb}}}
% the stops around \flo@rt, as florilegium-ink.lua finds them: a = stop k, b = stop k+1,
% k advancing while b's t < \flo@rt. Sets \flo@sa \flo@La \flo@Ca \flo@da and \flo@sb ...
\def\flo@rampseg#1,{%
  \ifx\relax#1\else
    \flo@rampstop#1%
    \ifcase\flo@rs\space
      \let\flo@sa\flo@st\let\flo@La\flo@sL\let\flo@Ca\flo@sC\let\flo@da\flo@sd\def\flo@rs{1}%
    \or
      \let\flo@sb\flo@st\let\flo@Lb\flo@sL\let\flo@Cb\flo@sC\let\flo@db\flo@sd\def\flo@rs{2}%
    \else
      \ifdim\flo@sb pt<\flo@rt pt
        \let\flo@sa\flo@sb\let\flo@La\flo@Lb\let\flo@Ca\flo@Cb\let\flo@da\flo@db
        \let\flo@sb\flo@st\let\flo@Lb\flo@sL\let\flo@Cb\flo@sC\let\flo@db\flo@sd
      \fi
    \fi
    \expandafter\flo@rampseg
  \fi}
\def\flo@rampstop#1#2#3#4{\def\flo@st{#1}\def\flo@sL{#2}\def\flo@sC{#3}\def\flo@sd{#4}}

% ---------------------------------------------------------------- shapes kept by name
% \flo@smoothprepT{N}{tension}: \flo@smoothprep with ink.smooth's tension (k = tension/6)
\def\flo@smoothprepT#1#2{%
  \edef\flo@N{\the\numexpr#1\relax}\edef\flo@tk{#2}%
  \flo@loop{spT}\flo@i{1}{\flo@N}{%
    \edef\flo@ia{\the\numexpr\ifnum\flo@i=1 \flo@N\else\flo@i-1\fi\relax}%
    \edef\flo@ib{\the\numexpr\ifnum\flo@i=\flo@N\space 1\else\flo@i+1\fi\relax}%
    \edef\flo@ic{\the\numexpr\ifnum\flo@ib=\flo@N\space 1\else\flo@ib+1\fi\relax}%
    \edef\flo@xi{\flo@x{\the\flo@i}}\edef\flo@yi{\flo@y{\the\flo@i}}%
    \flo@calc\flo@t{\flo@xi+(\flo@x\flo@ib-(\flo@x\flo@ia))*\flo@tk/6}\expandafter\let\csname flo@A\the\flo@i\endcsname\flo@t
    \flo@calc\flo@t{\flo@yi+(\flo@y\flo@ib-(\flo@y\flo@ia))*\flo@tk/6}\expandafter\let\csname flo@B\the\flo@i\endcsname\flo@t
    \flo@calc\flo@t{\flo@x\flo@ib-(\flo@x\flo@ic-(\flo@xi))*\flo@tk/6}\expandafter\let\csname flo@C\the\flo@i\endcsname\flo@t
    \flo@calc\flo@t{\flo@y\flo@ib-(\flo@y\flo@ic-(\flo@yi))*\flo@tk/6}\expandafter\let\csname flo@D\the\flo@i\endcsname\flo@t}}
% fill the current path in a scope of its own, #1 the scope's settings (opacity, blend):
% \pgfscope empties the current path, so it is carried in
\def\flo@scopefill#1{\pgfsyssoftpath@getcurrentpath\flo@scopepath
  \begin{pgfscope}#1\pgfsyssoftpath@setcurrentpath\flo@scopepath\pgfusepath{fill}\end{pgfscope}}
% keep the curve prepared last under the name #1, and emit a kept curve's path
\def\flo@keep#1{%
  \expandafter\edef\csname flo@#1@N\endcsname{\flo@N}%
  \flo@loop{kp}\flo@kb{1}{\flo@N}{%
    \edef\flo@t{\the\flo@kb}%
    \expandafter\edef\csname flo@#1@X\flo@t\endcsname{\flo@x\flo@t}\expandafter\edef\csname flo@#1@Y\flo@t\endcsname{\flo@y\flo@t}%
    \expandafter\edef\csname flo@#1@A\flo@t\endcsname{\csname flo@A\flo@t\endcsname}%
    \expandafter\edef\csname flo@#1@B\flo@t\endcsname{\csname flo@B\flo@t\endcsname}%
    \expandafter\edef\csname flo@#1@C\flo@t\endcsname{\csname flo@C\flo@t\endcsname}%
    \expandafter\edef\csname flo@#1@D\flo@t\endcsname{\csname flo@D\flo@t\endcsname}}}
\def\flo@kept#1{%
  \edef\flo@kn{\csname flo@#1@N\endcsname}%
  \pgfpathmoveto{\flo@P{\csname flo@#1@X1\endcsname}{\csname flo@#1@Y1\endcsname}}%
  \flo@loop{kpp}\flo@i{1}{\flo@kn}{%
    \edef\flo@ib{\the\numexpr\ifnum\flo@i=\flo@kn\space 1\else\flo@i+1\fi\relax}%
    \pgfpathcurveto{\flo@P{\csname flo@#1@A\the\flo@i\endcsname}{\csname flo@#1@B\the\flo@i\endcsname}}%
      {\flo@P{\csname flo@#1@C\the\flo@i\endcsname}{\csname flo@#1@D\the\flo@i\endcsname}}%
      {\flo@P{\csname flo@#1@X\flo@ib\endcsname}{\csname flo@#1@Y\flo@ib\endcsname}}}%
  \pgfpathclose}
% normals by central differences over points 1..#1 of flo@X/Y (ink.normals): flo@NX/NY
\def\flo@normals#1{%
  \flo@loop{nrm}\flo@kb{1}{#1}{%
    \edef\flo@ia{\the\numexpr\ifnum\flo@kb=1 1\else\flo@kb-1\fi\relax}%
    \edef\flo@ib{\the\numexpr\ifnum\flo@kb=\numexpr#1\relax #1\else\flo@kb+1\fi\relax}%
    \flo@calc\flo@da{\flo@x\flo@ib-(\flo@x\flo@ia)}\flo@calc\flo@db{\flo@y\flo@ib-(\flo@y\flo@ia)}%
    \pgfmathparse{veclen(\flo@da,\flo@db)}\let\flo@nl\pgfmathresult
    \ifdim\flo@nl pt<0.00002pt \def\flo@nl{1}\fi
    \flo@calc\flo@t{-(\flo@db)/\flo@nl}\expandafter\let\csname flo@NX\the\flo@kb\endcsname\flo@t
    \flo@calc\flo@t{(\flo@da)/\flo@nl}\expandafter\let\csname flo@NY\the\flo@kb\endcsname\flo@t}}
% flora's streak: a ribbon along points 1..#1 of flo@X/Y, width from #2 to #3 (narrower
% for its first 12%), smoothed and filled #4 at opacity #5
\def\flo@vstreak#1#2#3#4#5{%
  \flo@normals{#1}%
  \def\flo@acc{0}\expandafter\def\csname flo@S1\endcsname{0}%
  \flo@loop{arc}\flo@kb{2}{#1}{%
    \edef\flo@ia{\the\numexpr\flo@kb-1\relax}%
    \flo@calc\flo@acc{\flo@acc+veclen(\flo@x{\the\flo@kb}-(\flo@x\flo@ia),\flo@y{\the\flo@kb}-(\flo@y\flo@ia))}%
    \expandafter\let\csname flo@S\the\flo@kb\endcsname\flo@acc}%
  \flo@loop{rib}\flo@kb{1}{#1}{%
    \flo@calc\flo@u{\flo@acc>0 ? \csname flo@S\the\flo@kb\endcsname/\flo@acc : 0}%
    \flo@calc\flo@w{((#2)+((#3)-(#2))*\flo@u)*(\flo@u<0.12 ? 0.4+5*\flo@u : 1)/2}%
    \flo@calc\flo@xl{\flo@x{\the\flo@kb}+\csname flo@NX\the\flo@kb\endcsname*\flo@w}%
    \flo@calc\flo@yl{\flo@y{\the\flo@kb}+\csname flo@NY\the\flo@kb\endcsname*\flo@w}%
    \flo@calc\flo@xr{\flo@x{\the\flo@kb}-\csname flo@NX\the\flo@kb\endcsname*\flo@w}%
    \flo@calc\flo@yr{\flo@y{\the\flo@kb}-\csname flo@NY\the\flo@kb\endcsname*\flo@w}%
    \expandafter\let\csname flo@RX\the\flo@kb\endcsname\flo@xl\expandafter\let\csname flo@RY\the\flo@kb\endcsname\flo@yl
    \expandafter\let\csname flo@QX\the\flo@kb\endcsname\flo@xr\expandafter\let\csname flo@QY\the\flo@kb\endcsname\flo@yr}%
  \flo@loop{ribo}\flo@kb{1}{#1}{%
    \flo@put{\the\flo@kb}{\csname flo@RX\the\flo@kb\endcsname}{\csname flo@RY\the\flo@kb\endcsname}%
    \flo@put{\the\numexpr2*(#1)+1-\flo@kb\relax}{\csname flo@QX\the\flo@kb\endcsname}{\csname flo@QY\the\flo@kb\endcsname}}%
  \flo@smoothprep{\the\numexpr2*(#1)\relax}\flo@vfill{#4}{#5}{0}{\flo@smoothpath}}

% ---------------------------------------------------------------- the leaf (flora.leaf)
% along +y, length 1. Set before (empty: drawn as flora draws it): \flo@vl@W, \flo@vl@bend,
% \flo@vl@lobes, \flo@vl@depth, \flo@vl@tone; and \flo@vl@u (cm per unit, no random part)
\def\flo@lspine#1{\ifnum\flo@hk=1 \ifdim#1pt>\flo@hv pt \flo@lhook{#1}\else\flo@lspine@{#1}\fi\else\flo@lspine@{#1}\fi}
\def\flo@lspine@#1{\flo@calc\flo@sx{\flo@lbend*(#1)*(#1)-0.3*\flo@lbend*(#1)}\edef\flo@sy{#1}}
\def\flo@hk{0}
% A curled tip, as the reference's leaves curl: beyond \flo@hv the spine turns \flo@hth
% degrees along a circle, toward the side the leaf bends, as tight as the blade allows
% (its radius at least 1.8 times the half-width there), so a narrow leaf hooks right over and
% shows its underside while a broad one only bends its tip aside; none of 45 degrees or less.
% Draws: its length, its turn
\def\flo@hookset{%
  \flo@range\flo@hl{0.25}{0.4}\flo@calc\flo@hv{1-\flo@hl}\flo@shw\flo@hv
  \flo@range\flo@t{120}{190}\flo@calc\flo@hth{min(\flo@t,\flo@hl/(1.8*max(0.01,\flo@h))*57.29578)}%
  \ifdim\flo@hth pt>45pt
    \def\flo@hk{1}%
    \ifdim\flo@lbend pt<0pt \def\flo@hs{-1}\else\def\flo@hs{1}\fi
    \flo@lspine@\flo@hv\let\flo@hpx\flo@sx\let\flo@hpy\flo@sy
    \flo@calc\flo@htx{2*\flo@lbend*\flo@hv-0.3*\flo@lbend}\flo@calc\flo@t{veclen(\flo@htx,1)}%
    \flo@calc\flo@htx{\flo@htx/\flo@t}\flo@calc\flo@hty{1/\flo@t}%
    \flo@calc\flo@hnx{\flo@hs*\flo@hty}\flo@calc\flo@hny{-\flo@hs*\flo@htx}%
    \flo@calc\flo@hr{\flo@hl/\flo@hth*57.29578}%
  \fi}
% the spine along the curl, at #1 beyond \flo@hv
\def\flo@lhook#1{\flo@calc\flo@hph{((#1)-\flo@hv)/\flo@hl*\flo@hth}%
  \flo@calc\flo@sx{\flo@hpx+\flo@hr*(sin(\flo@hph)*\flo@htx+(1-cos(\flo@hph))*\flo@hnx)}%
  \flo@calc\flo@sy{\flo@hpy+\flo@hr*(sin(\flo@hph)*\flo@hty+(1-cos(\flo@hph))*\flo@hny)}}
% the curl's underside, where it turns past 95 degrees: the blade from just past the curl's
% middle to the tip, drawn again over it from the same margin samples, paler, its midrib
% white and its edge dark
\def\flo@hookunder{%
  \flo@calc\flo@hva{\flo@hv+0.45*\flo@hl}\def\flo@hka{0}%
  \flo@loop{hka}\flo@kb{1}{\flo@mn}{\ifnum\flo@hka=0
    \ifdim\csname flo@sv\the\flo@kb\endcsname pt>\flo@hva pt \edef\flo@hka{\the\flo@kb}\fi\fi}%
  \ifnum\flo@hka>1 \ifnum\flo@hka<\flo@mn
    \def\flo@hun{0}%
    \flo@loop{hkl}\flo@kb{\flo@hka}{\flo@mn}{\edef\flo@hun{\the\numexpr\flo@hun+1\relax}%
      \flo@put\flo@hun{\csname flo@RX\the\flo@kb\endcsname}{\csname flo@RY\the\flo@kb\endcsname}}%
    \flo@loop{hkr}\flo@kb{1}{\flo@mn-\flo@hka}{\edef\flo@hun{\the\numexpr\flo@hun+1\relax}%
      \edef\flo@q{\the\numexpr\flo@mn-\flo@kb\relax}%
      \flo@put\flo@hun{\csname flo@QX\flo@q\endcsname}{\csname flo@QY\flo@q\endcsname}}%
    \flo@smoothprepT\flo@hun\flo@ltk\flo@keep{lsu}%
    \flo@calc\flo@t{min(0.64,\flo@lt+0.26)}\flo@vtone{flo@c}{\flo@t}\flo@vfill{flo@c}{1}{0}{\flo@kept{lsu}}%
    \begin{pgfscope}\flo@kept{lsu}\pgfusepath{clip}%
      \flo@loop{hkm}\flo@kb{0}{10}{\flo@calc\flo@v{\flo@hva+(1-\flo@hva)*\the\flo@kb/10}%
        \flo@lspine\flo@v\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@sy}}%
      \flo@vstreak{11}{0.02}{0.003}{white}{0.6}%
      \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{1.3*\flo@vl@u}\flo@vstroke{flo@c}{\flo@t}{0.3}{1}{\flo@kept{lsu}}%
    \end{pgfscope}%
  \fi\fi}
\def\flo@ltan#1{%
  \flo@calc\flo@t{max(0,(#1)-0.01)}\flo@lspine\flo@t\let\flo@ta\flo@sx\let\flo@tb\flo@sy
  \flo@calc\flo@t{min(1,(#1)+0.01)}\flo@lspine\flo@t
  \flo@calc\flo@da{\flo@sx-(\flo@ta)}\flo@calc\flo@db{\flo@sy-(\flo@tb)}%
  \pgfmathparse{veclen(\flo@da,\flo@db)}\let\flo@nl\pgfmathresult
  \flo@calc\flo@tx{\flo@da/\flo@nl}\flo@calc\flo@ty{\flo@db/\flo@nl}}
\def\flo@lenv#1{\ifdim#1pt>0pt \ifdim#1pt<1pt
  \flo@calc\flo@env{\flo@lW*2.3*pow(#1,0.55)*pow(1-(#1),0.95)}\else\def\flo@env{0}\fi\else\def\flo@env{0}\fi}
\def\flo@lteeth#1{\flo@calc\flo@th{0.006*(1-abs(2*((#1)*9-floor((#1)*9))-1))}}
\def\flo@vleaf{%
  \ifx\flo@vl@W\pgfutil@empty\flo@range\flo@lW{0.20}{0.27}\else\edef\flo@lW{\flo@vl@W}\fi
  \ifx\flo@vl@bend\pgfutil@empty\flo@sym\flo@lbend{0.25}\else\edef\flo@lbend{\flo@vl@bend}\fi
  \ifx\flo@vl@lobes\pgfutil@empty\flo@int\flo@llobes{3}{5}\else\edef\flo@llobes{\flo@vl@lobes}\fi
  \ifx\flo@vl@depth\pgfutil@empty\flo@range\flo@ldepth{0.3}{0.7}\else\edef\flo@ldepth{\flo@vl@depth}\fi
  \ifx\flo@vl@tone\pgfutil@empty\flo@range\flo@lt{0.26}{0.38}\else\edef\flo@lt{\flo@vl@tone}\fi
  \ifdim\flo@vl@u pt>0.6pt \def\flo@fine{1}\def\flo@bn{36}\else\def\flo@fine{0}\def\flo@bn{24}\fi
  \ifdim\flo@ldepth pt>0pt \flo@calc\flo@bodyw{1-0.75*\flo@ldepth}\def\flo@lent{0}\else\def\flo@bodyw{1}\def\flo@lent{1}\fi
  % the body: a blade along the spine, toothed when it has no lobes
  \flo@loop{lbs}\flo@kb{0}{\flo@bn}{%
    \flo@calc\flo@v{\the\flo@kb/\flo@bn}\flo@lspine\flo@v
    \flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@sy}}%
  \flo@normals{\the\numexpr\flo@bn+1\relax}%
  \flo@loop{lbo}\flo@kb{0}{\flo@bn}{%
    \flo@calc\flo@v{\the\flo@kb/\flo@bn}\flo@lenv\flo@v\flo@calc\flo@h{\flo@env*\flo@bodyw}%
    \flo@calc\flo@t{\flo@v*3}\flo@lteeth\flo@t\flo@calc\flo@e{max(0,\flo@h+\flo@lent*\flo@th)}%
    \edef\flo@q{\the\numexpr\flo@kb+1\relax}%
    \flo@calc\flo@xl{\flo@x\flo@q+\csname flo@NX\flo@q\endcsname*\flo@e}\flo@calc\flo@yl{\flo@y\flo@q+\csname flo@NY\flo@q\endcsname*\flo@e}%
    \flo@calc\flo@xr{\flo@x\flo@q-\csname flo@NX\flo@q\endcsname*\flo@e}\flo@calc\flo@yr{\flo@y\flo@q-\csname flo@NY\flo@q\endcsname*\flo@e}%
    \expandafter\let\csname flo@RX\flo@q\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@q\endcsname\flo@yl
    \expandafter\let\csname flo@QX\flo@q\endcsname\flo@xr\expandafter\let\csname flo@QY\flo@q\endcsname\flo@yr}%
  \flo@bladeassemble{\flo@bn}\flo@smoothprepT{\the\numexpr2*\flo@bn\relax}{0.8}\flo@keep{ls1}%
  \def\flo@nshapes{1}\def\flo@nveins{0}%
  % the lobes, grown out of the body along the spine, turned 38..58 degrees outward
  \ifdim\flo@ldepth pt>0pt
    \flo@loop{lside}\flo@kc{0}{1}{%
      \ifnum\flo@kc=0 \def\flo@side{-1}\else\def\flo@side{1}\fi
      \flo@loop{lobe}\flo@ka{1}{\flo@llobes}{%
        \flo@calc\flo@lv{0.1+0.72*(\the\flo@ka-(\flo@side>0 ? 0.25 : 0.75))/\flo@llobes}%
        \flo@lspine\flo@lv\let\flo@lx\flo@sx\let\flo@ly\flo@sy\flo@ltan\flo@lv
        \flo@calc\flo@t{min(0.95,\flo@lv+0.08)}\flo@lenv\flo@t\flo@range\flo@t{0.95}{1.15}\flo@calc\flo@reach{\flo@env*\flo@t}%
        \flo@range\flo@lang{38}{58}%
        \flo@calc\flo@c{cos(\flo@lang)}\flo@calc\flo@sn{sin(\flo@lang)*\flo@side}%
        \flo@calc\flo@ldx{\flo@tx*\flo@c-\flo@ty*\flo@sn}\flo@calc\flo@ldy{\flo@tx*\flo@sn+\flo@ty*\flo@c}%
        \flo@calc\flo@lL{\flo@reach/sin(\flo@lang)*0.95}%
        \flo@sym\flo@t{0.25}\flo@calc\flo@lb{\flo@t-\flo@side*0.15}%
        \flo@loop{lbp}\flo@kb{0}{11}{%
          \flo@calc\flo@v{\the\flo@kb/11}%
          \flo@calc\flo@sx{\flo@lx+\flo@ldx*\flo@lL*\flo@v-\flo@ldy*\flo@lb*\flo@lL*\flo@v*\flo@v}%
          \flo@calc\flo@sy{\flo@ly+\flo@ldy*\flo@lL*\flo@v+\flo@ldx*\flo@lb*\flo@lL*\flo@v*\flo@v}%
          \flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@sy}}%
        \flo@normals{12}%
        \flo@loop{lbw}\flo@kb{0}{11}{%
          \flo@calc\flo@v{\the\flo@kb/11}\edef\flo@q{\the\numexpr\flo@kb+1\relax}%
          \ifdim\flo@v pt>0.2pt \flo@calc\flo@t{\flo@v*1.4+\the\flo@ka}\flo@lteeth\flo@t\flo@calc\flo@e{\flo@th*\flo@lL*4}\else\def\flo@e{0}\fi
          \ifdim\flo@v pt>0pt \flo@calc\flo@g{pow(max(0,sin(180*pow(\flo@v,0.62))),0.75)}\else\def\flo@g{0}\fi
          \flo@range\flo@t{0.26}{0.3}\flo@calc\flo@wa{max(0,\flo@lL*\flo@t*\flo@g+\flo@e)}%
          \flo@range\flo@t{0.26}{0.3}\flo@calc\flo@wb{max(0,\flo@lL*\flo@t*\flo@g+\flo@e)}%
          \flo@calc\flo@xl{\flo@x\flo@q+\csname flo@NX\flo@q\endcsname*\flo@wa}\flo@calc\flo@yl{\flo@y\flo@q+\csname flo@NY\flo@q\endcsname*\flo@wa}%
          \flo@calc\flo@xr{\flo@x\flo@q-\csname flo@NX\flo@q\endcsname*\flo@wb}\flo@calc\flo@yr{\flo@y\flo@q-\csname flo@NY\flo@q\endcsname*\flo@wb}%
          \expandafter\let\csname flo@RX\flo@q\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@q\endcsname\flo@yl
          \expandafter\let\csname flo@QX\flo@q\endcsname\flo@xr\expandafter\let\csname flo@QY\flo@q\endcsname\flo@yr}%
        % the lobe's vein: base, middle (t 0.45) and end (t 0.92) of its spine
        \edef\flo@nveins{\the\numexpr\flo@nveins+1\relax}%
        \flo@calc\flo@t{0.45}\flo@calc\flo@mx{\flo@lx+\flo@ldx*\flo@lL*\flo@t-\flo@ldy*\flo@lb*\flo@lL*\flo@t*\flo@t}%
        \flo@calc\flo@my{\flo@ly+\flo@ldy*\flo@lL*\flo@t+\flo@ldx*\flo@lb*\flo@lL*\flo@t*\flo@t}%
        \flo@calc\flo@t{0.92}\flo@calc\flo@ex{\flo@lx+\flo@ldx*\flo@lL*\flo@t-\flo@ldy*\flo@lb*\flo@lL*\flo@t*\flo@t}%
        \flo@calc\flo@ey{\flo@ly+\flo@ldy*\flo@lL*\flo@t+\flo@ldx*\flo@lb*\flo@lL*\flo@t*\flo@t}%
        \expandafter\edef\csname flo@V\flo@nveins\endcsname{{\flo@lx}{\flo@ly}{\flo@mx}{\flo@my}{\flo@ex}{\flo@ey}}%
        \flo@bladeassemble{11}\flo@smoothprepT{22}{0.8}%
        \edef\flo@nshapes{\the\numexpr\flo@nshapes+1\relax}\flo@keep{ls\flo@nshapes}}}%
  \fi
  \flo@vtone{flo@c}{\flo@lt}\flo@vfill{flo@c}{1}{0}{\flo@leaftrace}%
  \begin{pgfscope}%
    \flo@leaftrace\pgfusepath{clip}%
    % the darker half
    \flo@chance{0.5}\ifflo@yes\def\flo@sd{1}\else\def\flo@sd{-1}\fi
    \def\flo@hp{}%
    \flo@loop{lhalf}\flo@kb{0}{30}{%
      \flo@calc\flo@v{\the\flo@kb/30}\flo@lspine\flo@v
      \ifnum\flo@kb=0 \pgfpathmoveto{\flo@P\flo@sx\flo@sy}\else\pgfpathlineto{\flo@P\flo@sx\flo@sy}\fi}%
    \flo@calc\flo@t{\flo@sd*2}\pgfpathlineto{\flo@P\flo@t{1}}\pgfpathlineto{\flo@P\flo@t{0}}\pgfpathclose
    \flo@scopefill{\flo@vtone{flo@c}{0.12}\pgfsetfillcolor{flo@c}\pgfsetfillopacity{0.28}\pgfsetblendmode{multiply}}%
    \flo@calc\flo@xa{-\flo@lW*2.5}\flo@calc\flo@xb{\flo@lW*2.5}\flo@calc\flo@ta{\flo@lt-0.2}\flo@calc\flo@tb{\flo@lt+0.22}%
    \ifnum\flo@fine=1 \flo@vmottle\flo@xa{0}\flo@xb{1}{13}{0.11}\flo@ta\flo@tb{12}%
    \else\flo@vmottle\flo@xa{0}\flo@xb{1}{6}{0.11}\flo@ta\flo@tb{0}\fi
    \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{1.3*\flo@vl@u}\flo@vstroke{flo@c}{\flo@t}{0.22}{1}{\flo@leaftrace}%
    % midrib and veins in white
    \flo@loop{mid}\flo@kb{0}{10}{\flo@calc\flo@v{\the\flo@kb/10}\flo@lspine\flo@v\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@sy}}%
    \flo@vstreak{11}{0.03}{0.003}{white}{0.78}%
    \flo@loop{lvein}\flo@ka{1}{\flo@nveins}{%
      \expandafter\expandafter\expandafter\flo@lveinat\csname flo@V\the\flo@ka\endcsname
      \def\flo@twa{0.017}\def\flo@twb{0.002}\flo@range\flo@op{0.5}{0.75}%
      \flo@vfill{white}{\flo@op}{0}{\flo@vtaper\flo@va\flo@vb\flo@mx\flo@my\flo@c\flo@d\flo@ex\flo@ey}}%
    \ifnum\flo@nveins=0
      \flo@loop{sveins}\flo@ka{1}{9}{%
        \flo@calc\flo@v{(\the\flo@ka-0.3)/10*0.9}\ifodd\flo@ka\def\flo@sg{-1}\else\def\flo@sg{1}\fi
        \flo@lspine\flo@v\let\flo@lx\flo@sx\let\flo@ly\flo@sy\flo@ltan\flo@v
        \flo@calc\flo@nx{-\flo@ty*\flo@sg}\flo@calc\flo@ny{\flo@tx*\flo@sg}%
        \flo@lenv\flo@v\flo@range\flo@t{0.75}{0.95}\flo@calc\flo@lL{\flo@env*\flo@bodyw*\flo@t}%
        \flo@calc\flo@pa{\flo@lx+\flo@nx*\flo@lL*0.4}\flo@calc\flo@pb{\flo@ly+\flo@ny*\flo@lL*0.4}%
        \flo@calc\flo@pc{\flo@lx+\flo@nx*\flo@lL*0.75+\flo@tx*\flo@lL*0.3}\flo@calc\flo@pd{\flo@ly+\flo@ny*\flo@lL*0.75+\flo@ty*\flo@lL*0.3}%
        \flo@calc\flo@pe{\flo@lx+\flo@nx*\flo@lL*0.95+\flo@tx*\flo@lL*0.6}\flo@calc\flo@pf{\flo@ly+\flo@ny*\flo@lL*0.95+\flo@ty*\flo@lL*0.6}%
        \let\flo@qa\flo@pa\let\flo@qb\flo@pb\let\flo@qc\flo@pc\let\flo@qd\flo@pd\let\flo@qe\flo@pe\let\flo@qf\flo@pf
        \def\flo@twa{0.014}\def\flo@twb{0.002}\flo@range\flo@op{0.45}{0.7}%
        \flo@vfill{white}{\flo@op}{0}{\flo@vtaper\flo@lx\flo@ly\flo@qa\flo@qb\flo@qc\flo@qd\flo@qe\flo@qf}}%
    \fi
  \end{pgfscope}%
  \ifnum\flo@lent=1 \flo@vtone{flo@c}{0.05}\flo@vstroke{flo@c}{0.18}{0.4}{0}{\flo@kept{ls1}}\fi}
\def\flo@lveinat#1#2#3#4#5#6{\def\flo@va{#1}\def\flo@vb{#2}\def\flo@mx{#3}\def\flo@my{#4}\def\flo@ex{#5}\def\flo@ey{#6}%
  \flo@calc\flo@c{\flo@mx+(\flo@ex-\flo@mx)*0.5}\flo@calc\flo@d{\flo@my+(\flo@ey-\flo@my)*0.5}}
% every shape of the leaf, as one path (the body and the lobes)
\def\flo@leaftrace{\flo@loop{ltr}\flo@j{1}{\flo@nshapes}{\flo@kept{ls\the\flo@j}}}
% points 1..#1+1 from flo@RX/RY (left) and flo@QX/QY (right) into a blade outline
% (ink.blade's order: left base to tip, right back to the second point)
\def\flo@bladeassemble#1{%
  \flo@loop{bla}\flo@kb{1}{#1+1}{%
    \flo@put{\the\flo@kb}{\csname flo@RX\the\flo@kb\endcsname}{\csname flo@RY\the\flo@kb\endcsname}}%
  \flo@loop{blb}\flo@kb{2}{#1}{%
    \flo@put{\the\numexpr2*(#1)+2-\flo@kb\relax}{\csname flo@QX\the\flo@kb\endcsname}{\csname flo@QY\the\flo@kb\endcsname}}}

% ---------------------------------------------------------------- the species' leaf
% A simple leaf of the species along +y, length 1, in flora's hand (\flo@vleaf, which the
% v1.3 pic keeps as it was) with the species' own outline. The blade is two superellipse
% quarters that meet at its widest point \flo@lvm, set by the shape: the base's, from the
% junction, (1-t^kb)^(1/kb) with kb from the base (1 a wedge, 2 round, more a straight
% base), and the apex's, to the tip, with ka from the apex. An acuminate apex narrows into
% a drip tip, an emarginate one is notched and a mucronate one ends in a point. Basal lobes
% hang below the junction (cordate, reniform, sagittate: \flo@ldrop) or stand out beside it
% (hastate: \flo@lhl); an oblique base starts higher on one side (\flo@lobl). A petiolate
% leaf has a stalk below its blade, and stipules sit at its foot. \flo@lW is the
% half-width at the widest point. Set before: \flo@vl@bend, \flo@vl@lobes, \flo@vl@depth,
% \flo@vl@tone and \flo@vl@u as for \flo@vleaf.
% the outline's numbers: the base first, then the shape (which may fix the base), the apex
\def\flo@sshape{\flo@sshape@
  \edef\flo@t{\flo@get{attachment}}\def\flo@tmp{clasping}%
  \ifx\flo@t\flo@tmp\ifdim\flo@ldrop pt=0pt \def\flo@ldrop{0.7}\flo@calc\flo@lkb{max(\flo@lkb,2)}\fi\fi}
% (a leaflet's: no attachment)
\def\flo@sshape@{%
  \flo@calc\flo@lW{max(0.035,min(0.6,0.5/\flo@get{leafaspect}))}%
  \def\flo@lvm{0.35}\def\flo@ldrop{0}\def\flo@lhl{0}\def\flo@lobl{0}\def\flo@lacu{0}\def\flo@ltip{0}\def\flo@lround{0}%
  \csname flo@lb@\flo@get{leafbase}\endcsname
  \csname flo@ls@\flo@get{leafshape}\endcsname
  \csname flo@la@\flo@get{leafapex}\endcsname
  % a round or kidney-shaped blade keeps a round tip whatever its apex
  \ifnum\flo@lround=1 \flo@calc\flo@lka{max(\flo@lka,2.2)}\def\flo@lacu{0}\fi}
\def\flo@lb@cuneate{\def\flo@lkb{1.15}}
\def\flo@lb@rounded{\def\flo@lkb{2}}
\def\flo@lb@truncate{\def\flo@lkb{3.5}}
\def\flo@lb@cordate{\def\flo@lkb{2}\def\flo@ldrop{1}}
\def\flo@lb@auriculate{\def\flo@lkb{1.5}}
\def\flo@lb@oblique{\def\flo@lkb{1.8}\def\flo@lobl{0.08}}
\def\flo@ls@linear{\def\flo@lvm{0.45}\flo@calc\flo@lkb{max(\flo@lkb,2.2)}}
\def\flo@ls@lanceolate{\def\flo@lvm{0.3}}
\def\flo@ls@elliptic{\def\flo@lvm{0.5}}
\def\flo@ls@ovate{\def\flo@lvm{0.3}}
\def\flo@ls@obovate{\def\flo@lvm{0.68}}
\def\flo@ls@oblong{\def\flo@lvm{0.5}\flo@calc\flo@lkb{max(\flo@lkb,2.4)}}
\def\flo@ls@orbicular{\def\flo@lvm{0.5}\def\flo@lkb{2}\def\flo@lround{1}}
\def\flo@ls@cordate{\def\flo@lvm{0.3}}
\def\flo@ls@reniform{\def\flo@lvm{0.42}\def\flo@lkb{2}\def\flo@ldrop{0.8}\def\flo@lround{1}}
\def\flo@ls@deltoid{\def\flo@lvm{0.1}\def\flo@lkb{3.5}}
\def\flo@ls@sagittate{\def\flo@lvm{0.32}\def\flo@lkb{1.8}\def\flo@ldrop{2}}
\def\flo@ls@hastate{\def\flo@lvm{0.38}\def\flo@lkb{1.7}\def\flo@lhl{1.05}\def\flo@ldrop{0.2}}
\def\flo@la@acute{\def\flo@lka{1.25}}
\def\flo@la@acuminate{\def\flo@lka{1.5}\def\flo@lacu{1}}
\def\flo@la@obtuse{\def\flo@lka{2}}
\def\flo@la@rounded{\def\flo@lka{2.6}}
\def\flo@la@emarginate{\def\flo@lka{2.6}\def\flo@ltip{-1}}
\def\flo@la@mucronate{\def\flo@lka{2.3}\def\flo@ltip{1}}
% the blade's half-width \flo@h at #1 along the spine, and how far its edge hangs below
% that point (\flo@dy: basal lobes)
\def\flo@shw#1{%
  \edef\flo@shv{#1}%
  \ifdim\flo@shv pt<\flo@lvm pt
    \flo@calc\flo@t{(\flo@lvm-(\flo@shv))/\flo@lvm}%
    \ifdim\flo@t pt>0.9995pt \def\flo@h{0}\else\flo@calc\flo@h{\flo@lW*pow(1-pow(\flo@t,\flo@lkb),1/\flo@lkb)}\fi
    \flo@calc\flo@dy{\flo@ldrop*\flo@lW*sin(180*(1-\flo@t))*\flo@t}%
  \else
    \flo@calc\flo@t{((\flo@shv)-\flo@lvm)/(1-\flo@lvm)}%
    \ifdim\flo@t pt>0.9995pt \def\flo@h{0}\else\flo@calc\flo@h{\flo@lW*pow(1-pow(\flo@t,\flo@lka),1/\flo@lka)}\fi
    \ifnum\flo@lacu=1 \ifdim\flo@t pt>0.2pt
      \flo@calc\flo@t{min(1,(\flo@t-0.2)/0.65)}\flo@calc\flo@h{\flo@h*(1-0.7*\flo@t*\flo@t*(3-2*\flo@t))}\fi\fi
    \def\flo@dy{0}%
  \fi
  \ifdim\flo@lhl pt>0pt
    \flo@calc\flo@t{max(0,1-abs((\flo@shv)-0.11)/0.11)}%
    \ifdim\flo@t pt>0pt \flo@calc\flo@h{max(\flo@h,\flo@lhl*\flo@lW*\flo@t)}\fi
  \fi}
\def\flo@slenv#1{\flo@shw{#1}\let\flo@env\flo@h}
% The body's margin: samples \flo@sv<k> along the spine, k = 1..\flo@mn, each with its
% tooth profile \flo@sd<k> (1 at a tooth's tip and on a smooth edge, 0 at the bottom of a
% notch) and the cut's scale on the left and the right (\flo@sjl<k>, \flo@sjr<k>), so no two
% teeth are alike. A smooth margin is \flo@bn+1 samples closer together at the ends, a wavy
% one waves three to five times; teeth run from 0.12 to 0.93 along the spine, as many as the
% species has where the leaf is large enough to show them: serrate teeth lean toward the tip,
% dentate ones point out, crenate ones are round scallops, doubly serrate ones carry a
% smaller tooth. A lobed body keeps a smooth edge (its lobes have their own).
\def\flo@sadd#1#2#3#4{\edef\flo@mn{\the\numexpr\flo@mn+1\relax}%
  \expandafter\edef\csname flo@sv\flo@mn\endcsname{#1}\expandafter\edef\csname flo@sd\flo@mn\endcsname{#2}%
  \expandafter\edef\csname flo@sjl\flo@mn\endcsname{#3}\expandafter\edef\csname flo@sjr\flo@mn\endcsname{#4}}
% a point of the tooth that starts at \flo@tvo and is \flo@tw wide: #1 its phase, #2 its profile
\def\flo@tpt#1#2{\flo@calc\flo@t{\flo@tvo+\flo@tw*(#1)}\flo@sadd\flo@t{#2}\flo@jl\flo@jr}
\def\flo@lt@serrate{\flo@tpt{0}{0}\flo@tpt{0.75+\flo@jp}{1}}
\def\flo@lt@doubly{\flo@tpt{0}{0}\flo@tpt{0.38}{0.55}\flo@tpt{0.52}{0.3}\flo@tpt{0.82+\flo@jp}{1}}
\def\flo@lt@dentate{\flo@tpt{0}{0}\flo@tpt{0.5+\flo@jp}{1}}
\def\flo@lt@crenate{\flo@tpt{0}{0}\flo@tpt{0.2}{0.72}\flo@tpt{0.5+\flo@jp}{1}\flo@tpt{0.8}{0.72}}
% the margin's kind \flo@lmk (0 smooth, 1 wavy, 2 toothed), the cut's depth \flo@ldep and
% the outline's tension \flo@ltk (teeth a little sharper)
\def\flo@lm@undulate{\def\flo@lmk{1}}
\def\flo@lm@serrate{\def\flo@lmk{2}\def\flo@ltk{0.5}\def\flo@ltd{1.2}}
\def\flo@lm@doubly{\def\flo@lmk{2}\def\flo@ltk{0.5}\def\flo@ltd{1.3}}
\def\flo@lm@dentate{\def\flo@lmk{2}\def\flo@ltk{0.5}\def\flo@ltd{1.3}}
\def\flo@lm@crenate{\def\flo@lmk{2}\def\flo@ltd{1.5}}
\def\flo@smargin{%
  \def\flo@lmk{0}\def\flo@mn{0}\def\flo@ltk{0.8}\def\flo@ldep{0}\edef\flo@lmn{\flo@get{leafmargin}}%
  \ifx\flo@lmover\pgfutil@empty\else\let\flo@lmn\flo@lmover\fi
  \ifdim\flo@ldepth pt>0pt\else\ifcsname flo@lm@\flo@lmn\endcsname\csname flo@lm@\flo@lmn\endcsname\fi\fi
  \ifnum\flo@lmk=2 \ifnum\flo@get{teeth}<1 \def\flo@lmk{0}\def\flo@ltk{0.8}\fi\fi% no teeth: smooth
  \ifnum\flo@lmk<2
    \ifnum\flo@lmk=1 \flo@int\flo@lwn{3}{5}\flo@calc\flo@ldep{(0.05+\flo@get{dissection})*\flo@lW*2.4}\fi
    \flo@loop{smg}\flo@kb{0}{\flo@bn}{%
      \flo@calc\flo@v{0.5-0.5*cos(180*\the\flo@kb/\flo@bn)}%
      \ifnum\flo@lmk=1 \flo@calc\flo@t{0.5+0.5*sin(360*\flo@lwn*\flo@v)}\else\def\flo@t{1}\fi
      \flo@sadd\flo@v\flo@t{1}{1}}%
  \else
    \ifx\flo@lmover\pgfutil@empty\flo@calc\flo@ldep{\flo@get{dissection}*\flo@lW*\flo@ltd}%
    \else\flo@calc\flo@ldep{min(0.25,\flo@get{dissection})*\flo@lW*\flo@ltd}\fi
    \flo@calc\flo@t{min(\flo@get{teeth},max(4,round(4+8*\flo@vl@u)))}\pgfmathtruncatemacro\flo@ltn{\flo@t}%
    \flo@calc\flo@tw{0.81/\flo@ltn}%
    \flo@loop{smb}\flo@kb{0}{4}{\flo@calc\flo@v{0.12*(1-cos(90*\the\flo@kb/5))}\flo@sadd\flo@v{1}{1}{1}}%
    \flo@loop{smt}\flo@ka{1}{\flo@ltn}{%
      \flo@range\flo@jl{0.65}{1.35}\flo@range\flo@jr{0.65}{1.35}\flo@sym\flo@jp{0.06}%
      \flo@calc\flo@tvo{0.12+\flo@tw*(\the\flo@ka-1)}\csname flo@lt@\flo@lmn\endcsname}%
    \flo@sadd{0.93}{0}{1}{1}%
    \flo@loop{smp}\flo@kb{1}{5}{\flo@calc\flo@v{0.93+0.07*sin(90*\the\flo@kb/5)}\flo@sadd\flo@v{1}{1}{1}}%
  \fi}
\def\flo@sleaf{%
  \flo@sshape
  % a broad blade is drawn shorter, so that it stays within the room a leaf is given (about
  % 0.6 of its length across) and leaves of every shape carry about the same weight
  \flo@calc\flo@lsc{min(1,0.3/\flo@lW)}%
  % (a palmately lobed leaf's lobes fan out to about 0.55 of its length each side)
  \edef\flo@t{\flo@get{leafmargin}}\def\flo@tmp{palmatelobed}%
  \ifx\flo@t\flo@tmp\flo@calc\flo@lsc{min(1,0.3/max(\flo@lW,0.55))}\fi
  \begin{pgfscope}%
  \ifdim\flo@lsc pt<1pt \pgftransformscale{\flo@lsc}\flo@calc\flo@vl@u{\flo@vl@u*\flo@lsc}\fi
  % stipules at the foot, a pair of small leaflets (on leaves a centimeter long or more)
  \edef\flo@t{\flo@get{stipules}}\def\flo@tmp{none}%
  \ifx\flo@t\flo@tmp\else\ifdim\flo@vl@u pt>0.8pt
    \flo@loop{stip}\flo@kc{0}{1}{%
      \flo@range\flo@t{40}{65}\ifnum\flo@kc=1 \flo@calc\flo@t{-\flo@t}\fi\flo@range\flo@ts{0.1}{0.15}%
      \begin{pgfscope}%
        \pgftransformshift{\flo@P0{0.01}}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@ts}%
        \def\flo@vl@W{0.3}\def\flo@vl@tone{0.3}\flo@calc\flo@vl@u{\flo@vl@u*\flo@ts}\flo@vleaflet
      \end{pgfscope}}%
  \fi\fi
  % a petiolate leaf's stalk, then the blade above it
  \edef\flo@t{\flo@get{attachment}}\def\flo@tmp{petiolate}%
  \ifx\flo@t\flo@tmp\flo@range\flo@lpf{0.1}{0.2}\else\def\flo@lpf{0}\fi
  \ifdim\flo@lpf pt>0pt
    \flo@vtone{flo@c}{0.16}\def\flo@twa{0.024}\def\flo@twb{0.014}%
    \flo@calc\flo@lpe{\flo@lpf+0.01}\flo@calc\flo@ta{\flo@lpf/3}\flo@calc\flo@tb{2*\flo@lpf/3}%
    \flo@vfill{flo@c}{1}{0}{\flo@vtaper{0}{0}{0}\flo@ta{0}\flo@tb{0}\flo@lpe}%
  \fi
  \begin{pgfscope}%
    \ifdim\flo@lpf pt>0pt
      \pgftransformshift{\flo@P0\flo@lpf}\flo@calc\flo@t{1-\flo@lpf}\pgftransformscale{\flo@t}%
      \flo@calc\flo@vl@u{\flo@vl@u*\flo@t}%
    \fi
    \flo@sblade
  \end{pgfscope}%
  \end{pgfscope}}
\def\flo@sblade{%
  \ifx\flo@vl@bend\pgfutil@empty\flo@sym\flo@lbend{0.25}\else\edef\flo@lbend{\flo@vl@bend}\fi
  \edef\flo@llobes{\flo@vl@lobes}\edef\flo@ldepth{\flo@vl@depth}%
  \ifx\flo@vl@tone\pgfutil@empty\flo@range\flo@lt{0.26}{0.38}\else\edef\flo@lt{\flo@vl@tone}\fi
  \ifdim\flo@vl@u pt>0.6pt \def\flo@fine{1}\def\flo@bn{36}\else\def\flo@fine{0}\def\flo@bn{24}\fi
  % a leaflet's level of detail (\flo@lleaflet): under 1.4 cm a coarser edge, no mottle or
  % side veins, under 4 mm a flat shape
  \def\flo@lod{2}\ifnum\flo@lleaflet=1 \ifdim\flo@vl@u pt<1.4pt \def\flo@lod{1}\def\flo@fine{0}\def\flo@bn{16}%
    \ifdim\flo@vl@u pt<0.4pt \def\flo@lod{0}\def\flo@bn{12}\fi\fi\fi
  \ifdim\flo@ldepth pt>0pt \flo@calc\flo@bodyw{1-0.75*\flo@ldepth}\def\flo@lent{0}\else\def\flo@bodyw{1}\def\flo@lent{1}\fi
  % a curled tip (\flo@hookset), on an unlobed leaf drawn in full 8 mm long or more,
  % hairless unless it is broad (a narrow hairy one curled reads as a caterpillar), up to
  % one in two as the species' leaves curl
  \def\flo@hk{0}\def\flo@hok{1}\ifnum\flo@get{hairy}=1 \ifdim\flo@lW pt<0.15pt \def\flo@hok{0}\fi\fi
  \ifnum\flo@lod=2 \ifnum\flo@lent=1 \ifnum\flo@hok=1 \ifdim\flo@vl@u pt>0.8pt
    \flo@calc\flo@t{min(0.55,max(0,\flo@get{curl}+0.25))}\flo@chance\flo@t
    \ifflo@yes\flo@hookset\fi
  \fi\fi\fi\fi
  % the body along its margin's samples (\flo@smargin)
  \flo@smargin
  \flo@loop{sbs}\flo@kb{1}{\flo@mn}{%
    \edef\flo@v{\csname flo@sv\the\flo@kb\endcsname}\flo@lspine\flo@v\flo@put{\the\flo@kb}{\flo@sx}{\flo@sy}}%
  \flo@normals{\flo@mn}%
  \flo@loop{sbo}\flo@kb{1}{\flo@mn}{%
    \edef\flo@q{\the\flo@kb}\edef\flo@v{\csname flo@sv\flo@q\endcsname}\edef\flo@sdd{\csname flo@sd\flo@q\endcsname}%
    \flo@shw\flo@v\flo@calc\flo@cut{\flo@ldep*min(1,\flo@h/(0.45*\flo@lW))*(1-\flo@sdd)}%
    % a curled tip narrows as it turns edge-on, the more the species' leaves twist
    \def\flo@hwf{1}\ifnum\flo@hk=1 \ifdim\flo@v pt>\flo@hv pt
      \flo@calc\flo@hwt{min(1,(\flo@v-\flo@hv)/\flo@hl)}%
      \flo@calc\flo@hwf{1-(0.25+0.008*\flo@get{twist})*min(1,\flo@hth/150)*\flo@hwt*\flo@hwt*(3-2*\flo@hwt)}\fi\fi
    \flo@calc\flo@e{max(0,\flo@h*\flo@bodyw-\flo@cut*\csname flo@sjl\flo@q\endcsname)*\flo@hwf}%
    \flo@calc\flo@xl{\flo@x\flo@q+\csname flo@NX\flo@q\endcsname*\flo@e}\flo@calc\flo@yl{\flo@y\flo@q+\csname flo@NY\flo@q\endcsname*\flo@e-\flo@dy}%
    \ifdim\flo@lobl pt>0pt \flo@calc\flo@vo{max(0,(\flo@v-\flo@lobl)/(1-\flo@lobl))}\flo@shw\flo@vo\fi
    \flo@calc\flo@e{max(0,\flo@h*\flo@bodyw-\flo@cut*\csname flo@sjr\flo@q\endcsname)*\flo@hwf}%
    \flo@calc\flo@xr{\flo@x\flo@q-\csname flo@NX\flo@q\endcsname*\flo@e}\flo@calc\flo@yr{\flo@y\flo@q-\csname flo@NY\flo@q\endcsname*\flo@e-\flo@dy}%
    \expandafter\let\csname flo@RX\flo@q\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@q\endcsname\flo@yl
    \expandafter\let\csname flo@QX\flo@q\endcsname\flo@xr\expandafter\let\csname flo@QY\flo@q\endcsname\flo@yr}%
  % the tip: notched (emarginate) or a short point (mucronate)
  \edef\flo@q{\flo@mn}%
  \ifnum\flo@ltip<0 \flo@calc\flo@t{\csname flo@RY\flo@q\endcsname-0.25*\flo@lW}\expandafter\let\csname flo@RY\flo@q\endcsname\flo@t\fi
  \ifnum\flo@ltip>0 \flo@calc\flo@t{\csname flo@RY\flo@q\endcsname+0.04}\expandafter\let\csname flo@RY\flo@q\endcsname\flo@t\fi
  \edef\flo@mnm{\the\numexpr\flo@mn-1\relax}\flo@bladeassemble\flo@mnm
  \flo@smoothprepT{\the\numexpr2*\flo@mn-2\relax}{\flo@ltk}\flo@keep{ls1}%
  % a hairy leaf's fringe: short hairs straight out from every other point of its edge
  \ifnum\flo@get{hairy}=1 \ifnum\flo@fine=1
    \edef\flo@hn{\the\numexpr2*\flo@mn-2\relax}\flo@normals\flo@hn
    \flo@vtone{flo@c}{0.1}%
    \flo@vstroke{flo@c}{0.15}{0.55}{0}{%
      \flo@loop{hair}\flo@kb{1}{\flo@hn}{\ifodd\flo@kb
        \flo@range\flo@hl{0.008}{0.02}%
        \flo@calc\flo@xl{\flo@x{\the\flo@kb}+\csname flo@NX\the\flo@kb\endcsname*\flo@hl}%
        \flo@calc\flo@yl{\flo@y{\the\flo@kb}+\csname flo@NY\the\flo@kb\endcsname*\flo@hl}%
        \pgfpathmoveto{\flo@P{\flo@x{\the\flo@kb}}{\flo@y{\the\flo@kb}}}\pgfpathlineto{\flo@P\flo@xl\flo@yl}\fi}}%
  \fi\fi
  \def\flo@nshapes{1}\def\flo@nveins{0}%
  % the lobes, grown out of the body along the spine, turned 38..58 degrees outward; a
  % palmately lobed leaf's (a maple's) fan out from its base instead, wider, each shorter
  % and further round than the last
  \ifdim\flo@ldepth pt>0pt
    \def\flo@tmp{palmatelobed}\ifx\flo@lmn\flo@tmp
      \def\flo@lpal{1}\def\flo@lwf{1.3}\pgfmathtruncatemacro\flo@lnl{max(1,floor(\flo@llobes/2))}%
    \else\def\flo@lpal{0}\def\flo@lwf{1}\edef\flo@lnl{\flo@llobes}\fi
    \flo@loop{slside}\flo@kc{0}{1}{%
      \ifnum\flo@kc=0 \def\flo@side{-1}\else\def\flo@side{1}\fi
      \flo@loop{slobe}\flo@ka{1}{\flo@lnl}{%
        \ifnum\flo@lpal=1
          \flo@calc\flo@lv{0.04+0.025*\the\flo@ka}%
          \flo@lspine\flo@lv\let\flo@lx\flo@sx\let\flo@ly\flo@sy\flo@ltan\flo@lv
          \flo@range\flo@t{0.9}{1.1}\flo@calc\flo@lL{0.8*(1-0.3*(\the\flo@ka-1)/\flo@lnl)*\flo@t}%
          \flo@range\flo@lang{30}{40}\flo@calc\flo@lang{\flo@lang+45*(\the\flo@ka-1)/max(1,\flo@lnl-1)}%
        \else
          \flo@calc\flo@lv{0.1+0.72*(\the\flo@ka-(\flo@side>0 ? 0.25 : 0.75))/\flo@llobes}%
          \flo@lspine\flo@lv\let\flo@lx\flo@sx\let\flo@ly\flo@sy\flo@ltan\flo@lv
          \flo@calc\flo@t{min(0.95,\flo@lv+0.08)}\flo@slenv\flo@t\flo@range\flo@t{0.95}{1.15}\flo@calc\flo@reach{\flo@env*\flo@t}%
          \flo@range\flo@lang{38}{58}%
        \fi
        \flo@calc\flo@c{cos(\flo@lang)}\flo@calc\flo@sn{sin(\flo@lang)*\flo@side}%
        \flo@calc\flo@ldx{\flo@tx*\flo@c-\flo@ty*\flo@sn}\flo@calc\flo@ldy{\flo@tx*\flo@sn+\flo@ty*\flo@c}%
        \ifnum\flo@lpal=0 \flo@calc\flo@lL{\flo@reach/sin(\flo@lang)*0.95}\fi
        \flo@sym\flo@t{0.25}\flo@calc\flo@lb{\flo@t-\flo@side*0.15}%
        \flo@loop{slbp}\flo@kb{0}{11}{%
          \flo@calc\flo@v{\the\flo@kb/11}%
          \flo@calc\flo@sx{\flo@lx+\flo@ldx*\flo@lL*\flo@v-\flo@ldy*\flo@lb*\flo@lL*\flo@v*\flo@v}%
          \flo@calc\flo@sy{\flo@ly+\flo@ldy*\flo@lL*\flo@v+\flo@ldx*\flo@lb*\flo@lL*\flo@v*\flo@v}%
          \flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@sy}}%
        \flo@normals{12}%
        \flo@loop{slbw}\flo@kb{0}{11}{%
          \flo@calc\flo@v{\the\flo@kb/11}\edef\flo@q{\the\numexpr\flo@kb+1\relax}%
          \ifdim\flo@v pt>0.2pt \flo@calc\flo@t{\flo@v*1.4+\the\flo@ka}\flo@lteeth\flo@t\flo@calc\flo@e{\flo@th*\flo@lL*4}\else\def\flo@e{0}\fi
          \ifdim\flo@v pt>0pt \flo@calc\flo@g{pow(max(0,sin(180*pow(\flo@v,0.62))),0.75)}\else\def\flo@g{0}\fi
          \flo@range\flo@t{0.26}{0.3}\flo@calc\flo@wa{max(0,\flo@lL*\flo@t*\flo@lwf*\flo@g+\flo@e)}%
          \flo@range\flo@t{0.26}{0.3}\flo@calc\flo@wb{max(0,\flo@lL*\flo@t*\flo@lwf*\flo@g+\flo@e)}%
          \flo@calc\flo@xl{\flo@x\flo@q+\csname flo@NX\flo@q\endcsname*\flo@wa}\flo@calc\flo@yl{\flo@y\flo@q+\csname flo@NY\flo@q\endcsname*\flo@wa}%
          \flo@calc\flo@xr{\flo@x\flo@q-\csname flo@NX\flo@q\endcsname*\flo@wb}\flo@calc\flo@yr{\flo@y\flo@q-\csname flo@NY\flo@q\endcsname*\flo@wb}%
          \expandafter\let\csname flo@RX\flo@q\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@q\endcsname\flo@yl
          \expandafter\let\csname flo@QX\flo@q\endcsname\flo@xr\expandafter\let\csname flo@QY\flo@q\endcsname\flo@yr}%
        \edef\flo@nveins{\the\numexpr\flo@nveins+1\relax}%
        \flo@calc\flo@t{0.45}\flo@calc\flo@mx{\flo@lx+\flo@ldx*\flo@lL*\flo@t-\flo@ldy*\flo@lb*\flo@lL*\flo@t*\flo@t}%
        \flo@calc\flo@my{\flo@ly+\flo@ldy*\flo@lL*\flo@t+\flo@ldx*\flo@lb*\flo@lL*\flo@t*\flo@t}%
        \flo@calc\flo@t{0.92}\flo@calc\flo@ex{\flo@lx+\flo@ldx*\flo@lL*\flo@t-\flo@ldy*\flo@lb*\flo@lL*\flo@t*\flo@t}%
        \flo@calc\flo@ey{\flo@ly+\flo@ldy*\flo@lL*\flo@t+\flo@ldx*\flo@lb*\flo@lL*\flo@t*\flo@t}%
        \expandafter\edef\csname flo@V\flo@nveins\endcsname{{\flo@lx}{\flo@ly}{\flo@mx}{\flo@my}{\flo@ex}{\flo@ey}}%
        \flo@bladeassemble{11}\flo@smoothprepT{22}{0.8}%
        \edef\flo@nshapes{\the\numexpr\flo@nshapes+1\relax}\flo@keep{ls\flo@nshapes}}}%
  \fi
  \flo@vtone{flo@c}{\flo@lt}\flo@vfill{flo@c}{1}{0}{\flo@leaftrace}%
  \ifnum\flo@lod>0
  \begin{pgfscope}%
    \flo@leaftrace\pgfusepath{clip}%
    % the darker half
    \flo@chance{0.5}\ifflo@yes\def\flo@sd{1}\else\def\flo@sd{-1}\fi
    \flo@loop{slhalf}\flo@kb{0}{30}{%
      \flo@calc\flo@v{\the\flo@kb/30}\flo@lspine\flo@v
      \ifnum\flo@kb=0 \pgfpathmoveto{\flo@P\flo@sx\flo@sy}\else\pgfpathlineto{\flo@P\flo@sx\flo@sy}\fi}%
    \flo@calc\flo@t{\flo@sd*2}\pgfpathlineto{\flo@P\flo@t{1}}\pgfpathlineto{\flo@P\flo@t{-0.3}}%
    \pgfpathlineto{\flo@P0{-0.3}}\pgfpathclose
    \flo@scopefill{\flo@vtone{flo@c}{0.12}\pgfsetfillcolor{flo@c}\pgfsetfillopacity{0.28}\pgfsetblendmode{multiply}}%
    \flo@calc\flo@xa{-\flo@lW*2.5}\flo@calc\flo@xb{\flo@lW*2.5}\flo@calc\flo@ta{\flo@lt-0.2}\flo@calc\flo@tb{\flo@lt+0.22}%
    \ifnum\flo@lod=2
      \ifnum\flo@fine=1 \flo@vmottle\flo@xa{-0.2}\flo@xb{1}{13}{0.11}\flo@ta\flo@tb{12}%
      \else\flo@vmottle\flo@xa{-0.2}\flo@xb{1}{6}{0.11}\flo@ta\flo@tb{0}\fi\fi
    \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{1.3*\flo@vl@u}\flo@vstroke{flo@c}{\flo@t}{0.22}{1}{\flo@leaftrace}%
    % midrib and veins in white
    \flo@loop{slmid}\flo@kb{0}{10}{\flo@calc\flo@v{\the\flo@kb/10}\flo@lspine\flo@v\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@sy}}%
    \flo@vstreak{11}{0.03}{0.003}{white}{0.78}%
    \flo@loop{slvein}\flo@ka{1}{\flo@nveins}{%
      \expandafter\expandafter\expandafter\flo@lveinat\csname flo@V\the\flo@ka\endcsname
      \def\flo@twa{0.017}\def\flo@twb{0.002}\flo@range\flo@op{0.5}{0.75}%
      \flo@vfill{white}{\flo@op}{0}{\flo@vtaper\flo@va\flo@vb\flo@mx\flo@my\flo@c\flo@d\flo@ex\flo@ey}}%
    % veins: side veins from the midrib (pinnate), curving up along the edge toward the tip
    % (arcuate), or two each side fanning from the base below a few side veins (palmate)
    \ifnum\flo@nveins=0 \ifnum\flo@lod=2
      \edef\flo@vn{\flo@get{venation}}\def\flo@vka{1}\def\flo@varc{0}%
      \def\flo@tmp{arcuate}\ifx\flo@vn\flo@tmp\def\flo@varc{1}\fi
      \def\flo@tmp{palmate}\ifx\flo@vn\flo@tmp
        \def\flo@vka{5}%
        \flo@lspine{0.03}\let\flo@lx\flo@sx\let\flo@ly\flo@sy\flo@ltan{0.03}%
        \flo@loop{slpv}\flo@kc{0}{3}{%
          \ifnum\flo@kc<2 \def\flo@side{-1}\else\def\flo@side{1}\fi
          \ifodd\flo@kc\def\flo@t{64}\def\flo@vbl{1.1}\else\def\flo@t{32}\def\flo@vbl{1.5}\fi
          \flo@range\flo@lang{\flo@t-5}{\flo@t+5}%
          \flo@calc\flo@c{cos(\flo@lang)}\flo@calc\flo@sn{sin(\flo@lang)*\flo@side}%
          \flo@calc\flo@ldx{\flo@tx*\flo@c-\flo@ty*\flo@sn}\flo@calc\flo@ldy{\flo@tx*\flo@sn+\flo@ty*\flo@c}%
          \flo@range\flo@t{0.85}{1}\flo@calc\flo@lL{\flo@lW*\flo@vbl*\flo@t}%
          \flo@calc\flo@pa{\flo@lx+\flo@ldx*\flo@lL*0.4}\flo@calc\flo@pb{\flo@ly+\flo@ldy*\flo@lL*0.4}%
          \flo@calc\flo@pc{\flo@lx+\flo@ldx*\flo@lL*0.75+\flo@tx*\flo@lL*0.25}\flo@calc\flo@pd{\flo@ly+\flo@ldy*\flo@lL*0.75+\flo@ty*\flo@lL*0.25}%
          \flo@calc\flo@pe{\flo@lx+\flo@ldx*\flo@lL*0.9+\flo@tx*\flo@lL*0.6}\flo@calc\flo@pf{\flo@ly+\flo@ldy*\flo@lL*0.9+\flo@ty*\flo@lL*0.6}%
          \let\flo@qa\flo@pa\let\flo@qb\flo@pb\let\flo@qc\flo@pc\let\flo@qd\flo@pd\let\flo@qe\flo@pe\let\flo@qf\flo@pf
          \def\flo@twa{0.016}\def\flo@twb{0.002}\flo@range\flo@op{0.45}{0.7}%
          \flo@vfill{white}{\flo@op}{0}{\flo@vtaper\flo@lx\flo@ly\flo@qa\flo@qb\flo@qc\flo@qd\flo@qe\flo@qf}}%
      \fi
      \flo@loop{slsveins}\flo@ka{\flo@vka}{9}{%
        \flo@calc\flo@v{(\the\flo@ka-0.3)/10*0.9}\ifodd\flo@ka\def\flo@sg{-1}\else\def\flo@sg{1}\fi
        \flo@lspine\flo@v\let\flo@lx\flo@sx\let\flo@ly\flo@sy\flo@ltan\flo@v
        \flo@calc\flo@nx{-\flo@ty*\flo@sg}\flo@calc\flo@ny{\flo@tx*\flo@sg}%
        \flo@slenv\flo@v\flo@range\flo@t{0.75}{0.95}\flo@calc\flo@lL{\flo@env*\flo@bodyw*\flo@t}%
        \ifnum\flo@varc=1
          \flo@calc\flo@pa{\flo@lx+\flo@nx*\flo@lL*0.3+\flo@tx*\flo@lL*0.12}\flo@calc\flo@pb{\flo@ly+\flo@ny*\flo@lL*0.3+\flo@ty*\flo@lL*0.12}%
          \flo@calc\flo@pc{\flo@lx+\flo@nx*\flo@lL*0.62+\flo@tx*\flo@lL*0.55}\flo@calc\flo@pd{\flo@ly+\flo@ny*\flo@lL*0.62+\flo@ty*\flo@lL*0.55}%
          \flo@calc\flo@pe{\flo@lx+\flo@nx*\flo@lL*0.72+\flo@tx*\flo@lL*1.15}\flo@calc\flo@pf{\flo@ly+\flo@ny*\flo@lL*0.72+\flo@ty*\flo@lL*1.15}%
        \else
          \flo@calc\flo@pa{\flo@lx+\flo@nx*\flo@lL*0.4}\flo@calc\flo@pb{\flo@ly+\flo@ny*\flo@lL*0.4}%
          \flo@calc\flo@pc{\flo@lx+\flo@nx*\flo@lL*0.75+\flo@tx*\flo@lL*0.3}\flo@calc\flo@pd{\flo@ly+\flo@ny*\flo@lL*0.75+\flo@ty*\flo@lL*0.3}%
          \flo@calc\flo@pe{\flo@lx+\flo@nx*\flo@lL*0.95+\flo@tx*\flo@lL*0.6}\flo@calc\flo@pf{\flo@ly+\flo@ny*\flo@lL*0.95+\flo@ty*\flo@lL*0.6}%
        \fi
        \let\flo@qa\flo@pa\let\flo@qb\flo@pb\let\flo@qc\flo@pc\let\flo@qd\flo@pd\let\flo@qe\flo@pe\let\flo@qf\flo@pf
        \def\flo@twa{0.014}\def\flo@twb{0.002}\flo@range\flo@op{0.45}{0.7}%
        \flo@vfill{white}{\flo@op}{0}{\flo@vtaper\flo@lx\flo@ly\flo@qa\flo@qb\flo@qc\flo@qd\flo@qe\flo@qf}}%
    \fi\fi
  \end{pgfscope}%
  \ifnum\flo@lent=1 \flo@vtone{flo@c}{0.05}\flo@vstroke{flo@c}{0.18}{0.4}{0}{\flo@kept{ls1}}\fi
  \fi
  \ifnum\flo@hk=1 \ifdim\flo@hth pt>95pt \flo@hookunder\fi\fi}
\def\flo@lleaflet{0}\def\flo@lmover{}

% \pic {florilegium v13 leaf={seed=7, size=4cm}}: flora's leaf in pure TikZ, size its length
\tikzset{pics/florilegium v13 leaf/.style={code={\flo@engine{#1}{v13 leaf}{%
  \flo@picsetup{#1}%
  \pgftransformscale{\flo@sizept}%
  \def\flo@vl@W{}\def\flo@vl@bend{}\def\flo@vl@lobes{}\def\flo@vl@depth{}\def\flo@vl@tone{}%
  \flo@calc\flo@vl@u{\flo@sizept/28.45276}\flo@vleaf}}}}

% ---------------------------------------------------------------- leaflet, lily, floret, bud
% flora.leaflet: a small entire leaf, +y, length 1; \flo@vl@u as for the leaf, tone
% \flo@vl@tone (empty: drawn), half-width factor \flo@vl@W (empty: drawn)
\def\flo@vleaflet{%
  \ifx\flo@vl@W\pgfutil@empty\flo@range\flo@lW{0.16}{0.24}\else\edef\flo@lW{\flo@vl@W}\fi
  \flo@sym\flo@lbend{0.2}%
  \ifx\flo@vl@tone\pgfutil@empty\flo@range\flo@lt{0.2}{0.34}\else\edef\flo@lt{\flo@vl@tone}\fi
  \flo@loop{lfs}\flo@kb{0}{18}{%
    \flo@calc\flo@v{\the\flo@kb/18}\flo@calc\flo@sx{\flo@lbend*\flo@v*\flo@v}%
    \flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@v}}%
  \flo@normals{19}%
  \flo@loop{lfw}\flo@kb{0}{18}{%
    \flo@calc\flo@v{\the\flo@kb/18}\edef\flo@q{\the\numexpr\flo@kb+1\relax}%
    \ifdim\flo@v pt>0pt \ifdim\flo@v pt<1pt \flo@calc\flo@w{\flo@lW*2.2*pow(\flo@v,0.5)*pow(1-\flo@v,0.9)}\else\def\flo@w{0}\fi\else\def\flo@w{0}\fi
    \expandafter\let\csname flo@CX\flo@q\endcsname\flo@sx
    \flo@calc\flo@xl{\flo@x\flo@q+\csname flo@NX\flo@q\endcsname*\flo@w}\flo@calc\flo@yl{\flo@y\flo@q+\csname flo@NY\flo@q\endcsname*\flo@w}%
    \flo@calc\flo@xr{\flo@x\flo@q-\csname flo@NX\flo@q\endcsname*\flo@w}\flo@calc\flo@yr{\flo@y\flo@q-\csname flo@NY\flo@q\endcsname*\flo@w}%
    \expandafter\let\csname flo@RX\flo@q\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@q\endcsname\flo@yl
    \expandafter\let\csname flo@QX\flo@q\endcsname\flo@xr\expandafter\let\csname flo@QY\flo@q\endcsname\flo@yr}%
  % keep the spine and normals for the darker half
  \flo@loop{lfk}\flo@kb{1}{19}{%
    \expandafter\edef\csname flo@MX\the\flo@kb\endcsname{\flo@x{\the\flo@kb}}\expandafter\edef\csname flo@MY\the\flo@kb\endcsname{\flo@y{\the\flo@kb}}%
    \expandafter\edef\csname flo@MU\the\flo@kb\endcsname{\csname flo@NX\the\flo@kb\endcsname}%
    \expandafter\edef\csname flo@MV\the\flo@kb\endcsname{\csname flo@NY\the\flo@kb\endcsname}}%
  \flo@bladeassemble{18}\flo@smoothprep{36}\flo@keep{lf}%
  \flo@vtone{flo@c}{\flo@lt}\flo@vfill{flo@c}{1}{0}{\flo@kept{lf}}%
  \ifdim\flo@vl@u pt>0.25pt
    \begin{pgfscope}\flo@kept{lf}\pgfusepath{clip}%
      \flo@chance{0.5}\ifflo@yes\def\flo@sd{1}\else\def\flo@sd{-1}\fi
      \pgfpathmoveto{\flo@P{\csname flo@MX1\endcsname}{\csname flo@MY1\endcsname}}%
      \flo@loop{lfh}\flo@kb{2}{19}{\pgfpathlineto{\flo@P{\csname flo@MX\the\flo@kb\endcsname}{\csname flo@MY\the\flo@kb\endcsname}}}%
      \flo@loop{lfh2}\flo@kb{1}{19}{\edef\flo@q{\the\numexpr20-\flo@kb\relax}%
        \flo@calc\flo@xl{\csname flo@MX\flo@q\endcsname+\flo@sd*\csname flo@MU\flo@q\endcsname}%
        \flo@calc\flo@yl{\csname flo@MY\flo@q\endcsname+\flo@sd*\csname flo@MV\flo@q\endcsname}%
        \pgfpathlineto{\flo@P\flo@xl\flo@yl}}\pgfpathclose
      \flo@scopefill{\flo@vtone{flo@c}{0.08}\pgfsetfillcolor{flo@c}\pgfsetfillopacity{0.3}\pgfsetblendmode{multiply}}%
      \flo@loop{lfm}\flo@kb{0}{10}{\flo@calc\flo@v{\the\flo@kb/10}\flo@calc\flo@sx{\flo@lbend*\flo@v*\flo@v}\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@v}}%
      \flo@vstreak{11}{0.03}{0.003}{white}{0.65}%
      \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{1.3*\flo@vl@u}\flo@vstroke{flo@c}{\flo@t}{0.3}{1}{\flo@kept{lf}}%
    \end{pgfscope}%
  \fi}
% a monocot's strap leaf in flora's manner: the leaflet's blade, narrow, with parallel
% white veins instead of a midrib; +y, length 1. A leaf a centimeter long or more may arch
% over, its spine turning by \flo@zsT degrees toward its bend, more toward the tip (the
% species' curl makes it likelier); some of those twist past spine point \flo@zska, turning
% edge on, and show their paler underside beyond it (its twist makes it likelier)
\def\flo@vstrap{%
  \flo@sym\flo@lbend{0.25}\ifdefined\flo@sbend\let\flo@lbend\flo@sbend\fi\flo@range\flo@lt{0.24}{0.34}%
  \def\flo@zsT{0}\def\flo@zska{25}%
  \ifdim\flo@vl@u pt>1pt
    \flo@calc\flo@t{max(0.1,min(0.65,0.3+\flo@get{curl}))}\flo@chance\flo@t
    \ifflo@yes
      \flo@range\flo@zsT{30}{85}\flo@calc\flo@zsT{\flo@zsT*min(1,0.07/\flo@lW)}%
      \ifdim\flo@lbend pt<0pt \flo@calc\flo@zsT{-\flo@zsT}\fi
      \flo@calc\flo@t{(0.3+0.01*\flo@get{twist})*max(0,min(1,(0.1-\flo@lW)/0.05))}\flo@chance\flo@t
      \ifflo@yes\flo@int\flo@zska{13}{17}\fi
    \fi
  \fi
  \ifnum\flo@zska<25 \flo@calc\flo@zsvt{(\flo@zska-1.5)/24}\else\def\flo@zsvt{2}\fi
  \ifdim\flo@zsT pt=0pt
    \flo@loop{sts}\flo@kb{0}{24}{%
      \flo@calc\flo@v{\the\flo@kb/24}\flo@calc\flo@sx{\flo@lbend*\flo@v*\flo@v}\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@v}}%
  \else
    \def\flo@xx{0}\def\flo@yy{0}\flo@put1{0}{0}%
    \flo@loop{sta}\flo@kb{1}{24}{%
      \flo@calc\flo@a{\flo@zsT*pow((\the\flo@kb-0.5)/24,2)}%
      \flo@calc\flo@xx{\flo@xx+sin(\flo@a)}\flo@calc\flo@yy{\flo@yy+cos(\flo@a)}%
      \flo@calc\flo@sx{\flo@xx/24}\flo@calc\flo@sy{\flo@yy/24}\flo@put{\the\numexpr\flo@kb+1\relax}\flo@sx\flo@sy}%
  \fi
  \flo@normals{25}%
  \flo@loop{stc}\flo@kb{1}{25}{%
    \edef\flo@q{\the\flo@kb}%
    \expandafter\edef\csname flo@zsX\flo@q\endcsname{\flo@x\flo@q}\expandafter\edef\csname flo@zsY\flo@q\endcsname{\flo@y\flo@q}%
    \expandafter\edef\csname flo@zsN\flo@q\endcsname{\csname flo@NX\flo@q\endcsname}%
    \expandafter\edef\csname flo@zsM\flo@q\endcsname{\csname flo@NY\flo@q\endcsname}%
    \flo@calc\flo@v{(\the\flo@kb-1)/24}\flo@zshw\flo@v\expandafter\let\csname flo@zsW\flo@q\endcsname\flo@w}%
  \flo@zspiece1\flo@zska\flo@smoothprep\flo@zsn\flo@keep{st}%
  \flo@vtone{flo@c}{\flo@lt}\flo@vfill{flo@c}{1}{0}{\flo@kept{st}}%
  \begin{pgfscope}\flo@kept{st}\pgfusepath{clip}%
    % the darker half, as the leaf folds along its rib (flora.leaf), following the spine's turn
    \flo@chance{0.5}\ifflo@yes\def\flo@sd{1}\else\def\flo@sd{-1}\fi
    \ifdim\flo@zsT pt=0pt
      \flo@loop{sth}\flo@kb{0}{12}{%
        \flo@calc\flo@v{\the\flo@kb/12}\flo@calc\flo@sx{\flo@lbend*\flo@v*\flo@v}%
        \ifnum\flo@kb=0 \pgfpathmoveto{\flo@P\flo@sx\flo@v}\else\pgfpathlineto{\flo@P\flo@sx\flo@v}\fi}%
      \flo@calc\flo@t{\flo@sd*2}\pgfpathlineto{\flo@P\flo@t{1}}\pgfpathlineto{\flo@P\flo@t{0}}\pgfpathclose
      \flo@calc\flo@xa{-\flo@lW*2.5}\flo@calc\flo@xb{\flo@lW*2.5}\def\flo@yb{1}%
    \else
      \pgfpathmoveto{\flo@P00}%
      \flo@loop{sth}\flo@kb{2}{\flo@zska}{\pgfpathlineto{\flo@P{\csname flo@zsX\the\flo@kb\endcsname}{\csname flo@zsY\the\flo@kb\endcsname}}}%
      \flo@loop{sti}\flo@kb{1}{\flo@zska}{\edef\flo@q{\the\numexpr\flo@zska+1-\flo@kb\relax}%
        \flo@calc\flo@w{\flo@sd*(1.3*\csname flo@zsW\flo@q\endcsname+0.01)}%
        \flo@calc\flo@xl{\csname flo@zsX\flo@q\endcsname+\csname flo@zsN\flo@q\endcsname*\flo@w}%
        \flo@calc\flo@yl{\csname flo@zsY\flo@q\endcsname+\csname flo@zsM\flo@q\endcsname*\flo@w}%
        \pgfpathlineto{\flo@P\flo@xl\flo@yl}}%
      \pgfpathclose
      \def\flo@xa{0}\def\flo@xb{0}\def\flo@yb{0}%
      \flo@loop{stb}\flo@kb{1}{25}{%
        \flo@calc\flo@xa{min(\flo@xa,\csname flo@zsX\the\flo@kb\endcsname)}\flo@calc\flo@xb{max(\flo@xb,\csname flo@zsX\the\flo@kb\endcsname)}%
        \flo@calc\flo@yb{max(\flo@yb,\csname flo@zsY\the\flo@kb\endcsname)}}%
      \flo@calc\flo@xa{\flo@xa-\flo@lW*2.5}\flo@calc\flo@xb{\flo@xb+\flo@lW*2.5}\flo@calc\flo@yb{\flo@yb+\flo@lW}%
    \fi
    \flo@scopefill{\flo@vtone{flo@c}{0.12}\pgfsetfillcolor{flo@c}\pgfsetfillopacity{0.28}\pgfsetblendmode{multiply}}%
    \flo@calc\flo@ta{\flo@lt-0.2}\flo@calc\flo@tb{\flo@lt+0.22}%
    \flo@vmottle\flo@xa{0}\flo@xb\flo@yb{10}{0.07}\flo@ta\flo@tb{8}%
    \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{1.3*\flo@vl@u}\flo@vstroke{flo@c}{\flo@t}{0.22}{1}{\flo@kept{st}}%
    % the midrib in white, and faint parallel veins either side
    \ifdim\flo@zsT pt=0pt
      \flo@loop{stm}\flo@kb{0}{10}{\flo@calc\flo@v{0.02+0.93*\the\flo@kb/10}%
        \flo@calc\flo@sx{\flo@lbend*\flo@v*\flo@v}\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@v}}%
      \def\flo@zsm{11}%
    \else
      \flo@loop{stm}\flo@kb{1}{24}{\flo@put{\the\flo@kb}{\csname flo@zsX\the\flo@kb\endcsname}{\csname flo@zsY\the\flo@kb\endcsname}}%
      \def\flo@zsm{24}%
    \fi
    \flo@vstreak\flo@zsm{0.016}{0.002}{white}{0.7}%
    \flo@loop{stv}\flo@ka{1}{4}{%
      \flo@calc\flo@f{(\the\flo@ka<3 ? \the\flo@ka-3 : \the\flo@ka-2)*0.38}%
      \ifdim\flo@zsT pt=0pt
        \flo@loop{stvp}\flo@kb{0}{10}{\flo@calc\flo@v{0.05+0.85*\the\flo@kb/10}%
          \flo@calc\flo@w{\flo@f*\flo@lW*2.2*pow(\flo@v,0.25)*pow(1-\flo@v,0.6)}%
          \flo@calc\flo@sx{\flo@lbend*\flo@v*\flo@v+\flo@w}\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@v}}%
      \else
        \flo@loop{stvq}\flo@kb{1}{11}{\edef\flo@q{\the\numexpr2*\flo@kb\relax}%
          \flo@calc\flo@w{\flo@f*\csname flo@zsW\flo@q\endcsname}%
          \flo@calc\flo@xl{\csname flo@zsX\flo@q\endcsname+\csname flo@zsN\flo@q\endcsname*\flo@w}%
          \flo@calc\flo@yl{\csname flo@zsY\flo@q\endcsname+\csname flo@zsM\flo@q\endcsname*\flo@w}%
          \flo@put{\the\flo@kb}\flo@xl\flo@yl}%
      \fi
      \flo@range\flo@op{0.18}{0.32}\flo@vstreak{11}{0.007}{0.001}{white}{\flo@op}}%
  \end{pgfscope}%
  % past the twist, the underside
  \ifnum\flo@zska<25
    \flo@zspiece\flo@zska{25}\flo@smoothprep\flo@zsn\flo@keep{su}%
    \flo@calc\flo@t{min(0.64,\flo@lt+0.26)}\flo@vtone{flo@c}\flo@t\flo@vfill{flo@c}{1}{0}{\flo@kept{su}}%
    \begin{pgfscope}\flo@kept{su}\pgfusepath{clip}%
      \flo@loop{stu}\flo@kb{\flo@zska}{24}{%
        \flo@put{\the\numexpr\flo@kb+1-\flo@zska\relax}{\csname flo@zsX\the\flo@kb\endcsname}{\csname flo@zsY\the\flo@kb\endcsname}}%
      \edef\flo@zsm{\the\numexpr25-\flo@zska\relax}\flo@vstreak\flo@zsm{0.014}{0.002}{white}{0.6}%
      \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{1.3*\flo@vl@u}\flo@vstroke{flo@c}{\flo@t}{0.3}{1}{\flo@kept{su}}%
    \end{pgfscope}%
  \fi}
% the strap's half-width at #1 (0..1), narrowing as it turns edge on at the twist and
% narrower past it: \flo@w
\def\flo@zshw#1{%
  \def\flo@w{0}%
  \ifdim#1pt>0pt \ifdim#1pt<1pt
    \flo@calc\flo@w{\flo@lW*2.2*pow(#1,0.25)*pow(1-(#1),0.6)}%
    \flo@calc\flo@zst{((#1)-\flo@zsvt+0.15)/0.3}%
    \ifdim\flo@zst pt<1pt
      \ifdim\flo@zst pt>0pt
        \flo@calc\flo@w{\flo@w*max(0.12,(\flo@zst>0.5 ? 0.8 : 1)*abs(cos(180*\flo@zst*\flo@zst*(3-2*\flo@zst))))}%
      \fi
    \else\flo@calc\flo@w{0.8*\flo@w}\fi
  \fi\fi}
% the strap's outline over spine points #1..#2 into flo@X/Y, \flo@zsn points: up the left
% side, down the right, an end once where it is a point
\def\flo@zspiece#1#2{%
  \def\flo@zsn{0}%
  \flo@loop{stp}\flo@kb{#1}{#2}{\flo@zsside{\the\flo@kb}{}}%
  \ifdim\csname flo@zsW#2\endcsname pt>0pt \flo@zsside{#2}{-}\fi
  \flo@loop{stq}\flo@kb{#1+1}{#2-1}{\flo@zsside{\the\numexpr#2+#1-\flo@kb\relax}{-}}%
  \ifdim\csname flo@zsW#1\endcsname pt>0pt \flo@zsside{#1}{-}\fi}
% spine point #1 moved out by its half-width along its normal (#2 empty) or against it (-)
\def\flo@zsside#1#2{%
  \edef\flo@q{#1}\edef\flo@w{#2\csname flo@zsW\flo@q\endcsname}%
  \flo@calc\flo@xl{\csname flo@zsX\flo@q\endcsname+\csname flo@zsN\flo@q\endcsname*(\flo@w)}%
  \flo@calc\flo@yl{\csname flo@zsY\flo@q\endcsname+\csname flo@zsM\flo@q\endcsname*(\flo@w)}%
  \edef\flo@zsn{\the\numexpr\flo@zsn+1\relax}\flo@put\flo@zsn\flo@xl\flo@yl}

% flora.lily: a star lily at a tilt, six pointed petals, back ones first, a pale throat,
% stamens; center at the origin, facing +y, petal length 1. #1 cm per unit (no random
% part); tone \flo@vf@tone (empty: drawn)
\def\flo@vlily#1{%
  \edef\flo@vu{#1}%
  \flo@range\flo@tilt{0.45}{0.62}\flo@range\flo@spin{0}{60}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@tq{0.30}{0.38}\else\edef\flo@tq{\flo@vf@tone}\fi
  \flo@loop{lio}\flo@ka{1}{6}{\flo@sym\flo@t{8}\flo@calc\flo@a{\flo@spin+(\the\flo@ka-1)*60+\flo@t}%
    \expandafter\let\csname flo@O\the\flo@ka\endcsname\flo@a}%
  % back petals first: sort by sin(a), largest first (a small bubble sort)
  \flo@loop{liso}\flo@ka{1}{5}{\flo@loop{liso2}\flo@kb{1}{6-\flo@ka}{%
    \edef\flo@ia{\csname flo@O\the\flo@kb\endcsname}\edef\flo@ib{\csname flo@O\the\numexpr\flo@kb+1\relax\endcsname}%
    \flo@calc\flo@t{sin(\flo@ib)>sin(\flo@ia) ? 1 : 0}%
    \ifnum\flo@t=1 \expandafter\let\csname flo@O\the\flo@kb\endcsname\flo@ib
      \expandafter\let\csname flo@O\the\numexpr\flo@kb+1\relax\endcsname\flo@ia\fi}}%
  \flo@loop{lip}\flo@kc{1}{6}{%
    \edef\flo@a{\csname flo@O\the\flo@kc\endcsname}\flo@calc\flo@back{sin(\flo@a)}%
    \flo@range\flo@js{0.88}{1.05}%
    \flo@range\flo@lw{0.11}{0.14}\flo@sym\flo@t{0.03}\flo@calc\flo@tp{\flo@tq+0.1*\flo@back*-0.8+\flo@t}%
    \flo@chance{0.5}\ifflo@yes\def\flo@sg{1}\else\def\flo@sg{-1}\fi\flo@range\flo@t{0.04}{0.14}\flo@calc\flo@pbend{\flo@sg*\flo@t}%
    \flo@int\flo@pns{3}{4}%
    \begin{pgfscope}%
      \pgftransformyscale{\flo@tilt}\flo@calc\flo@t{\flo@a-90}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@js}%
      \def\flo@vp@pointed{1}\edef\flo@vp@W{\flo@lw}\edef\flo@vp@bend{\flo@pbend}\edef\flo@vp@ns{\flo@pns}%
      \def\flo@vp@heart{0}\edef\flo@vp@tone{\flo@tp}\edef\flo@vp@u{\flo@vu}%
      \flo@vpetal
    \end{pgfscope}}%
  \flo@loop{lth}\flo@ka{1}{4}{\flo@calc\flo@t{0.05+0.05*\the\flo@ka}\flo@calc\flo@ms{\flo@t*\flo@tilt}%
    \flo@vblob{0}{0}\flo@t\flo@ms{0.2}{9}\flo@vfill{white}{0.22}{0}{\flo@smoothpath}}%
  \flo@loop{lsta}\flo@ka{1}{6}{%
    \flo@sym\flo@t{6}\flo@calc\flo@a{(\the\flo@ka-3.5)*16+\flo@t}\flo@range\flo@len{0.3}{0.48}%
    \flo@calc\flo@ex{\flo@len*sin(\flo@a)}\flo@calc\flo@ey{\flo@len*cos(\flo@a)}%
    \flo@calc\flo@c{\flo@ex*0.2}\flo@calc\flo@d{\flo@ey*0.5}\flo@calc\flo@cc{\flo@ex*0.8}\flo@calc\flo@dd{\flo@ey*0.85}%
    \flo@vbezier{0}{0}\flo@c\flo@d\flo@cc\flo@dd\flo@ex\flo@ey
    \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{0.25}{0.85}{0}{\flo@openpath}%
    \flo@sym\flo@t{30}\flo@calc\flo@t{-\flo@a+\flo@t}%
    \begin{pgfscope}\pgftransformshift{\flo@P\flo@ex\flo@ey}\pgftransformrotate{\flo@t}%
      \flo@vblob{0}{0}{0.022}{0.04}{0.1}{6}\flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{1}{0}{\flo@smoothpath}\end{pgfscope}%
    \flo@chance{0.5}\ifflo@yes\flo@sym\flo@t{0.03}\flo@calc\flo@xa{\flo@ex+\flo@t}\flo@range\flo@t{0.02}{0.05}\flo@calc\flo@ya{\flo@ey+\flo@t}%
      \flo@vaccent{flo@c}{0}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P\flo@xa\flo@ya}{0.008pt}}\fi}%
  \flo@vaccent{flo@c}{-0.2}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.035pt}}}

% a lily whose tepals sweep back (reflex under -40), held sideways or nodding, seen from the
% side and a little from below: from the center at the origin six tepals leave a little
% forward (+y, the way the flower faces), then curl back toward the stalk, the more the
% further the species' reflex; the far ones first, darker, then the stamens hanging out of
% the flower, then the near ones; the species' dots on them. Tepal length about 1; #1 cm
% per unit; tone \flo@vf@tone (empty: drawn)
\def\flo@vturkscap#1{%
  \edef\flo@vu{#1}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@tq{0.30}{0.38}\else\edef\flo@tq{\flo@vf@tone}\fi
  \flo@range\flo@spin{0}{60}\flo@range\flo@tkbe{18}{32}%
  \flo@calc\flo@tkcb{cos(\flo@tkbe)}\flo@calc\flo@tksb{sin(\flo@tkbe)}\flo@calc\flo@tkcurl{60-1.6*\flo@get{reflex}}%
  \flo@loop{tka}\flo@ka{1}{6}{%
    \flo@sym\flo@t{8}\flo@calc\flo@a{\flo@spin+(\the\flo@ka-1)*60+\flo@t}\expandafter\let\csname flo@tkA\the\flo@ka\endcsname\flo@a
    \flo@range\flo@t{0.88}{1.05}\expandafter\let\csname flo@tkJ\the\flo@ka\endcsname\flo@t
    \flo@range\flo@t{0.13}{0.17}\expandafter\let\csname flo@tkW\the\flo@ka\endcsname\flo@t
    \flo@range\flo@t{0.85}{1.1}\flo@calc\flo@t{\flo@tkcurl*\flo@t}\expandafter\let\csname flo@tkC\the\flo@ka\endcsname\flo@t
    \flo@sym\flo@t{0.03}\flo@calc\flo@t{\flo@tq+0.08*sin(\flo@a)+\flo@t}\expandafter\let\csname flo@tkQ\the\flo@ka\endcsname\flo@t
    \expandafter\edef\csname flo@tkO\the\flo@ka\endcsname{\the\flo@ka}}%
  % the far tepals first (a bubble sort of their order on sin)
  \flo@loop{tkso}\flo@ka{1}{5}{\flo@loop{tkso2}\flo@kb{1}{6-\flo@ka}{%
    \edef\flo@ia{\csname flo@tkO\the\flo@kb\endcsname}\edef\flo@ib{\csname flo@tkO\the\numexpr\flo@kb+1\relax\endcsname}%
    \flo@calc\flo@t{sin(\csname flo@tkA\flo@ib\endcsname)<sin(\csname flo@tkA\flo@ia\endcsname) ? 1 : 0}%
    \ifnum\flo@t=1 \expandafter\let\csname flo@tkO\the\flo@kb\endcsname\flo@ib
      \expandafter\let\csname flo@tkO\the\numexpr\flo@kb+1\relax\endcsname\flo@ia\fi}}%
  \def\flo@tkfar{1}%
  \flo@loop{tkt}\flo@kc{1}{6}{%
    \edef\flo@tkk{\csname flo@tkO\the\flo@kc\endcsname}%
    \ifnum\flo@tkfar=1
      \flo@calc\flo@t{sin(\csname flo@tkA\flo@tkk\endcsname)<0 ? 1 : 0}%
      \ifnum\flo@t=0 \def\flo@tkfar{0}\flo@tkstamens\fi
    \fi
    \flo@tktepal}%
  \ifnum\flo@tkfar=1 \flo@tkstamens\fi}
% the stamens and their anthers, and the center
\def\flo@tkstamens{%
  \flo@loop{tkst}\flo@ka{1}{6}{%
    \flo@sym\flo@t{5}\flo@calc\flo@a{(\the\flo@ka-3.5)*12+\flo@t}\flo@range\flo@len{0.5}{0.75}%
    \flo@calc\flo@ex{\flo@len*sin(\flo@a)}\flo@calc\flo@ey{\flo@len*cos(\flo@a)}%
    \flo@calc\flo@c{\flo@ex*0.2}\flo@calc\flo@d{\flo@ey*0.5}\flo@calc\flo@cc{\flo@ex*0.8}\flo@calc\flo@dd{\flo@ey*0.85}%
    \flo@vbezier{0}{0}\flo@c\flo@d\flo@cc\flo@dd\flo@ex\flo@ey
    \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{0.25}{0.85}{0}{\flo@openpath}%
    \flo@sym\flo@t{30}\flo@calc\flo@t{-\flo@a+\flo@t}%
    \begin{pgfscope}\pgftransformshift{\flo@P\flo@ex\flo@ey}\pgftransformrotate{\flo@t}%
      \flo@vblob{0}{0}{0.022}{0.045}{0.1}{6}\flo@vaccent{flo@c}{-0.1}\flo@vfill{flo@c}{1}{0}{\flo@smoothpath}\end{pgfscope}}%
  \flo@vtone{flo@c}{0.1}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.05pt}}}
% tepal \flo@tkk: its spine in 3D (flo@tkX/Y/Z), half-widths (flo@tkH), then its outline seen
\def\flo@tktepal{%
  \edef\flo@a{\csname flo@tkA\flo@tkk\endcsname}\flo@calc\flo@tkca{cos(\flo@a)}\flo@calc\flo@tksa{sin(\flo@a)}%
  \edef\flo@tkj{\csname flo@tkJ\flo@tkk\endcsname}\edef\flo@tkw{\csname flo@tkW\flo@tkk\endcsname}%
  \edef\flo@tkc{\csname flo@tkC\flo@tkk\endcsname}%
  \def\flo@xx{0}\def\flo@yy{0}\def\flo@zz{0}%
  \expandafter\def\csname flo@tkX1\endcsname{0}\expandafter\def\csname flo@tkY1\endcsname{0}%
  \expandafter\def\csname flo@tkZ1\endcsname{0}\expandafter\def\csname flo@tkH1\endcsname{0}%
  \flo@loop{tks}\flo@kb{1}{10}{%
    \flo@calc\flo@f{-15+\flo@tkc*pow((\the\flo@kb-0.5)/10,1.3)}%
    \flo@calc\flo@tkr{cos(\flo@f)*\flo@tkj/10}\flo@calc\flo@tkb{-sin(\flo@f)*\flo@tkj/10}%
    \flo@calc\flo@xx{\flo@xx+\flo@tkr*\flo@tkca}\flo@calc\flo@yy{\flo@yy+\flo@tkb}\flo@calc\flo@zz{\flo@zz+\flo@tkr*\flo@tksa}%
    \edef\flo@q{\the\numexpr\flo@kb+1\relax}%
    \expandafter\let\csname flo@tkX\flo@q\endcsname\flo@xx\expandafter\let\csname flo@tkY\flo@q\endcsname\flo@yy
    \expandafter\let\csname flo@tkZ\flo@q\endcsname\flo@zz
    \ifnum\flo@kb<10 \flo@calc\flo@t{\flo@tkw*\flo@tkj*pow(sin(180*pow(\the\flo@kb/10,0.55)),0.9)}\else\def\flo@t{0}\fi
    \expandafter\let\csname flo@tkH\flo@q\endcsname\flo@t}%
  \def\flo@tkn{0}%
  \flo@loop{tko}\flo@kb{1}{11}{\flo@tkat{\the\flo@kb}{1}}%
  \flo@loop{tkp}\flo@kb{2}{10}{\flo@tkat{\the\numexpr12-\flo@kb\relax}{-1}}%
  \flo@smoothprep{20}\flo@keep{tk}%
  \flo@vtone{flo@c}{\csname flo@tkQ\flo@tkk\endcsname}\flo@vfill{flo@c}{1}{0}{\flo@kept{tk}}%
  \ifdim\flo@vu pt>0.15pt
    \begin{pgfscope}\flo@kept{tk}\pgfusepath{clip}%
      \def\flo@tkn{0}\flo@loop{tkm}\flo@kb{2}{10}{\flo@tkat{\the\flo@kb}{0}}%
      \flo@vstreak{9}{0.03}{0.004}{white}{0.5}%
      \edef\flo@t{\flo@get{guides}}\def\flo@tmp{none}%
      \ifx\flo@t\flo@tmp\else
        \flo@vtone{flo@c}{0.06}%
        \flo@vfill{flo@c}{0.8}{1}{\flo@loop{tkd}\flo@ka{1}{5}{%
          \flo@int\flo@tki{2}{5}\flo@sym\flo@tko{0.6}%
          \flo@tkpt\flo@tki{\flo@tko*\csname flo@tkH\flo@tki\endcsname}%
          \flo@range\flo@t{0.012}{0.022}\pgfpathcircle{\flo@P\flo@xl\flo@yl}{\flo@t pt}}}%
      \fi
      \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{1.3*\flo@vu}\flo@vstroke{flo@c}{\flo@t}{0.3}{1}{\flo@kept{tk}}%
    \end{pgfscope}%
  \fi
  \flo@vtone{flo@c}{0.08}\flo@vstroke{flo@c}{0.18}{0.35}{0}{\flo@kept{tk}}}
% tepal point #1 moved #2 across (along the tepal's width), as seen: \flo@xl, \flo@yl
\def\flo@tkpt#1#2{%
  \edef\flo@q{#1}\flo@calc\flo@w{#2}%
  \flo@calc\flo@xl{\csname flo@tkX\flo@q\endcsname-\flo@w*\flo@tksa}%
  \flo@calc\flo@t{\csname flo@tkZ\flo@q\endcsname+\flo@w*\flo@tkca}%
  \flo@calc\flo@yl{\csname flo@tkY\flo@q\endcsname*\flo@tkcb-\flo@t*\flo@tksb}}
% the same, #2 times its half-width, put as the next point of flo@X/Y (\flo@tkn)
\def\flo@tkat#1#2{%
  \flo@tkpt{#1}{(#2)*\csname flo@tkH#1\endcsname}%
  \edef\flo@tkn{\the\numexpr\flo@tkn+1\relax}\flo@put\flo@tkn\flo@xl\flo@yl}

% flora.floret: a small flower of #2 petals (flora: 5), radius 1; #1 its radius on the page
% in cm (no random part). Star or round: \flo@vf@star (empty: drawn); tone \flo@vf@tone
\def\flo@vfloret#1#2{%
  \ifx\flo@vf@star\pgfutil@empty\flo@chance{0.5}\ifflo@yes\def\flo@star{1}\else\def\flo@star{0}\fi
  \else\edef\flo@star{\flo@vf@star}\fi
  \edef\flo@fn{#2}%
  \ifdim#1pt<0.07pt
    \flo@range\flo@ph{0}{360}%
    \flo@loop{flp}\flo@kb{0}{2*\flo@fn-1}{%
      \flo@calc\flo@a{\flo@ph+\the\flo@kb*180/\flo@fn}%
      \ifodd\flo@kb\flo@calc\flo@r{\flo@star==1 ? 0.32 : 0.62}\else\def\flo@r{1}\fi
      \flo@calc\flo@xa{\flo@r*cos(\flo@a)}\flo@calc\flo@ya{\flo@r*sin(\flo@a)}%
      \flo@put{\the\numexpr\flo@kb+1\relax}{\flo@xa}{\flo@ya}}%
    \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@tq{0.22}{0.42}\else\edef\flo@tq{\flo@vf@tone}\fi
    \flo@vtone{flo@c}{\flo@tq}\flo@vfill{flo@c}{1}{0}{\pgfpathmoveto{\flo@P{\flo@x1}{\flo@y1}}%
      \flo@loop{flpp}\flo@kb{2}{2*\flo@fn}{\pgfpathlineto{\flo@P{\flo@x{\the\flo@kb}}{\flo@y{\the\flo@kb}}}}\pgfpathclose}%
    \flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{1}{0}{\pgfpathmoveto{\flo@P{0.2}0}\pgfpathlineto{\flo@P0{0.2}}%
      \pgfpathlineto{\flo@P{-0.2}0}\pgfpathlineto{\flo@P0{-0.2}}\pgfpathclose}%
  \else
    \flo@range\flo@ph{0}{360}\flo@spk={}%
    \flo@loop{flr}\flo@ka{0}{\flo@fn-1}{%
      \flo@sym\flo@t{8.6}\flo@calc\flo@a{\flo@ph+\the\flo@ka*360/\flo@fn+\flo@t}\flo@range\flo@len{0.85}{1.1}%
      \flo@calc\flo@c{cos(\flo@a)}\flo@calc\flo@sn{sin(\flo@a)}%
      \ifnum\flo@star=1
        \flo@put1{0}{0}\flo@put2{0.45}{0.156}\flo@put3{1}{0}\flo@put4{0.45}{-0.156}\def\flo@np{4}\def\flo@tk{0.5}%
      \else
        \flo@put1{0}{0}\flo@put2{0.3}{0.42}\flo@put3{0.85}{0.336}\flo@put4{1}{0}\flo@put5{0.85}{-0.336}\flo@put6{0.3}{-0.42}%
        \def\flo@np{6}\def\flo@tk{1}%
      \fi
      \flo@loop{flrr}\flo@kb{1}{\flo@np}{%
        \flo@calc\flo@xa{\flo@len*(\flo@x{\the\flo@kb}*\flo@c-\flo@y{\the\flo@kb}*\flo@sn)}%
        \flo@calc\flo@ya{\flo@len*(\flo@x{\the\flo@kb}*\flo@sn+\flo@y{\the\flo@kb}*\flo@c)}%
        \expandafter\let\csname flo@TX\the\flo@kb\endcsname\flo@xa\expandafter\let\csname flo@TY\the\flo@kb\endcsname\flo@ya}%
      \flo@loop{flrs}\flo@kb{1}{\flo@np}{\flo@put{\the\flo@kb}{\csname flo@TX\the\flo@kb\endcsname}{\csname flo@TY\the\flo@kb\endcsname}}%
      \flo@smoothprepT{\flo@np}{\flo@tk}%
      \edef\flo@tmp{\noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@x1}{\flo@y1}}}%
      \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}%
      \flo@loop{flrc}\flo@i{1}{\flo@np}{%
        \edef\flo@ib{\the\numexpr\ifnum\flo@i=\flo@np\space 1\else\flo@i+1\fi\relax}%
        \edef\flo@tmp{\noexpand\pgfpathcurveto{\noexpand\flo@P{\csname flo@A\the\flo@i\endcsname}{\csname flo@B\the\flo@i\endcsname}}%
          {\noexpand\flo@P{\csname flo@C\the\flo@i\endcsname}{\csname flo@D\the\flo@i\endcsname}}{\noexpand\flo@P{\flo@x\flo@ib}{\flo@y\flo@ib}}}%
        \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
      \flo@spk\expandafter{\the\flo@spk\pgfpathclose}}%
    \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@tq{0.22}{0.42}\else\edef\flo@tq{\flo@vf@tone}\fi
    \flo@vtone{flo@c}{\flo@tq}\flo@vfill{flo@c}{1}{0}{\the\flo@spk}%
    \ifdim#1pt>0.05pt \flo@vfill{white}{0.75}{0}{\pgfpathcircle{\flo@P00}{0.35pt}}\fi
    \flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.16pt}}%
  \fi}

% flora.bud: a teardrop and three sepals, base at the origin, +y, length 1; #1 cm per unit;
% tone \flo@vf@tone (empty: drawn)
\def\flo@vbud#1{%
  \flo@sym\flo@bend{0.1}%
  \flo@loop{bds}\flo@kb{0}{18}{%
    \flo@calc\flo@v{\the\flo@kb/18}\flo@calc\flo@sx{\flo@bend*\flo@v*\flo@v}\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@v}}%
  \flo@normals{19}%
  \flo@loop{bdw}\flo@kb{0}{18}{%
    \flo@calc\flo@v{\the\flo@kb/18}\edef\flo@q{\the\numexpr\flo@kb+1\relax}%
    \ifdim\flo@v pt>0pt \flo@calc\flo@w{0.3*pow(max(0,sin(180*pow(\flo@v,0.6))),0.8)}\else\def\flo@w{0}\fi
    \ifdim\flo@w pt<0pt \def\flo@w{0}\fi
    \flo@calc\flo@xl{\flo@x\flo@q+\csname flo@NX\flo@q\endcsname*\flo@w}\flo@calc\flo@yl{\flo@y\flo@q+\csname flo@NY\flo@q\endcsname*\flo@w}%
    \flo@calc\flo@xr{\flo@x\flo@q-\csname flo@NX\flo@q\endcsname*\flo@w}\flo@calc\flo@yr{\flo@y\flo@q-\csname flo@NY\flo@q\endcsname*\flo@w}%
    \expandafter\let\csname flo@RX\flo@q\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@q\endcsname\flo@yl
    \expandafter\let\csname flo@QX\flo@q\endcsname\flo@xr\expandafter\let\csname flo@QY\flo@q\endcsname\flo@yr}%
  \flo@bladeassemble{18}\flo@smoothprep{36}\flo@keep{bd}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@tq{0.3}{0.42}\else\edef\flo@tq{\flo@vf@tone}\fi
  \flo@vtone{flo@c}{\flo@tq}\flo@vfill{flo@c}{1}{0}{\flo@kept{bd}}%
  \begin{pgfscope}\flo@kept{bd}\pgfusepath{clip}%
    \flo@calc\flo@ta{\flo@tq-0.2}\flo@calc\flo@tb{\flo@tq+0.2}\flo@vmottle{-0.3}{0}{0.3}{1}{5}{0.1}\flo@ta\flo@tb{0}%
    \def\flo@twa{0.06}\def\flo@twb{0.005}\flo@calc\flo@t{\flo@bend*0.8}%
    \flo@vfill{white}{0.7}{0}{\flo@vtaper{-0.08}{0.05}{-0.1}{0.35}{-0.05}{0.65}\flo@t{0.95}}%
    \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{1.4*(#1)}\flo@vstroke{flo@c}{\flo@t}{0.3}{1}{\flo@kept{bd}}%
  \end{pgfscope}%
  % the sepals: three small blades, transformed here so that they fill as one path
  \flo@spk={}%
  \flo@loop{sep}\flo@ka{0}{2}{%
    \edef\flo@k{\the\numexpr\flo@ka-1\relax}\flo@sym\flo@t{6}\flo@calc\flo@a{\flo@k*24+\flo@t}%
    \ifnum\flo@k=0 \def\flo@sy{0.22}\else\def\flo@sy{0.32}\fi
    \flo@loop{seps}\flo@kb{0}{8}{\flo@calc\flo@v{\the\flo@kb/8}\flo@calc\flo@sx{-\flo@k*0.4*\flo@v*\flo@v}\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@v}}%
    \flo@normals{9}%
    \flo@loop{sepw}\flo@kb{0}{8}{%
      \flo@calc\flo@v{\the\flo@kb/8}\edef\flo@q{\the\numexpr\flo@kb+1\relax}%
      \ifdim\flo@v pt>0pt \flo@calc\flo@w{sin(180*pow(\flo@v,0.6))}\else\def\flo@w{0}\fi
      \ifdim\flo@w pt<0pt \def\flo@w{0}\fi
      \flo@calc\flo@xl{\flo@x\flo@q+\csname flo@NX\flo@q\endcsname*\flo@w}\flo@calc\flo@yl{\flo@y\flo@q+\csname flo@NY\flo@q\endcsname*\flo@w}%
      \flo@calc\flo@xr{\flo@x\flo@q-\csname flo@NX\flo@q\endcsname*\flo@w}\flo@calc\flo@yr{\flo@y\flo@q-\csname flo@NY\flo@q\endcsname*\flo@w}%
      \expandafter\let\csname flo@RX\flo@q\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@q\endcsname\flo@yl
      \expandafter\let\csname flo@QX\flo@q\endcsname\flo@xr\expandafter\let\csname flo@QY\flo@q\endcsname\flo@yr}%
    \flo@bladeassemble{8}%
    % into the sepal's place: scale (0.06, \flo@sy), turn by \flo@a, move to (0.05 k, -0.02)
    \flo@loop{sept}\flo@kb{1}{16}{%
      \flo@calc\flo@xa{0.06*\flo@x{\the\flo@kb}}\flo@calc\flo@ya{\flo@sy*\flo@y{\the\flo@kb}}%
      \flo@calc\flo@xb{\flo@k*0.05+\flo@xa*cos(\flo@a)-\flo@ya*sin(\flo@a)}\flo@calc\flo@yb{-0.02+\flo@xa*sin(\flo@a)+\flo@ya*cos(\flo@a)}%
      \flo@put{\the\flo@kb}{\flo@xb}{\flo@yb}}%
    \flo@smoothprep{16}%
    \edef\flo@tmp{\noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@x1}{\flo@y1}}}%
    \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}%
    \flo@loop{sepc}\flo@i{1}{16}{%
      \edef\flo@ib{\the\numexpr\ifnum\flo@i=16 1\else\flo@i+1\fi\relax}%
      \edef\flo@tmp{\noexpand\pgfpathcurveto{\noexpand\flo@P{\csname flo@A\the\flo@i\endcsname}{\csname flo@B\the\flo@i\endcsname}}%
        {\noexpand\flo@P{\csname flo@C\the\flo@i\endcsname}{\csname flo@D\the\flo@i\endcsname}}{\noexpand\flo@P{\flo@x\flo@ib}{\flo@y\flo@ib}}}%
      \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
    \flo@spk\expandafter{\the\flo@spk\pgfpathclose}}%
  \flo@vtone{flo@c}{0.14}\flo@vfill{flo@c}{0.9}{0}{\the\flo@spk}}

% ================================================================ the species, in v1.3's hand
% defaults: drawn as flora draws them
\def\flo@vf@star{}\def\flo@vf@tone{}
% the flower's tone from its color group, as florilegium's ramp sees colors: blue as flora
% draws it (\flo@vf@tone empty), violet deeper, pink, green, yellow and white paler but
% close enough to flora's range that a page keeps v1.3's weight of ink,
% red and orange in the accent's ramp (copper)
\def\flo@stone{%
  \edef\flo@col{\flo@get{color}}\def\flo@rampname{flo@ramp}\def\flo@vf@tone{}%
  \def\flo@tmp{violet}\ifx\flo@col\flo@tmp\flo@range\flo@vf@tone{0.18}{0.26}\fi
  \def\flo@tmp{pink}\ifx\flo@col\flo@tmp\flo@range\flo@vf@tone{0.34}{0.42}\fi
  \def\flo@tmp{white}\ifx\flo@col\flo@tmp\flo@range\flo@vf@tone{0.46}{0.54}\fi
  \def\flo@tmp{yellow}\ifx\flo@col\flo@tmp\flo@range\flo@vf@tone{0.4}{0.48}\fi
  \def\flo@tmp{green}\ifx\flo@col\flo@tmp\flo@range\flo@vf@tone{0.38}{0.46}\fi
  \def\flo@tmp{red}\ifx\flo@col\flo@tmp\def\flo@rampname{flo@aramp}\flo@range\flo@vf@tone{0.3}{0.4}\fi
  \def\flo@tmp{orange}\ifx\flo@col\flo@tmp\def\flo@rampname{flo@aramp}\flo@range\flo@vf@tone{0.42}{0.52}\fi}
% the species' flower face on, diameter 1 (lily: star at a tilt; head: rays around a disk;
% small: a floret; else flora's flower with the species' parts); #1 diameter on the page in pt
\def\flo@sflower#1{%
  \edef\flo@sfd{#1}\edef\flo@form{\flo@get{form}}\edef\flo@nn{\flo@get{merosity}}%
  \ifnum\flo@get{merovar}=1 \flo@int\flo@t{1}{10}%
    \ifnum\flo@t=1 \edef\flo@nn{\the\numexpr\flo@nn-1\relax}\fi
    \ifnum\flo@t>7 \edef\flo@nn{\the\numexpr\flo@nn+1\relax}\fi\fi
  \edef\flo@ps{\flo@get{petalshape}}\def\flo@vf@pointed{0}%
  \def\flo@tmp{lanceolate}\ifx\flo@ps\flo@tmp\def\flo@vf@pointed{1}\fi
  \def\flo@tmp{linear}\ifx\flo@ps\flo@tmp\def\flo@vf@pointed{1}\fi
  \def\flo@tmp{head}%
  \ifx\flo@form\flo@tmp\flo@sdaisy\flo@sfd\else
  \def\flo@tmp{lily}%
  \ifx\flo@form\flo@tmp
    \begin{pgfscope}\pgftransformscale{0.48}\flo@calc\flo@oarg{(\flo@sfd)*0.48/28.45276}\flo@vlily\flo@oarg
      \edef\flo@t{\flo@get{corona}}\def\flo@tmp{none}\ifx\flo@t\flo@tmp\else\flo@vcorona\flo@oarg\fi\end{pgfscope}%
  \else
    \def\flo@tmp{iris}\def\flo@ivon{0}\ifx\flo@form\flo@tmp\ifdim\flo@sfd pt<8pt \else\def\flo@ivon{1}\fi\fi
    \ifnum\flo@ivon=1 \flo@viris\flo@sfd\else
    \ifdim\flo@sfd pt<22pt
      % small: a floret (under about 3 mm) or a blossom of the species' parts
      \flo@calc\flo@t{max(4,min(6,\flo@nn))}\pgfmathtruncatemacro\flo@fp{\flo@t}%
      \ifdim\flo@sfd pt<8pt
        \edef\flo@vf@star{\flo@vf@pointed}%
        \begin{pgfscope}\pgftransformscale{0.5}\flo@calc\flo@oarg{(\flo@sfd)*0.5/28.45276}\flo@vfloret\flo@oarg\flo@fp\end{pgfscope}%
      \else
        \begin{pgfscope}\pgftransformscale{0.5}\flo@calc\flo@oarg{(\flo@sfd)*0.5/28.45276}\flo@vblossom\flo@oarg\flo@fp\end{pgfscope}%
      \fi
    \else
      \edef\flo@cl{\flo@get{clade}}\def\flo@tmp{monocot}%
      \ifx\flo@cl\flo@tmp\edef\flo@np{\the\numexpr2*\flo@nn\relax}\else\edef\flo@np{\flo@nn}\fi
      \ifnum\flo@vf@pointed=1 \let\flo@vf@W\undefined
      \else\flo@calc\flo@vf@W{max(0.28,min(0.5,0.66/\flo@get{petalaspect}))}%
        \def\flo@tmp{cruciform}\ifx\flo@form\flo@tmp\def\flo@vf@W{0.3}\fi\fi
      \edef\flo@g{\flo@get{guides}}\def\flo@tmp{none}%
      \ifx\flo@g\flo@tmp\ifnum\flo@vf@pointed=0 \def\flo@vf@ns{5}\else\let\flo@vf@ns\undefined\fi
      \else\let\flo@vf@ns\undefined\fi
      \def\flo@tmp{rosaceous}\ifx\flo@form\flo@tmp
        \def\flo@vf@ns{3}\def\flo@vp@notchp{0.85}\def\flo@vp@notchk{1.6}\fi
      \begin{pgfscope}\pgftransformscale{0.45}\flo@calc\flo@vs{(\flo@sfd)*0.45/28.45276}\flo@vflower\flo@vs\flo@np\end{pgfscope}%
      \ifx\flo@form\flo@tmp\flo@vboss\fi
    \fi\fi
  \fi\fi}
% one part of an iris: from the origin toward #1 degrees, #2 long, a narrow haft for
% \flo@ivc of it (none at 0), then flora's petal: #3 half-wide, bent #4, tone #5, a white
% heart (#6 1) or none, #7 white streaks (empty: drawn), notched with chance #8; #9 cm per
% unit of the flower; pointed when \flo@ivpt is 1
\def\flo@ivc{0}\def\flo@ivpt{0}
\def\flo@ivpart#1#2#3#4#5#6#7#8#9{%
  \edef\flo@iva{#1}\edef\flo@ivl{#2}\edef\flo@ivw{#3}\edef\flo@ivb{#4}\edef\flo@ivt{#5}%
  \edef\flo@ivh{#6}\edef\flo@ivn{#7}\edef\flo@ivp{#8}\edef\flo@ivu{#9}%
  \begin{pgfscope}\flo@calc\flo@t{\flo@iva-90}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@ivl}%
    \ifdim\flo@ivc pt>0pt
      \flo@calc\flo@twa{0.3*\flo@ivw}\flo@calc\flo@twb{0.34*\flo@ivw*(1-\flo@ivc)}%
      \flo@vtone{flo@c}{\flo@ivt}\flo@calc\flo@t{\flo@ivc*0.5}\flo@calc\flo@ya{\flo@ivc+0.01}%
      \flo@vfill{flo@c}{1}{0}{\flo@vtaper{0}{0}{0}\flo@t{0}\flo@t{0}\flo@ya}%
      \def\flo@twa{0.02}\def\flo@twb{0.004}\flo@calc\flo@ya{\flo@ivc*0.95}%
      \flo@vfill{white}{0.6}{0}{\flo@vtaper{0}{0.02}{0}\flo@t{0}\flo@t{0}\flo@ya}%
      \pgftransformshift{\flo@P0\flo@ivc}\flo@calc\flo@t{1-\flo@ivc}\pgftransformscale{\flo@t}%
    \fi
    \let\flo@vp@pointed\flo@ivpt\let\flo@vp@W\flo@ivw\let\flo@vp@bend\flo@ivb\let\flo@vp@ns\flo@ivn
    \let\flo@vp@heart\flo@ivh\let\flo@vp@tone\flo@ivt\let\flo@vp@notchp\flo@ivp\def\flo@vp@notchk{1.6}%
    \flo@calc\flo@vp@u{\flo@ivu*\flo@ivl*(1-\flo@ivc)}\flo@vpetal\end{pgfscope}}
% an iris, three-quarters from the front, diameter 1, its heart at the origin: three
% standards that rise and cup together, the back one behind; three falls that spread and
% droop, the front one toward the viewer with a copper beard and the species' guides; a
% pale crest (a style arm) over each fall's base. #1 its diameter on the page in pt
\def\flo@viris#1{%
  \flo@calc\flo@ivs{(#1)/28.45276}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@ivq{0.28}{0.38}\else\edef\flo@ivq{\flo@vf@tone}\fi
  % the standards' hafts are shorter than the falls' (the species' claw)
  \flo@calc\flo@ivcf{0.7*min(0.45,\flo@get{claw})}\flo@calc\flo@ivc{0.55*\flo@ivcf}%
  % the back standard
  \flo@sym\flo@t{6}\flo@calc\flo@a{90+\flo@t}\flo@range\flo@len{0.46}{0.52}\flo@sym\flo@b{0.06}%
  \flo@calc\flo@tp{\flo@ivq+0.04}\flo@ivpart\flo@a\flo@len{0.27}\flo@b\flo@tp{0}{5}{0.5}\flo@ivs
  % the side falls, each with its crest
  \flo@loop{ivf}\flo@ka{0}{1}{%
    \ifnum\flo@ka=0 \def\flo@sg{-1}\else\def\flo@sg{1}\fi
    \flo@range\flo@t{20}{45}\flo@calc\flo@a{-90+\flo@sg*\flo@t}%
    \flo@range\flo@len{0.52}{0.6}\flo@range\flo@b{0.15}{0.3}\flo@calc\flo@b{\flo@sg*\flo@b}%
    \flo@sym\flo@t{0.03}\flo@calc\flo@tp{\flo@ivq+\flo@t}%
    \let\flo@ivc\flo@ivcf\flo@ivpart\flo@a\flo@len{0.34}\flo@b\flo@tp{0}{}{0.3}\flo@ivs
    \def\flo@ivc{0}\flo@range\flo@len{0.26}{0.32}\flo@calc\flo@tp{\flo@ivq+0.18}%
    \flo@ivpart\flo@a\flo@len{0.24}{0}\flo@tp{0}{3}{0.9}\flo@ivs}%
  \flo@calc\flo@ivc{0.55*\flo@ivcf}%
  % the front standards, cupping toward each other
  \flo@loop{ivs}\flo@ka{0}{1}{%
    \ifnum\flo@ka=0 \def\flo@sg{-1}\else\def\flo@sg{1}\fi
    \flo@range\flo@t{8}{28}\flo@calc\flo@a{90-\flo@sg*\flo@t}%
    \flo@range\flo@len{0.48}{0.56}\flo@range\flo@b{0.15}{0.3}\flo@calc\flo@b{-\flo@sg*\flo@b}%
    \flo@sym\flo@t{0.03}\flo@calc\flo@tp{\flo@ivq+0.02+\flo@t}%
    \flo@ivpart\flo@a\flo@len{0.27}\flo@b\flo@tp{0}{5}{0.5}\flo@ivs}%
  % the front fall, its guides and beard, its crest
  \flo@sym\flo@t{6}\flo@calc\flo@a{-90+\flo@t}\flo@range\flo@len{0.56}{0.64}\flo@sym\flo@b{0.08}%
  \let\flo@ivc\flo@ivcf\flo@ivpart\flo@a\flo@len{0.36}\flo@b\flo@ivq{0}{}{0.3}\flo@ivs\def\flo@ivc{0}%
  \flo@calc\flo@t{\flo@ivs*\flo@len}%
  \ifdim\flo@t pt>0.15pt
    \begin{pgfscope}\flo@calc\flo@t{\flo@a-90}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@len}%
      \edef\flo@g{\flo@get{guides}}%
      \def\flo@tmp{lines}\ifx\flo@g\flo@tmp
        \flo@vtone{flo@c}{0.06}\def\flo@twb{0.004}\def\flo@twa{0.035}%
        \flo@loop{ivg}\flo@kb{-2}{2}{%
          \flo@sym\flo@t{0.03}\flo@calc\flo@f{\the\flo@kb*0.07+\flo@t}\flo@range\flo@ya{0.25}{0.38}%
          \flo@calc\flo@xb{0.6*\flo@f}\flo@calc\flo@xc{1.1*\flo@f}\flo@calc\flo@xd{1.4*\flo@f}%
          \flo@calc\flo@yb{0.35*\flo@ya+0.4}\flo@calc\flo@yc{0.7*\flo@ya+0.4}\flo@calc\flo@yd{\flo@ya+0.4}%
          \flo@vfill{flo@c}{0.45}{1}{\flo@vtaper\flo@f{0.4}\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}}\fi
      \def\flo@tmp{blotch}\ifx\flo@g\flo@tmp
        \flo@vblob{0}{0.62}{0.16}{0.12}{0.25}{9}\flo@vfill{white}{0.7}{0}{\flo@smoothpath}%
        \flo@vblob{0}{0.62}{0.07}{0.05}{0.3}{7}\flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{0.5}{1}{\flo@smoothpath}\fi
      \def\flo@tmp{dots}\ifx\flo@g\flo@tmp
        \flo@spk={}%
        \flo@loop{ivd}\flo@kb{1}{9}{%
          \flo@sym\flo@xa{0.16}\flo@range\flo@ya{0.45}{0.8}\flo@range\flo@r{0.012}{0.024}%
          \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xa}{\flo@ya}}{\flo@r pt}}%
          \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
        \flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{0.7}{1}{\the\flo@spk}\fi
      % the beard: copper hairs along the fall's middle, beyond its crest
      \flo@spk={}%
      \flo@loop{ivb}\flo@kb{1}{14}{%
        \flo@sym\flo@xa{0.035}\flo@calc\flo@ya{0.38+0.024*\the\flo@kb}\flo@range\flo@r{0.012}{0.022}%
        \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xa}{\flo@ya}}{\flo@r pt}}%
        \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
      \flo@vaccent{flo@c}{0.1}\flo@vfill{flo@c}{0.9}{0}{\the\flo@spk}%
    \end{pgfscope}%
  \fi
  \flo@range\flo@len{0.26}{0.32}\flo@calc\flo@tp{\flo@ivq+0.18}%
  \flo@ivpart\flo@a\flo@len{0.24}{0}\flo@tp{0}{3}{0.9}\flo@ivs}
% an orchid face on, diameter 1, upright: pointed sepals in a star, one above and two
% below, two narrower petals raised beside the upper one, a lip at the bottom of two small
% side lobes and a notched middle lobe with a pale heart and the species' guides, and the
% column over it; flora's petals (\flo@ivpart). #1 cm per unit
\def\flo@vorchid#1{%
  \edef\flo@ocu{#1}\def\flo@ivc{0}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@ocq{0.28}{0.38}\else\edef\flo@ocq{\flo@vf@tone}\fi
  % the lateral sepals, then the dorsal one
  \def\flo@ivpt{1}%
  \flo@loop{ocs}\flo@ka{0}{1}{%
    \ifnum\flo@ka=0 \def\flo@sg{-1}\else\def\flo@sg{1}\fi
    \flo@range\flo@t{45}{60}\flo@calc\flo@a{-90+\flo@sg*\flo@t}\flo@range\flo@len{0.42}{0.5}%
    \flo@sym\flo@b{0.08}\flo@sym\flo@t{0.03}\flo@calc\flo@tp{\flo@ocq+0.02+\flo@t}%
    \flo@ivpart\flo@a\flo@len{0.12}\flo@b\flo@tp{0}{3}{0}\flo@ocu}%
  \flo@sym\flo@t{6}\flo@calc\flo@a{90+\flo@t}\flo@range\flo@len{0.4}{0.48}\flo@sym\flo@b{0.08}%
  \flo@calc\flo@tp{\flo@ocq+0.02}\flo@ivpart\flo@a\flo@len{0.13}\flo@b\flo@tp{0}{3}{0}\flo@ocu
  \def\flo@ivpt{0}%
  % the petals, raised beside the dorsal sepal
  \flo@loop{ocp}\flo@ka{0}{1}{%
    \ifnum\flo@ka=0 \def\flo@sg{-1}\else\def\flo@sg{1}\fi
    \flo@range\flo@t{45}{65}\flo@calc\flo@a{90-\flo@sg*\flo@t}\flo@range\flo@len{0.36}{0.44}%
    \flo@range\flo@b{0}{0.12}\flo@calc\flo@b{\flo@sg*\flo@b}\flo@sym\flo@t{0.03}\flo@calc\flo@tp{\flo@ocq+\flo@t}%
    \flo@ivpart\flo@a\flo@len{0.2}\flo@b\flo@tp{0}{5}{0.3}\flo@ocu}%
  % the lip: two side lobes, the middle lobe, its guides
  \flo@calc\flo@tp{\flo@ocq-0.06}%
  \flo@loop{ocl}\flo@ka{0}{1}{%
    \ifnum\flo@ka=0 \def\flo@sg{-1}\else\def\flo@sg{1}\fi
    \flo@range\flo@t{40}{55}\flo@calc\flo@a{-90+\flo@sg*\flo@t}\flo@range\flo@len{0.18}{0.24}%
    \flo@ivpart\flo@a\flo@len{0.35}{0}\flo@tp{0}{3}{0}\flo@ocu}%
  \flo@sym\flo@t{6}\flo@calc\flo@a{-90+\flo@t}\flo@range\flo@len{0.44}{0.54}\flo@sym\flo@b{0.06}%
  \flo@ivpart\flo@a\flo@len{0.38}\flo@b\flo@tp{1}{5}{0.85}\flo@ocu
  \flo@calc\flo@t{\flo@ocu*\flo@len}%
  \ifdim\flo@t pt>0.15pt
    \begin{pgfscope}\flo@calc\flo@t{\flo@a-90}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@len}%
      \edef\flo@g{\flo@get{guides}}%
      \def\flo@tmp{lines}\ifx\flo@g\flo@tmp
        \flo@vtone{flo@c}{0.06}\def\flo@twb{0.004}\def\flo@twa{0.035}%
        \flo@loop{ocg}\flo@kb{-2}{2}{%
          \flo@sym\flo@t{0.03}\flo@calc\flo@f{\the\flo@kb*0.09+\flo@t}\flo@range\flo@ya{0.35}{0.5}%
          \flo@calc\flo@xb{0.7*\flo@f}\flo@calc\flo@xc{1.2*\flo@f}\flo@calc\flo@xd{1.5*\flo@f}%
          \flo@calc\flo@yb{0.35*\flo@ya+0.12}\flo@calc\flo@yc{0.7*\flo@ya+0.12}\flo@calc\flo@yd{\flo@ya+0.12}%
          \flo@vfill{flo@c}{0.45}{1}{\flo@vtaper\flo@f{0.12}\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}}\fi
      \def\flo@tmp{blotch}\ifx\flo@g\flo@tmp
        \flo@vblob{0}{0.4}{0.2}{0.15}{0.3}{9}\flo@vfill{white}{0.65}{0}{\flo@smoothpath}%
        \flo@spk={}%
        \flo@loop{ocb}\flo@kb{1}{8}{%
          \flo@sym\flo@xa{0.14}\flo@range\flo@ya{0.3}{0.5}\flo@range\flo@r{0.015}{0.03}%
          \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xa}{\flo@ya}}{\flo@r pt}}%
          \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
        \flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{0.7}{1}{\the\flo@spk}\fi
      \def\flo@tmp{dots}\ifx\flo@g\flo@tmp
        \flo@spk={}%
        \flo@loop{ocd}\flo@kb{1}{11}{%
          \flo@sym\flo@xa{0.24}\flo@range\flo@ya{0.2}{0.75}\flo@range\flo@r{0.014}{0.028}%
          \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xa}{\flo@ya}}{\flo@r pt}}%
          \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
        \flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{0.7}{1}{\the\flo@spk}\fi
    \end{pgfscope}%
  \fi
  % the column: pale, hooded, a dark cap
  \flo@vblob{0}{0.05}{0.05}{0.085}{0.15}{8}\flo@vfill{white}{0.85}{0}{\flo@smoothpath}%
  \flo@vtone{flo@c}{0.1}\flo@vstroke{flo@c}{0.2}{0.5}{0}{\flo@smoothpath}%
  \flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P0{0.11}}{0.022pt}}}
% a lily's corona (the monocot's cup or trumpet, as a daffodil's), in \flo@vlily's frame
% after its star (petal length 1, the face toward +y, \flo@tilt its squash): a body that
% flares from the heart toward the face, a frilled rim seen as an ellipse, the throat
% inside darker; a cup is short, a trumpet long. #1 cm per unit
\def\flo@vcorona#1{%
  \edef\flo@cqu{#1}\edef\flo@cqf{\flo@get{corona}}\def\flo@tmp{trumpet}%
  \ifx\flo@cqf\flo@tmp\flo@range\flo@cqh{0.4}{0.6}\def\flo@cqb{0.1}\flo@range\flo@cqR{0.24}{0.32}%
  \else\flo@range\flo@cqh{0.12}{0.2}\def\flo@cqb{0.14}\flo@range\flo@cqR{0.2}{0.28}\fi
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@cqq{0.24}{0.32}\else\flo@calc\flo@cqq{\flo@vf@tone-0.08}\fi
  \flo@int\flo@cqn{9}{14}\flo@range\flo@cqp{0}{360}%
  % the body: the base's near half, the right side, the rim's near half, the left side
  \flo@loop{cqa}\flo@kb{0}{4}{%
    \flo@calc\flo@a{180+45*\the\flo@kb}%
    \flo@calc\flo@xa{\flo@cqb*cos(\flo@a)}\flo@calc\flo@ya{\flo@cqb*\flo@tilt*sin(\flo@a)}%
    \flo@put{\the\numexpr\flo@kb+1\relax}\flo@xa\flo@ya}%
  \flo@loop{cqb}\flo@kb{1}{3}{%
    \flo@calc\flo@v{\the\flo@kb/4}\flo@calc\flo@xa{\flo@cqb+(\flo@cqR-\flo@cqb)*pow(\flo@v,1.6)}\flo@calc\flo@ya{\flo@cqh*\flo@v}%
    \flo@put{\the\numexpr\flo@kb+5\relax}\flo@xa\flo@ya}%
  \flo@loop{cqc}\flo@kb{0}{6}{%
    \flo@calc\flo@a{-30*\the\flo@kb}%
    \flo@calc\flo@r{1+0.09*sin(\flo@cqn*\flo@a+\flo@cqp)}%
    \flo@calc\flo@xa{\flo@cqR*\flo@r*cos(\flo@a)}\flo@calc\flo@ya{\flo@cqh+\flo@cqR*\flo@r*\flo@tilt*sin(\flo@a)}%
    \flo@put{\the\numexpr\flo@kb+9\relax}\flo@xa\flo@ya}%
  \flo@loop{cqd}\flo@kb{1}{3}{%
    \flo@calc\flo@v{1-\the\flo@kb/4}\flo@calc\flo@xa{-\flo@cqb-(\flo@cqR-\flo@cqb)*pow(\flo@v,1.6)}\flo@calc\flo@ya{\flo@cqh*\flo@v}%
    \flo@put{\the\numexpr\flo@kb+15\relax}\flo@xa\flo@ya}%
  \flo@smoothprepT{18}{0.9}\flo@keep{cqo}%
  \flo@vtone{flo@c}{\flo@cqq}\flo@vfill{flo@c}{1}{0}{\flo@kept{cqo}}%
  \ifdim\flo@cqu pt>0.12pt
    \begin{pgfscope}\flo@kept{cqo}\pgfusepath{clip}%
      % streaks up the body, white and dark by turns
      \def\flo@twa{0.025}\def\flo@twb{0.008}%
      \flo@loop{cqs}\flo@ka{-2}{2}{%
        \flo@calc\flo@f{\the\flo@ka/2.6}\flo@sym\flo@t{0.02}%
        \flo@calc\flo@xa{\flo@f*\flo@cqb}\flo@calc\flo@xd{\flo@f*\flo@cqR+\flo@t}\flo@calc\flo@ya{-0.02}\flo@calc\flo@yd{\flo@cqh}%
        \flo@calc\flo@xb{0.7*\flo@xa+0.3*\flo@xd}\flo@calc\flo@yb{0.4*\flo@cqh}\flo@calc\flo@xc{0.3*\flo@xa+0.7*\flo@xd}\flo@calc\flo@yc{0.75*\flo@cqh}%
        \ifodd\flo@ka\flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{0.25}{1}{\flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}%
        \else\flo@vfill{white}{0.5}{0}{\flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}\fi}%
    \end{pgfscope}%
  \fi
  % the opening: the rim's ellipse, frilled, paler, the throat darker inside
  \flo@loop{cqe}\flo@kb{1}{16}{%
    \flo@calc\flo@a{22.5*\the\flo@kb}\flo@calc\flo@r{1+0.09*sin(\flo@cqn*\flo@a+\flo@cqp)}%
    \flo@calc\flo@xa{\flo@cqR*\flo@r*cos(\flo@a)}\flo@calc\flo@ya{\flo@cqh+\flo@cqR*\flo@r*\flo@tilt*sin(\flo@a)}%
    \flo@put{\the\flo@kb}\flo@xa\flo@ya}%
  \flo@smoothprepT{16}{1}\flo@keep{cqr}%
  \flo@calc\flo@t{\flo@cqq+0.12}\flo@vtone{flo@c}{\flo@t}\flo@vfill{flo@c}{1}{0}{\flo@kept{cqr}}%
  \flo@calc\flo@t{0.55*\flo@cqR}\flo@calc\flo@ya{\flo@cqh-0.15*\flo@cqR*\flo@tilt}\flo@calc\flo@r{\flo@t*\flo@tilt}%
  \flo@vblob{0}\flo@ya\flo@t\flo@r{0.15}{8}\flo@calc\flo@t{\flo@cqq-0.12}\flo@vtone{flo@c}{\flo@t}\flo@vfill{flo@c}{0.6}{1}{\flo@smoothpath}%
  \flo@vtone{flo@c}{0.08}\flo@vstroke{flo@c}{0.2}{0.6}{0}{\flo@kept{cqr}}%
  \flo@vstroke{flo@c}{0.2}{0.35}{0}{\flo@kept{cqo}}}
% a columbine in profile (a spurred flower), in \flo@vtube's units: the stalk meets it at
% the origin, its face toward +y. Pointed sepals spread like a star, two swept back and
% two forward; three of its five spurs run back past the stalk, tapering to a knob, their
% tips drawn together or spread apart; the cup of petal blades in front (\flo@vtube's
% aqcup: paler, lobed, stamens out of it). #1 cm per unit
\def\flo@vaquilegia#1{%
  \edef\flo@aqu{#1}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@aqq{0.3}{0.4}\else\edef\flo@aqq{\flo@vf@tone}\fi
  % the sepals swept back
  \def\flo@ivc{0}\def\flo@ivpt{1}%
  \flo@loop{aqb}\flo@ka{0}{1}{%
    \ifnum\flo@ka=0 \def\flo@sg{-1}\else\def\flo@sg{1}\fi
    \flo@range\flo@t{105}{135}\flo@calc\flo@a{90-\flo@sg*\flo@t}\flo@range\flo@len{0.32}{0.4}%
    \flo@sym\flo@b{0.08}\flo@calc\flo@tp{\flo@aqq-0.04}%
    \begin{pgfscope}\pgftransformshift{\flo@P0{0.12}}\flo@ivpart\flo@a\flo@len{0.14}\flo@b\flo@tp{0}{3}{0}\flo@aqu\end{pgfscope}}%
  % the spurs
  \flo@range\flo@aqh{0}{0.16}\def\flo@twb{0.024}%
  \flo@loop{aqs}\flo@ka{-1}{1}{%
    \flo@range\flo@len{0.38}{0.58}\flo@sym\flo@t{0.03}%
    \flo@calc\flo@xa{\the\flo@ka*0.08}\flo@calc\flo@xb{\the\flo@ka*0.16+\flo@t}\flo@calc\flo@yb{0.16-0.4*\flo@len}%
    \flo@calc\flo@xc{\the\flo@ka*0.14+\flo@t}\flo@calc\flo@yc{0.16-0.8*\flo@len}%
    \flo@calc\flo@xd{\the\flo@ka*(0.16-\flo@aqh)+\flo@t}\flo@calc\flo@yd{0.16-\flo@len}%
    \ifnum\flo@ka=0 \flo@calc\flo@tp{\flo@aqq-0.06}\else\edef\flo@tp{\flo@aqq}\fi
    \def\flo@twa{0.12}\flo@vtone{flo@c}{\flo@tp}%
    \flo@vfill{flo@c}{1}{0}{\flo@vtaper\flo@xa{0.16}\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}%
    \ifdim\flo@aqu pt>0.15pt
      \def\flo@twa{0.018}\flo@calc\flo@xa{\flo@xa+0.025}\flo@calc\flo@xb{\flo@xb+0.018}\flo@calc\flo@xc{\flo@xc+0.01}%
      \flo@vfill{white}{0.35}{0}{\flo@vtaper\flo@xa{0.14}\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}\fi
    \flo@calc\flo@t{\flo@tp-0.12}\flo@vtone{flo@c}{\flo@t}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P\flo@xd\flo@yd}{0.03pt}}}%
  % the sepals swept forward
  \flo@loop{aqf}\flo@ka{0}{1}{%
    \ifnum\flo@ka=0 \def\flo@sg{-1}\else\def\flo@sg{1}\fi
    \flo@range\flo@t{45}{70}\flo@calc\flo@a{90-\flo@sg*\flo@t}\flo@range\flo@len{0.3}{0.38}%
    \flo@sym\flo@b{0.08}\flo@sym\flo@t{0.03}\flo@calc\flo@tp{\flo@aqq+\flo@t}%
    \begin{pgfscope}\pgftransformshift{\flo@P0{0.12}}\flo@ivpart\flo@a\flo@len{0.14}\flo@b\flo@tp{0}{3}{0}\flo@aqu\end{pgfscope}}%
  \def\flo@ivpt{0}%
  % the cup of petal blades, paler, in front
  \begin{pgfscope}\pgftransformshift{\flo@P0{0.08}}\flo@calc\flo@vf@tone{\flo@aqq+0.1}\flo@vtube\flo@aqu{aqcup}\end{pgfscope}}
% a daisy head, diameter 1: rays (flora's petals, narrow and round-tipped, as ligules are) around a disk of florets
\def\flo@sdaisy#1{%
  \edef\flo@nr{\flo@get{merosity}}\flo@range\flo@spin{0}{360}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@tq{0.3}{0.46}\else\edef\flo@tq{\flo@vf@tone}\fi
  \flo@calc\flo@vu{(#1)*0.36/28.45276}%
  \flo@loop{ray}\flo@ka{1}{\flo@nr}{%
    \flo@sym\flo@t{4}\flo@calc\flo@a{\flo@spin+\the\flo@ka*360/\flo@nr+\flo@t-90}%
    \flo@range\flo@js{0.9}{1.05}\flo@sym\flo@t{0.04}\flo@calc\flo@tp{\flo@tq+\flo@t}%
    \flo@calc\flo@lw{min(0.17,1.6/\flo@nr)}%
    \begin{pgfscope}\pgftransformrotate{\flo@a}\pgftransformshift{\flo@P0{0.1}}\pgftransformscale{0.4}\pgftransformscale{\flo@js}%
      \def\flo@vp@pointed{0}\edef\flo@vp@W{\flo@lw}\def\flo@vp@bend{}\def\flo@vp@ns{2}\def\flo@vp@heart{0}%
      \edef\flo@vp@tone{\flo@tp}\edef\flo@vp@u{\flo@vu}\flo@vpetal\end{pgfscope}}%
  % the disk: deep copper, florets in spirals (Vogel 1979), paler toward the rim
  \let\flo@savedramp\flo@rampname\def\flo@rampname{flo@aramp}%
  \flo@vtone{flo@c}{0.3}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.105pt}}%
  \flo@calc\flo@nd{int(min(90,max(24,(#1)*1.2)))}%
  \flo@vtone{flo@c}{0.68}\flo@spk={}%
  \flo@loop{disk}\flo@ka{1}{\flo@nd}{%
    \flo@calc\flo@r{0.095*sqrt(\the\flo@ka/\flo@nd)}\flo@calc\flo@a{137.508*\the\flo@ka}%
    \flo@calc\flo@dx{\flo@r*cos(\flo@a)}\flo@calc\flo@dy{\flo@r*sin(\flo@a)}%
    \flo@calc\flo@dr{0.004+0.006*sqrt(\the\flo@ka/\flo@nd)}%
    \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@dx}{\flo@dy}}{\flo@dr pt}}%
    \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
  \flo@vfill{flo@c}{0.9}{0}{\the\flo@spk}%
  \let\flo@rampname\flo@savedramp}
% the rose family's boss, face on, in the flower's units (diameter about 1): a ring of many
% stamens, copper anthers, around a pale receptacle with the styles as dots
\def\flo@vboss{%
  \edef\flo@stm{\flo@get{stamens}}\def\flo@tmp{exserted}%
  \ifx\flo@stm\flo@tmp\def\flo@bl{0.04}\else\def\flo@bl{0}\fi
  \flo@int\flo@bn{36}{52}\flo@range\flo@bph{0}{360}%
  \flo@spk={}\flo@spa={}%
  \flo@loop{bos}\flo@Gc{1}{\flo@bn}{%
    \flo@sym\flo@t{4}\flo@calc\flo@a{\flo@bph+360/\flo@bn*\the\flo@Gc+\flo@t}%
    \flo@range\flo@t{0.09}{0.17}\flo@calc\flo@r{\flo@t+\flo@bl}%
    \flo@calc\flo@xa{0.035*cos(\flo@a)}\flo@calc\flo@ya{0.035*sin(\flo@a)}%
    \flo@calc\flo@xb{\flo@r*cos(\flo@a)}\flo@calc\flo@yb{\flo@r*sin(\flo@a)}%
    \edef\flo@tmp{\noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@xa}{\flo@ya}}\noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xb}{\flo@yb}}}%
    \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}%
    \flo@range\flo@t{0.007}{0.011}%
    \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xb}{\flo@yb}}{\flo@t pt}}%
    \flo@spa\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spa\flo@tmp}}%
  \flo@vtone{flo@c}{0.14}\flo@vstroke{flo@c}{0.2}{0.8}{0}{\the\flo@spk}%
  \let\flo@savedramp\flo@rampname\def\flo@rampname{flo@aramp}%
  \flo@vtone{flo@c}{0.42}\flo@vfill{flo@c}{1}{0}{\the\flo@spa}%
  \flo@vtone{flo@c}{0.66}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.045pt}}%
  \let\flo@rampname\flo@savedramp
  \flo@vtone{flo@c}{0.2}\flo@vfill{flo@c}{0.9}{0}{\pgfpathcircle{\flo@P{0.014}{0.009}}{0.009pt}%
    \pgfpathcircle{\flo@P{-0.012}{0.013}}{0.009pt}\pgfpathcircle{\flo@P{-0.002}{-0.015}}{0.009pt}}}
% the leaf of the species along +y, length 1: its simple leaf (\flo@sleaf, lobed or toothed),
% a strap leaf for parallel veins, its leaflets (\flo@sleaflet) on a rachis for a compound
% leaf, a fern's frond; #1 its length on the page in pt
\def\flo@leaf#1{%
  \edef\flo@lfpt{#1}\def\flo@shd{0}%
  \ifx\flo@lsd\pgfutil@empty\else\edef\flo@t{\flo@get{attachment}}\def\flo@tmp{sheathing}%
    \ifx\flo@t\flo@tmp\flo@sheath\fi\fi
  \ifnum\flo@shd=1 \begin{pgfscope}\pgftransformshift{\flo@P\flo@shx\flo@shy}\flo@leaf@\flo@lfpt\end{pgfscope}%
  \else\flo@leaf@\flo@lfpt\fi}
% A sheathing leaf's base wrapped round the stem from the node up (a grass's or an
% umbellifer's), \flo@lsd degrees from the leaf's axis, \flo@lsw wide, in the leaf's units;
% the leaf goes on from its top, \flo@shx,\flo@shy
\def\flo@sheath{%
  \flo@range\flo@shl{0.14}{0.22}%
  \flo@calc\flo@shx{-\flo@shl*sin(\flo@lsd)}\flo@calc\flo@shy{\flo@shl*cos(\flo@lsd)}%
  \edef\flo@twa{\flo@lsw}\flo@calc\flo@twb{0.8*\flo@lsw}%
  \flo@calc\flo@xa{\flo@shx/3}\flo@calc\flo@ya{\flo@shy/3}\flo@calc\flo@xb{2*\flo@shx/3}\flo@calc\flo@yb{2*\flo@shy/3}%
  \flo@vtone{flo@c}{0.34}\flo@vfill{flo@c}{1}{0}{\flo@vtaper{0}{0}\flo@xa\flo@ya\flo@xb\flo@yb\flo@shx\flo@shy}%
  \flo@vtone{flo@c}{0.08}\flo@vstroke{flo@c}{0.2}{0.6}{0}{\flo@vtaper{0}{0}\flo@xa\flo@ya\flo@xb\flo@yb\flo@shx\flo@shy}%
  \def\flo@shd{1}}
\def\flo@leaf@#1{%
  \edef\flo@lfpt{#1}\edef\flo@cp{\flo@get{compound}}\edef\flo@ve{\flo@get{venation}}%
  \flo@calc\flo@vl@u{(\flo@lfpt)/28.45276}%
  \def\flo@tmp{simple}%
  \ifx\flo@cp\flo@tmp
    \def\flo@tmp{parallel}%
    \ifx\flo@ve\flo@tmp
      \flo@calc\flo@lW{max(0.025,min(0.12,0.42/\flo@get{leafaspect}))}\flo@vstrap
    \else
      \ifdefined\flo@sbend\let\flo@vl@bend\flo@sbend\else\def\flo@vl@bend{}\fi\def\flo@vl@tone{}%
      \edef\flo@lm{\flo@get{leafmargin}}\def\flo@vl@depth{0}\def\flo@vl@lobes{3}%
      \def\flo@tmp{lobed}\ifx\flo@lm\flo@tmp\def\flo@vl@depth{x}\fi
      \def\flo@tmp{pinnatifid}\ifx\flo@lm\flo@tmp\def\flo@vl@depth{x}\fi
      \def\flo@tmp{palmatelobed}\ifx\flo@lm\flo@tmp\def\flo@vl@depth{x}\fi
      \def\flo@tmp{x}\ifx\flo@vl@depth\flo@tmp
        \flo@calc\flo@vl@depth{min(0.85,max(0.3,\flo@get{dissection}))}%
        \flo@calc\flo@t{max(2,min(6,\flo@get{teeth}))}\pgfmathtruncatemacro\flo@vl@lobes{\flo@t}\fi
      \flo@sleaf
    \fi
  \else\def\flo@tmp{frond}\ifx\flo@cp\flo@tmp\flo@frond\flo@lfpt\else
    \flo@range\flo@lt{0.24}{0.4}%
    % stipules at the foot, small or (a pea's) leafy
    \edef\flo@t{\flo@get{stipules}}\def\flo@tmp{none}%
    \ifx\flo@t\flo@tmp\else
      \def\flo@tmp{leafy}%
      \ifx\flo@t\flo@tmp\def\flo@sta{0.1}\def\flo@stb{0.16}\def\flo@vl@W{0.36}\else\def\flo@sta{0.05}\def\flo@stb{0.08}\def\flo@vl@W{0.3}\fi
      \flo@loop{cstip}\flo@kc{0}{1}{%
        \flo@range\flo@t{55}{80}\ifnum\flo@kc=1 \flo@calc\flo@t{-\flo@t}\fi\flo@range\flo@ts{\flo@sta}{\flo@stb}%
        \begin{pgfscope}%
          \pgftransformshift{\flo@P0{0.01}}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@ts}%
          \def\flo@vl@tone{0.3}\flo@calc\flo@vl@u{\flo@lfpt*\flo@ts/28.45276}\flo@vleaflet
        \end{pgfscope}}%
    \fi
    \flo@tone{flo@c}{0.07}{flo@ink}\pgfsetstrokecolor{flo@c}%
    \flo@calc\flo@lw{max(0.25,0.006*(\flo@lfpt))}\pgfsetlinewidth{\flo@lw bp}\pgfsetroundcap
    \edef\flo@ptend{\flo@get{tendrils}}%
    \def\flo@tmp{pinnate}\ifx\flo@cp\flo@tmp\flo@calc\flo@t{int(min(7,\flo@get{leaflets}))}\flo@pinnate\flo@lfpt\flo@t{0.4}\fi
    \def\flo@tmp{bipinnate}\ifx\flo@cp\flo@tmp\flo@bipinnate\flo@lfpt\fi
    \def\flo@tmp{palmate}\ifx\flo@cp\flo@tmp\flo@palmate\flo@lfpt{\flo@get{leaflets}}\fi
    \def\flo@tmp{trifoliate}\ifx\flo@cp\flo@tmp\flo@trifoliate\flo@lfpt\fi
  \fi\fi}
% a leaflet of a compound leaf in the species' hand (\flo@sblade): its shape, apex, base
% and margin, with no stalk or stipules, two or three lobes a side (under 7 mm, scallops
% instead, or a pinnatifid leaflet's deep teeth: \flo@lmover); along +y, length 1; #1 its
% tone, \flo@vl@u its length on the page in cm
\def\flo@sleaflet#1{%
  \def\flo@vl@bend{}\edef\flo@vl@tone{#1}\def\flo@vl@depth{0}\def\flo@vl@lobes{3}%
  \edef\flo@lm{\flo@get{leafmargin}}%
  \def\flo@tmp{lobed}\ifx\flo@lm\flo@tmp\def\flo@vl@depth{x}\fi
  \def\flo@tmp{pinnatifid}\ifx\flo@lm\flo@tmp\def\flo@vl@depth{x}\fi
  \def\flo@tmp{palmatelobed}\ifx\flo@lm\flo@tmp\def\flo@vl@depth{x}\fi
  \def\flo@lmover{}\def\flo@tmp{x}%
  \ifx\flo@vl@depth\flo@tmp
    \ifdim\flo@vl@u pt<0.7pt \def\flo@vl@depth{0}\def\flo@lmover{crenate}%
      \def\flo@tmp{pinnatifid}\ifx\flo@lm\flo@tmp\def\flo@lmover{dentate}\fi\else
    \flo@calc\flo@vl@depth{min(0.85,max(0.3,\flo@get{dissection}))}%
    \flo@calc\flo@t{max(2,min(3,\flo@get{teeth}))}\pgfmathtruncatemacro\flo@vl@lobes{\flo@t}\fi\fi
  \flo@sshape@
  \flo@calc\flo@lsc{min(1,0.3/\flo@lW)}%
  \def\flo@tmp{palmatelobed}\ifx\flo@lm\flo@tmp\flo@calc\flo@lsc{min(1,0.3/max(\flo@lW,0.55))}\fi
  \begin{pgfscope}%
    \ifdim\flo@lsc pt<1pt \pgftransformscale{\flo@lsc}\flo@calc\flo@vl@u{\flo@vl@u*\flo@lsc}\fi
    \def\flo@lleaflet{1}\flo@sblade
  \end{pgfscope}}

% flora.blossom: a small flower of #2 round petals (flora: 5), radius 1; #1 its radius on
% the page in cm (no random part); tone \flo@vf@tone (empty: drawn)
\def\flo@vblossom#1#2{%
  \edef\flo@bnp{#2}\flo@range\flo@spin{0}{72}%
  \ifx\flo@vf@tone\pgfutil@empty\flo@range\flo@tq{0.30}{0.45}\else\edef\flo@tq{\flo@vf@tone}\fi
  \flo@loop{bls}\flo@ka{0}{\flo@bnp-1}{%
    \flo@sym\flo@t{8}\flo@calc\flo@a{\flo@spin+\the\flo@ka*360/\flo@bnp+\flo@t}\flo@range\flo@js{0.9}{1.08}%
    \flo@range\flo@pW{0.36}{0.44}%
    \begin{pgfscope}\pgftransformrotate{\flo@a}\pgftransformscale{\flo@js}%
      \def\flo@vp@pointed{0}%
      \flo@loop{blo}\flo@kb{0}{18}{%
        \flo@calc\flo@v{\the\flo@kb/18}\flo@vhalf\flo@v\edef\flo@q{\the\numexpr\flo@kb+1\relax}%
        \flo@calc\flo@xl{-\flo@h}\expandafter\let\csname flo@RX\flo@q\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@q\endcsname\flo@v
        \expandafter\let\csname flo@QX\flo@q\endcsname\flo@h\expandafter\let\csname flo@QY\flo@q\endcsname\flo@v}%
      \flo@bladeassemble{18}\flo@smoothprep{36}\flo@keep{bl}%
      \flo@sym\flo@t{0.05}\flo@vtone{flo@c}{\flo@tq+\flo@t}\flo@vfill{flo@c}{1}{0}{\flo@kept{bl}}%
      \begin{pgfscope}\flo@kept{bl}\pgfusepath{clip}%
        \flo@sym\flo@mx{0.2}\flo@range\flo@my{0.5}{0.9}%
        \flo@vblob\flo@mx\flo@my{0.35}{0.3}{0.3}{8}\flo@vtone{flo@c}{\flo@tq-0.2}\flo@vfill{flo@c}{0.3}{1}{\flo@smoothpath}%
        \def\flo@twa{0.12}\def\flo@twb{0.01}\flo@sym\flo@t{0.05}%
        \flo@vfill{white}{0.7}{0}{\flo@vtaper{0}{0}{0.02}{0.2}{-0.02}{0.4}\flo@t{0.55}}%
        \flo@vtone{flo@c}{0.08}\flo@calc\flo@t{1.2*(#1)}\flo@vstroke{flo@c}{\flo@t}{0.25}{1}{\flo@kept{bl}}%
      \end{pgfscope}%
    \end{pgfscope}}%
  \flo@vfill{white}{0.85}{0}{\pgfpathcircle{\flo@P00}{0.22pt}}%
  \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P00}{0.09pt}}}


% ================================================================ ferns
% A fern's frond along +y, length 1: the stipe from the origin, then the rachis through the
% blade, turning \flo@fearch degrees by its tip (+ to the left; empty: drawn from the
% species' curl), as fronds arch over. Its pinnae come in pairs, a little alternate, inside
% the blade's outline, spread at the foot and swept forward toward the tip, as wide as their
% spacing allows and curving toward the tip; once divided, each pinna is a blade with the
% species' tip and edge; twice, a comb of pinnules; three times, pinnules lobed in turn. Set
% before: \flo@feun, how far it has unrolled (1 open; below 0.97 the rest of the blade is
% still rolled in a crozier at the top, the pinnae just below it still small);
% \flo@fefert 1 for a dimorphic fern's fertile frond (narrow, its pinnae rows of beads, in
% the accent); \flo@feund 1 for a frond turned to show its underside (paler, with the sori
% in the accent, darkened). #1 its length on the page in pt
\def\flo@feun{1}\def\flo@fefert{0}\def\flo@feund{0}\def\flo@fearch{}
\def\flo@feput#1#2#3{\expandafter\edef\csname flo@feX#1\endcsname{#2}\expandafter\edef\csname flo@feY#1\endcsname{#3}}
\def\flo@fex@#1{\csname flo@feX#1\endcsname}\def\flo@fey@#1{\csname flo@feY#1\endcsname}
% the outline: its widest point, the share of the longest pinna at the foot, how the tip
% narrows, the longest pinna to the blade
\def\flo@feol@lanceolate{\def\flo@febm{0.3}\def\flo@felo{0.45}\def\flo@fekx{0.8}\def\flo@fewr{0.26}}
\def\flo@feol@oblong{\def\flo@febm{0.12}\def\flo@felo{0.7}\def\flo@fekx{0.35}\def\flo@fewr{0.2}}
\def\flo@feol@ovate{\def\flo@febm{0.2}\def\flo@felo{0.75}\def\flo@fekx{0.9}\def\flo@fewr{0.32}}
\def\flo@feol@deltoid{\def\flo@febm{0.04}\def\flo@felo{0.9}\def\flo@fekx{1.3}\def\flo@fewr{0.42}}
% a pinna's tip (how its sides close) and edge (scallops or teeth, their depth)
\def\flo@feap@acute{\def\flo@fekp{1.6}\def\flo@fekq{0.9}}
\def\flo@feap@obtuse{\def\flo@fekp{3}\def\flo@fekq{0.6}}
\def\flo@feap@rounded{\def\flo@fekp{5}\def\flo@fekq{0.45}}
\def\flo@fem@entire{\def\flo@fetd{0}}\def\flo@fem@crenate{\def\flo@fetd{0.2}}\def\flo@fem@serrate{\def\flo@fetd{0.26}}
\def\flo@frond#1{%
  \edef\flo@fept{#1}\flo@calc\flo@fecm{(#1)/28.45276}%
  \ifx\flo@fearch\pgfutil@empty\flo@sym\flo@t{1}\flo@calc\flo@fearch{\flo@t*(20+70*\flo@get{curl})}\fi
  \ifdim\flo@feun pt<0.97pt \else\def\flo@feun{1}\fi
  \ifnum\flo@fefert=1 \def\flo@rampname{flo@aramp}\fi
  \edef\flo@fest{\flo@get{stipe}}\edef\flo@fen{\flo@get{pinnae}}\edef\flo@fediv{\flo@get{division}}%
  \csname flo@feol@\flo@get{outline}\endcsname\csname flo@feap@\flo@get{leafapex}\endcsname
  \csname flo@fem@\flo@get{leafmargin}\endcsname
  \edef\flo@fesh{\flo@get{leafshape}}\def\flo@tmp{lanceolate}%
  \ifx\flo@fesh\flo@tmp\def\flo@fenar{0.3}\else\def\flo@fenar{0}\fi
  % the open part: the stipe and the blade up to \flo@feo (a young frond's axis lengthens
  % before its blade unrolls); its spine in 32 steps
  \flo@calc\flo@feo{\flo@fest+(1-\flo@fest)*(\flo@feun<1 ? 0.3+0.7*\flo@feun : 1)}%
  \def\flo@fex{0}\def\flo@fey{0}\flo@feput1{0}{0}%
  \flo@loop{fesp}\flo@kb{1}{32}{%
    \flo@calc\flo@t{\flo@feo*(\the\flo@kb-0.5)/32}\flo@calc\flo@fea{90+\flo@fearch*pow(\flo@t,1.5)}%
    \flo@calc\flo@fex{\flo@fex+\flo@feo/32*cos(\flo@fea)}\flo@calc\flo@fey{\flo@fey+\flo@feo/32*sin(\flo@fea)}%
    \flo@feput{\the\numexpr\flo@kb+1\relax}\flo@fex\flo@fey}%
  % the crozier: the rest of the blade rolled toward the side the frond arches, a spiral of
  % 24 steps closing to a quarter of its radius, \flo@fecT degrees in all (fewer as it
  % unrolls), as long as two thirds of the blade it holds; points 34..57
  \ifdim\flo@feun pt<1pt
    \ifdim\flo@fearch pt<0pt \def\flo@fesg{-1}\else\def\flo@fesg{1}\fi
    \flo@calc\flo@fecT{100+440*(1-\flo@feun)}%
    \flo@calc\flo@fecr{0.65*(1-\flo@feo)/(\flo@fecT*0.0174533*0.541)}%
    \flo@calc\flo@fea{90+\flo@fearch*pow(\flo@feo,1.5)}%
    \flo@loop{fecl}\flo@kb{1}{24}{%
      \flo@calc\flo@fea{\flo@fea+\flo@fesg*\flo@fecT/24}%
      \flo@calc\flo@t{\flo@fecr*pow(0.25,(\the\flo@kb-0.5)/24)*\flo@fecT/24*0.0174533}%
      \flo@calc\flo@fex{\flo@fex+\flo@t*cos(\flo@fea)}\flo@calc\flo@fey{\flo@fey+\flo@t*sin(\flo@fea)}%
      \flo@feput{\the\numexpr\flo@kb+33\relax}\flo@fex\flo@fey}%
  \fi
  % the pinnae, pair by pair from the foot; the longest \flo@fepm, the frond's tone
  \flo@range\flo@t{0.9}{1.1}\flo@calc\flo@fepm{(1-\flo@fest)*\flo@fewr*\flo@t}%
  \ifnum\flo@fefert=1 \flo@calc\flo@fepm{0.45*\flo@fepm}\fi
  \flo@range\flo@fetone{0.24}{0.34}\ifnum\flo@feund=1 \flo@calc\flo@fetone{\flo@fetone+0.14}\fi
  \flo@loop{fepn}\flo@Gd{1}{\flo@fen}{%
    \flo@loop{feps}\flo@Ge{0}{1}{%
      \flo@calc\flo@feb{0.93*pow((\the\flo@Gd-0.5+0.42*\the\flo@Ge)/\flo@fen,0.85)}%
      \flo@calc\flo@fes{\flo@fest+(1-\flo@fest)*\flo@feb}%
      \ifdim\flo@feb pt<\flo@febm pt \flo@calc\flo@fee{\flo@felo+(1-\flo@felo)*sin(90*\flo@feb/\flo@febm)}%
      \else\flo@calc\flo@fee{pow(max(0.0001,cos(90*(\flo@feb-\flo@febm)/(1-\flo@febm))),\flo@fekx)}\fi
      \ifdim\flo@feun pt<1pt \flo@calc\flo@fee{\flo@fee*max(0,min(1,0.3+0.7*(\flo@feo-\flo@fes)/0.15))}\fi
      \flo@range\flo@t{0.92}{1.06}\flo@calc\flo@fel{\flo@fepm*\flo@fee*\flo@t}%
      \flo@sym\flo@t{4}\flo@calc\flo@fal{70-30*\flo@feb+\flo@t}%
      \flo@calc\flo@fepcm{\flo@fel*\flo@fecm}%
      \flo@calc\flo@t{\flo@fes<\flo@feo-0.004 && \flo@fepcm>0.08 ? 1 : 0}%
      \ifdim\flo@t pt>0.5pt
        % two thirds as wide as the gap to the next pinna on its side
        \flo@calc\flo@t{0.93*(1-\flo@fest)*(pow((\the\flo@Gd+0.5)/\flo@fen,0.85)-pow((\the\flo@Gd-0.5)/\flo@fen,0.85))}%
        \flo@calc\flo@feW{min(0.22,0.34*\flo@t*sin(\flo@fal)/\flo@fel)}%
        % where it leaves the rachis, and the rachis' direction there
        \flo@calc\flo@t{\flo@fes/\flo@feo*32}\pgfmathtruncatemacro\flo@fei{\flo@t}\flo@calc\flo@fef{\flo@t-\flo@fei}%
        \edef\flo@fia{\the\numexpr\flo@fei+1\relax}\edef\flo@fib{\the\numexpr\flo@fei+2\relax}%
        \flo@calc\flo@fpx{\flo@fex@\flo@fia+(\flo@fex@\flo@fib-(\flo@fex@\flo@fia))*\flo@fef}%
        \flo@calc\flo@fpy{\flo@fey@\flo@fia+(\flo@fey@\flo@fib-(\flo@fey@\flo@fia))*\flo@fef}%
        \flo@calc\flo@fea{90+\flo@fearch*pow(\flo@fes,1.5)}%
        \begin{pgfscope}%
          \pgftransformshift{\flo@P\flo@fpx\flo@fpy}%
          \ifnum\flo@Ge=0 \flo@calc\flo@t{\flo@fea+\flo@fal-90}\else\flo@calc\flo@t{\flo@fea-\flo@fal-90}\fi
          \pgftransformrotate{\flo@t}\ifnum\flo@Ge=1 \pgftransformxscale{-1}\fi\pgftransformscale{\flo@fel}%
          \ifnum\flo@fefert=1 \flo@febeads
          \else\ifnum\flo@fediv>1 \ifdim\flo@fepcm pt>0.45pt \flo@fecomb\else\flo@fepinna\fi\else\flo@fepinna\fi\fi
        \end{pgfscope}%
      \fi}}%
  % an open frond ends in a pinna-like tip along the rachis
  \ifdim\flo@feun pt<1pt\else\ifnum\flo@fefert=0
    \flo@calc\flo@fes{\flo@fest+0.91*(1-\flo@fest)}\flo@calc\flo@fel{0.1*(1-\flo@fest)}%
    \flo@calc\flo@t{\flo@fes*32}\pgfmathtruncatemacro\flo@fei{\flo@t}\flo@calc\flo@fef{\flo@t-\flo@fei}%
    \edef\flo@fia{\the\numexpr\flo@fei+1\relax}\edef\flo@fib{\the\numexpr\flo@fei+2\relax}%
    \flo@calc\flo@fpx{\flo@fex@\flo@fia+(\flo@fex@\flo@fib-(\flo@fex@\flo@fia))*\flo@fef}%
    \flo@calc\flo@fpy{\flo@fey@\flo@fia+(\flo@fey@\flo@fib-(\flo@fey@\flo@fia))*\flo@fef}%
    \flo@calc\flo@fea{90+\flo@fearch*pow(\flo@fes,1.5)}\def\flo@feW{0.13}\flo@calc\flo@fepcm{\flo@fel*\flo@fecm}%
    \begin{pgfscope}\pgftransformshift{\flo@P\flo@fpx\flo@fpy}\flo@calc\flo@t{\flo@fea-90}\pgftransformrotate{\flo@t}%
      \pgftransformscale{\flo@fel}\flo@fepinna\end{pgfscope}%
  \fi\fi
  % the stipe and rachis, dark, over the pinnae's feet
  \flo@loop{fecp}\flo@kb{1}{33}{\flo@put{\the\flo@kb}{\flo@fex@{\the\flo@kb}}{\flo@fey@{\the\flo@kb}}}%
  \flo@calc\flo@fewb{0.0025+0.006*(1-\flo@feun)}\flo@vtone{flo@c}{0.1}\flo@feribbon{33}{0.012}\flo@fewb
  % scales on the stipe, brown, on a scaly fern
  \ifnum\flo@get{hairy}=1
    \flo@spk={}%
    \flo@loop{fesc}\flo@kb{2}{32}{%
      \flo@calc\flo@t{\flo@feo*(\the\flo@kb-1)/32<0.9*\flo@fest && mod(\the\flo@kb,2)==0 ? 1 : 0}%
      \ifdim\flo@t pt>0.5pt
        \edef\flo@fia{\the\numexpr\flo@kb+1\relax}%
        \flo@calc\flo@da{\flo@fex@\flo@fia-(\flo@fex@{\the\flo@kb})}\flo@calc\flo@db{\flo@fey@\flo@fia-(\flo@fey@{\the\flo@kb})}%
        \flo@nrm\flo@da\flo@db\flo@nax\flo@nay
        \flo@calc\flo@t{mod(\the\flo@kb,4)==0 ? 1 : -1}\flo@range\flo@ts{0.012}{0.02}%
        \flo@calc\flo@xa{\flo@fex@{\the\flo@kb}+\flo@t*\flo@nax*0.005}\flo@calc\flo@ya{\flo@fey@{\the\flo@kb}+\flo@t*\flo@nay*0.005}%
        \flo@calc\flo@xb{\flo@xa+\flo@t*\flo@nax*\flo@ts+\flo@da*12*\flo@ts}\flo@calc\flo@yb{\flo@ya+\flo@t*\flo@nay*\flo@ts+\flo@db*12*\flo@ts}%
        \edef\flo@tmp{\noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@xa}{\flo@ya}}\noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xb}{\flo@yb}}}%
        \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}%
      \fi}%
    \flo@vaccent{flo@c}{-0.3}\flo@vstroke{flo@c}{0.35}{0.85}{0}{\the\flo@spk}%
  \fi
  % the crozier: a coil thick with the pinnae rolled in it, scalloped along its outside,
  % a pale line along it
  \ifdim\flo@feun pt<1pt
    \flo@loop{fecc}\flo@kb{1}{25}{\flo@put{\the\flo@kb}{\flo@fex@{\the\numexpr\flo@kb+32\relax}}{\flo@fey@{\the\numexpr\flo@kb+32\relax}}}%
    \flo@normals{25}\flo@spk={}%
    \flo@loop{fecb}\flo@kb{2}{24}{%
      \flo@calc\flo@r{\flo@fecr*pow(0.25,(\the\flo@kb-1)/24)}%
      \flo@calc\flo@xa{\flo@x{\the\flo@kb}-\flo@fesg*\csname flo@NX\the\flo@kb\endcsname*0.33*\flo@r}%
      \flo@calc\flo@ya{\flo@y{\the\flo@kb}-\flo@fesg*\csname flo@NY\the\flo@kb\endcsname*0.33*\flo@r}%
      \flo@calc\flo@t{(\ifodd\flo@kb 0.15\else 0.21\fi)*\flo@r}%
      \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xa}{\flo@ya}}{\flo@t pt}}%
      \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
    \flo@calc\flo@fewa{0.56*\flo@fecr}\flo@calc\flo@fewb{0.16*\flo@fecr}%
    \flo@vtone{flo@c}{0.27}\flo@feribbon{25}\flo@fewa\flo@fewb
    \flo@vtone{flo@c}{0.2}\flo@vfill{flo@c}{1}{0}{\the\flo@spk}%
    \flo@vtone{flo@c}{0.06}\flo@vstroke{flo@c}{0.25}{0.35}{1}{\the\flo@spk}%
    \flo@loop{fecd}\flo@kb{1}{22}{\flo@put{\the\flo@kb}{\flo@fex@{\the\numexpr\flo@kb+32\relax}}{\flo@fey@{\the\numexpr\flo@kb+32\relax}}}%
    \flo@calc\flo@fewa{0.14*\flo@fecr}\flo@vstreak{22}\flo@fewa{0.002}{white}{0.5}%
  \fi}
% a filled ribbon along points 1..#1 of flo@X/Y, widths #2 to #3 in the drawing's units
% (read at each point: not \flo@t, which \flo@normals takes), in the color flo@c
% (\flo@vstem's ribbon)
\def\flo@feribbon#1#2#3{%
  \edef\flo@sn{\the\numexpr#1\relax}\flo@normals\flo@sn
  \def\flo@acc{0}\expandafter\def\csname flo@S1\endcsname{0}%
  \flo@loop{fera}\flo@kb{2}{\flo@sn}{%
    \edef\flo@ia{\the\numexpr\flo@kb-1\relax}%
    \flo@calc\flo@acc{\flo@acc+veclen(\flo@x{\the\flo@kb}-(\flo@x\flo@ia),\flo@y{\the\flo@kb}-(\flo@y\flo@ia))}%
    \expandafter\let\csname flo@S\the\flo@kb\endcsname\flo@acc}%
  \flo@loop{ferr}\flo@kb{1}{\flo@sn}{%
    \flo@calc\flo@w{((#2)+((#3)-(#2))*\csname flo@S\the\flo@kb\endcsname/\flo@acc)/2}%
    \flo@calc\flo@xl{\flo@x{\the\flo@kb}+\csname flo@NX\the\flo@kb\endcsname*\flo@w}%
    \flo@calc\flo@yl{\flo@y{\the\flo@kb}+\csname flo@NY\the\flo@kb\endcsname*\flo@w}%
    \flo@calc\flo@xr{\flo@x{\the\flo@kb}-\csname flo@NX\the\flo@kb\endcsname*\flo@w}%
    \flo@calc\flo@yr{\flo@y{\the\flo@kb}-\csname flo@NY\the\flo@kb\endcsname*\flo@w}%
    \expandafter\let\csname flo@RX\the\flo@kb\endcsname\flo@xl\expandafter\let\csname flo@RY\the\flo@kb\endcsname\flo@yl
    \expandafter\let\csname flo@QX\the\flo@kb\endcsname\flo@xr\expandafter\let\csname flo@QY\the\flo@kb\endcsname\flo@yr}%
  \flo@loop{fero}\flo@kb{1}{\flo@sn}{%
    \flo@put{\the\flo@kb}{\csname flo@RX\the\flo@kb\endcsname}{\csname flo@RY\the\flo@kb\endcsname}%
    \flo@put{\the\numexpr2*\flo@sn+1-\flo@kb\relax}{\csname flo@QX\the\flo@kb\endcsname}{\csname flo@QY\the\flo@kb\endcsname}}%
  \flo@smoothprep{\the\numexpr2*\flo@sn\relax}\flo@vfill{flo@c}{1}{0}{\flo@smoothpath}}
% a pinna (or pinnule, or a frond's tip) along +y, length 1, \flo@feW its half-width, curving
% toward the frond's tip (+x); \flo@fepcm its length in cm. Its sides close by the species'
% tip, narrow toward it if lanceolate, and on a pinna 6 mm long or more go in and out by
% the species' edge (2 points a tooth, a tooth's crest set forward if serrate). Then the
% darker half away from the tip, the white midrib, and the sori on an underside
\def\flo@fepinna{%
  \flo@range\flo@fefb{0.05}{0.16}\flo@sym\flo@t{0.03}\flo@calc\flo@fet{\flo@fetone+\flo@t}%
  \def\flo@fenp{10}\def\flo@fetk{0}%
  \ifdim\flo@fepcm pt<0.3pt \def\flo@fenp{6}\fi
  \ifdim\flo@fepcm pt>0.6pt \ifdim\flo@fetd pt>0pt
    \edef\flo@fetk{\flo@fetd}\flo@calc\flo@fenp{2*int(min(9,3+4*\flo@fepcm))}\pgfmathtruncatemacro\flo@fenp{\flo@fenp}\fi\fi
  \def\flo@fecs{0}\def\flo@tmp{serrate}\edef\flo@t{\flo@get{leafmargin}}%
  \ifdim\flo@fetk pt>0pt \ifx\flo@t\flo@tmp\flo@calc\flo@fecs{0.35/\flo@fenp}\fi\fi
  \flo@loop{fpsp}\flo@kb{0}{\flo@fenp}{%
    \flo@calc\flo@v{\the\flo@kb/\flo@fenp}%
    \ifodd\flo@kb\ifnum\flo@kb<\flo@fenp \flo@calc\flo@v{\flo@v+\flo@fecs}\fi\fi
    \flo@calc\flo@sx{\flo@fefb*\flo@v*\flo@v}\flo@put{\the\numexpr\flo@kb+1\relax}{\flo@sx}{\flo@v}}%
  \flo@normals{\the\numexpr\flo@fenp+1\relax}%
  \flo@loop{fpsw}\flo@kb{0}{\flo@fenp}{%
    \edef\flo@q{\the\numexpr\flo@kb+1\relax}\edef\flo@v{\flo@y\flo@q}%
    \ifdim\flo@v pt>0pt \ifdim\flo@v pt<1pt
      \flo@calc\flo@w{\flo@feW*pow(min(1,\flo@v/0.12),0.45)*pow(max(0.0001,1-pow(\flo@v,\flo@fekp)),\flo@fekq)*(1-\flo@fenar*\flo@v)}%
      \ifodd\flo@kb\else\flo@calc\flo@w{\flo@w*(1-\flo@fetk)}\fi
    \else\def\flo@w{0}\fi\else\def\flo@w{0}\fi
    \flo@calc\flo@xl{\flo@x\flo@q+\csname flo@NX\flo@q\endcsname*\flo@w}\flo@calc\flo@yl{\flo@y\flo@q+\csname flo@NY\flo@q\endcsname*\flo@w}%
    \flo@calc\flo@xr{\flo@x\flo@q-\csname flo@NX\flo@q\endcsname*\flo@w}\flo@calc\flo@yr{\flo@y\flo@q-\csname flo@NY\flo@q\endcsname*\flo@w}%
    \expandafter\let\csname flo@RX\flo@q\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@q\endcsname\flo@yl
    \expandafter\let\csname flo@QX\flo@q\endcsname\flo@xr\expandafter\let\csname flo@QY\flo@q\endcsname\flo@yr}%
  \flo@bladeassemble\flo@fenp\flo@smoothprep{\the\numexpr2*\flo@fenp\relax}\flo@keep{fep}%
  \flo@vtone{flo@c}{\flo@fet}\flo@vfill{flo@c}{1}{0}{\flo@kept{fep}}%
  \ifdim\flo@fepcm pt>0.2pt \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{0.28}{1}{\flo@fehalf{fep}\flo@fenp}\fi
  \ifdim\flo@fepcm pt>0.35pt
    \def\flo@twa{0.03}\def\flo@twb{0.004}%
    \flo@calc\flo@xb{\flo@fefb*0.82*0.82/3}\flo@calc\flo@xc{\flo@fefb*0.82*0.82}%
    \flo@vfill{white}{0.6}{0}{\flo@vtaper{0}{0}{0}{0.2733}\flo@xb{0.5467}\flo@xc{0.82}}%
  \fi
  \ifnum\flo@feund=1 \ifdim\flo@fepcm pt>0.35pt \flo@fesori{fep}\fi\fi}
% the half of kept shape #1 (#2 points a side) on its left, from its base to its tip, then
% back down the midrib (\flo@fefb's parabola)
\def\flo@fehalf#1#2{%
  \edef\flo@kn{\csname flo@#1@N\endcsname}\edef\flo@fehn{#2}%
  \pgfpathmoveto{\flo@P{\csname flo@#1@X1\endcsname}{\csname flo@#1@Y1\endcsname}}%
  \flo@loop{feh}\flo@i{1}{\flo@fehn}{%
    \edef\flo@ib{\the\numexpr\flo@i+1\relax}%
    \pgfpathcurveto{\flo@P{\csname flo@#1@A\the\flo@i\endcsname}{\csname flo@#1@B\the\flo@i\endcsname}}%
      {\flo@P{\csname flo@#1@C\the\flo@i\endcsname}{\csname flo@#1@D\the\flo@i\endcsname}}%
      {\flo@P{\csname flo@#1@X\flo@ib\endcsname}{\csname flo@#1@Y\flo@ib\endcsname}}}%
  \flo@loop{fehm}\flo@i{1}{8}{\flo@calc\flo@v{1-\the\flo@i/8}\flo@calc\flo@sx{\flo@fefb*\flo@v*\flo@v}%
    \pgfpathlineto{\flo@P\flo@sx\flo@v}}%
  \pgfpathclose}
% the sori under kept shape #1 (a pinna): two rows of dots beside the midrib, lines slanting
% out from it, or a band along the edge; the accent, darkened
\def\flo@fesori#1{%
  \edef\flo@fesr{\flo@get{sori}}\flo@vaccent{flo@c}{-0.35}%
  \def\flo@tmp{marginal}\ifx\flo@fesr\flo@tmp
    \flo@calc\flo@t{min(0.5,0.3*\flo@fepcm)}\flo@vstroke{flo@c}{\flo@t}{0.75}{0}{\flo@kept{#1}}\fi
  \def\flo@tmp{dots}\ifx\flo@fesr\flo@tmp
    \flo@spk={}\flo@calc\flo@t{int(min(7,2+4*\flo@fepcm))}\pgfmathtruncatemacro\flo@fend{\flo@t}%
    \flo@loop{fesd}\flo@kb{1}{\flo@fend}{%
      \flo@calc\flo@v{0.14+0.66*(\the\flo@kb-1)/max(1,\flo@fend-1)}\flo@calc\flo@sx{\flo@fefb*\flo@v*\flo@v}%
      \flo@calc\flo@w{0.5*\flo@feW*(1-0.5*\flo@v)}\flo@calc\flo@t{0.3*\flo@feW*(1-0.4*\flo@v)}%
      \flo@calc\flo@xa{\flo@sx-\flo@w}\flo@calc\flo@xb{\flo@sx+\flo@w}%
      \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xa}{\flo@v}}{\flo@t pt}\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xb}{\flo@v}}{\flo@t pt}}%
      \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
    \flo@vfill{flo@c}{0.9}{0}{\the\flo@spk}%
  \fi
  \def\flo@tmp{lines}\ifx\flo@fesr\flo@tmp
    \flo@spk={}\flo@calc\flo@t{int(min(6,2+3*\flo@fepcm))}\pgfmathtruncatemacro\flo@fend{\flo@t}%
    \flo@loop{fesl}\flo@kb{1}{\flo@fend}{%
      \flo@calc\flo@v{0.12+0.62*(\the\flo@kb-1)/max(1,\flo@fend-1)}\flo@calc\flo@sx{\flo@fefb*\flo@v*\flo@v}%
      \flo@calc\flo@w{0.7*\flo@feW*(1-0.5*\flo@v)}%
      \flo@calc\flo@xa{\flo@sx-0.15*\flo@w}\flo@calc\flo@xb{\flo@sx-\flo@w}\flo@calc\flo@ya{\flo@v+0.6*\flo@w}%
      \flo@calc\flo@xc{\flo@sx+0.15*\flo@w}\flo@calc\flo@xd{\flo@sx+\flo@w}%
      \edef\flo@tmp{\noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@xa}{\flo@v}}\noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xb}{\flo@ya}}%
        \noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@xc}{\flo@v}}\noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xd}{\flo@ya}}}%
      \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
    \flo@vstroke{flo@c}{0.45}{0.85}{0}{\the\flo@spk}%
  \fi}
% a pinna cut into pinnules (twice divided): a comb along +y, length 1, \flo@feW the longest
% pinnule, \flo@fecn pinnules a side, each set forward and shorter toward the pinna's tip,
% joined by a narrow wing; three times divided, each pinnule's sides go in once (lobed).
% The darker half, the midrib, the sori as for a pinna
\def\flo@fecomb{%
  \flo@range\flo@fefb{0.04}{0.12}\flo@sym\flo@t{0.03}\flo@calc\flo@fet{\flo@fetone+\flo@t}%
  \flo@calc\flo@t{int(max(3,min(9,\flo@fepcm/0.15)))}\pgfmathtruncatemacro\flo@fecn{\flo@t}%
  \flo@calc\flo@fecd{0.9/\flo@fecn}\flo@calc\flo@fecs{0.35*\flo@fecd}%
  % one side's points into flo@RX/RY (x < 0, base to tip), the other mirrored
  \def\flo@fecp{1}\expandafter\def\csname flo@RX1\endcsname{0}\expandafter\def\csname flo@RY1\endcsname{0}%
  \flo@loop{fecm}\flo@kb{1}{\flo@fecn}{%
    \flo@calc\flo@v{0.05+\flo@fecd*(\the\flo@kb-0.5)}\flo@range\flo@t{0.9}{1.06}%
    \flo@calc\flo@fecl{\flo@feW*(1-0.72*pow(\flo@v,1.5))*\flo@t}%
    \ifnum\flo@fediv>2
      \flo@fecpt{0.12*\flo@feW}{\flo@v-0.5*\flo@fecd}\flo@fecpt{0.5*\flo@fecl}{\flo@v-0.4*\flo@fecd+0.3*\flo@fecs}%
      \flo@fecpt{0.62*\flo@fecl}{\flo@v-0.2*\flo@fecd+0.55*\flo@fecs}\flo@fecpt{\flo@fecl}{\flo@v+\flo@fecs}%
      \flo@fecpt{0.66*\flo@fecl}{\flo@v+0.24*\flo@fecd+0.7*\flo@fecs}\flo@fecpt{0.52*\flo@fecl}{\flo@v+0.38*\flo@fecd+0.5*\flo@fecs}%
    \else
      \flo@fecpt{0.12*\flo@feW}{\flo@v-0.5*\flo@fecd}\flo@fecpt{0.58*\flo@fecl}{\flo@v-0.36*\flo@fecd+0.5*\flo@fecs}%
      \flo@fecpt{\flo@fecl}{\flo@v+\flo@fecs}\flo@fecpt{0.62*\flo@fecl}{\flo@v+0.36*\flo@fecd+0.6*\flo@fecs}%
    \fi}%
  % the tip, then the other side back down
  \edef\flo@fech{\flo@fecp}\edef\flo@fecp{\the\numexpr\flo@fecp+1\relax}%
  \expandafter\edef\csname flo@RX\flo@fecp\endcsname{\flo@fefb}\expandafter\def\csname flo@RY\flo@fecp\endcsname{1}%
  \flo@loop{fecr}\flo@kb{2}{\flo@fech}{%
    \edef\flo@q{\the\numexpr\flo@fech+2-\flo@kb\relax}\edef\flo@ia{\the\numexpr\flo@fecp+\flo@kb-1\relax}%
    \flo@calc\flo@t{\csname flo@RY\flo@q\endcsname}\flo@calc\flo@xl{2*\flo@fefb*\flo@t*\flo@t-(\csname flo@RX\flo@q\endcsname)}%
    \expandafter\let\csname flo@RX\flo@ia\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@ia\endcsname\flo@t}%
  \edef\flo@fecp{\the\numexpr2*\flo@fech\relax}%
  \flo@loop{fecx}\flo@kb{1}{\flo@fecp}{\flo@put{\the\flo@kb}{\csname flo@RX\the\flo@kb\endcsname}{\csname flo@RY\the\flo@kb\endcsname}}%
  \flo@smoothprep\flo@fecp\flo@keep{fec}%
  \flo@vtone{flo@c}{\flo@fet}\flo@vfill{flo@c}{1}{0}{\flo@kept{fec}}%
  \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{0.28}{1}{\flo@fehalf{fec}\flo@fech}%
  \def\flo@twa{0.025}\def\flo@twb{0.004}%
  \flo@calc\flo@xb{\flo@fefb*0.9*0.9/3}\flo@calc\flo@xc{\flo@fefb*0.9*0.9}%
  \flo@vfill{white}{0.55}{0}{\flo@vtaper{0}{0}{0}{0.3}\flo@xb{0.6}\flo@xc{0.9}}%
  \ifnum\flo@feund=1 \flo@fesorc\fi}
% a comb's point at #1 out from the midrib (to the left), #2 along it
\def\flo@fecpt#1#2{%
  \edef\flo@fecp{\the\numexpr\flo@fecp+1\relax}\flo@calc\flo@t{#2}%
  \flo@calc\flo@xl{\flo@fefb*\flo@t*\flo@t-(#1)}%
  \expandafter\let\csname flo@RX\flo@fecp\endcsname\flo@xl\expandafter\let\csname flo@RY\flo@fecp\endcsname\flo@t}
% the sori of a comb: a dot in each pinnule, a line along it, or a band along the edge
\def\flo@fesorc{%
  \edef\flo@fesr{\flo@get{sori}}\flo@vaccent{flo@c}{-0.35}%
  \def\flo@tmp{marginal}\ifx\flo@fesr\flo@tmp
    \flo@calc\flo@t{min(0.4,0.22*\flo@fepcm)}\flo@vstroke{flo@c}{\flo@t}{0.75}{0}{\flo@kept{fec}}\else
    \flo@spk={}%
    \flo@loop{fesq}\flo@kb{1}{\flo@fecn}{%
      \flo@calc\flo@v{0.05+\flo@fecd*(\the\flo@kb-0.5)}\flo@calc\flo@fecl{\flo@feW*(1-0.72*pow(\flo@v,1.5))}%
      \flo@calc\flo@ya{\flo@v+0.35*\flo@fecs}\flo@calc\flo@sx{\flo@fefb*\flo@ya*\flo@ya}%
      \flo@calc\flo@xa{\flo@sx-0.45*\flo@fecl}\flo@calc\flo@xb{\flo@sx+0.45*\flo@fecl}%
      \def\flo@tmp{dots}\ifx\flo@fesr\flo@tmp
        \flo@calc\flo@t{0.16*min(\flo@fecd,\flo@fecl)}%
        \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xa}{\flo@ya}}{\flo@t pt}\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@xb}{\flo@ya}}{\flo@t pt}}%
      \else
        \flo@calc\flo@xc{\flo@sx-0.7*\flo@fecl}\flo@calc\flo@xd{\flo@sx+0.7*\flo@fecl}\flo@calc\flo@yb{\flo@ya+0.6*\flo@fecs}%
        \edef\flo@tmp{\noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@xa}{\flo@ya}}\noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xc}{\flo@yb}}%
          \noexpand\pgfpathmoveto{\noexpand\flo@P{\flo@xb}{\flo@ya}}\noexpand\pgfpathlineto{\noexpand\flo@P{\flo@xd}{\flo@yb}}}%
      \fi
      \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
    \def\flo@tmp{dots}\ifx\flo@fesr\flo@tmp\flo@vfill{flo@c}{0.9}{0}{\the\flo@spk}\else
    \def\flo@tmp{lines}\ifx\flo@fesr\flo@tmp\flo@vstroke{flo@c}{0.45}{0.85}{0}{\the\flo@spk}\fi\fi
  \fi}
% a fertile pinna of a dimorphic fern: a row of beads (the pinna rolled round its sori)
% along +y, length 1, smaller toward its tip, on a thin midrib
\def\flo@febeads{%
  \flo@range\flo@fefb{0.02}{0.08}\flo@calc\flo@t{int(max(2,min(7,2+5*\flo@fepcm)))}\pgfmathtruncatemacro\flo@fend{\flo@t}%
  \flo@vtone{flo@c}{0.12}\flo@calc\flo@xb{\flo@fefb*0.9*0.9/3}\flo@calc\flo@xc{\flo@fefb*0.9*0.9}%
  \flo@vstroke{flo@c}{0.3}{0.8}{0}{\pgfpathmoveto{\flo@P00}\pgfpathcurveto{\flo@P0{0.3}}{\flo@P\flo@xb{0.6}}{\flo@P\flo@xc{0.9}}}%
  \flo@spk={}%
  \flo@loop{febd}\flo@kb{1}{\flo@fend}{%
    \flo@calc\flo@v{0.95*(\the\flo@kb-0.3)/\flo@fend}\flo@calc\flo@sx{\flo@fefb*\flo@v*\flo@v}%
    \flo@range\flo@t{0.85}{1.1}\flo@calc\flo@t{0.6/\flo@fend*(1-0.4*\flo@v)*\flo@t}%
    \edef\flo@tmp{\noexpand\pgfpathcircle{\noexpand\flo@P{\flo@sx}{\flo@v}}{\flo@t pt}}%
    \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@tmp}}%
  \flo@sym\flo@t{0.04}\flo@vtone{flo@c}{0.32+\flo@t}\flo@vfill{flo@c}{1}{0}{\the\flo@spk}%
  \flo@vtone{flo@c}{0.08}\flo@vstroke{flo@c}{0.25}{0.45}{1}{\the\flo@spk}}
% A fern's crown at the origin, in centimeters, \flo@gH the longest frond, in the season
% \flo@o@season: three to five fronds fanning out and arching away from the middle, the
% middle ones longest; in spring still unrolling from fiddleheads, each a little behind
% the season or ahead of it; two in five of the open ones turned to show the sori beneath;
% a dimorphic fern's fertile frond upright in the middle from midsummer. Each frond draws
% from its own stream (\flo@seedorgan)
\def\flo@ferncrown{%
  \pgfsetroundcap\pgfsetroundjoin\pgftransformscale{28.45276}%
  \pgfmathparse{\flo@o@season}\let\flo@season\pgfmathresult\flo@int\flo@fenf{3}{5}%
  \flo@loop{fecu}\flo@Ga{1}{\flo@fenf}{%
    \flo@calc\flo@f{(\the\flo@Ga-(\flo@fenf+1)/2)/((\flo@fenf-1)/2)}%
    \flo@sym\flo@t{8}\flo@calc\flo@fela{90-44*\flo@f+\flo@t}%
    \flo@range\flo@t{0.8}{1.2}\flo@calc\flo@feac{(\flo@f<0 ? 1 : -1)*(20+70*\flo@get{curl})*\flo@t*(0.4+0.6*abs(\flo@f))}%
    \flo@range\flo@t{0.85}{1}\flo@calc\flo@fell{\flo@gH*(1-0.22*abs(\flo@f))*\flo@t}%
    \flo@range\flo@t{0}{0.3}\flo@calc\flo@feuu{max(0,min(1,(\flo@season-0.1-\flo@get{phenology}-\flo@t)/0.4))}%
    \flo@chance{0.4}\ifflo@yes\def\flo@feuf{1}\else\def\flo@feuf{0}\fi
    \flo@rnd\flo@lc\flo@calc\flo@fexx{0.06*\flo@f}%
    \flo@seedorgan
    \flo@organ{%
      \edef\flo@feun{\flo@feuu}\edef\flo@fearch{\flo@feac}%
      \ifdim\flo@feun pt<0.97pt \def\flo@feund{0}\else\edef\flo@feund{\flo@feuf}\fi
      \pgftransformshift{\flo@P\flo@fexx{0}}\flo@calc\flo@t{\flo@fela-90}\pgftransformrotate{\flo@t}%
      \pgftransformscale{\flo@fell}\flo@autumnleaf
      \flo@calc\flo@oarg{\flo@fell*28.45276}\flo@frond\flo@oarg}}%
  \ifnum\flo@get{dimorphic}=1 \ifdim\flo@season pt>0.55pt
    \flo@sym\flo@t{6}\flo@calc\flo@fela{90+\flo@t}\flo@sym\flo@feac{12}%
    \flo@range\flo@t{0.55}{0.7}\flo@calc\flo@fell{\flo@gH*\flo@t}%
    \flo@seedorgan
    \flo@organ{%
      \def\flo@fefert{1}\edef\flo@fearch{\flo@feac}\def\flo@feun{1}%
      \flo@calc\flo@t{\flo@fela-90}\pgftransformrotate{\flo@t}\pgftransformscale{\flo@fell}%
      \flo@calc\flo@oarg{\flo@fell*28.45276}\flo@frond\flo@oarg}%
  \fi\fi}

% ================================================================ visitors
% A visitor is drawn as a plant is: the pic samples it (\florilegiumvisitor), then
% reseeds pgf's generator for the drawing (draw=, or the seed + 1).
%
% Butterflies and moths: florilegium-flora.lua's butterfly, shaped and painted by the
% genome. In units of half the wingspan, the thorax at the origin, the head toward +y; a
% side's wings are drawn to the right, the left side mirrored, so the pattern is the
% same on both and only the wash differs. The forewing's tip sets its outline (rounded,
% angular, falcate: hooked, pointed: a hawkmoth's narrow swept wing); a scalloped or
% toothed edge gets three points between each two along the outer margin, every other one
% drawn toward the root; a tail hangs from the hindwing, or two thread tails. Inside each
% wing, as flora paints one: the wash and mottle, then the groundplan's systems (the
% nymphalid groundplan of Schwanwitsch 1924 and Süffert 1927): a dark wash at the base, a
% central band or a row of spots with a discal spot on the cell, at the border a dark
% band, a row of spots or of eyespots with one to three rings (and an arc outside each),
% pale lunules along the edge; the pooled rim; white veins from the root and pale spots at
% the rim. Poses: open; a moth's flat or tent (its
% forewings swept back over the hindwings); closed (one side seen from the side, the
% underside paler, the legs gripping); hover (a hawkmoth's wings a blur).
\newcount\flo@Wa \newcount\flo@Wb \newcount\flo@Wc \newcount\flo@Wd
\def\flo@wgput#1#2#3#4{\expandafter\edef\csname flo@wg#1X#2\endcsname{#3}\expandafter\edef\csname flo@wg#1Y#2\endcsname{#4}}
\def\flo@wgx#1#2{\csname flo@wg#1X#2\endcsname}
\def\flo@wgy#1#2{\csname flo@wg#1Y#2\endcsname}
% the outlines (flora's), then the forewing's tip
\def\flo@wgshape{%
  \flo@wgput{fw}1{0.05}{0.1}\flo@wgput{fw}2{0.3}{0.45}\flo@wgput{fw}3{0.65}{0.68}%
  \flo@wgput{fw}4{0.92}{0.66}\flo@wgput{fw}5{1}{0.5}\flo@wgput{fw}6{0.88}{0.25}%
  \flo@wgput{fw}7{0.55}{0.05}\flo@wgput{fw}8{0.15}{-0.02}%
  \flo@wgput{hw}1{0.06}{-0.02}\flo@wgput{hw}2{0.45}{-0.02}\flo@wgput{hw}3{0.72}{-0.22}%
  \flo@wgput{hw}4{0.7}{-0.5}\flo@wgput{hw}5{0.5}{-0.72}\flo@wgput{hw}6{0.25}{-0.7}%
  \flo@wgput{hw}7{0.08}{-0.35}%
  \csname flo@wgap@\flo@xget{apex}\endcsname}
\def\flo@wgap@rounded{}
\def\flo@wgap@angular{\flo@wgput{fw}3{0.66}{0.7}\flo@wgput{fw}4{1}{0.72}\flo@wgput{fw}5{0.98}{0.52}}
\def\flo@wgap@falcate{\flo@wgput{fw}3{0.66}{0.72}\flo@wgput{fw}4{1.04}{0.78}\flo@wgput{fw}5{0.9}{0.55}}
\def\flo@wgap@pointed{%
  \flo@wgput{fw}1{0.05}{0.08}\flo@wgput{fw}2{0.35}{0.36}\flo@wgput{fw}3{0.72}{0.42}%
  \flo@wgput{fw}4{1}{0.38}\flo@wgput{fw}5{0.97}{0.28}\flo@wgput{fw}6{0.7}{0.16}%
  \flo@wgput{fw}7{0.38}{0.04}\flo@wgput{fw}8{0.12}{-0.02}%
  \flo@wgput{hw}2{0.4}{-0.02}\flo@wgput{hw}3{0.55}{-0.12}\flo@wgput{hw}4{0.52}{-0.28}%
  \flo@wgput{hw}5{0.38}{-0.38}\flo@wgput{hw}6{0.2}{-0.36}\flo@wgput{hw}7{0.07}{-0.2}}
% each point of wing #1 (#2 points) moved a little (flora: rng.sym(0.03) each way)
\def\flo@wgjit#1#2{\flo@loop{wgj#1}\flo@Wa{1}{#2}{%
  \flo@sym\flo@t{0.03}\flo@calc\flo@xa{\flo@wgx{#1}{\the\flo@Wa}+\flo@t}%
  \flo@sym\flo@t{0.03}\flo@calc\flo@ya{\flo@wgy{#1}{\the\flo@Wa}+\flo@t}%
  \flo@wgput{#1}{\the\flo@Wa}\flo@xa\flo@ya}}
% a tail strap after the hindwing's point 5: five points off it
\expandafter\def\csname flo@wgtx1\endcsname{-0.05}\expandafter\def\csname flo@wgty1\endcsname{-0.04}
\expandafter\def\csname flo@wgtx2\endcsname{-0.06}\expandafter\def\csname flo@wgty2\endcsname{-0.19}
\expandafter\def\csname flo@wgtx3\endcsname{-0.1}\expandafter\def\csname flo@wgty3\endcsname{-0.25}
\expandafter\def\csname flo@wgtx4\endcsname{-0.15}\expandafter\def\csname flo@wgty4\endcsname{-0.2}
\expandafter\def\csname flo@wgtx5\endcsname{-0.13}\expandafter\def\csname flo@wgty5\endcsname{-0.04}
\def\flo@wgtailpts{%
  \edef\flo@xb{\flo@wgx{hw}5}\edef\flo@yb{\flo@wgy{hw}5}%
  \flo@loop{wgtl}\flo@Wb{1}{5}{%
    \flo@calc\flo@xa{\flo@xb+\csname flo@wgtx\the\flo@Wb\endcsname}%
    \flo@calc\flo@ya{\flo@yb+\csname flo@wgty\the\flo@Wb\endcsname}%
    \advance\flo@Wc by1 \flo@put{\the\flo@Wc}\flo@xa\flo@ya}}
% the outline of wing #1 (#2 points; the edge from point #3 to #4) into flo@X/Y, prepared
\def\flo@wgoutline#1#2#3#4{%
  \flo@Wc=0
  \flo@loop{wgo#1}\flo@Wa{1}{#2}{%
    \advance\flo@Wc by1 \flo@put{\the\flo@Wc}{\flo@wgx{#1}{\the\flo@Wa}}{\flo@wgy{#1}{\the\flo@Wa}}%
    \ifnum\flo@wgtail=\flo@Wa\relax\flo@wgtailpts\fi
    \ifdim\flo@wgdep pt>0pt \ifnum\flo@Wa<#4 \ifnum\flo@Wa>\numexpr#3-1\relax
      \edef\flo@wgn{\the\numexpr\flo@Wa+1\relax}%
      \flo@loop{wgs#1}\flo@Wb{1}{3}{%
        \flo@calc\flo@t{\the\flo@Wb/4}%
        \flo@calc\flo@xa{\flo@wgx{#1}{\the\flo@Wa}+(\flo@wgx{#1}\flo@wgn-(\flo@wgx{#1}{\the\flo@Wa}))*\flo@t}%
        \flo@calc\flo@ya{\flo@wgy{#1}{\the\flo@Wa}+(\flo@wgy{#1}\flo@wgn-(\flo@wgy{#1}{\the\flo@Wa}))*\flo@t}%
        \ifodd\flo@Wb\flo@calc\flo@xa{\flo@xa*(1-\flo@wgdep)}\flo@calc\flo@ya{\flo@ya*(1-\flo@wgdep)}\fi
        \advance\flo@Wc by1 \flo@put{\the\flo@Wc}\flo@xa\flo@ya}%
    \fi\fi\fi}%
  \flo@smoothprep{\the\flo@Wc}}
% a point s (0..1) along wing #1's edge from point #2 to #3, #5 of the way out from the
% root: \flo@wx, \flo@wy
\def\flo@wgat#1#2#3#4#5{%
  \edef\flo@wm{\the\numexpr#3-#2\relax}%
  \flo@calc\flo@wq{(#4)*\flo@wm}\pgfmathtruncatemacro\flo@wk{min(\flo@wm-1,floor(\flo@wq))}%
  \flo@calc\flo@wf{\flo@wq-\flo@wk}%
  \edef\flo@wi{\the\numexpr#2+\flo@wk\relax}\edef\flo@wj{\the\numexpr#2+\flo@wk+1\relax}%
  \flo@calc\flo@wx{(\flo@wgx{#1}\flo@wi+(\flo@wgx{#1}\flo@wj-(\flo@wgx{#1}\flo@wi))*\flo@wf)*(#5)}%
  \flo@calc\flo@wy{(\flo@wgy{#1}\flo@wi+(\flo@wgy{#1}\flo@wj-(\flo@wgy{#1}\flo@wi))*\flo@wf)*(#5)}}
% an eyespot at (#1,#2), radius #3: dark, a pale ring, a copper ring or pupil, a dark
% pupil with a white glint, as many as its rings
\def\flo@wgeye#1#2#3{%
  \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{0.85}{0}{\pgfpathcircle{\flo@P{#1}{#2}}{#3pt}}%
  \ifnum\flo@xget{rings}>1 \flo@calc\flo@t{(#3)*0.68}\flo@vfill{white}{0.85}{0}{\pgfpathcircle{\flo@P{#1}{#2}}{\flo@t pt}}\fi
  \flo@calc\flo@t{(#3)*(\flo@xget{rings}>2 ? 0.46 : 0.34)}%
  \flo@vaccent{flo@c}{0}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P{#1}{#2}}{\flo@t pt}}%
  \ifnum\flo@xget{rings}>2
    \flo@calc\flo@t{(#3)*0.22}\flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P{#1}{#2}}{\flo@t pt}}%
    \flo@calc\flo@xa{#1+(#3)*0.1}\flo@calc\flo@ya{#2+(#3)*0.1}\flo@calc\flo@t{(#3)*0.08}%
    \flo@vfill{white}{0.9}{0}{\pgfpathcircle{\flo@P\flo@xa\flo@ya}{\flo@t pt}}%
  \fi
  % the parafocal arc, outside it, facing away from the root
  \ifnum\flo@xget{parafocal}=1
    \flo@calc\flo@wa{atan2(#2,#1)}\flo@calc\flo@wr{(#3)*1.5}%
    \flo@calc\flo@xa{#1+\flo@wr*cos(\flo@wa-55)}\flo@calc\flo@ya{#2+\flo@wr*sin(\flo@wa-55)}%
    \flo@calc\flo@xb{#1+\flo@wr*1.15*cos(\flo@wa-20)}\flo@calc\flo@yb{#2+\flo@wr*1.15*sin(\flo@wa-20)}%
    \flo@calc\flo@xc{#1+\flo@wr*1.15*cos(\flo@wa+20)}\flo@calc\flo@yc{#2+\flo@wr*1.15*sin(\flo@wa+20)}%
    \flo@calc\flo@xd{#1+\flo@wr*cos(\flo@wa+55)}\flo@calc\flo@yd{#2+\flo@wr*sin(\flo@wa+55)}%
    \flo@calc\flo@twa{(#3)*0.22}\flo@calc\flo@twb{(#3)*0.22}%
    \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{0.6}{1}{\flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}%
  \fi}
% the band, spots and wash anchors of each wing
\def\flo@wgbx@fw{0.12}\def\flo@wgby@fw{0.12}\def\flo@wgbx@hw{0.12}\def\flo@wgby@hw{-0.12}
\def\flo@wgry@fw{0.04}\def\flo@wgry@hw{-0.04}
\def\flo@wgcb@fw{\flo@calc\flo@xa{0.47+\flo@wgcj}\flo@calc\flo@xb{0.42+\flo@wgcj}%
  \flo@vtaper{0.5}{0.66}\flo@xa{0.45}\flo@xb{0.25}{0.36}{0.04}}
\def\flo@wgcb@hw{\flo@calc\flo@xa{0.37+\flo@wgcj}\flo@calc\flo@xb{0.28+\flo@wgcj}%
  \flo@vtaper{0.42}{-0.02}\flo@xa{-0.2}\flo@xb{-0.38}{0.14}{-0.55}}
\def\flo@wgcs@fw{\flo@calc\flo@xa{0.47+\flo@wgcj}\flo@calc\flo@xb{0.42+\flo@wgcj}%
  \def\flo@ya{0.45}\def\flo@yb{0.25}}
\def\flo@wgcs@hw{\flo@calc\flo@xa{0.37+\flo@wgcj}\flo@calc\flo@xb{0.28+\flo@wgcj}%
  \def\flo@ya{-0.2}\def\flo@yb{-0.38}}
\def\flo@wgds@fw{\flo@calc\flo@xa{0.47+\flo@wgcj*0.5}\def\flo@ya{0.42}}
\def\flo@wgds@hw{\flo@calc\flo@xa{0.34+\flo@wgcj*0.5}\def\flo@ya{-0.27}}
% paint wing #1 (#2 points, its edge from #3 to #4): the wash, then in its clip the
% mottle, the pattern, the pooled rim, veins and rim spots; a hindwing's thread tails
\def\flo@wgpaint#1#2#3#4{%
  \flo@vtone{flo@c}{\flo@wgt}\flo@vfill{flo@c}{\flo@wgop}{0}{\flo@kept{wg#1}}%
  \ifnum\flo@wgblur=0
  \begin{pgfscope}%
    \flo@kept{wg#1}\pgfusepath{clip}%
    \flo@calc\flo@ta{\flo@wgt-0.2}\flo@calc\flo@tb{\flo@wgt+0.2}%
    \ifnum\flo@fine=1 \flo@vmottle{-1.2}{-1.2}{1.2}{1.2}{9}{0.14}\flo@ta\flo@tb{8}%
    \else\flo@vmottle{-1.2}{-1.2}{1.2}{1.2}{4}{0.14}\flo@ta\flo@tb{0}\fi
    \ifnum\flo@xget{basal}=1
      \flo@vblob{\csname flo@wgbx@#1\endcsname}{\csname flo@wgby@#1\endcsname}{0.2}{0.15}{0.3}{9}%
      \flo@calc\flo@t{\flo@wgt-0.18}\flo@vtone{flo@c}\flo@t\flo@vfill{flo@c}{0.45}{1}{\flo@smoothpath}%
    \fi
    \edef\flo@wgsys{\flo@xget{central}}%
    \def\flo@tmp{band}\ifx\flo@wgsys\flo@tmp
      \edef\flo@twa{\flo@wgcw}\flo@calc\flo@twb{\flo@wgcw*0.8}%
      \flo@calc\flo@t{\flo@wgt-0.2}\flo@vtone{flo@c}\flo@t
      \flo@vfill{flo@c}{0.6}{1}{\csname flo@wgcb@#1\endcsname}%
    \fi
    \def\flo@tmp{spots}\ifx\flo@wgsys\flo@tmp
      \csname flo@wgcs@#1\endcsname
      \flo@calc\flo@xc{(\flo@xa+\flo@xb)/2}\flo@calc\flo@yc{(\flo@ya+\flo@yb)/2}%
      \flo@calc\flo@t{\flo@wgt-0.22}\flo@vtone{flo@c}\flo@t
      \flo@vfill{flo@c}{0.65}{1}{\pgfpathcircle{\flo@P\flo@xa\flo@ya}{0.045pt}%
        \pgfpathcircle{\flo@P\flo@xb\flo@yb}{0.045pt}\pgfpathcircle{\flo@P\flo@xc\flo@yc}{0.04pt}}%
    \fi
    \ifnum\flo@xget{discal}=1
      \csname flo@wgds@#1\endcsname
      \flo@calc\flo@t{\flo@wgt-0.25}\flo@vtone{flo@c}\flo@t
      \flo@vfill{flo@c}{0.75}{1}{\pgfpathellipse{\flo@P\flo@xa\flo@ya}{\flo@P{0.03}0}{\flo@P0{0.045}}}%
    \fi
    \edef\flo@wgsys{\flo@xget{border}}%
    \def\flo@tmp{band}\ifx\flo@wgsys\flo@tmp
      \flo@calc\flo@t{6.8*\flo@wgu}\flo@calc\flo@ta{\flo@wgt-0.22}\flo@vtone{flo@c}\flo@ta
      \flo@vstroke{flo@c}{\flo@t}{0.55}{1}{\flo@kept{wg#1}}%
    \fi
    % the pooled rim (flora: tone 0.05, 0.26 of a unit wide, multiplied)
    \flo@vtone{flo@c}{0.05}\flo@calc\flo@t{7.37*\flo@wgu}\flo@vstroke{flo@c}{\flo@t}{0.55}{1}{\flo@kept{wg#1}}%
    \def\flo@tmp{spots}\ifx\flo@wgsys\flo@tmp
      \flo@vtone{flo@c}{0.06}%
      \flo@loop{wgsp#1}\flo@Wb{1}{\flo@xget{eyes}}{%
        \flo@calc\flo@t{(\the\flo@Wb-0.5)/\flo@xget{eyes}}\flo@wgat{#1}{#3}{#4}\flo@t{0.86}%
        \flo@vfill{flo@c}{0.8}{0}{\pgfpathcircle{\flo@P\flo@wx\flo@wy}{\csname flo@wgsr@#1\endcsname pt}}}%
    \fi
    \def\flo@tmp{eyes}\ifx\flo@wgsys\flo@tmp
      \flo@loop{wgey#1}\flo@Wb{1}{\csname flo@wgne@#1\endcsname}{%
        \flo@calc\flo@t{\csname flo@wges@#1\endcsname+(\the\flo@Wb-1)*\csname flo@wged@#1\endcsname}%
        \flo@wgat{#1}{#3}{#4}\flo@t{0.78}%
        \flo@wgeye\flo@wx\flo@wy{\csname flo@wger@#1\endcsname}}%
    \fi
    % lunules: rows of pale crescents along the edge
    \ifnum\flo@xget{lunules}>0
      \edef\flo@wgnc{\the\numexpr2*(#4-#3)\relax}%
      \flo@loop{wglr#1}\flo@Wc{1}{\flo@xget{lunules}}{%
        \flo@calc\flo@wgf{0.95-0.07*(\the\flo@Wc-1)}%
        \flo@loop{wglu#1}\flo@Wb{1}{\flo@wgnc}{%
          \flo@calc\flo@t{(\the\flo@Wb-0.85)/\flo@wgnc}\flo@wgat{#1}{#3}{#4}\flo@t\flo@wgf
          \let\flo@xc\flo@wx\let\flo@yc\flo@wy
          \flo@calc\flo@t{(\the\flo@Wb-0.15)/\flo@wgnc}\flo@wgat{#1}{#3}{#4}\flo@t\flo@wgf
          \flo@calc\flo@xa{\flo@xc+(\flo@wx-\flo@xc)/3}\flo@calc\flo@ya{\flo@yc+(\flo@wy-\flo@yc)/3}%
          \flo@calc\flo@xb{\flo@xc+(\flo@wx-\flo@xc)*2/3}\flo@calc\flo@yb{\flo@yc+(\flo@wy-\flo@yc)*2/3}%
          \flo@calc\flo@xa{\flo@xa*0.96}\flo@calc\flo@ya{\flo@ya*0.96}\flo@calc\flo@xb{\flo@xb*0.96}\flo@calc\flo@yb{\flo@yb*0.96}%
          \def\flo@twa{0.03}\def\flo@twb{0.008}%
          \flo@vfill{white}{0.55}{0}{\flo@vtaper\flo@xc\flo@yc\flo@xa\flo@ya\flo@xb\flo@yb\flo@wx\flo@wy}}}%
    \fi
    % veins: white streaks fanning from the root to each point (flora), pale spots at the rim
    \ifnum\flo@xget{veins}=1
      \def\flo@wgrx{0.04}\edef\flo@wgry{\csname flo@wgry@#1\endcsname}%
      \flo@loop{wgvn#1}\flo@Wb{1}{#2}{%
        \flo@range\flo@f{0.7}{0.88}%
        \flo@calc\flo@xd{\flo@wgrx+(\flo@wgx{#1}{\the\flo@Wb}-\flo@wgrx)*\flo@f}%
        \flo@calc\flo@yd{\flo@wgry+(\flo@wgy{#1}{\the\flo@Wb}-(\flo@wgry))*\flo@f}%
        \flo@put1\flo@wgrx\flo@wgry
        \flo@calc\flo@xa{\flo@wgrx+(\flo@xd-\flo@wgrx)*0.3}\flo@calc\flo@ya{\flo@wgry+(\flo@yd-(\flo@wgry))*0.4}\flo@put2\flo@xa\flo@ya
        \flo@calc\flo@xa{\flo@wgrx+(\flo@xd-\flo@wgrx)*0.7}\flo@calc\flo@ya{\flo@wgry+(\flo@yd-(\flo@wgry))*0.75}\flo@put3\flo@xa\flo@ya
        \flo@put4\flo@xd\flo@yd
        \flo@range\flo@op{0.35}{0.6}\flo@vstreak{4}{0.035}{0.004}{white}\flo@op
        \def\flo@tmp{none}\ifx\flo@wgsys\flo@tmp\ifnum\flo@fine=1 \ifnum\flo@Wb>1 \ifnum\flo@Wb<#2
          \flo@calc\flo@xa{\flo@wgrx+(\flo@wgx{#1}{\the\flo@Wb}-\flo@wgrx)*0.9}%
          \flo@calc\flo@ya{\flo@wgry+(\flo@wgy{#1}{\the\flo@Wb}-(\flo@wgry))*0.9}%
          \flo@range\flo@t{0.025}{0.04}\flo@vfill{white}{0.8}{0}{\pgfpathcircle{\flo@P\flo@xa\flo@ya}{\flo@t pt}}%
        \fi\fi\fi\fi}%
    \fi
  \end{pgfscope}%
  % thread tails off the hindwing
  \ifnum\flo@xget{tails}=2 \def\flo@tmp{#1}\def\flo@tmpb{hw}\ifx\flo@tmp\flo@tmpb
    \edef\flo@xb{\flo@wgx{hw}5}\edef\flo@yb{\flo@wgy{hw}5}%
    \def\flo@twa{0.022}\def\flo@twb{0.006}\flo@vtone{flo@c}{0.08}%
    \flo@vfill{flo@c}{0.9}{0}{%
      \flo@calc\flo@xa{\flo@xb-0.05}\flo@calc\flo@ya{\flo@yb-0.02}\flo@calc\flo@xd{\flo@xb-0.02}\flo@calc\flo@yd{\flo@yb-0.26}%
      \flo@calc\flo@xc{\flo@xb-0.04}\flo@calc\flo@yc{\flo@yb-0.1}\flo@calc\flo@xe{\flo@xb-0.025}\flo@calc\flo@ye{\flo@yb-0.18}%
      \flo@vtaper\flo@xa\flo@ya\flo@xc\flo@yc\flo@xe\flo@ye\flo@xd\flo@yd
      \flo@calc\flo@xa{\flo@xb-0.14}\flo@calc\flo@xd{\flo@xb-0.13}\flo@calc\flo@yd{\flo@yb-0.2}%
      \flo@calc\flo@xc{\flo@xb-0.14}\flo@calc\flo@yc{\flo@yb-0.08}\flo@calc\flo@xe{\flo@xb-0.135}\flo@calc\flo@ye{\flo@yb-0.14}%
      \flo@vtaper\flo@xa\flo@yb\flo@xc\flo@yc\flo@xe\flo@ye\flo@xd\flo@yd}%
  \fi\fi
  \fi}
% the body: abdomen (a blade, flora's), banded on a hawkmoth; thorax, hairy on a moth;
% head; feelers clubbed, threadlike or feathery; legs in profile
\def\flo@wgbody{%
  \flo@loop{wgab}\flo@Wb{0}{10}{%
    \flo@calc\flo@v{\the\flo@Wb/10}\flo@calc\flo@h{\flo@wgaw*sin(180*pow(\flo@v,0.7))}%
    \flo@calc\flo@ya{-\flo@wgal+\flo@wgal*\flo@v}\flo@calc\flo@xa{-\flo@h}%
    \flo@put{\the\numexpr\flo@Wb+1\relax}\flo@xa\flo@ya
    \ifnum\flo@Wb>0 \ifnum\flo@Wb<10 \flo@put{\the\numexpr21-\flo@Wb\relax}\flo@h\flo@ya\fi\fi}%
  \flo@smoothprep{20}\flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{1}{0}{\flo@smoothpath}%
  \ifnum\flo@xget{bands}>0
    \def\flo@twa{0.03}\def\flo@twb{0.03}%
    \flo@loop{wgbd}\flo@Wb{1}{\flo@xget{bands}}{%
      \flo@calc\flo@ya{-\flo@wgal*\the\flo@Wb/(\flo@xget{bands}+1)}\flo@calc\flo@xa{\flo@wgaw*0.9}\flo@calc\flo@xb{-\flo@wgaw*0.9}%
      \flo@calc\flo@xc{\flo@wgaw*0.3}\flo@calc\flo@xd{-\flo@wgaw*0.3}%
      \flo@vfill{white}{0.45}{0}{\flo@vtaper\flo@xb\flo@ya\flo@xd\flo@ya\flo@xc\flo@ya\flo@xa\flo@ya}}%
  \fi
  \flo@vtone{flo@c}{0.04}\flo@vfill{flo@c}{1}{0}{\pgfpathellipse{\flo@P0{0.08}}{\flo@P\flo@wgtw0}{\flo@P0{0.13}}}%
  \ifdim\flo@xget{hair}pt>0pt
    \pgfmathtruncatemacro\flo@wgnh{4+12*\flo@xget{hair}}\flo@vtone{flo@c}{0.12}%
    \def\flo@twa{0.022}\def\flo@twb{0.003}%
    \flo@loop{wghr}\flo@Wb{1}{\flo@wgnh}{%
      \flo@range\flo@wa{0}{360}\flo@range\flo@t{0.03}{0.06}%
      \flo@calc\flo@xa{\flo@wgtw*cos(\flo@wa)}\flo@calc\flo@ya{0.08+0.13*sin(\flo@wa)}%
      \flo@calc\flo@xd{(\flo@wgtw+\flo@t)*cos(\flo@wa)}\flo@calc\flo@yd{0.08+(0.13+\flo@t)*sin(\flo@wa)}%
      \flo@calc\flo@xb{\flo@xa+(\flo@xd-\flo@xa)/3}\flo@calc\flo@yb{\flo@ya+(\flo@yd-\flo@ya)/3}%
      \flo@calc\flo@xc{\flo@xa+(\flo@xd-\flo@xa)*2/3}\flo@calc\flo@yc{\flo@ya+(\flo@yd-\flo@ya)*2/3}%
      \flo@vfill{flo@c}{0.7}{0}{\flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}}%
  \fi
  \flo@vtone{flo@c}{0.04}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P0{0.27}}{\flo@wghr pt}}%
  % feelers: from the head, a cubic out to (\flo@ex,\flo@ey)
  \flo@calc\flo@wgw{max(0.3,0.5*\flo@wgu)}%
  \flo@loop{wgan}\flo@Wb{1}{2}{%
    \ifnum\flo@wgsides=1 \def\flo@sx{1}\else\ifnum\flo@Wb=1 \def\flo@sx{-1}\else\def\flo@sx{1}\fi\fi
    \edef\flo@t{\flo@xget{antenna}}%
    \def\flo@tmp{clubbed}\ifx\flo@t\flo@tmp\flo@range\flo@ex{0.22}{0.3}\flo@range\flo@ey{0.78}{0.9}\else
    \def\flo@tmp{feathery}\ifx\flo@t\flo@tmp\flo@range\flo@ex{0.24}{0.32}\flo@range\flo@ey{0.62}{0.72}\else
    \flo@range\flo@ex{0.26}{0.36}\flo@range\flo@ey{0.72}{0.88}\fi\fi% a thread, and any other kind's feeler
    \ifnum\flo@wgsides=1 \ifnum\flo@Wb=2 \flo@calc\flo@ex{\flo@ex*0.8}\flo@calc\flo@ey{\flo@ey*0.95}\fi\fi
    \flo@calc\flo@ex{\flo@sx*\flo@ex}\flo@calc\flo@xa{\flo@sx*0.02}\flo@calc\flo@xb{\flo@sx*0.05}%
    \flo@calc\flo@xc{\flo@ex*0.6}\flo@calc\flo@yc{\flo@ey*0.9}%
    \flo@vtone{flo@c}{0.08}%
    \flo@vstroke{flo@c}{\flo@wgw}{1}{0}{\pgfpathmoveto{\flo@P\flo@xa{0.31}}%
      \pgfpathcurveto{\flo@P\flo@xb{0.5}}{\flo@P\flo@xc\flo@yc}{\flo@P\flo@ex\flo@ey}}%
    \def\flo@tmp{clubbed}\ifx\flo@t\flo@tmp
      \flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P\flo@ex\flo@ey}{0.025pt}}\fi
    \def\flo@tmp{feathery}\ifx\flo@t\flo@tmp
      \flo@calc\flo@t{0.5*\flo@wgw}%
      \flo@vstroke{flo@c}{\flo@t}{1}{0}{%
        \flo@loop{wgbb}\flo@Wc{3}{9}{%
          \flo@calc\flo@v{\the\flo@Wc/10}\flo@calc\flo@wf{1-\flo@v}%
          \flo@calc\flo@wx{\flo@wf*\flo@wf*\flo@wf*\flo@xa+3*\flo@wf*\flo@wf*\flo@v*\flo@xb+3*\flo@wf*\flo@v*\flo@v*\flo@xc+\flo@v*\flo@v*\flo@v*\flo@ex}%
          \flo@calc\flo@wy{\flo@wf*\flo@wf*\flo@wf*0.31+3*\flo@wf*\flo@wf*\flo@v*0.5+3*\flo@wf*\flo@v*\flo@v*\flo@yc+\flo@v*\flo@v*\flo@v*\flo@ey}%
          \flo@calc\flo@da{3*\flo@wf*\flo@wf*(\flo@xb-\flo@xa)+6*\flo@wf*\flo@v*(\flo@xc-\flo@xb)+3*\flo@v*\flo@v*(\flo@ex-\flo@xc)}%
          \flo@calc\flo@db{3*\flo@wf*\flo@wf*0.19+6*\flo@wf*\flo@v*(\flo@yc-0.5)+3*\flo@v*\flo@v*(\flo@ey-\flo@yc)}%
          \flo@nrm\flo@da\flo@db\flo@nx\flo@ny\flo@calc\flo@wr{0.05*(1.1-\flo@v)}%
          \flo@calc\flo@xd{\flo@wx+\flo@nx*\flo@wr}\flo@calc\flo@yd{\flo@wy+\flo@ny*\flo@wr}%
          \flo@calc\flo@xe{\flo@wx-\flo@nx*\flo@wr}\flo@calc\flo@ye{\flo@wy-\flo@ny*\flo@wr}%
          \pgfpathmoveto{\flo@P\flo@xd\flo@yd}\pgfpathlineto{\flo@P\flo@xe\flo@ye}}}%
    \fi}%
  % legs, seen from the side
  \ifnum\flo@wgsides=1
    \flo@vtone{flo@c}{0.08}%
    \flo@vstroke{flo@c}{\flo@wgw}{1}{0}{%
      \flo@loop{wglg}\flo@Wb{0}{2}{%
        \flo@calc\flo@ya{0.16-0.08*\the\flo@Wb}\flo@calc\flo@yb{\flo@ya+0.03}\flo@calc\flo@yc{\flo@ya-0.12}%
        \pgfpathmoveto{\flo@P{-0.03}\flo@ya}\pgfpathlineto{\flo@P{-0.12}\flo@yb}\pgfpathlineto{\flo@P{-0.2}\flo@yc}}}%
  \fi
  \ifnum\flo@fine=1 \def\flo@tmp{butterfly}\ifx\flo@wgk\flo@tmp
    \flo@calc\flo@t{\flo@wgal/0.62}%
    \flo@calc\flo@ya{-0.55*\flo@t}\flo@put1{-0.015}\flo@ya\flo@calc\flo@ya{-0.35*\flo@t}\flo@put2{-0.02}\flo@ya
    \flo@calc\flo@ya{-0.1*\flo@t}\flo@put3{-0.02}\flo@ya\flo@put4{-0.01}{0}%
    \flo@vstreak{4}{0.015}{0.004}{white}{0.45}%
  \fi\fi}
% a wing of the side: rotated #2 degrees about its root, painted (#1, then the paint's arguments)
\def\flo@wgwing#1#2#3#4#5{\begin{pgfscope}%
  \pgftransformshift{\flo@P{0.04}{0}}\pgftransformrotate{#2}\pgftransformshift{\flo@P{-0.04}{0}}%
  \flo@wgpaint{#1}{#3}{#4}{#5}\end{pgfscope}}
% a butterfly or moth; #1 its wingspan on the page in pt
\def\flo@lepid#1{%
  \flo@calc\flo@wgu{(#1)/56.90552}%
  \ifdim\flo@wgu pt>0.3pt \def\flo@fine{1}\else\def\flo@fine{0}\fi
  \edef\flo@wgk{\flo@xget{kind}}\edef\flo@wgpose{\flo@xget{pose}}\edef\flo@wgground{\flo@xget{ground}}%
  % the wash: the ink's, paler, darker, or the copper's; the underside paler
  \edef\flo@wgt{\flo@xget{tone}}%
  \def\flo@tmp{pale}\ifx\flo@wgground\flo@tmp\flo@calc\flo@wgt{min(0.78,\flo@wgt+0.32)}\fi
  \def\flo@tmp{dark}\ifx\flo@wgground\flo@tmp\flo@calc\flo@wgt{\flo@wgt-0.12}\fi
  \def\flo@tmp{copper}\ifx\flo@wgground\flo@tmp\def\flo@rampname{flo@aramp}\fi
  \def\flo@wgsides{2}\def\flo@wgop{1}\def\flo@wgblur{0}\def\flo@wgxs{1}%
  \def\flo@wgrf{0}\def\flo@wgrh{0}\def\flo@wgpass{1}%
  \def\flo@tmp{closed}\ifx\flo@wgpose\flo@tmp\def\flo@wgsides{1}\def\flo@wgrf{18}\def\flo@wgrh{18}%
    \flo@calc\flo@wgt{min(0.8,\flo@wgt+0.12)}\fi
  \def\flo@tmp{flat}\ifx\flo@wgpose\flo@tmp\def\flo@wgrf{-18}\def\flo@wgrh{-10}\fi
  \def\flo@tmp{tent}\ifx\flo@wgpose\flo@tmp\def\flo@wgrf{-58}\def\flo@wgrh{-38}\def\flo@wgxs{0.8}\fi
  \def\flo@tmp{hover}\ifx\flo@wgpose\flo@tmp\def\flo@wgop{0.3}\def\flo@wgblur{1}\def\flo@wgpass{2}\fi
  % the body's proportions: a moth's stouter
  \def\flo@wgaw{0.05}\def\flo@wgal{0.62}\def\flo@wgtw{0.075}\def\flo@wghr{0.06}%
  \def\flo@tmp{moth}\ifx\flo@wgk\flo@tmp\def\flo@wgaw{0.075}\def\flo@wgtw{0.095}\def\flo@wghr{0.07}\fi
  \def\flo@tmp{hawkmoth}\ifx\flo@wgk\flo@tmp\def\flo@wgaw{0.075}\def\flo@wgal{0.85}\def\flo@wgtw{0.09}\def\flo@wghr{0.07}\fi
  \ifnum\flo@wgsides=1 \flo@calc\flo@wgaw{\flo@wgaw*0.8}\fi
  % the wings' outlines
  \flo@wgshape\flo@wgjit{fw}{8}\flo@wgjit{hw}{7}%
  \edef\flo@t{\flo@xget{wingedge}}\def\flo@wgdep{0}%
  \def\flo@tmp{scalloped}\ifx\flo@t\flo@tmp\def\flo@wgdep{0.045}\fi
  \def\flo@tmp{toothed}\ifx\flo@t\flo@tmp\def\flo@wgdep{0.09}\fi
  \def\flo@wgtail{0}\flo@wgoutline{fw}{8}{4}{6}\flo@keep{wgfw}%
  \ifnum\flo@xget{tails}=1 \def\flo@wgtail{5}\fi\flo@wgoutline{hw}{7}{3}{6}\flo@keep{wghw}%
  % the pattern's place: the central band's width and sway; eyespots, a row on the hindwing
  % and one at the forewing's tip
  \flo@range\flo@wgcw{0.07}{0.11}\flo@sym\flo@wgcj{0.04}%
  \edef\flo@wgne@hw{\flo@xget{eyes}}\def\flo@wgne@fw{0}\ifnum\flo@xget{eyes}>2 \def\flo@wgne@fw{1}\fi
  \ifnum\flo@wgne@hw>0 \flo@calc\flo@wger@hw{min(0.1,0.34/\flo@wgne@hw)}\flo@calc\flo@wges@hw{0.5/\flo@wgne@hw}%
    \flo@calc\flo@wged@hw{1/\flo@wgne@hw}\fi
  \def\flo@wger@fw{0.065}\def\flo@wges@fw{0.22}\def\flo@wged@fw{0}%
  \def\flo@wgsr@fw{0.03}\def\flo@wgsr@hw{0.034}%
  % closed, it stands: the body level, the head to the left, the wings raised
  \ifnum\flo@wgsides=1 \pgftransformrotate{90}\fi
  \flo@loop{wgsd}\flo@Wa{1}{\flo@wgsides}{%
    \begin{pgfscope}%
      \ifnum\flo@Wa=2 \pgftransformxscale{-1}\fi
      \ifdim\flo@wgxs pt<1pt \pgftransformxscale{\flo@wgxs}\fi
      \flo@loop{wgps}\flo@Wd{1}{\flo@wgpass}{%
        \ifnum\flo@wgpass=2 \ifnum\flo@Wd=1 \def\flo@wgrf{14}\def\flo@wgrh{14}\else\def\flo@wgrf{-14}\def\flo@wgrh{-14}\fi\fi
        \ifnum\flo@wgsides=1
          \flo@wgwing{fw}\flo@wgrf{8}{4}{6}\flo@wgwing{hw}\flo@wgrh{7}{3}{6}%
        \else
          \flo@wgwing{hw}\flo@wgrh{7}{3}{6}\flo@wgwing{fw}\flo@wgrf{8}{4}{6}%
        \fi}%
    \end{pgfscope}}%
  \flo@wgbody}
% ---------------------------------------------------------------- bees and hoverflies
% Bees and hoverflies: florilegium-flora.lua's bee, shaped and painted by the genome. In
% units of the body's length, seen from above, the head toward +y, the waist near the
% origin. A honeybee's abdomen is an egg in the wash with dark bands across it; a
% bumblebee is round and black with pale bands (as many as its bands: the collar, the
% second segment, the back of the thorax, the first segment), a pale tail and a fringe of
% hair all round that takes the color it grows from; a solitary bee is slim and dark with
% thin bands of pale hair; a hoverfly is flat and dark with pairs of pale marks split by a
% dark line down its back, a wide head that is nearly all eye, short feelers and one pair
% of wings. Pollen is a copper lump on each hind leg. Poses: a bee visiting (legs spread,
% wings folded back over the abdomen) or in flight (legs hanging, the wings a faint wash,
% flora's dotted trail looping behind); a hoverfly resting (wings out at 45 degrees) or
% hovering (its wings a wash).
\newtoks\flo@spw
\def\flo@bgell#1#2#3#4{\pgfpathellipse{\flo@P{#1}{#2}}{\flo@P{#3}0}{\flo@P0{#4}}}
% a band across the body from y #1 down to #2, its middle #3 nearer the tail
\def\flo@bgband#1#2#3{%
  \flo@calc\flo@bya{#1-(#3)}\flo@calc\flo@byb{#2-(#3)}%
  \pgfpathmoveto{\flo@P{-0.5}{#1}}\pgfpathcurveto{\flo@P{-0.17}\flo@bya}{\flo@P{0.17}\flo@bya}{\flo@P{0.5}{#1}}%
  \pgfpathlineto{\flo@P{0.5}{#2}}\pgfpathcurveto{\flo@P{0.17}\flo@byb}{\flo@P{-0.17}\flo@byb}{\flo@P{-0.5}{#2}}%
  \pgfpathclose}
% the abdomen's outline: 16 points round an egg (a hoverfly's squarer), kept as bgab
\def\flo@bgabdomen{%
  \flo@loop{bgao}\flo@Wa{1}{16}{%
    \flo@calc\flo@wa{22.5*\the\flo@Wa-11.25}\flo@calc\flo@t{cos(\flo@wa)}\flo@calc\flo@v{sin(\flo@wa)}%
    \flo@calc\flo@xa{\flo@bgrx*(\flo@t<0 ? -1 : 1)*pow(abs(\flo@t),\flo@bgsq)}%
    \flo@calc\flo@ya{\flo@bgay+\flo@bgry*\flo@v*(\flo@v<0 ? \flo@bgegg : 1)}%
    \flo@put{\the\flo@Wa}\flo@xa\flo@ya}%
  \flo@smoothprep{16}\flo@keep{bgab}}
% a bumblebee's pale bands on part #1 (t the thorax, a the abdomen), in flo@c; its tail
\def\flo@bgpale#1{%
  \flo@loop{bgpl}\flo@Wb{1}{\flo@xget{bands}}{%
    \edef\flo@t{\csname flo@bgbp\the\flo@Wb\endcsname}\def\flo@tmp{#1}%
    \ifx\flo@t\flo@tmp
      \flo@vfill{flo@c}{0.95}{0}{\flo@bgband{\csname flo@bgbh\the\flo@Wb\endcsname}{\csname flo@bgbl\the\flo@Wb\endcsname}{0.02}}%
    \fi}%
  \def\flo@t{#1}\def\flo@tmp{a}\ifx\flo@t\flo@tmp\ifnum\flo@xget{paletail}=1
    \flo@bgwhite\flo@vfill{flo@c}{1}{0}{\flo@bgband\flo@bgtl{-2}{0.02}}\fi\fi}
% a bumblebee's white: the ink's palest
\def\flo@bgwhite{\let\flo@savedramp\flo@rampname\def\flo@rampname{flo@ramp}\flo@vtone{flo@c}{0.93}\let\flo@rampname\flo@savedramp}
% the color of the hair at height #1 on part #2: \flo@bgc 0 dark, 1 pale, 2 white
\def\flo@bgcolorat#1#2{%
  \def\flo@bgc{0}%
  \def\flo@tmp{bumblebee}\ifx\flo@bgk\flo@tmp
    \flo@loop{bgct}\flo@Wd{1}{\flo@xget{bands}}{%
      \edef\flo@t{\csname flo@bgbp\the\flo@Wd\endcsname}\def\flo@tmp{#2}%
      \ifx\flo@t\flo@tmp
        \ifdim#1pt<\csname flo@bgbh\the\flo@Wd\endcsname pt \ifdim#1pt>\csname flo@bgbl\the\flo@Wd\endcsname pt
          \def\flo@bgc{1}\fi\fi
      \fi}%
    \def\flo@t{#2}\def\flo@tmp{a}\ifx\flo@t\flo@tmp\ifnum\flo@xget{paletail}=1 \ifdim#1pt<\flo@bgtl pt
      \def\flo@bgc{2}\fi\fi\fi
  \fi}
% a fringe of #3 hairs round the ellipse at (0,#1), half-width #2, half-height #4 above
% the middle and #5 below, on part #6; each hair the color of the band it grows from
\def\flo@bgfur#1#2#3#4#5#6{%
  \flo@spk={}\flo@spa={}\flo@spw={}\def\flo@bgnd{0}\def\flo@bgnp{0}\def\flo@bgnw{0}%
  \flo@calc\flo@bghl{0.5+\flo@xget{hair}}%
  \flo@loop{bgfr}\flo@Wb{1}{#3}{%
    \flo@range\flo@wa{0}{360}\flo@range\flo@t{0.02}{0.045}\flo@sym\flo@wb{25}%
    \flo@calc\flo@t{\flo@t*\flo@bghl+0.014}\flo@calc\flo@v{sin(\flo@wa)}%
    \flo@calc\flo@wr{(\flo@v<0 ? #5 : #4)-0.014}%
    \flo@calc\flo@xa{(#2-0.014)*cos(\flo@wa)}\flo@calc\flo@ya{#1+\flo@wr*\flo@v}%
    \flo@calc\flo@xd{\flo@xa+\flo@t*cos(\flo@wa+\flo@wb)}\flo@calc\flo@yd{\flo@ya+\flo@t*sin(\flo@wa+\flo@wb)}%
    \flo@calc\flo@xb{\flo@xa+(\flo@xd-\flo@xa)/3}\flo@calc\flo@yb{\flo@ya+(\flo@yd-\flo@ya)/3}%
    \flo@calc\flo@xc{\flo@xa+(\flo@xd-\flo@xa)*2/3}\flo@calc\flo@yc{\flo@ya+(\flo@yd-\flo@ya)*2/3}%
    \edef\flo@bghair{\noexpand\flo@vtaper{\flo@xa}{\flo@ya}{\flo@xb}{\flo@yb}{\flo@xc}{\flo@yc}{\flo@xd}{\flo@yd}}%
    \flo@bgcolorat\flo@ya{#6}%
    \ifcase\flo@bgc
      \flo@spk\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spk\flo@bghair}%
      \edef\flo@bgnd{\the\numexpr\flo@bgnd+1}%
    \or
      \flo@spa\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spa\flo@bghair}%
      \edef\flo@bgnp{\the\numexpr\flo@bgnp+1}%
    \else
      \flo@spw\expandafter\expandafter\expandafter{\expandafter\the\expandafter\flo@spw\flo@bghair}%
      \edef\flo@bgnw{\the\numexpr\flo@bgnw+1}%
    \fi}%
  \def\flo@twa{0.013}\def\flo@twb{0.003}%
  \ifnum\flo@bgnd>0 \flo@vtone{flo@c}{\flo@bgfd}\flo@vfill{flo@c}{0.8}{0}{\the\flo@spk}\fi
  \ifnum\flo@bgnp>0 \flo@vtone{flo@c}{\flo@bgpt}\flo@vfill{flo@c}{0.9}{0}{\the\flo@spa}\fi
  \ifnum\flo@bgnw>0 \flo@bgwhite\flo@vfill{flo@c}{0.9}{0}{\the\flo@spw}\fi}
% the abdomen's pattern, in its clip
\def\flo@bgab@honeybee{%
  \flo@calc\flo@bgsp{\flo@bgla/(\flo@xget{bands}+0.6)}\flo@calc\flo@bgbt{0.42*\flo@bgsp}%
  \flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{0.88}{0}{%
    \flo@loop{bghb}\flo@Wb{1}{\flo@xget{bands}}{%
      \flo@calc\flo@ya{\flo@bgat-\flo@bgsp*(\the\flo@Wb+0.15)+\flo@bgbt/2}\flo@calc\flo@yb{\flo@ya-\flo@bgbt}%
      \flo@bgband\flo@ya\flo@yb{0.03}}}}
\def\flo@bgab@bumblebee{\flo@vtone{flo@c}{\flo@bgpt}\flo@bgpale{a}}
\def\flo@bgab@solitarybee{%
  \flo@vfill{white}{0.6}{0}{%
    \flo@loop{bgsb}\flo@Wb{1}{\flo@xget{bands}}{%
      \flo@calc\flo@ya{\flo@bgat-\flo@bgla*(0.12+0.17*\the\flo@Wb)}\flo@calc\flo@yb{\flo@ya-0.035}%
      \flo@bgband\flo@ya\flo@yb{0.025}}}}
\def\flo@bgab@hoverfly{%
  \flo@calc\flo@bgsp{\flo@bgla/(\flo@xget{bands}+0.5)}%
  \def\flo@tmp{copper}\ifx\flo@bgground\flo@tmp\flo@vaccent{flo@c}{0.1}%
  \else\flo@calc\flo@t{min(0.86,\flo@bgt+0.4)}\flo@vtone{flo@c}\flo@t\fi
  \flo@vfill{flo@c}{0.92}{0}{%
    \flo@loop{bghf}\flo@Wb{1}{\flo@xget{bands}}{%
      \flo@calc\flo@yd{\flo@bgat-\flo@bgsp*(\the\flo@Wb-0.2)}%
      \flo@calc\flo@twa{0.42*\flo@bgsp}\ifnum\flo@Wb=1 \flo@calc\flo@twa{0.3*\flo@bgsp}\fi
      \flo@calc\flo@twb{0.15*\flo@bgsp}%
      \flo@loop{bghs}\flo@Wc{1}{2}{%
        \ifnum\flo@Wc=1 \def\flo@sx{-1}\else\def\flo@sx{1}\fi
        \flo@calc\flo@xa{\flo@sx*0.03}\flo@calc\flo@ya{\flo@yd+0.01}%
        \flo@calc\flo@xb{\flo@sx*\flo@bgrx*0.4}\flo@calc\flo@yb{\flo@yd+0.03}%
        \flo@calc\flo@xc{\flo@sx*\flo@bgrx*0.75}\flo@calc\flo@yc{\flo@yd}%
        \flo@calc\flo@xe{\flo@sx*\flo@bgrx*1.05}\flo@calc\flo@ye{\flo@yd-0.04}%
        \flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xe\flo@ye}}}}
% the abdomen: its wash, the pattern, mottle, the pooled rim and a highlight down one side
\def\flo@bgpaintab{%
  \flo@vtone{flo@c}{\flo@bgabt}\flo@vfill{flo@c}{1}{0}{\flo@kept{bgab}}%
  \begin{pgfscope}\flo@kept{bgab}\pgfusepath{clip}%
    \csname flo@bgab@\flo@bgk\endcsname
    \ifnum\flo@fine=1
      \flo@calc\flo@bgxl{-\flo@bgrx}\flo@calc\flo@bgyl{\flo@bgat-\flo@bgla}%
      \flo@calc\flo@ta{\flo@bgabt-0.18}\flo@calc\flo@tb{\flo@bgabt+0.17}%
      \flo@vmottle\flo@bgxl\flo@bgyl\flo@bgrx\flo@bgat{4}{0.06}\flo@ta\flo@tb\flo@bgspk
    \fi
    \flo@vtone{flo@c}{0.05}\flo@calc\flo@t{3.4*\flo@bgu}\flo@vstroke{flo@c}{\flo@t}{\flo@bgrim}{1}{\flo@kept{bgab}}%
    \flo@calc\flo@t{\flo@bgrx/0.19}\flo@calc\flo@v{\flo@bgry/0.3}%
    \flo@calc\flo@xa{-0.1*\flo@t}\flo@calc\flo@ya{\flo@bgay-0.18*\flo@v}\flo@put1\flo@xa\flo@ya
    \flo@calc\flo@xa{-0.13*\flo@t}\flo@calc\flo@ya{\flo@bgay-0.05*\flo@v}\flo@put2\flo@xa\flo@ya
    \flo@calc\flo@xa{-0.12*\flo@t}\flo@calc\flo@ya{\flo@bgay+0.08*\flo@v}\flo@put3\flo@xa\flo@ya
    \flo@calc\flo@xa{-0.08*\flo@t}\flo@calc\flo@ya{\flo@bgay+0.2*\flo@v}\flo@put4\flo@xa\flo@ya
    \flo@vstreak{4}{0.04}{0.008}{white}{0.5}%
  \end{pgfscope}}
% the thorax: a blob, a bumblebee's bands on it, mottle
\def\flo@bgthorax{%
  \flo@calc\flo@t{\flo@bgtr*0.93}\flo@vblob{0}\flo@bgty\flo@bgtr\flo@t{0.1}{12}\flo@keep{bgth}%
  \flo@vtone{flo@c}{\flo@bgtt}\flo@vfill{flo@c}{1}{0}{\flo@kept{bgth}}%
  \begin{pgfscope}\flo@kept{bgth}\pgfusepath{clip}%
    \def\flo@tmp{bumblebee}\ifx\flo@bgk\flo@tmp\flo@vtone{flo@c}{\flo@bgpt}\flo@bgpale{t}\fi
    \ifnum\flo@fine=1
      \flo@calc\flo@bgxl{-\flo@bgtr}\flo@calc\flo@bgyl{\flo@bgty-\flo@bgtr}\flo@calc\flo@bgyh{\flo@bgty+\flo@bgtr}%
      \flo@calc\flo@ta{\flo@bgtt-0.04}\flo@calc\flo@tb{\flo@bgtt+0.24}%
      \flo@vmottle\flo@bgxl\flo@bgyl\flo@bgtr\flo@bgyh{3}{0.05}\flo@ta\flo@tb{6}%
    \fi
  \end{pgfscope}}
% the head: eyes at its sides, or a hoverfly's that nearly cover it; a glint in each
\def\flo@bghead{%
  \flo@vtone{flo@c}{\flo@bght}\flo@vfill{flo@c}{1}{0}{\flo@bgell0\flo@bghy\flo@bghx\flo@bghr}%
  \flo@calc\flo@ya{\flo@bghy+0.008}%
  \def\flo@tmp{hoverfly}\ifx\flo@bgk\flo@tmp
    \def\flo@xa{0.055}\def\flo@xb{0.068}\def\flo@yb{0.08}%
  \else
    \flo@calc\flo@xa{\flo@bghx-0.022}\def\flo@xb{0.028}\def\flo@yb{0.05}%
  \fi
  \flo@vtone{flo@c}{0.02}\flo@vfill{flo@c}{1}{0}{\flo@bgell{-\flo@xa}\flo@ya\flo@xb\flo@yb\flo@bgell\flo@xa\flo@ya\flo@xb\flo@yb}%
  \ifnum\flo@fine=1
    \flo@calc\flo@xc{\flo@xa-0.3*\flo@xb}\flo@calc\flo@yc{\flo@ya+0.35*\flo@yb}%
    \flo@vfill{white}{0.7}{0}{\pgfpathcircle{\flo@P{-\flo@xc}\flo@yc}{0.011pt}\pgfpathcircle{\flo@P\flo@xc\flo@yc}{0.011pt}}%
  \fi}
% feelers: a bee's elbowed, a hoverfly's short with a bristle
\def\flo@bgfeelers{%
  \flo@vtone{flo@c}{0.06}%
  \def\flo@tmp{hoverfly}\ifx\flo@bgk\flo@tmp
    \flo@calc\flo@ya{\flo@bghy+0.07}\flo@calc\flo@yb{\flo@bghy+0.11}\flo@calc\flo@yc{\flo@bghy+0.14}%
    \flo@vstroke{flo@c}{\flo@bgw}{1}{0}{\pgfpathmoveto{\flo@P{-0.02}\flo@ya}\pgfpathlineto{\flo@P{-0.035}\flo@yb}%
      \pgfpathmoveto{\flo@P{0.02}\flo@ya}\pgfpathlineto{\flo@P{0.035}\flo@yb}}%
    \flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P{-0.035}\flo@yb}{0.014pt}\pgfpathcircle{\flo@P{0.035}\flo@yb}{0.014pt}}%
    \ifnum\flo@fine=1 \flo@calc\flo@t{0.5*\flo@bgw}%
      \flo@vstroke{flo@c}{\flo@t}{1}{0}{\pgfpathmoveto{\flo@P{-0.035}\flo@yb}\pgfpathlineto{\flo@P{-0.075}\flo@yc}%
        \pgfpathmoveto{\flo@P{0.035}\flo@yb}\pgfpathlineto{\flo@P{0.075}\flo@yc}}%
    \fi
  \else
    \flo@calc\flo@ya{\flo@bghy+0.05}%
    \flo@vstroke{flo@c}{\flo@bgw}{1}{0}{%
      \flo@loop{bgfl}\flo@Wb{1}{2}{%
        \ifnum\flo@Wb=1 \def\flo@sx{-1}\else\def\flo@sx{1}\fi
        \flo@range\flo@xb{0.05}{0.08}\flo@range\flo@yb{0.11}{0.15}\flo@range\flo@xc{0.11}{0.17}\flo@range\flo@yc{0.17}{0.23}%
        \flo@calc\flo@xa{\flo@sx*0.03}\flo@calc\flo@xb{\flo@sx*\flo@xb}\flo@calc\flo@yb{\flo@bghy+\flo@yb}%
        \flo@calc\flo@xc{\flo@sx*\flo@xc}\flo@calc\flo@yc{\flo@bghy+\flo@yc}%
        \pgfpathmoveto{\flo@P\flo@xa\flo@ya}\pgfpathlineto{\flo@P\flo@xb\flo@yb}\pgfpathlineto{\flo@P\flo@xc\flo@yc}}}%
  \fi}
% the legs of a side, root, knee and foot (x along the side, y from the thorax's middle):
% spread on a flower, hanging in flight
\def\flo@bgLvi{{0.05}{0.06}{0.17}{0.1}{0.2}{0.22}}\def\flo@bgLvii{{0.06}{0}{0.23}{-0.03}{0.3}{-0.15}}
\def\flo@bgLviii{{0.06}{-0.06}{0.28}{-0.16}{0.32}{-0.42}}
\def\flo@bgLfi{{0.05}{0.04}{0.13}{0}{0.15}{-0.1}}\def\flo@bgLfii{{0.06}{0}{0.17}{-0.08}{0.18}{-0.24}}
\def\flo@bgLfiii{{0.06}{-0.05}{0.21}{-0.16}{0.22}{-0.44}}
% the points of leg \flo@Wb: \flo@bgL[a-f]<i>, the knee and foot moved a little
\def\flo@bglegpts#1#2#3#4#5#6{%
  \edef\flo@bgi{\the\flo@Wb}%
  \flo@calc\flo@t{(#1)*\flo@bglx}\expandafter\let\csname flo@bgLa\flo@bgi\endcsname\flo@t
  \flo@calc\flo@t{\flo@bgty+(#2)}\expandafter\let\csname flo@bgLb\flo@bgi\endcsname\flo@t
  \flo@sym\flo@v{0.02}\flo@calc\flo@t{(#3)*\flo@bglx+\flo@v}\expandafter\let\csname flo@bgLc\flo@bgi\endcsname\flo@t
  \flo@sym\flo@v{0.02}\flo@calc\flo@t{\flo@bgty+(#4)+\flo@v}\expandafter\let\csname flo@bgLd\flo@bgi\endcsname\flo@t
  \flo@sym\flo@v{0.025}\flo@calc\flo@t{(#5)*\flo@bglx+\flo@v}\expandafter\let\csname flo@bgLe\flo@bgi\endcsname\flo@t
  \flo@sym\flo@v{0.025}\flo@calc\flo@t{\flo@bgty+(#6)+\flo@v}\expandafter\let\csname flo@bgLf\flo@bgi\endcsname\flo@t}
% the legs of the side (drawn to the right): thigh and shank tapered; pollen on the hind leg
\def\flo@bglegs{%
  \flo@loop{bglp}\flo@Wb{1}{3}{%
    \expandafter\expandafter\expandafter\flo@bglegpts\csname flo@bgL\flo@bglp\romannumeral\flo@Wb\endcsname}%
  \flo@vtone{flo@c}{0.08}%
  \flo@vfill{flo@c}{1}{0}{\flo@loop{bglg}\flo@Wb{1}{3}{%
    \edef\flo@bgi{\the\flo@Wb}%
    \edef\flo@xa{\csname flo@bgLa\flo@bgi\endcsname}\edef\flo@ya{\csname flo@bgLb\flo@bgi\endcsname}%
    \edef\flo@xd{\csname flo@bgLc\flo@bgi\endcsname}\edef\flo@yd{\csname flo@bgLd\flo@bgi\endcsname}%
    \edef\flo@xe{\csname flo@bgLe\flo@bgi\endcsname}\edef\flo@ye{\csname flo@bgLf\flo@bgi\endcsname}%
    \flo@calc\flo@xb{\flo@xa+(\flo@xd-\flo@xa)/3}\flo@calc\flo@yb{\flo@ya+(\flo@yd-\flo@ya)/3}%
    \flo@calc\flo@xc{\flo@xa+(\flo@xd-\flo@xa)*2/3}\flo@calc\flo@yc{\flo@ya+(\flo@yd-\flo@ya)*2/3}%
    \edef\flo@twa{\flo@bgfw}\flo@calc\flo@twb{\flo@bgfw*0.8}%
    \flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd
    \flo@calc\flo@xb{\flo@xd+(\flo@xe-\flo@xd)/3}\flo@calc\flo@yb{\flo@yd+(\flo@ye-\flo@yd)/3}%
    \flo@calc\flo@xc{\flo@xd+(\flo@xe-\flo@xd)*2/3}\flo@calc\flo@yc{\flo@yd+(\flo@ye-\flo@yd)*2/3}%
    \flo@calc\flo@twa{\flo@bgfw*0.8}\flo@calc\flo@twb{\flo@bgfw*0.35}%
    \flo@vtaper\flo@xd\flo@yd\flo@xb\flo@yb\flo@xc\flo@yc\flo@xe\flo@ye}}%
  \ifnum\flo@xget{pollen}=1
    \flo@calc\flo@da{\csname flo@bgLe3\endcsname-(\csname flo@bgLc3\endcsname)}\flo@calc\flo@db{\csname flo@bgLf3\endcsname-(\csname flo@bgLd3\endcsname)}%
    \flo@nrm\flo@da\flo@db\flo@nx\flo@ny
    \flo@calc\flo@xa{\csname flo@bgLc3\endcsname+0.45*\flo@da}\flo@calc\flo@ya{\csname flo@bgLd3\endcsname+0.45*\flo@db}%
    \flo@calc\flo@xb{\flo@ny*0.065*\flo@bgpr}\flo@calc\flo@yb{-(\flo@nx)*0.065*\flo@bgpr}%
    \flo@calc\flo@xc{\flo@nx*0.042*\flo@bgpr}\flo@calc\flo@yc{\flo@ny*0.042*\flo@bgpr}%
    \flo@vaccent{flo@c}{0}\flo@vfill{flo@c}{1}{0}{\pgfpathellipse{\flo@P\flo@xa\flo@ya}{\flo@P\flo@xb\flo@yb}{\flo@P\flo@xc\flo@yc}}%
    \ifnum\flo@fine=1
      \flo@calc\flo@xa{\flo@xa+0.35*\flo@xc-0.25*\flo@xb}\flo@calc\flo@ya{\flo@ya+0.35*\flo@yc-0.25*\flo@yb}%
      \flo@vfill{white}{0.6}{0}{\pgfpathcircle{\flo@P\flo@xa\flo@ya}{0.012pt}}%
    \fi
  \fi}
% a wing's outline: eight points round a teardrop #1 long and #2 wide each way, each
% moved a little; kept as #3
\def\flo@bgWd#1#2#3{\expandafter\def\csname flo@bgWx#1\endcsname{#2}\expandafter\def\csname flo@bgWy#1\endcsname{#3}}
\flo@bgWd1{0.02}{0}\flo@bgWd2{0.15}{0.55}\flo@bgWd3{0.45}{0.95}\flo@bgWd4{0.8}{0.85}
\flo@bgWd5{1}{0.25}\flo@bgWd6{0.92}{-0.45}\flo@bgWd7{0.6}{-0.8}\flo@bgWd8{0.25}{-0.55}
\def\flo@bgwingshape#1#2#3{%
  \flo@loop{bgws}\flo@Wb{1}{8}{%
    \flo@sym\flo@t{0.012}\flo@calc\flo@xa{\csname flo@bgWx\the\flo@Wb\endcsname*(#1)+\flo@t}%
    \flo@sym\flo@t{0.012}\flo@calc\flo@ya{\csname flo@bgWy\the\flo@Wb\endcsname*(#2)+\flo@t}%
    \flo@put{\the\flo@Wb}\flo@xa\flo@ya}%
  \flo@smoothprep{8}\flo@keep{#3}}
% veins, at (#1 of the length, #2 of the width): \flo@bgvm moves there, \flo@bgvl draws to it
\def\flo@bgvm#1#2{\flo@calc\flo@xa{(#1)*\flo@bgwl}\flo@calc\flo@ya{(#2)*\flo@bgww}\pgfpathmoveto{\flo@P\flo@xa\flo@ya}}
\def\flo@bgvl#1#2{\flo@calc\flo@xa{(#1)*\flo@bgwl}\flo@calc\flo@ya{(#2)*\flo@bgww}\pgfpathlineto{\flo@P\flo@xa\flo@ya}}
\def\flo@bgV@f{% a bee's forewing
  \flo@bgvm{0.03}{0.3}\flo@bgvl{0.35}{0.72}\flo@bgvl{0.62}{0.78}%
  \flo@bgvm{0.03}{0.05}\flo@bgvl{0.3}{0.2}\flo@bgvl{0.62}{0.25}\flo@bgvl{0.85}{0.32}%
  \flo@bgvm{0.05}{-0.15}\flo@bgvl{0.35}{-0.25}\flo@bgvl{0.6}{-0.3}%
  \flo@bgvm{0.62}{0.78}\flo@bgvl{0.62}{0.25}\flo@bgvl{0.6}{-0.3}}
\def\flo@bgV@h{\flo@bgvm{0.03}{0.05}\flo@bgvl{0.55}{0.15}}
\def\flo@bgV@v{% a hoverfly's wing: the vein that dips before the tip, the cross veins along the edge
  \flo@bgvm{0.03}{0.35}\flo@bgvl{0.5}{0.8}\flo@bgvl{0.85}{0.62}%
  \flo@bgvm{0.03}{0}\flo@bgvl{0.5}{0.1}\flo@bgvl{0.78}{0.22}\flo@bgvl{0.92}{0.05}%
  \flo@bgvm{0.05}{-0.2}\flo@bgvl{0.45}{-0.32}\flo@bgvl{0.72}{-0.28}\flo@bgvl{0.86}{-0.08}%
  \flo@bgvm{0.5}{0.8}\flo@bgvl{0.5}{0.1}\flo@bgvl{0.45}{-0.32}}
% wing #1 (kept) at its root (#2,#3), turned #4 degrees, its wash at opacity #5 in the ink's
% pale; with #6 = 1 its rim and veins (#7: f, h or v)
\def\flo@bgwing#1#2#3#4#5#6#7{\begin{pgfscope}%
  \def\flo@rampname{flo@ramp}%
  \pgftransformshift{\flo@P{#2}{#3}}\pgftransformrotate{#4}%
  \flo@vtone{flo@c}{0.85}\flo@vfill{flo@c}{#5}{0}{\flo@kept{#1}}%
  \ifnum#6=1
    \flo@vtone{flo@c}{0.15}\flo@vstroke{flo@c}{\flo@bglw}{0.75}{0}{\flo@kept{#1}}%
    \ifnum\flo@fine=1 \flo@vtone{flo@c}{0.2}\flo@vstroke{flo@c}{\flo@bgvw}{0.6}{0}{\csname flo@bgV@#7\endcsname}\fi
  \fi\end{pgfscope}}
% the wings of the side: a bee's hindwing under its forewing; still, or a wash of three
\def\flo@bgwings{%
  \flo@bgwingshape\flo@bgFl\flo@bgFw{bgwf}%
  \ifdim\flo@bgHl pt>0pt \flo@bgwingshape\flo@bgHl\flo@bgHw{bgwh}\fi
  \flo@calc\flo@bgyf{\flo@bgty+0.05}\flo@calc\flo@bgyh{\flo@bgty-0.01}%
  \ifnum\flo@bgblur=1
    \flo@loop{bgwb}\flo@Wb{1}{3}{%
      \ifdim\flo@bgHl pt>0pt \flo@calc\flo@t{\flo@bgah+(\the\flo@Wb-2)*\flo@bgdl}\flo@bgwing{bgwh}{0.06}\flo@bgyh\flo@t{0.16}{0}{h}\fi
      \flo@calc\flo@t{\flo@bgaf+(\the\flo@Wb-2)*\flo@bgdl}\flo@bgwing{bgwf}{0.06}\flo@bgyf\flo@t{0.16}{0}{f}}%
  \else
    \ifdim\flo@bgHl pt>0pt \let\flo@bgwl\flo@bgHl\let\flo@bgww\flo@bgHw\flo@bgwing{bgwh}{0.06}\flo@bgyh\flo@bgah{0.55}{1}{h}\fi
    \let\flo@bgwl\flo@bgFl\let\flo@bgww\flo@bgFw\flo@bgwing{bgwf}{0.06}\flo@bgyf\flo@bgaf{0.55}{1}\flo@bgvn
  \fi}
% flora's flight path: a dotted line looping away behind
\def\flo@bgtrail{%
  \flo@range\flo@bgtc{0.16}{0.22}\flo@range\flo@bgtn{1}{1.3}\flo@chance{0.5}%
  \ifflo@yes\def\flo@sx{1}\else\def\flo@sx{-1}\fi
  \flo@calc\flo@t{max(0.6,1.1*\flo@bgu)}\flo@calc\flo@v{max(2.2,3.2*\flo@bgu)}%
  \begin{pgfscope}\pgfsetdash{{0bp}{\flo@v bp}}{0bp}%
  \flo@vtone{flo@c}{0.18}\flo@vstroke{flo@c}{\flo@t}{0.7}{0}{%
    \flo@loop{bgtr}\flo@Wb{0}{40}{%
      \flo@calc\flo@wa{\the\flo@Wb/40*\flo@bgtn*360}%
      \flo@calc\flo@xa{\flo@sx*0.32*sin(\flo@wa)}%
      \flo@calc\flo@ya{\flo@bgtip-0.06-\flo@bgtc*\flo@wa*0.0174533+0.192*(cos(\flo@wa)-1)}%
      \ifnum\flo@Wb=0 \pgfpathmoveto{\flo@P\flo@xa\flo@ya}\else\pgfpathlineto{\flo@P\flo@xa\flo@ya}\fi}}%
  \end{pgfscope}}
% a bee or a hoverfly; #1 its length on the page in pt
\def\flo@bee#1{%
  \flo@calc\flo@bgu{(#1)/28.45276}%
  \ifdim\flo@bgu pt>0.25pt \def\flo@fine{1}\else\def\flo@fine{0}\fi
  \edef\flo@bgk{\flo@xget{kind}}\edef\flo@bgpose{\flo@xget{pose}}\edef\flo@bgground{\flo@xget{ground}}%
  \edef\flo@bgt{\flo@xget{tone}}\def\flo@bgpt{0.74}%
  \def\flo@tmp{dark}\ifx\flo@bgground\flo@tmp\flo@calc\flo@bgt{\flo@bgt-0.12}\fi
  \def\flo@tmp{pale}\ifx\flo@bgground\flo@tmp\flo@calc\flo@bgt{min(0.78,\flo@bgt+0.32)}\fi% fixed: paler, as a butterfly's
  \def\flo@tmp{copper}\ifx\flo@bgground\flo@tmp\def\flo@rampname{flo@aramp}\def\flo@bgpt{0.6}\fi
  % proportions: the abdomen (its half-width from the build), the thorax, head, wings, legs;
  % the tones of the abdomen, thorax, head, the hair and the pale bands
  \flo@calc\flo@bgrx{0.48*\flo@xget{build}}\def\flo@bgry{0.3}\def\flo@bgsq{1}\def\flo@bgegg{1.12}%
  \def\flo@bgtr{0.13}\def\flo@bghx{0.09}\def\flo@bghr{0.075}%
  \def\flo@bgFl{0.52}\def\flo@bgFw{0.12}\def\flo@bgHl{0.38}\def\flo@bgHw{0.08}\def\flo@bgvn{f}%
  \def\flo@bgfw{0.032}\def\flo@bgpr{1}%
  \edef\flo@bgabt{\flo@bgt}\def\flo@bgtt{0.06}\def\flo@bght{0.04}\edef\flo@bgfd{\flo@bgt}%
  \def\flo@bgspk{4}\def\flo@bgrim{0.4}%
  \def\flo@tmp{honeybee}\ifx\flo@bgk\flo@tmp\flo@calc\flo@bgtt{max(0.06,\flo@bgt-0.24)}\fi
  \def\flo@tmp{bumblebee}\ifx\flo@bgk\flo@tmp
    \def\flo@bgegg{1}\def\flo@bgtr{0.16}\def\flo@bghx{0.1}\def\flo@bgFl{0.48}\def\flo@bgFw{0.11}%
    \def\flo@bgHl{0.34}\def\flo@bgfw{0.036}\def\flo@bgpr{1.2}\def\flo@bgabt{0.06}\def\flo@bgtt{0.05}%
    \def\flo@bgfd{0.08}\def\flo@bgspk{14}\def\flo@bgrim{0.15}\fi
  \def\flo@tmp{solitarybee}\ifx\flo@bgk\flo@tmp
    \def\flo@bgry{0.32}\def\flo@bgtr{0.11}\def\flo@bghx{0.08}\def\flo@bgpr{0.9}%
    \flo@calc\flo@bgabt{max(0.05,\flo@bgt-0.24)}\fi
  \def\flo@tmp{hoverfly}\ifx\flo@bgk\flo@tmp
    \flo@calc\flo@bgrx{0.42*\flo@xget{build}}\def\flo@bgsq{0.8}\def\flo@bgegg{1.2}\def\flo@bgtr{0.12}\def\flo@bghx{0.13}%
    \def\flo@bghr{0.085}\def\flo@bgFl{0.62}\def\flo@bgHl{0}\def\flo@bgvn{v}\def\flo@bgfw{0.022}%
    \def\flo@bgabt{0.08}\def\flo@bgtt{0.08}\def\flo@bght{0.1}\def\flo@bgfd{0.25}\fi
  % where things are along the body: the thorax, head, the abdomen's top, middle and tip
  \def\flo@bgty{0.15}\flo@calc\flo@bghy{\flo@bgty+\flo@bgtr+0.04}%
  \flo@calc\flo@bgat{\flo@bgty-\flo@bgtr+0.09}\flo@calc\flo@bgay{\flo@bgat-\flo@bgry}%
  \flo@calc\flo@bgla{\flo@bgry*(1+0.98*\flo@bgegg)}\flo@calc\flo@bgtip{\flo@bgat-\flo@bgla}%
  \flo@calc\flo@bglx{0.6+2*\flo@bgrx}%
  % a bumblebee's pale bands: the collar, the second segment, the back of the thorax, the
  % first segment; the tail
  \expandafter\def\csname flo@bgbp1\endcsname{t}\expandafter\def\csname flo@bgbp2\endcsname{a}%
  \expandafter\def\csname flo@bgbp3\endcsname{t}\expandafter\def\csname flo@bgbp4\endcsname{a}%
  \flo@calc\flo@t{\flo@bgty+\flo@bgtr+0.03}\expandafter\let\csname flo@bgbh1\endcsname\flo@t
  \flo@calc\flo@t{\flo@bgty+0.4*\flo@bgtr}\expandafter\let\csname flo@bgbl1\endcsname\flo@t
  \flo@calc\flo@t{\flo@bgat-0.3*\flo@bgla}\expandafter\let\csname flo@bgbh2\endcsname\flo@t
  \flo@calc\flo@t{\flo@bgat-0.5*\flo@bgla}\expandafter\let\csname flo@bgbl2\endcsname\flo@t
  \flo@calc\flo@t{\flo@bgty-0.5*\flo@bgtr}\expandafter\let\csname flo@bgbh3\endcsname\flo@t
  \flo@calc\flo@t{\flo@bgty-\flo@bgtr-0.03}\expandafter\let\csname flo@bgbl3\endcsname\flo@t
  \flo@calc\flo@t{\flo@bgat+0.03}\expandafter\let\csname flo@bgbh4\endcsname\flo@t
  \flo@calc\flo@t{\flo@bgat-0.17*\flo@bgla}\expandafter\let\csname flo@bgbl4\endcsname\flo@t
  \flo@calc\flo@bgtl{\flo@bgat-0.7*\flo@bgla}%
  % line widths
  \flo@calc\flo@bgw{max(0.25,0.45*\flo@bgu)}\flo@calc\flo@bglw{max(0.2,0.35*\flo@bgu)}%
  \flo@calc\flo@bgvw{max(0.15,0.25*\flo@bgu)}%
  % the pose: legs, the wings' angles, a wash of three
  \def\flo@bglp{v}\def\flo@bgblur{0}\def\flo@bgaf{-70}\def\flo@bgah{-78}\def\flo@bgdl{0}%
  \def\flo@tmp{fly}\ifx\flo@bgpose\flo@tmp\def\flo@bglp{f}\def\flo@bgblur{1}\def\flo@bgaf{14}\def\flo@bgah{-4}\def\flo@bgdl{16}\fi
  \def\flo@tmp{rest}\ifx\flo@bgpose\flo@tmp\def\flo@bgaf{-45}\fi
  \def\flo@tmp{hover}\ifx\flo@bgpose\flo@tmp\def\flo@bglp{f}\def\flo@bgblur{1}\def\flo@bgaf{10}\def\flo@bgdl{22}\fi
  % the trail, the legs, the abdomen (a bumblebee's furred), the thorax and its hair, the
  % head and feelers, the wings
  \def\flo@tmp{fly}\ifx\flo@bgpose\flo@tmp\flo@bgtrail\fi
  \flo@loop{bgsl}\flo@Wa{1}{2}{\begin{pgfscope}\ifnum\flo@Wa=2 \pgftransformxscale{-1}\fi\flo@bglegs\end{pgfscope}}%
  \flo@bgabdomen\flo@bgpaintab
  \def\flo@tmp{hoverfly}\ifx\flo@bgk\flo@tmp\else\def\flo@tmp{bumblebee}\ifx\flo@bgk\flo@tmp\else
    \flo@calc\flo@ya{\flo@bgtip+0.04}\flo@calc\flo@yb{\flo@bgtip-0.05}%
    \flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{1}{0}{\pgfpathmoveto{\flo@P{-0.022}\flo@ya}%
      \pgfpathlineto{\flo@P0\flo@yb}\pgfpathlineto{\flo@P{0.022}\flo@ya}\pgfpathclose}%
  \fi\fi
  \def\flo@tmp{bumblebee}\ifx\flo@bgk\flo@tmp
    \pgfmathtruncatemacro\flo@bgnf{24+60*\flo@xget{hair}}\flo@calc\flo@bgrb{\flo@bgry*\flo@bgegg}%
    \flo@bgfur\flo@bgay\flo@bgrx\flo@bgnf\flo@bgry\flo@bgrb{a}%
  \fi
  \flo@bgthorax
  \pgfmathtruncatemacro\flo@bgnf{6+40*\flo@xget{hair}}\flo@calc\flo@bgrb{\flo@bgtr*0.93}%
  \flo@bgfur\flo@bgty\flo@bgtr\flo@bgnf\flo@bgrb\flo@bgrb{t}%
  \flo@bghead\flo@bgfeelers
  \flo@loop{bgsw}\flo@Wa{1}{2}{\begin{pgfscope}\ifnum\flo@Wa=2 \pgftransformxscale{-1}\fi\flo@bgwings\end{pgfscope}}}
% ---------------------------------------------------------------- jointed legs
% The legs of a side (drawn to the right) from table #1: per leg its root, knee, foot and
% the end of its tarsus, (x, y) from (0, \flo@lgy), times \flo@lgx; the knee, foot and end
% further out by \flo@lgex and moved a little (up to \flo@lgj); the feet of the first and
% last legs shifted \flo@lgph along the body and the middle one's back (a walking gait);
% thigh, shank and tarsus tapered from the width \flo@lgw
\def\flo@lgoi{{0.025}{0.03}{0.06}{0.06}{0.07}{0.11}{0.065}{0.15}}
\def\flo@lgoii{{0.03}{0}{0.075}{0.02}{0.095}{0.07}{0.095}{0.1}}
\def\flo@lgoiii{{0.03}{-0.03}{0.085}{-0.03}{0.11}{0.01}{0.115}{0.045}}
\def\flo@lgbi{{0.06}{0.08}{-0.06}{0.13}{0.02}{0.27}{0.04}{0.34}}
\def\flo@lgbii{{0.08}{-0.04}{0}{-0.02}{0.1}{-0.1}{0.15}{-0.14}}
\def\flo@lgbiii{{0.08}{-0.12}{-0.02}{-0.24}{0.06}{-0.42}{0.08}{-0.5}}
\def\flo@lgpts#1#2#3#4#5#6#7#8{%
  \edef\flo@lgi{\the\flo@Wb}%
  \ifnum\flo@Wb=2 \flo@calc\flo@lgp{-(\flo@lgph)}\else\edef\flo@lgp{\flo@lgph}\fi
  \flo@calc\flo@t{(#1)*\flo@lgx}\expandafter\let\csname flo@lg\flo@lgi a\endcsname\flo@t
  \flo@calc\flo@t{\flo@lgy+(#2)*\flo@lgx}\expandafter\let\csname flo@lg\flo@lgi b\endcsname\flo@t
  \flo@sym\flo@v{\flo@lgj}\flo@calc\flo@t{(#3)*\flo@lgx+\flo@lgex+\flo@v}\expandafter\let\csname flo@lg\flo@lgi c\endcsname\flo@t
  \flo@sym\flo@v{\flo@lgj}\flo@calc\flo@t{\flo@lgy+(#4)*\flo@lgx+\flo@v}\expandafter\let\csname flo@lg\flo@lgi d\endcsname\flo@t
  \flo@sym\flo@v{\flo@lgj}\flo@calc\flo@lgfx{(#5)*\flo@lgx+\flo@lgex+\flo@v}\expandafter\let\csname flo@lg\flo@lgi e\endcsname\flo@lgfx
  \flo@sym\flo@v{\flo@lgj}\flo@calc\flo@lgfy{\flo@lgy+(#6)*\flo@lgx+\flo@lgp+\flo@v}\expandafter\let\csname flo@lg\flo@lgi f\endcsname\flo@lgfy
  \flo@calc\flo@t{\flo@lgfx+((#7)-(#5))*\flo@lgx}\expandafter\let\csname flo@lg\flo@lgi g\endcsname\flo@t
  \flo@calc\flo@t{\flo@lgfy+((#8)-(#6))*\flo@lgx}\expandafter\let\csname flo@lg\flo@lgi h\endcsname\flo@t}
% a segment of a leg from (#1,#2) to (#3,#4), widths \flo@twa to \flo@twb
\def\flo@lgseg#1#2#3#4{%
  \flo@calc\flo@xb{#1+(#3-(#1))/3}\flo@calc\flo@yb{#2+(#4-(#2))/3}%
  \flo@calc\flo@xc{#1+(#3-(#1))*2/3}\flo@calc\flo@yc{#2+(#4-(#2))*2/3}%
  \flo@vtaper{#1}{#2}\flo@xb\flo@yb\flo@xc\flo@yc{#3}{#4}}
\def\flo@vlegs#1{%
  \flo@loop{lgpt}\flo@Wb{1}{3}{%
    \expandafter\expandafter\expandafter\flo@lgpts\csname flo@lg#1\romannumeral\flo@Wb\endcsname}%
  \flo@vfill{flo@c}{1}{0}{\flo@loop{lgdr}\flo@Wb{1}{3}{%
    \edef\flo@lgi{\the\flo@Wb}%
    \edef\flo@lga{\csname flo@lg\flo@lgi a\endcsname}\edef\flo@lgb{\csname flo@lg\flo@lgi b\endcsname}%
    \edef\flo@lgc{\csname flo@lg\flo@lgi c\endcsname}\edef\flo@lgd{\csname flo@lg\flo@lgi d\endcsname}%
    \edef\flo@lge{\csname flo@lg\flo@lgi e\endcsname}\edef\flo@lgf{\csname flo@lg\flo@lgi f\endcsname}%
    \edef\flo@lgg{\csname flo@lg\flo@lgi g\endcsname}\edef\flo@lgh{\csname flo@lg\flo@lgi h\endcsname}%
    \edef\flo@twa{\flo@lgw}\flo@calc\flo@twb{\flo@lgw*0.8}\flo@lgseg\flo@lga\flo@lgb\flo@lgc\flo@lgd
    \flo@calc\flo@twa{\flo@lgw*0.75}\flo@calc\flo@twb{\flo@lgw*0.45}\flo@lgseg\flo@lgc\flo@lgd\flo@lge\flo@lgf
    \flo@calc\flo@twa{\flo@lgw*0.4}\flo@calc\flo@twb{\flo@lgw*0.2}\flo@lgseg\flo@lge\flo@lgf\flo@lgg\flo@lgh}}}
% ---------------------------------------------------------------- dragonflies and damselflies
% Dragonflies and damselflies, seen from above, in units of the body's length, the head
% toward +y. A dragonfly perches with its four wings held out flat (pose cross), the hind
% ones broader at the root, and its eyes meet on top of its head. A damselfly is a needle
% with its eyes far apart and its wings narrow at the root, folded together along its back
% or held half open (spread). The wings: a clear or tinted wash, the long veins and, when
% large, the net of cross veins between them; the dark spot near the tip of the leading
% edge (stigma). The abdomen: ten segments, the hindmost ringed dark, as many as its bands.
% a wing's outline: ten points (along the wing, across it in units of its width), table #1
\def\flo@odWd#1#2#3#4{\expandafter\def\csname flo@odW#1x#2\endcsname{#3}\expandafter\def\csname flo@odW#1y#2\endcsname{#4}}
\flo@odWd f1{0.01}{0.35}\flo@odWd f2{0.12}{0.75}\flo@odWd f3{0.45}{0.95}\flo@odWd f4{0.8}{0.9}\flo@odWd f5{0.97}{0.55}
\flo@odWd f6{1}{0.1}\flo@odWd f7{0.93}{-0.45}\flo@odWd f8{0.7}{-0.75}\flo@odWd f9{0.35}{-0.85}\flo@odWd f{10}{0.08}{-0.6}
\flo@odWd h1{0.01}{0.35}\flo@odWd h2{0.15}{0.8}\flo@odWd h3{0.5}{0.95}\flo@odWd h4{0.85}{0.85}\flo@odWd h5{1}{0.3}
\flo@odWd h6{0.96}{-0.35}\flo@odWd h7{0.75}{-0.75}\flo@odWd h8{0.45}{-1}\flo@odWd h9{0.2}{-1.45}\flo@odWd h{10}{0.04}{-0.8}
\flo@odWd d1{0}{0.1}\flo@odWd d2{0.2}{0.2}\flo@odWd d3{0.45}{0.8}\flo@odWd d4{0.78}{0.98}\flo@odWd d5{0.98}{0.6}
\flo@odWd d6{1}{0}\flo@odWd d7{0.94}{-0.6}\flo@odWd d8{0.75}{-0.9}\flo@odWd d9{0.45}{-0.6}\flo@odWd d{10}{0.2}{-0.2}
% the long veins of table #1, 0 the leading edge's side and 5 the trailing edge's (both
% outside the wing): across the wing at its root, middle and tip
\def\flo@odVd#1#2#3#4#5{\expandafter\def\csname flo@odV#1#2\endcsname{{#3}{#4}{#5}}}
\flo@odVd f0{1.3}{1.3}{1.3}\flo@odVd f1{0.45}{0.72}{0.5}\flo@odVd f2{0.15}{0.3}{0.05}
\flo@odVd f3{-0.1}{-0.3}{-0.45}\flo@odVd f4{-0.3}{-0.7}{-0.8}\flo@odVd f5{-1.6}{-1.6}{-1.6}
\flo@odVd h0{1.3}{1.3}{1.3}\flo@odVd h1{0.45}{0.72}{0.5}\flo@odVd h2{0.15}{0.3}{0.05}
\flo@odVd h3{-0.1}{-0.35}{-0.45}\flo@odVd h4{-0.4}{-0.9}{-0.8}\flo@odVd h5{-1.6}{-1.6}{-1.6}
\flo@odVd d0{1.3}{1.3}{1.3}\flo@odVd d1{0.06}{0.6}{0.4}\flo@odVd d2{0.02}{0.2}{0}
\flo@odVd d3{-0.02}{-0.25}{-0.4}\flo@odVd d4{-0.06}{-0.5}{-0.7}\flo@odVd d5{-1.6}{-1.6}{-1.6}
% \flo@odvat{vein}{u}: the vein's place across the wing at u along it, into \flo@odvv
\def\flo@odvat#1#2{\expandafter\expandafter\expandafter\flo@odvat@\csname flo@odV\flo@odwk#1\endcsname{#2}}
\def\flo@odvat@#1#2#3#4{\flo@calc\flo@odvv{(#4<0.5 ? #1+(#2-(#1))*2*#4 : #2+(#3-(#2))*(2*#4-1))}}
% a wing's outline from table #1, #2 long and #3 wide, each point moved a little; kept as #4
\def\flo@odwingshape#1#2#3#4{%
  \flo@loop{odws}\flo@Wb{1}{10}{%
    \flo@sym\flo@t{0.008}\flo@calc\flo@xa{\csname flo@odW#1x\the\flo@Wb\endcsname*(#2)+\flo@t}%
    \flo@sym\flo@t{0.008}\flo@calc\flo@ya{\csname flo@odW#1y\the\flo@Wb\endcsname*(#3)+\flo@t}%
    \flo@put{\the\flo@Wb}\flo@xa\flo@ya}%
  \flo@smoothprep{10}\flo@keep{#4}}
% wing #1 (kept, table \flo@odwk, \flo@odwl long, \flo@odww wide) at its root (#2,#3),
% turned #4 degrees: its wash, a tinted wing's darker root, the stigma, the veins, the rim
\def\flo@odwing#1#2#3#4{\begin{pgfscope}%
  \pgftransformshift{\flo@P{#2}{#3}}\pgftransformrotate{#4}%
  \begin{pgfscope}\def\flo@rampname{flo@ramp}%
    \flo@vtone{flo@c}{\flo@odwt}\flo@vfill{flo@c}{\flo@odwo}{0}{\flo@kept{#1}}\end{pgfscope}%
  \begin{pgfscope}\flo@kept{#1}\pgfusepath{clip}%
    \def\flo@tmp{tinted}\edef\flo@t{\flo@xget{tint}}\ifx\flo@t\flo@tmp
      \flo@calc\flo@xa{0.1*\flo@odwl}\flo@calc\flo@ya{-0.2*\flo@odww}\flo@calc\flo@xb{0.2*\flo@odwl}\flo@calc\flo@yb{1.2*\flo@odww}%
      \flo@vtone{flo@c}{0.45}\flo@vfill{flo@c}{0.3}{0}{\flo@bgell\flo@xa\flo@ya\flo@xb\flo@yb}%
    \fi
    \ifnum\flo@xget{stigma}=1
      \flo@calc\flo@xa{0.83*\flo@odwl}\flo@calc\flo@xb{0.91*\flo@odwl}\flo@calc\flo@ya{1.3*\flo@odww}\flo@calc\flo@yb{0.55*\flo@odww}%
      \flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{0.9}{0}{\pgfpathmoveto{\flo@P\flo@xa\flo@ya}\pgfpathlineto{\flo@P\flo@xb\flo@ya}%
        \pgfpathlineto{\flo@P\flo@xb\flo@yb}\pgfpathlineto{\flo@P\flo@xa\flo@yb}\pgfpathclose}%
    \fi
    \ifnum\flo@fine=1
      \begin{pgfscope}\def\flo@rampname{flo@ramp}\flo@vtone{flo@c}{0.15}%
      \flo@vstroke{flo@c}{\flo@odvw}{0.6}{0}{\flo@loop{odvl}\flo@Wc{1}{4}{%
        \expandafter\expandafter\expandafter\flo@odvein\csname flo@odV\flo@odwk\the\flo@Wc\endcsname}}%
      \ifnum\flo@odnet=1
        \flo@vtone{flo@c}{0.2}\flo@vstroke{flo@c}{\flo@odnw}{0.45}{0}{%
          \flo@loop{odng}\flo@Wc{1}{5}{%
            \flo@loop{odnt}\flo@Wd{1}{22}{%
              \flo@sym\flo@t{0.3}\flo@calc\flo@u{(\the\flo@Wd-0.5+\flo@t)/22*0.96+0.02}%
              \flo@odvat{\the\numexpr\flo@Wc-1\relax}\flo@u\flo@calc\flo@ya{\flo@odvv*\flo@odww}%
              \flo@odvat{\the\flo@Wc}\flo@u\flo@calc\flo@yb{\flo@odvv*\flo@odww}%
              \flo@calc\flo@xa{\flo@u*\flo@odwl}\flo@sym\flo@t{0.01}\flo@calc\flo@xb{(\flo@u+\flo@t)*\flo@odwl}%
              \pgfpathmoveto{\flo@P\flo@xa\flo@ya}\pgfpathlineto{\flo@P\flo@xb\flo@yb}}}}%
      \fi\end{pgfscope}%
    \fi
  \end{pgfscope}%
  \ifnum\flo@fine=1 \begin{pgfscope}\def\flo@rampname{flo@ramp}%
    \flo@vtone{flo@c}{0.15}\flo@vstroke{flo@c}{\flo@odlw}{0.7}{0}{\flo@kept{#1}}\end{pgfscope}\fi
  \end{pgfscope}}
\def\flo@odvein#1#2#3{%
  \flo@calc\flo@ya{(#1)*\flo@odww}\pgfpathmoveto{\flo@P0\flo@ya}%
  \flo@calc\flo@xa{0.5*\flo@odwl}\flo@calc\flo@ya{(#2)*\flo@odww}\pgfpathlineto{\flo@P\flo@xa\flo@ya}%
  \flo@calc\flo@ya{(#3)*\flo@odww}\pgfpathlineto{\flo@P\flo@odwl\flo@ya}}
% the wings of the side: the hind one under the fore
\def\flo@odwings{%
  \flo@odwingshape\flo@odhk\flo@odHl\flo@odHw{odwh}\flo@odwingshape\flo@odfk\flo@odFl\flo@odFw{odwf}%
  \flo@calc\flo@ya{\flo@odty-\flo@odhd}\edef\flo@odwk{\flo@odhk}\let\flo@odwl\flo@odHl\let\flo@odww\flo@odHw
  \flo@odwing{odwh}{\flo@odrx}\flo@ya\flo@odah
  \flo@calc\flo@ya{\flo@odty+\flo@odfd}\edef\flo@odwk{\flo@odfk}\let\flo@odwl\flo@odFl\let\flo@odww\flo@odFw
  \flo@odwing{odwf}{\flo@odrx}\flo@ya\flo@odaf}
% the abdomen's outline: twelve points down each side, swollen at its root, round at its
% tip; kept as odab
\def\flo@odabdomen{%
  \flo@loop{odao}\flo@Wa{0}{11}{%
    \flo@calc\flo@v{\the\flo@Wa/11}%
    \flo@calc\flo@h{\flo@odaw*(1+\flo@odbul*exp(-min(9,\flo@v*\flo@v/0.012)))*min(1,(1.04-\flo@v)*5)}%
    \flo@calc\flo@ya{\flo@odat+(\flo@odtip-\flo@odat)*\flo@v}\flo@calc\flo@xa{-\flo@h}%
    \flo@put{\the\numexpr\flo@Wa+1\relax}\flo@h\flo@ya\flo@put{\the\numexpr24-\flo@Wa\relax}\flo@xa\flo@ya}%
  \flo@smoothprep{24}\flo@keep{odab}}
% the end of segment #1 down the abdomen, into \flo@odsv (0 its root, 1 its tip)
\def\flo@odseg#1{\flo@calc\flo@odsv{(#1)<1 ? 0 : pow((#1)/10,1.12)}}
% the abdomen: its wash, the dark rings, the joints, a highlight, the pooled rim
\def\flo@odpaintab{%
  \flo@vtone{flo@c}{\flo@odt}\flo@vfill{flo@c}{1}{0}{\flo@kept{odab}}%
  \begin{pgfscope}\flo@kept{odab}\pgfusepath{clip}%
    \ifnum\flo@xget{bands}>0
      \flo@vtone{flo@c}{0.04}\flo@vfill{flo@c}{0.85}{0}{%
        \flo@loop{odbd}\flo@Wb{1}{\flo@xget{bands}}{%
          \edef\flo@odsn{\the\numexpr10-\flo@xget{bands}+\flo@Wb\relax}%
          \flo@odseg{\flo@odsn-1}\let\flo@odsa\flo@odsv\flo@odseg\flo@odsn
          \flo@calc\flo@ya{\flo@odat+(\flo@odtip-\flo@odat)*(\flo@odsa+0.6*(\flo@odsv-\flo@odsa))}%
          \flo@calc\flo@yb{\flo@odat+(\flo@odtip-\flo@odat)*\flo@odsv-0.01}%
          \flo@bgband\flo@ya\flo@yb{0.004}}}%
    \fi
    \ifnum\flo@fine=1
      \flo@vtone{flo@c}{0.05}\flo@vstroke{flo@c}{\flo@odjw}{0.5}{0}{%
        \flo@loop{odjn}\flo@Wb{1}{9}{%
          \flo@odseg{\the\flo@Wb}\flo@calc\flo@ya{\flo@odat+(\flo@odtip-\flo@odat)*\flo@odsv}%
          \pgfpathmoveto{\flo@P{-0.1}\flo@ya}\pgfpathlineto{\flo@P{0.1}\flo@ya}}}%
      \flo@calc\flo@t{\flo@odtip-\flo@odat}%
      \flo@calc\flo@xa{-0.4*\flo@odaw}\flo@calc\flo@ya{\flo@odat+0.06*\flo@t}\flo@put1\flo@xa\flo@ya
      \flo@calc\flo@xa{-0.45*\flo@odaw}\flo@calc\flo@ya{\flo@odat+0.3*\flo@t}\flo@put2\flo@xa\flo@ya
      \flo@calc\flo@xa{-0.45*\flo@odaw}\flo@calc\flo@ya{\flo@odat+0.6*\flo@t}\flo@put3\flo@xa\flo@ya
      \flo@calc\flo@xa{-0.35*\flo@odaw}\flo@calc\flo@ya{\flo@odat+0.85*\flo@t}\flo@put4\flo@xa\flo@ya
      \flo@calc\flo@stw{0.5*\flo@odaw}\flo@vstreak{4}\flo@stw{0.004}{white}{0.45}%
    \fi
    \flo@vtone{flo@c}{0.05}\flo@calc\flo@t{1.4*\flo@odu}\flo@vstroke{flo@c}{\flo@t}{0.35}{1}{\flo@kept{odab}}%
  \end{pgfscope}%
  \ifnum\flo@fine=1
    \flo@calc\flo@ya{\flo@odtip+0.012}\flo@calc\flo@yb{\flo@odtip-0.022}%
    \flo@calc\flo@xa{0.5*\flo@odaw}\flo@calc\flo@xb{0.9*\flo@odaw}%
    \flo@vtone{flo@c}{0.05}\flo@vstroke{flo@c}{\flo@odjw}{1}{0}{\pgfpathmoveto{\flo@P{-\flo@xa}\flo@ya}%
      \pgfpathlineto{\flo@P{-\flo@xb}\flo@yb}\pgfpathmoveto{\flo@P\flo@xa\flo@ya}\pgfpathlineto{\flo@P\flo@xb\flo@yb}}%
  \fi}
% the thorax: a blob, a dragonfly's pale stripes on its shoulders, the rim
\def\flo@odthorax{%
  \flo@vblob{0}\flo@odty\flo@odtr\flo@odth{0.06}{10}\flo@keep{odth}%
  \flo@vtone{flo@c}{\flo@odtt}\flo@vfill{flo@c}{1}{0}{\flo@kept{odth}}%
  \begin{pgfscope}\flo@kept{odth}\pgfusepath{clip}%
    \ifnum\flo@fine=1
      \flo@calc\flo@twa{0.3*\flo@odtr}\flo@calc\flo@twb{0.12*\flo@odtr}%
      \flo@vfill{white}{0.35}{0}{\flo@loop{odts}\flo@Wb{1}{2}{%
        \ifnum\flo@Wb=1 \def\flo@sx{-1}\else\def\flo@sx{1}\fi
        \flo@calc\flo@xa{\flo@sx*0.3*\flo@odtr}\flo@calc\flo@ya{\flo@odty+0.75*\flo@odth}%
        \flo@calc\flo@xd{\flo@sx*0.6*\flo@odtr}\flo@calc\flo@yd{\flo@odty-0.45*\flo@odth}%
        \flo@lgseg\flo@xa\flo@ya\flo@xd\flo@yd}}%
    \fi
    \flo@vtone{flo@c}{0.05}\flo@calc\flo@t{1.2*\flo@odu}\flo@vstroke{flo@c}{\flo@t}{0.4}{1}{\flo@kept{odth}}%
  \end{pgfscope}}
% the head: a dragonfly's eyes meet on top, a damselfly's stand apart; a glint in each
\def\flo@odhead{%
  \flo@vtone{flo@c}{0.06}\flo@vfill{flo@c}{1}{0}{\flo@bgell0\flo@odhy\flo@odhx\flo@odhr}%
  \flo@calc\flo@ya{\flo@odhy+\flo@odey}%
  \flo@vtone{flo@c}{\flo@odet}\flo@vfill{flo@c}{1}{0}{\flo@bgell{-\flo@odex}\flo@ya\flo@oder\flo@oder
    \flo@bgell\flo@odex\flo@ya\flo@oder\flo@oder}%
  \ifnum\flo@fine=1
    \flo@calc\flo@xa{\flo@odex-0.35*\flo@oder}\flo@calc\flo@yb{\flo@ya+0.4*\flo@oder}\flo@calc\flo@t{0.22*\flo@oder}%
    \flo@vfill{white}{0.7}{0}{\pgfpathcircle{\flo@P{-\flo@xa}\flo@yb}{\flo@t pt}\pgfpathcircle{\flo@P\flo@xa\flo@yb}{\flo@t pt}}%
  \fi}
% a dragonfly or a damselfly; #1 its length on the page in pt
\def\flo@odo#1{%
  \flo@calc\flo@odu{(#1)/28.45276}%
  \ifdim\flo@odu pt>0.4pt \def\flo@fine{1}\else\def\flo@fine{0}\fi
  \ifdim\flo@odu pt>1.5pt \def\flo@odnet{1}\else\def\flo@odnet{0}\fi
  \edef\flo@odk{\flo@xget{kind}}\edef\flo@odpose{\flo@xget{pose}}\edef\flo@odground{\flo@xget{ground}}%
  \edef\flo@odt{\flo@xget{tone}}%
  \def\flo@tmp{dark}\ifx\flo@odground\flo@tmp\flo@calc\flo@odt{\flo@odt-0.12}\fi
  \def\flo@tmp{copper}\ifx\flo@odground\flo@tmp\def\flo@rampname{flo@aramp}\fi
  \flo@calc\flo@odtt{max(0.05,\flo@odt-0.08)}\flo@calc\flo@odet{max(0.06,\flo@odt-0.1)}%
  \def\flo@tmp{tinted}\edef\flo@t{\flo@xget{tint}}%
  \ifx\flo@t\flo@tmp\def\flo@odwt{0.7}\def\flo@odwo{0.42}\else\def\flo@odwt{0.88}\def\flo@odwo{0.28}\fi
  % proportions: a dragonfly's, then a damselfly's
  \def\flo@odaw{0.032}\def\flo@odbul{0.7}\def\flo@odat{0.16}\def\flo@odtip{-0.62}%
  \def\flo@odty{0.235}\def\flo@odtr{0.066}\def\flo@odth{0.08}%
  \def\flo@odhy{0.34}\def\flo@odhx{0.075}\def\flo@odhr{0.048}\def\flo@odex{0.038}\def\flo@odey{0.006}\def\flo@oder{0.046}%
  \def\flo@odfk{f}\def\flo@odhk{h}\def\flo@odFl{0.62}\def\flo@odFw{0.065}\def\flo@odHl{0.6}\def\flo@odHw{0.075}%
  \def\flo@odrx{0.02}\def\flo@odfd{0.03}\def\flo@odhd{0.035}\def\flo@odaf{8}\def\flo@odah{-6}%
  \def\flo@lgx{1}\def\flo@lgw{0.014}%
  \def\flo@tmp{damselfly}\ifx\flo@odk\flo@tmp
    \def\flo@odaw{0.016}\def\flo@odbul{0.5}\def\flo@odat{0.2}\def\flo@odtip{-0.66}%
    \def\flo@odty{0.26}\def\flo@odtr{0.04}\def\flo@odth{0.058}%
    \def\flo@odhy{0.34}\def\flo@odhx{0.075}\def\flo@odhr{0.028}\def\flo@odex{0.058}\def\flo@odey{0}\def\flo@oder{0.026}%
    \def\flo@odfk{d}\def\flo@odhk{d}\def\flo@odFl{0.5}\def\flo@odFw{0.06}\def\flo@odHl{0.48}\def\flo@odHw{0.06}%
    \def\flo@odrx{0.012}\def\flo@odfd{0.02}\def\flo@odhd{0.02}\def\flo@odaf{-84}\def\flo@odah{-88}%
    \def\flo@lgx{0.75}\def\flo@lgw{0.01}%
    \def\flo@tmp{spread}\ifx\flo@odpose\flo@tmp\def\flo@odaf{-38}\def\flo@odah{-50}\else\def\flo@odFw{0.032}\def\flo@odHw{0.032}\fi
  \fi
  % line widths
  \flo@calc\flo@odlw{max(0.18,0.3*\flo@odu)}\flo@calc\flo@odvw{max(0.12,0.22*\flo@odu)}%
  \flo@calc\flo@odnw{max(0.08,0.1*\flo@odu)}\flo@calc\flo@odjw{max(0.1,0.18*\flo@odu)}%
  % the legs, the abdomen, the thorax, the head, the wings
  \edef\flo@lgy{\flo@odty}\def\flo@lgex{0}\def\flo@lgj{0.006}\def\flo@lgph{0}%
  \flo@vtone{flo@c}{0.06}%
  \flo@loop{odsl}\flo@Wa{1}{2}{\begin{pgfscope}\ifnum\flo@Wa=2 \pgftransformxscale{-1}\fi\flo@vlegs{o}\end{pgfscope}}%
  \flo@odabdomen\flo@odpaintab\flo@odthorax\flo@odhead
  \flo@loop{odsw}\flo@Wa{1}{2}{\begin{pgfscope}\ifnum\flo@Wa=2 \pgftransformxscale{-1}\fi\flo@odwings\end{pgfscope}}}
% ---------------------------------------------------------------- beetles and ladybirds
% Beetles and ladybirds, seen from above as they walk, in units of the body's length, the
% head toward +y. The wing cases (elytra) meet down a seam; in front of them the shield
% of the thorax (pronotum) and the head, a small triangle (scutellum) at the top of the
% seam; six jointed legs, a gait apart on the two sides; feelers like threads, clubbed or
% combed. A beetle's cases are plain, striped or spotted, glossy; a ladybird is a dome, red
% with black spots (or black with red), its shield black with white patches at the front.
\def\flo@btelytra{%
  \flo@loop{bteo}\flo@Wa{1}{16}{%
    \flo@calc\flo@wa{22.5*\the\flo@Wa-11.25}\flo@calc\flo@t{cos(\flo@wa)}\flo@calc\flo@v{sin(\flo@wa)}%
    \flo@calc\flo@xa{\flo@btew*(\flo@t<0 ? -1 : 1)*pow(abs(\flo@t),\flo@btsq)}%
    \flo@calc\flo@ya{\flo@btey+\flo@v*(\flo@v<0 ? \flo@btrb : \flo@btrt)}%
    \flo@put{\the\flo@Wa}\flo@xa\flo@ya}%
  \flo@smoothprep{16}\flo@keep{btel}}
% the shield behind the head: ten points, its back #1 wide and over the cases by
% \flo@btso, its front #2 wide and #3 ahead of the cases; kept as btpn
\def\flo@btshield#1#2#3{%
  \flo@calc\flo@btsa{\flo@btet-\flo@btso}\flo@calc\flo@btsb{\flo@btet+(#3)}\flo@calc\flo@btsl{\flo@btsb-\flo@btsa}%
  \flo@calc\flo@xa{0.55*(#1)}\flo@calc\flo@xb{-\flo@xa}\flo@calc\flo@ya{\flo@btsa-0.01}\flo@put1\flo@xa\flo@ya\flo@put{10}\flo@xb\flo@ya
  \flo@calc\flo@xa{#1}\flo@calc\flo@xb{-\flo@xa}\flo@put2\flo@xa\flo@btsa\flo@put9\flo@xb\flo@btsa
  \flo@calc\flo@xa{\flo@btsw*(#1)}\flo@calc\flo@xb{-\flo@xa}\flo@calc\flo@ya{\flo@btsa+0.45*\flo@btsl}\flo@put3\flo@xa\flo@ya\flo@put8\flo@xb\flo@ya
  \flo@calc\flo@xa{#2}\flo@calc\flo@xb{-\flo@xa}\flo@calc\flo@ya{\flo@btsb-0.15*\flo@btsl}\flo@put4\flo@xa\flo@ya\flo@put7\flo@xb\flo@ya
  \flo@calc\flo@xa{0.5*(#2)}\flo@calc\flo@xb{-\flo@xa}\flo@put5\flo@xa\flo@btsb\flo@put6\flo@xb\flo@btsb
  \flo@smoothprep{10}\flo@keep{btpn}}
% the half-width of the cases at height #1, into \flo@h
\def\flo@bthw#1{\flo@calc\flo@t{(#1-\flo@btey)/(#1>\flo@btey ? \flo@btrt : \flo@btrb)}%
  \flo@calc\flo@h{\flo@btew*sqrt(max(0,1-\flo@t*\flo@t))}}
% stripes: two down each case
\def\flo@btstripes{%
  \flo@calc\flo@t{\flo@btet-\flo@bttip}\def\flo@twa{0.045}\def\flo@twb{0.012}%
  \flo@vfill{flo@c}{0.8}{0}{\flo@loop{btst}\flo@Wb{1}{4}{%
    \ifnum\flo@Wb<3 \def\flo@sx{1}\else\def\flo@sx{-1}\fi
    \ifodd\flo@Wb\def\flo@u{0.36}\else\def\flo@u{0.72}\fi
    \flo@calc\flo@xa{\flo@sx*\flo@u*\flo@btew}\flo@calc\flo@ya{\flo@btet-0.03}%
    \flo@calc\flo@xb{\flo@xa*1.04}\flo@calc\flo@yb{\flo@btet-0.35*\flo@t}%
    \flo@calc\flo@xc{\flo@xa*0.9}\flo@calc\flo@yc{\flo@btet-0.7*\flo@t}%
    \flo@calc\flo@xd{\flo@xa*0.35}\flo@calc\flo@yd{\flo@bttip+0.06}%
    \flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}}}
% a spot at (#1,#2), radius about #3, filled in flo@c
\def\flo@btspot#1#2#3{%
  \flo@range\flo@t{0.85}{1.1}\flo@calc\flo@btsr{(#3)*\flo@t}\flo@calc\flo@t{\flo@btsr*0.92}%
  \flo@vblob{#1}{#2}\flo@btsr\flo@t{0.1}{8}\flo@vfill{flo@c}{0.95}{0}{\flo@smoothpath}}
% the spots: an odd one on the seam behind the shield, the rest in rows on each case,
% the two sides alike
\def\flo@btspots{%
  \pgfmathtruncatemacro\flo@btm{floor(\flo@xget{spots}/2)}%
  \flo@calc\flo@btr{\flo@xget{spotsize}*\flo@btew*1.6/sqrt(max(1,\flo@btm))}%
  \ifnum\flo@btm<4 \def\flo@btc{1}\else\ifnum\flo@btm<8 \def\flo@btc{2}\else\def\flo@btc{3}\fi\fi
  \pgfmathtruncatemacro\flo@btrows{floor((\flo@btm+\flo@btc-1)/\flo@btc)}%
  \flo@calc\flo@t{\flo@xget{spots}-2*\flo@btm}\ifdim\flo@t pt>0pt
    \flo@calc\flo@ya{\flo@btet-\flo@btso-0.6*\flo@btr}\flo@calc\flo@v{1.15*\flo@btr}\flo@btspot{0}\flo@ya\flo@v\fi
  \flo@loop{btsp}\flo@Wb{1}{\flo@btm}{%
    \pgfmathtruncatemacro\flo@btrow{floor((\the\flo@Wb-1)/\flo@btc)}%
    \pgfmathtruncatemacro\flo@btcol{\the\flo@Wb-1-\flo@btc*\flo@btrow}%
    \flo@sym\flo@t{0.04}\flo@calc\flo@v{(\flo@btrow+0.5)/\flo@btrows+\flo@t}%
    \ifcase\flo@btc\or
      \flo@calc\flo@u{\flo@btm==1 ? 0.5 : (\flo@btrow==1 ? 0.4 : 0.62)}%
    \or
      \flo@calc\flo@u{(\flo@btcol==0 ? 0.33 : 0.7)}%
      \ifnum\flo@Wb=\flo@btm\relax\ifnum\flo@btcol=0 \def\flo@u{0.5}\fi\fi
    \else
      \flo@calc\flo@u{0.2+0.3*\flo@btcol}%
    \fi
    \flo@sym\flo@t{0.05}\flo@calc\flo@u{\flo@u+\flo@t}%
    \flo@calc\flo@bty{\flo@btet-\flo@btso-0.04-\flo@v*(\flo@btet-\flo@btso-\flo@bttip-0.08)}\flo@bthw\flo@bty
    \flo@calc\flo@btx{\flo@u*\flo@h}%
    \flo@btspot\flo@btx\flo@bty\flo@btr\flo@btspot{-\flo@btx}\flo@bty\flo@btr}}
% the wing cases: the wash, stripes or spots, mottle, the pooled rim, the gloss; the seam
\def\flo@btpaintel{%
  \flo@vtone{flo@c}{\flo@btt}\flo@vfill{flo@c}{1}{0}{\flo@kept{btel}}%
  \begin{pgfscope}\flo@kept{btel}\pgfusepath{clip}%
    \edef\flo@btpat{\flo@xget{pattern}}%
    \def\flo@tmp{stripes}\ifx\flo@btpat\flo@tmp\flo@btmark\flo@btstripes\fi
    \def\flo@tmp{spots}\ifx\flo@btpat\flo@tmp\flo@btmark\flo@btspots\fi
    \ifnum\flo@fine=1
      \flo@calc\flo@btxl{-\flo@btew}\flo@calc\flo@ta{\flo@btt-0.06}\flo@calc\flo@tb{\flo@btt+0.2}%
      \flo@vmottle\flo@btxl\flo@bttip\flo@btew\flo@btet{3}{0.08}\flo@ta\flo@tb{0}%
    \fi
    \flo@vtone{flo@c}{0.04}\flo@calc\flo@t{2.6*\flo@btu}\flo@vstroke{flo@c}{\flo@t}{0.35}{1}{\flo@kept{btel}}%
    \ifnum\flo@fine=1
      \flo@calc\flo@btln{(\flo@btet-\flo@bttip)*\flo@btgl}\flo@calc\flo@stw{0.14*\flo@btew}%
      \flo@loop{btgl}\flo@Wb{1}{2}{%
        \ifnum\flo@Wb=1 \def\flo@sx{-1}\def\flo@sto{0.55}\else\def\flo@sx{1}\def\flo@sto{0.3}\fi
        \flo@calc\flo@xa{\flo@sx*0.5*\flo@btew}\flo@calc\flo@ya{\flo@btet-\flo@btso-0.06*\flo@btln}\flo@put1\flo@xa\flo@ya
        \flo@calc\flo@xa{\flo@sx*0.56*\flo@btew}\flo@calc\flo@ya{\flo@btet-\flo@btso-0.23*\flo@btln}\flo@put2\flo@xa\flo@ya
        \flo@calc\flo@xa{\flo@sx*0.54*\flo@btew}\flo@calc\flo@ya{\flo@btet-\flo@btso-0.43*\flo@btln}\flo@put3\flo@xa\flo@ya
        \flo@calc\flo@xa{\flo@sx*0.45*\flo@btew}\flo@calc\flo@ya{\flo@btet-\flo@btso-0.6*\flo@btln}\flo@put4\flo@xa\flo@ya
        \flo@vstreak{4}\flo@stw{0.01}{white}\flo@sto}%
    \fi
  \end{pgfscope}%
  \flo@vtone{flo@c}{0.04}\flo@vstroke{flo@c}{\flo@btw}{0.8}{0}{\pgfpathmoveto{\flo@P0\flo@btet}%
    \pgfpathlineto{\flo@P0\flo@bttip}}}
% the color of the stripes or spots: dark on a pale or red case; on a dark one pale, or a
% black ladybird's red
\def\flo@btmark{%
  \def\flo@tmp{dark}\ifx\flo@btground\flo@tmp
    \def\flo@tmp{ladybird}\ifx\flo@btk\flo@tmp\flo@vaccent{flo@c}{0}\else\flo@vtone{flo@c}{0.8}\fi
  \else\flo@vtone{flo@c}{0.04}\fi}
% feelers of the side: a thread, a club, a comb (another kind's, fixed, as a thread)
\def\flo@btfeeler{%
  \edef\flo@t{\flo@xget{antenna}}%
  \flo@calc\flo@xa{0.35*\flo@bthx}\flo@calc\flo@ya{\flo@bthy+0.6*\flo@bthr}%
  \def\flo@tmp{clubbed}\ifx\flo@t\flo@tmp\flo@range\flo@xb{0.06}{0.08}\flo@range\flo@yb{0.06}{0.08}%
    \flo@range\flo@xc{0.1}{0.13}\flo@range\flo@yc{0.12}{0.15}\else
  \def\flo@tmp{comb}\ifx\flo@t\flo@tmp\flo@range\flo@xb{0.08}{0.1}\flo@range\flo@yb{0.08}{0.1}%
    \flo@range\flo@xc{0.16}{0.2}\flo@range\flo@yc{0.18}{0.22}\else
  \flo@range\flo@xb{0.1}{0.14}\flo@range\flo@yb{0.1}{0.14}% a thread, and any other kind's feeler
    \flo@range\flo@xc{0.2}{0.28}\flo@range\flo@yc{0.24}{0.32}\fi\fi
  \flo@calc\flo@xb{\flo@xa+\flo@xb*\flo@btfs}\flo@calc\flo@yb{\flo@ya+\flo@yb*\flo@btfs}%
  \flo@calc\flo@xc{\flo@xa+\flo@xc*\flo@btfs}\flo@calc\flo@yc{\flo@ya+\flo@yc*\flo@btfs}%
  \flo@vstroke{flo@c}{\flo@btw}{1}{0}{\pgfpathmoveto{\flo@P\flo@xa\flo@ya}\pgfpathlineto{\flo@P\flo@xb\flo@yb}%
    \pgfpathlineto{\flo@P\flo@xc\flo@yc}}%
  \def\flo@tmp{clubbed}\ifx\flo@t\flo@tmp
    \flo@calc\flo@da{\flo@xc-\flo@xb}\flo@calc\flo@db{\flo@yc-\flo@yb}\flo@nrm\flo@da\flo@db\flo@nx\flo@ny
    \flo@calc\flo@xd{\flo@ny*0.034*\flo@btfs}\flo@calc\flo@yd{-(\flo@nx)*0.034*\flo@btfs}%
    \flo@calc\flo@xe{\flo@nx*0.02*\flo@btfs}\flo@calc\flo@ye{\flo@ny*0.02*\flo@btfs}%
    \flo@vfill{flo@c}{1}{0}{\pgfpathellipse{\flo@P\flo@xc\flo@yc}{\flo@P\flo@xd\flo@yd}{\flo@P\flo@xe\flo@ye}}%
  \fi
  \def\flo@tmp{comb}\ifx\flo@t\flo@tmp\ifnum\flo@fine=1
    \flo@calc\flo@da{\flo@xc-\flo@xb}\flo@calc\flo@db{\flo@yc-\flo@yb}\flo@nrm\flo@da\flo@db\flo@nx\flo@ny
    \flo@calc\flo@t{0.6*\flo@btw}%
    \flo@vstroke{flo@c}{\flo@t}{1}{0}{\flo@loop{btcm}\flo@Wc{1}{6}{%
      \flo@calc\flo@v{\the\flo@Wc/6}%
      \flo@calc\flo@xd{\flo@xb+\flo@v*\flo@da}\flo@calc\flo@yd{\flo@yb+\flo@v*\flo@db}%
      \flo@calc\flo@xe{\flo@xd-\flo@nx*0.035*\flo@btfs}\flo@calc\flo@ye{\flo@yd-\flo@ny*0.035*\flo@btfs}%
      \pgfpathmoveto{\flo@P\flo@xd\flo@yd}\pgfpathlineto{\flo@P\flo@xe\flo@ye}}}%
  \fi\fi}
% the head, its eyes, a beetle's jaws; a ladybird's white dots
\def\flo@bthead{%
  \flo@vtone{flo@c}{\flo@btht}\flo@vfill{flo@c}{1}{0}{\flo@bgell0\flo@bthy\flo@bthx\flo@bthr}%
  \def\flo@tmp{ladybird}\ifx\flo@btk\flo@tmp
    \ifnum\flo@fine=1
      \flo@calc\flo@xa{0.45*\flo@bthx}\flo@calc\flo@ya{\flo@bthy+0.3*\flo@bthr}\flo@calc\flo@t{0.22*\flo@bthx}%
      \flo@bgwhite\flo@vfill{flo@c}{0.9}{0}{\pgfpathcircle{\flo@P{-\flo@xa}\flo@ya}{\flo@t pt}\pgfpathcircle{\flo@P\flo@xa\flo@ya}{\flo@t pt}}%
    \fi
  \else
    \flo@calc\flo@xa{0.82*\flo@bthx}\flo@calc\flo@ya{\flo@bthy+0.1*\flo@bthr}\flo@calc\flo@xb{0.24*\flo@bthx}\flo@calc\flo@yb{0.42*\flo@bthr}%
    \flo@vtone{flo@c}{0.02}\flo@vfill{flo@c}{1}{0}{\flo@bgell{-\flo@xa}\flo@ya\flo@xb\flo@yb\flo@bgell\flo@xa\flo@ya\flo@xb\flo@yb}%
    \ifnum\flo@fine=1
      \flo@calc\flo@twa{0.3*\flo@bthx}\def\flo@twb{0.004}%
      \flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{1}{0}{\flo@loop{btjw}\flo@Wb{1}{2}{%
        \ifnum\flo@Wb=1 \def\flo@sx{-1}\else\def\flo@sx{1}\fi
        \flo@calc\flo@xa{\flo@sx*0.4*\flo@bthx}\flo@calc\flo@ya{\flo@bthy+0.8*\flo@bthr}%
        \flo@calc\flo@xb{\flo@sx*0.5*\flo@bthx}\flo@calc\flo@yb{\flo@bthy+1.25*\flo@bthr}%
        \flo@calc\flo@xc{\flo@sx*0.3*\flo@bthx}\flo@calc\flo@yc{\flo@bthy+1.55*\flo@bthr}%
        \flo@calc\flo@xd{\flo@sx*0.08*\flo@bthx}\flo@calc\flo@yd{\flo@bthy+1.6*\flo@bthr}%
        \flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}}%
    \fi
  \fi}
% the shield: its wash, a ladybird's white patches, a highlight, the rim
\def\flo@btpaintpn{%
  \flo@vtone{flo@c}{\flo@btpt}\flo@vfill{flo@c}{1}{0}{\flo@kept{btpn}}%
  \begin{pgfscope}\flo@kept{btpn}\pgfusepath{clip}%
    \def\flo@tmp{ladybird}\ifx\flo@btk\flo@tmp
      \flo@calc\flo@xa{0.72*\flo@btpb}\flo@calc\flo@ya{\flo@btsa+0.62*\flo@btsl}%
      \flo@calc\flo@xb{0.3*\flo@btpb}\flo@calc\flo@yb{0.4*\flo@btsl}%
      \flo@bgwhite\flo@vfill{flo@c}{0.95}{0}{\flo@bgell{-\flo@xa}\flo@ya\flo@xb\flo@yb\flo@bgell\flo@xa\flo@ya\flo@xb\flo@yb}%
    \fi
    \ifnum\flo@fine=1
      \flo@calc\flo@xa{-0.55*\flo@btpb}\flo@calc\flo@ya{\flo@btsa+0.3*\flo@btsl}\flo@put1\flo@xa\flo@ya
      \flo@calc\flo@xa{-0.4*\flo@btpb}\flo@calc\flo@ya{\flo@btsa+0.62*\flo@btsl}\flo@put2\flo@xa\flo@ya
      \flo@calc\flo@xa{-0.2*\flo@btpb}\flo@calc\flo@ya{\flo@btsa+0.8*\flo@btsl}\flo@put3\flo@xa\flo@ya
      \flo@calc\flo@stw{0.12*\flo@btsl}\flo@vstreak{3}\flo@stw{0.006}{white}{0.4}%
    \fi
    \flo@vtone{flo@c}{0.03}\flo@calc\flo@t{2*\flo@btu}\flo@vstroke{flo@c}{\flo@t}{0.35}{1}{\flo@kept{btpn}}%
  \end{pgfscope}}
% a beetle or a ladybird; #1 its length on the page in pt
\def\flo@beetle#1{%
  \flo@calc\flo@btu{(#1)/28.45276}%
  \ifdim\flo@btu pt>0.25pt \def\flo@fine{1}\else\def\flo@fine{0}\fi
  \edef\flo@btk{\flo@xget{kind}}\edef\flo@btground{\flo@xget{ground}}%
  \edef\flo@btt{\flo@xget{tone}}%
  \def\flo@tmp{dark}\ifx\flo@btground\flo@tmp\flo@calc\flo@btt{max(0.04,\flo@btt-0.22)}%
    \def\flo@tmp{ladybird}\ifx\flo@btk\flo@tmp\def\flo@btt{0.06}\fi\fi
  \def\flo@tmp{copper}\ifx\flo@btground\flo@tmp\def\flo@rampname{flo@aramp}\fi
  % proportions: a beetle's, then a ladybird's
  \flo@calc\flo@btew{0.5*\flo@xget{build}}\def\flo@btet{0.14}\def\flo@bttip{-0.56}\def\flo@btrt{0.12}\def\flo@btsq{0.7}%
  \flo@calc\flo@btpb{0.88*\flo@btew}\flo@calc\flo@btpf{0.62*\flo@btew}\def\flo@btpl{0.17}\def\flo@btso{0.012}\def\flo@btsw{1.02}%
  \flo@calc\flo@bthx{0.36*\flo@btew}\def\flo@bthr{0.065}\def\flo@bthy{0.36}\def\flo@btfs{1}\def\flo@btgl{1}%
  \flo@calc\flo@btpt{max(0.04,\flo@btt-0.06)}\flo@calc\flo@btht{max(0.04,\flo@btt-0.1)}%
  \def\flo@lgw{0.03}\def\flo@lgj{0.015}\def\flo@lgx{1}\flo@calc\flo@lgex{\flo@btew}\def\flo@btly{0}%
  \def\flo@tmp{ladybird}\ifx\flo@btk\flo@tmp
    \def\flo@btet{0.22}\def\flo@bttip{-0.5}\def\flo@btrt{0.36}\def\flo@btsq{1}%
    \flo@calc\flo@btpb{0.6*\flo@btew}\flo@calc\flo@btpf{0.4*\flo@btew}\def\flo@btpl{0.05}\def\flo@btso{0.075}\def\flo@btsw{0.92}%
    \flo@calc\flo@bthx{0.3*\flo@btew}\def\flo@bthr{0.055}\def\flo@bthy{0.27}\def\flo@btfs{0.45}\def\flo@btgl{0.55}%
    \def\flo@btpt{0.04}\def\flo@btht{0.04}\def\flo@lgw{0.032}\def\flo@lgj{0.01}\def\flo@lgx{0.7}%
    \flo@calc\flo@lgex{0.8*\flo@btew}\def\flo@btly{0.12}%
  \fi
  \flo@calc\flo@btey{\flo@btet-\flo@btrt}\flo@calc\flo@btrb{\flo@btey-\flo@bttip}%
  \flo@calc\flo@btw{max(0.25,0.4*\flo@btu)}%
  % the legs, the feelers, the head, the wing cases, the shield, the scutellum
  \flo@calc\flo@lgy{\flo@btet-\flo@btly}%
  \flo@vtone{flo@c}{0.05}%
  \flo@loop{btsl}\flo@Wa{1}{2}{\begin{pgfscope}%
    \ifnum\flo@Wa=2 \pgftransformxscale{-1}\def\flo@lgph{-0.04}\else\def\flo@lgph{0.04}\fi
    \flo@vlegs{b}\end{pgfscope}}%
  \flo@vtone{flo@c}{0.05}%
  \flo@loop{btsf}\flo@Wa{1}{2}{\begin{pgfscope}\ifnum\flo@Wa=2 \pgftransformxscale{-1}\fi\flo@btfeeler\end{pgfscope}}%
  \flo@bthead\flo@btelytra\flo@btpaintel
  \flo@btshield\flo@btpb\flo@btpf\flo@btpl\flo@btpaintpn
  \def\flo@tmp{ladybird}\ifx\flo@btk\flo@tmp\else
    \flo@calc\flo@ya{\flo@btet+0.004}\flo@calc\flo@yb{\flo@btet-0.05}%
    \flo@vtone{flo@c}{\flo@btpt}\flo@vfill{flo@c}{1}{0}{\pgfpathmoveto{\flo@P{-0.035}\flo@ya}%
      \pgfpathlineto{\flo@P{0.035}\flo@ya}\pgfpathlineto{\flo@P0\flo@yb}\pgfpathclose}%
  \fi}
% ---------------------------------------------------------------- caterpillars
% A caterpillar on its host leaf, in units of its length: the leaf along +y from the
% origin, its right edge bitten where the caterpillar feeds; the caterpillar seen from the
% side along that edge, its belly toward the leaf (curled, lying on it), its head toward
% the leaf's tip. The body
% is thirteen segments along a spine that the pose bends: nearly straight, arched in a
% loop (a looper, legs only at both ends) or curled in a C. True legs on the three
% segments behind the head, prolegs on the 5th to 8th from the tail and the last; a pale
% line along the side with the breathing holes, or a dark one down the back; tufts of hair
% on the back, a horn near the tail.
% the leaf's half-width at v (0 its root, 1 its tip), into \flo@h; the midrib's x into \flo@hfx
\def\flo@hfw#1{\flo@calc\flo@h{\flo@hfW*pow(sin(180*pow(#1,0.8)),0.85)}\flo@calc\flo@hfx{\flo@hfbend*(#1)*(#1)}}
% the outline: the root, 23 points up the right edge (round the bites), the tip, 23 down
% the left; kept as hfl
\def\flo@hfoutline{%
  \flo@put1{0}{0}\flo@calc\flo@xa{\flo@hfbend}\flo@put{25}\flo@xa\flo@hfL
  \flo@loop{hfo}\flo@Wa{1}{23}{%
    \flo@calc\flo@v{\the\flo@Wa/24}\flo@hfw\flo@v\flo@calc\flo@ya{\flo@v*\flo@hfL}%
    \flo@calc\flo@xa{\flo@hfx+\flo@h}\flo@calc\flo@xb{\flo@hfx-\flo@h}%
    \flo@loop{hfb}\flo@Wb{1}{\flo@hfnb}{%
      \edef\flo@hfi{\the\flo@Wb}%
      \flo@calc\flo@t{abs(\flo@ya-\csname flo@hfby\flo@hfi\endcsname)}%
      \flo@calc\flo@xa{\flo@t<\csname flo@hfbr\flo@hfi\endcsname ? min(\flo@xa,\csname flo@hfbx\flo@hfi\endcsname
        -sqrt(max(0,\csname flo@hfbr\flo@hfi\endcsname*\csname flo@hfbr\flo@hfi\endcsname-\flo@t*\flo@t))) : \flo@xa}}%
    \flo@put{\the\numexpr\flo@Wa+1\relax}\flo@xa\flo@ya\flo@put{\the\numexpr49-\flo@Wa\relax}\flo@xb\flo@ya}%
  \flo@smoothprep{48}\flo@keep{hfl}}
% the host leaf: a stalk, the wash, its left half darker, mottle, white veins, the rim
\def\flo@hfpaint{\begin{pgfscope}\def\flo@rampname{flo@ramp}%
  \flo@vtone{flo@c}{0.2}\def\flo@twa{0.028}\def\flo@twb{0.02}%
  \flo@vfill{flo@c}{1}{0}{\flo@vtaper{0}{-0.14}{0}{-0.09}{0}{-0.05}{0}{0.02}}%
  \flo@vtone{flo@c}{\flo@hft}\flo@vfill{flo@c}{1}{0}{\flo@kept{hfl}}%
  \begin{pgfscope}\flo@kept{hfl}\pgfusepath{clip}%
    \flo@calc\flo@t{\flo@hft-0.12}\flo@vtone{flo@c}\flo@t
    \flo@vfill{flo@c}{0.35}{1}{\pgfpathmoveto{\flo@P{-1}{0}}\pgfpathlineto{\flo@P00}%
      \flo@loop{hfh}\flo@Wa{1}{8}{\flo@calc\flo@v{\the\flo@Wa/8}\flo@hfw\flo@v\flo@calc\flo@ya{\flo@v*\flo@hfL}%
        \pgfpathlineto{\flo@P\flo@hfx\flo@ya}}%
      \pgfpathlineto{\flo@P{-1}\flo@hfL}\pgfpathclose}%
    \ifnum\flo@fine=1
      \flo@calc\flo@hfxl{-\flo@hfW}\flo@calc\flo@ta{\flo@hft-0.16}\flo@calc\flo@tb{\flo@hft+0.18}%
      \flo@vmottle\flo@hfxl{0}\flo@hfW\flo@hfL{6}{0.12}\flo@ta\flo@tb{8}%
      \def\flo@twa{0.022}\def\flo@twb{0.004}%
      \flo@vfill{white}{0.5}{0}{%
        \flo@hfw{0.33}\flo@calc\flo@xb{\flo@hfx}\flo@calc\flo@yb{0.33*\flo@hfL}%
        \flo@hfw{0.67}\flo@calc\flo@xc{\flo@hfx}\flo@calc\flo@yc{0.67*\flo@hfL}%
        \flo@hfw{0.97}\flo@calc\flo@xd{\flo@hfx}\flo@calc\flo@yd{0.97*\flo@hfL}%
        \flo@vtaper{0}{0}\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}%
      \def\flo@twa{0.014}\def\flo@twb{0.002}%
      \flo@vfill{white}{0.4}{0}{\flo@loop{hfv}\flo@Wa{1}{10}{%
        \ifodd\flo@Wa\def\flo@sx{1}\else\def\flo@sx{-1}\fi
        \flo@calc\flo@v{0.1+0.15*floor((\the\flo@Wa-1)/2)}\flo@hfw\flo@v
        \flo@calc\flo@xa{\flo@hfx}\flo@calc\flo@ya{\flo@v*\flo@hfL}%
        \flo@calc\flo@xd{\flo@hfx+\flo@sx*0.85*\flo@h}\flo@calc\flo@yd{\flo@ya+0.09*\flo@hfL}%
        \flo@calc\flo@xb{\flo@xa+(\flo@xd-\flo@xa)*0.4}\flo@calc\flo@yb{\flo@ya+(\flo@yd-\flo@ya)*0.15}%
        \flo@calc\flo@xc{\flo@xa+(\flo@xd-\flo@xa)*0.75}\flo@calc\flo@yc{\flo@ya+(\flo@yd-\flo@ya)*0.55}%
        \flo@vtaper\flo@xa\flo@ya\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}}%
    \fi
    \flo@vtone{flo@c}{0.06}\flo@calc\flo@t{0.9*\flo@ctu}\flo@vstroke{flo@c}{\flo@t}{0.4}{1}{\flo@kept{hfl}}%
  \end{pgfscope}\end{pgfscope}}
% the spine's angle at s (0 the tail, 1 the head), into \flo@cta
\def\flo@ctangle#1{%
  \def\flo@tmp{loop}\ifx\flo@ctpose\flo@tmp\flo@calc\flo@cta{105*cos(180*(#1))}\else
  \def\flo@tmp{curl}\ifx\flo@ctpose\flo@tmp\flo@calc\flo@cta{150-300*(#1)}\else
  \flo@calc\flo@cta{\flo@ctwa*sin(540*(#1)+\flo@ctph)}\fi\fi}
% the spine: 27 points from the tail (\flo@ctX/Y<k>), the angle (\flo@ctA<k>), the normal
% toward the back (\flo@ctNX/NY<k>) and the half-width (\flo@ctW<k>) at each
\def\flo@ctspine{%
  \expandafter\def\csname flo@ctX0\endcsname{0}\expandafter\def\csname flo@ctY0\endcsname{0}%
  \flo@loop{cts}\flo@Wa{0}{26}{%
    \edef\flo@cti{\the\flo@Wa}\flo@calc\flo@v{\flo@cti/26}%
    \ifnum\flo@Wa>0
      \flo@calc\flo@t{(\flo@cti-0.5)/26}\flo@ctangle\flo@t
      \flo@calc\flo@xa{\csname flo@ctX\the\numexpr\flo@Wa-1\endcsname+cos(\flo@cta)/26}%
      \flo@calc\flo@ya{\csname flo@ctY\the\numexpr\flo@Wa-1\endcsname+sin(\flo@cta)/26}%
      \expandafter\let\csname flo@ctX\flo@cti\endcsname\flo@xa\expandafter\let\csname flo@ctY\flo@cti\endcsname\flo@ya
    \fi
    \flo@ctangle\flo@v\expandafter\let\csname flo@ctA\flo@cti\endcsname\flo@cta
    \flo@calc\flo@t{-sin(\flo@cta)}\expandafter\let\csname flo@ctNX\flo@cti\endcsname\flo@t
    \flo@calc\flo@t{cos(\flo@cta)}\expandafter\let\csname flo@ctNY\flo@cti\endcsname\flo@t
    \flo@calc\flo@t{\flo@ctW*(0.7+0.3*sin(180*min(1,1.6*\flo@v)))*(\flo@v>0.92 ? 1-(\flo@v-0.92)*2.5 : 1)}%
    \expandafter\let\csname flo@ctW\flo@cti\endcsname\flo@t}}
% the point at spine k, f half-widths toward the back (f < 0: the belly), g along it: \flo@xa/ya
\def\flo@ctat#1#2#3{%
  \flo@calc\flo@xa{\csname flo@ctX#1\endcsname+(#2)*\csname flo@ctW#1\endcsname*\csname flo@ctNX#1\endcsname
    +(#3)*\csname flo@ctW#1\endcsname*\csname flo@ctNY#1\endcsname}%
  \flo@calc\flo@ya{\csname flo@ctY#1\endcsname+(#2)*\csname flo@ctW#1\endcsname*\csname flo@ctNY#1\endcsname
    -(#3)*\csname flo@ctW#1\endcsname*\csname flo@ctNX#1\endcsname}}
% the outline: the belly from the tail, the back from the head, a point behind the tail
\def\flo@ctoutline{%
  \flo@loop{cto}\flo@Wa{0}{26}{%
    \flo@ctat{\the\flo@Wa}{-1}{0}\flo@put{\the\numexpr\flo@Wa+1\relax}\flo@xa\flo@ya
    \flo@ctat{\the\flo@Wa}{1}{0}\flo@put{\the\numexpr54-\flo@Wa\relax}\flo@xa\flo@ya}%
  \flo@ctat{0}{0}{-0.7}\flo@put{55}\flo@xa\flo@ya
  \flo@smoothprep{55}\flo@keep{ctb}}
% a leg at spine #1: from #2 half-widths under the back to #3 under it, #4 along the body
\def\flo@ctleg#1#2#3#4{%
  \flo@ctat{#1}{-(#2)}{0}\let\flo@ctlx\flo@xa\let\flo@ctly\flo@ya
  \flo@ctat{#1}{-(#3)}{#4}\let\flo@xd\flo@xa\let\flo@yd\flo@ya
  \flo@lgseg\flo@ctlx\flo@ctly\flo@xd\flo@yd}
% points k = #1, #1+#3, ... #2 at #4 half-widths toward the back, for a streak
\def\flo@ctline#1#2#3#4{%
  \def\flo@ctn{0}%
  \flo@loop{ctl}\flo@Wb{0}{(#2-#1)/#3}{%
    \edef\flo@ctn{\the\numexpr\flo@ctn+1\relax}%
    \flo@ctat{\the\numexpr#1+#3*\flo@Wb\relax}{#4}{0}\flo@put\flo@ctn\flo@xa\flo@ya}}
% the body: legs, the wash, the belly's shade, stripes, joints, mottle, a highlight, the rim
\def\flo@ctbody{%
  % prolegs (a looper's only at both ends), then the true legs
  \flo@calc\flo@twa{0.9*\flo@ctW}\flo@calc\flo@twb{0.65*\flo@ctW}%
  \flo@calc\flo@t{max(0.05,\flo@ctt-0.08)}\flo@vtone{flo@c}\flo@t
  \flo@vfill{flo@c}{1}{0}{\flo@loop{ctp}\flo@Wa{1}{5}{%
    \edef\flo@ctk{\ifcase\flo@Wa\or1\or9\or11\or13\or15\fi}%
    \def\flo@tmp{loop}\ifx\flo@ctpose\flo@tmp\ifnum\flo@Wa>2 \def\flo@ctk{}\fi\fi
    \ifx\flo@ctk\pgfutil@empty\else\flo@ctleg\flo@ctk{0.5}{1.45}{-0.1}\fi}}%
  \flo@calc\flo@twa{0.35*\flo@ctW}\flo@calc\flo@twb{0.06*\flo@ctW}%
  \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{1}{0}{\flo@loop{cttl}\flo@Wa{0}{2}{%
    \flo@ctleg{\the\numexpr21+2*\flo@Wa\relax}{0.6}{1.55}{0.35}}}%
  \flo@ctoutline
  \flo@vtone{flo@c}{\flo@ctt}\flo@vfill{flo@c}{1}{0}{\flo@kept{ctb}}%
  \begin{pgfscope}\flo@kept{ctb}\pgfusepath{clip}%
    \flo@calc\flo@t{\flo@ctt-0.12}\flo@vtone{flo@c}\flo@t
    \flo@vfill{flo@c}{0.35}{1}{%
      \flo@loop{ctsh}\flo@Wa{0}{26}{\flo@ctat{\the\flo@Wa}{0}{0}%
        \ifnum\flo@Wa=0 \pgfpathmoveto{\flo@P\flo@xa\flo@ya}\else\pgfpathlineto{\flo@P\flo@xa\flo@ya}\fi}%
      \flo@loop{ctsi}\flo@Wa{0}{26}{\flo@ctat{\the\numexpr26-\flo@Wa\relax}{-1.4}{0}\pgfpathlineto{\flo@P\flo@xa\flo@ya}}%
      \pgfpathclose}%
    \edef\flo@t{\flo@xget{stripes}}%
    \def\flo@tmp{side}\ifx\flo@t\flo@tmp
      \flo@ctline{1}{25}{2}{-0.2}\flo@calc\flo@stw{0.45*\flo@ctW}\flo@calc\flo@sto{0.3*\flo@ctW}%
      \flo@vstreak{13}\flo@stw\flo@sto{white}{0.6}%
      \ifnum\flo@fine=1
        \flo@calc\flo@ctsr{0.13*\flo@ctW}\flo@calc\flo@ctsq{0.09*\flo@ctW}%
        \flo@vtone{flo@c}{0.04}\flo@vfill{flo@c}{0.85}{0}{\flo@loop{ctsp}\flo@Wa{1}{9}{%
          \flo@ctat{\the\numexpr1+2*\flo@Wa\relax}{0.08}{0}\flo@bgell\flo@xa\flo@ya\flo@ctsq\flo@ctsr}}%
      \fi
    \fi
    \def\flo@tmp{back}\ifx\flo@t\flo@tmp
      \flo@ctline{1}{25}{2}{0.72}\flo@calc\flo@stw{0.42*\flo@ctW}\flo@calc\flo@sto{0.3*\flo@ctW}%
      \flo@vtone{flo@c}{0.05}\flo@vstreak{13}\flo@stw\flo@sto{flo@c}{0.7}%
    \fi
    \ifnum\flo@fine=1
      \flo@vtone{flo@c}{0.05}\flo@vstroke{flo@c}{\flo@ctjw}{0.4}{1}{\flo@loop{ctj}\flo@Wa{1}{12}{%
        \flo@ctat{\the\numexpr2*\flo@Wa\relax}{-1.3}{0}\pgfpathmoveto{\flo@P\flo@xa\flo@ya}%
        \flo@ctat{\the\numexpr2*\flo@Wa\relax}{1.3}{0}\pgfpathlineto{\flo@P\flo@xa\flo@ya}}}%
      \flo@calc\flo@ctxl{-0.2}\flo@calc\flo@ctyl{-0.4}\flo@calc\flo@ctxh{1.1}\flo@calc\flo@ctyh{0.8}%
      \flo@calc\flo@ta{\flo@ctt-0.14}\flo@calc\flo@tb{\flo@ctt+0.18}%
      \flo@vmottle\flo@ctxl\flo@ctyl\flo@ctxh\flo@ctyh{5}{0.05}\flo@ta\flo@tb{10}%
      \flo@ctline{2}{24}{2}{0.45}\flo@calc\flo@stw{0.3*\flo@ctW}%
      \flo@vstreak{12}\flo@stw{0.004}{white}{0.4}%
    \fi
    \flo@vtone{flo@c}{0.05}\flo@calc\flo@t{0.9*\flo@ctu}\flo@vstroke{flo@c}{\flo@t}{0.6}{1}{\flo@kept{ctb}}%
  \end{pgfscope}}
% the head: a capsule past the last point, an eye, the jaws, a glint
\def\flo@cthead{%
  \flo@ctat{26}{0}{0.5}\let\flo@cthx\flo@xa\let\flo@cthy\flo@ya
  \flo@calc\flo@xb{\csname flo@ctNY26\endcsname*0.92*\flo@ctW}\flo@calc\flo@yb{-\csname flo@ctNX26\endcsname*0.92*\flo@ctW}%
  \flo@calc\flo@xc{\csname flo@ctNX26\endcsname*0.85*\flo@ctW}\flo@calc\flo@yc{\csname flo@ctNY26\endcsname*0.85*\flo@ctW}%
  \flo@vtone{flo@c}{\flo@ctht}\flo@vfill{flo@c}{1}{0}{\pgfpathellipse{\flo@P\flo@cthx\flo@cthy}{\flo@P\flo@xb\flo@yb}{\flo@P\flo@xc\flo@yc}}%
  \ifnum\flo@fine=1
    \flo@calc\flo@xa{\flo@cthx+0.35*\flo@xb+0.15*\flo@xc}\flo@calc\flo@ya{\flo@cthy+0.35*\flo@yb+0.15*\flo@yc}%
    \flo@calc\flo@t{0.13*\flo@ctW}\flo@vtone{flo@c}{0.02}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P\flo@xa\flo@ya}{\flo@t pt}}%
    \flo@calc\flo@xa{\flo@cthx-0.25*\flo@xb+0.45*\flo@xc}\flo@calc\flo@ya{\flo@cthy-0.25*\flo@yb+0.45*\flo@yc}%
    \flo@calc\flo@t{0.1*\flo@ctW}\flo@vfill{white}{0.6}{0}{\pgfpathcircle{\flo@P\flo@xa\flo@ya}{\flo@t pt}}%
    \flo@calc\flo@xa{\flo@cthx+0.8*\flo@xb-0.45*\flo@xc}\flo@calc\flo@ya{\flo@cthy+0.8*\flo@yb-0.45*\flo@yc}%
    \flo@calc\flo@xd{\flo@cthx+1.2*\flo@xb-0.75*\flo@xc}\flo@calc\flo@yd{\flo@cthy+1.2*\flo@yb-0.75*\flo@yc}%
    \flo@calc\flo@twa{0.25*\flo@ctW}\flo@calc\flo@twb{0.05*\flo@ctW}%
    \flo@vtone{flo@c}{0.04}\flo@vfill{flo@c}{1}{0}{\flo@lgseg\flo@xa\flo@ya\flo@xd\flo@yd}%
  \fi}
% a horn near the tail; tufts of hair on the back and pencils at both ends
\def\flo@cthorn{%
  \flo@ctat{5}{0.8}{0}\let\flo@xe\flo@xa\let\flo@ye\flo@ya
  \flo@ctat{5}{2.4}{-1.6}\let\flo@xd\flo@xa\let\flo@yd\flo@ya
  \flo@ctat{5}{1.7}{0}\let\flo@xb\flo@xa\let\flo@yb\flo@ya
  \flo@ctat{5}{2.4}{-0.7}\let\flo@xc\flo@xa\let\flo@yc\flo@ya
  \flo@calc\flo@twa{0.5*\flo@ctW}\flo@calc\flo@twb{0.05*\flo@ctW}%
  \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{1}{0}{\flo@vtaper\flo@xe\flo@ye\flo@xb\flo@yb\flo@xc\flo@yc\flo@xd\flo@yd}}
\def\flo@cthair#1#2#3#4{% a hair at spine #1, out #2 half-widths from #3 along it, #4 degrees off the back
  \flo@ctat{#1}{0.85}{#3}\let\flo@xe\flo@xa\let\flo@ye\flo@ya
  \flo@calc\flo@t{\csname flo@ctA#1\endcsname+90+(#4)}%
  \flo@calc\flo@xd{\flo@xe+(#2)*\flo@ctW*cos(\flo@t)}\flo@calc\flo@yd{\flo@ye+(#2)*\flo@ctW*sin(\flo@t)}%
  \flo@lgseg\flo@xe\flo@ye\flo@xd\flo@yd}
\def\flo@cttufts{%
  \flo@calc\flo@twa{0.1*\flo@ctW}\flo@calc\flo@twb{0.02*\flo@ctW}%
  \flo@bgwhite\flo@vfill{flo@c}{0.9}{0}{\flo@loop{ctt}\flo@Wa{1}{4}{%
    \flo@loop{cth}\flo@Wb{1}{9}{%
      \flo@range\flo@ctl{1.2}{1.8}\flo@range\flo@ctg{-0.25}{0.25}%
      \flo@cthair{\the\numexpr9+2*\flo@Wa\relax}\flo@ctl\flo@ctg{(\the\flo@Wb-5)*8}}}}%
  \flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{0.9}{0}{\flo@loop{ctpn}\flo@Wa{1}{5}{%
    \flo@range\flo@ctl{2.4}{3}\flo@cthair{24}\flo@ctl{0}{\the\flo@Wa*6-48}%
    \flo@range\flo@ctl{2}{2.6}\flo@cthair{2}\flo@ctl{0}{\the\flo@Wa*6+12}}}}
% a caterpillar on its leaf; #1 its length on the page in pt
\def\flo@caterpillar#1{%
  \flo@calc\flo@ctu{(#1)/28.45276}%
  \ifdim\flo@ctu pt>0.25pt \def\flo@fine{1}\else\def\flo@fine{0}\fi
  \edef\flo@ctpose{\flo@xget{pose}}\edef\flo@ctground{\flo@xget{ground}}\edef\flo@ctt{\flo@xget{tone}}%
  \def\flo@tmp{pale}\ifx\flo@ctground\flo@tmp\flo@calc\flo@ctt{min(0.6,\flo@ctt+0.22)}\fi
  \flo@calc\flo@ctW{\flo@xget{build}/2}\flo@calc\flo@ctht{max(0.05,\flo@ctt-0.16)}%
  \flo@calc\flo@ctjw{max(0.1,0.16*\flo@ctu)}%
  \flo@range\flo@ctwa{3}{7}\flo@range\flo@ctph{0}{360}\flo@ctspine
  % the leaf: its size, the edge the caterpillar holds, the bites ahead of its head
  \def\flo@hfL{1.5}\def\flo@hfW{0.36}\flo@sym\flo@hfbend{0.12}\def\flo@hft{0.66}%
  \flo@hfw{0.1}\flo@calc\flo@ctox{\flo@hfx+\flo@h}\flo@calc\flo@ctoy{0.1*\flo@hfL}%
  \flo@hfw{0.62}\flo@calc\flo@t{atan2(0.62*\flo@hfL-\flo@ctoy,\flo@hfx+\flo@h-\flo@ctox)}%
  % straight or looping, the body is mirrored across its axis (y to -y, after the turn),
  % so its legs hold the edge and its back is turned away from the leaf, tail to head
  % along the edge; curled, it lies on the leaf from its tail, its legs turned in
  \def\flo@tmp{curl}\ifx\flo@ctpose\flo@tmp\edef\flo@ctrot{\flo@t}\def\flo@ctmy{1}%
    \flo@calc\flo@cthy{\flo@ctoy+\csname flo@ctX26\endcsname*sin(\flo@ctrot)+\csname flo@ctY26\endcsname*cos(\flo@ctrot)}%
  \else\def\flo@ctmy{-1}%
    \flo@calc\flo@ctrot{\flo@t+atan2(\csname flo@ctY26\endcsname,\csname flo@ctX26\endcsname)}%
    \flo@calc\flo@cthy{\flo@ctoy+\csname flo@ctX26\endcsname*sin(\flo@ctrot)-(\csname flo@ctY26\endcsname)*cos(\flo@ctrot)}%
  \fi
  \flo@chance{0.5}\ifflo@yes\def\flo@hfnb{3}\else\def\flo@hfnb{2}\fi
  \flo@calc\flo@t{min(0.86*\flo@hfL,max(0.3*\flo@hfL,\flo@cthy+0.04))}%
  \flo@loop{hfbs}\flo@Wa{1}{\flo@hfnb}{%
    \edef\flo@hfi{\the\flo@Wa}%
    \flo@range\flo@v{0.07}{0.11}\expandafter\let\csname flo@hfbr\flo@hfi\endcsname\flo@v
    \expandafter\let\csname flo@hfby\flo@hfi\endcsname\flo@t
    \flo@calc\flo@v{\flo@t/\flo@hfL}\flo@hfw\flo@v
    \flo@calc\flo@v{\flo@hfx+\flo@h+0.3*\csname flo@hfbr\flo@hfi\endcsname}\expandafter\let\csname flo@hfbx\flo@hfi\endcsname\flo@v
    \flo@range\flo@v{0.15}{0.22}\flo@calc\flo@t{\flo@t+\flo@v}%
    \ifdim\flo@t pt>1.38pt \def\flo@t{1.38}\fi}%
  \flo@hfoutline\flo@hfpaint
  % the caterpillar, in the copper if its ground is
  \def\flo@tmp{copper}\ifx\flo@ctground\flo@tmp\def\flo@rampname{flo@aramp}\fi
  \begin{pgfscope}\pgftransformshift{\flo@P\flo@ctox\flo@ctoy}\pgftransformrotate{\flo@ctrot}\ifnum\flo@ctmy=-1 \pgftransformyscale{-1}\fi
    \flo@ctbody\flo@cthead
    \ifnum\flo@xget{horn}=1 \flo@cthorn\fi
    \ifnum\flo@xget{tufts}=1 \flo@cttufts\fi
  \end{pgfscope}}
% ---------------------------------------------------------------- snails
% A snail, in units of its shell's width, crawling toward +y, its foot along the y axis and
% its shell on the +x side; a shell that coils to the left is the whole snail mirrored. The
% shell is Raup's coiled tube (the shells report, part A): a ring 1 across the coil and S
% (the genome's aperture) along it, y0 out from the coiling axis and x0 along it, sweeps
% through the whorls and grows W times (its expansion) a turn. Seen from the spire's side
% with the axis tilted toward the viewer, a ring shows as an ellipse, and its two extremes
% across the coil are the whorl's edges there. The whorls are painted from the mouth in, each
% older one over the one after it, so its outer edge is the suture on the next; each is
% mottled, shaded under its suture and lit on its shoulder, with bands, ribs or cords and
% growth lines. The mouth faces the foot and shows the snail's body, or the pale seal of a
% snail withdrawn into its shell, which shows no foot and no feelers.
\def\flo@gsbodypt#1#2#3{%
  \flo@sym\flo@t{0.08}\flo@calc\flo@xa{(#2)*(1+\flo@t)}%
  \flo@calc\flo@ya{(#3)*((#3)<0 ? 0.5+0.5*\flo@gsx : 0.75+0.3*\flo@gsx)}\flo@put{#1}\flo@xa\flo@ya}
\def\flo@gsbody{%
  \flo@gsbodypt1{0}{-0.78}\flo@gsbodypt2{-0.01}{-0.3}\flo@gsbodypt3{0}{0.3}\flo@gsbodypt4{0.04}{0.58}%
  \flo@gsbodypt5{0.12}{0.7}\flo@gsbodypt6{0.22}{0.66}\flo@gsbodypt7{0.24}{0.5}\flo@gsbodypt8{0.2}{0.32}%
  \flo@gsbodypt9{0.17}{0}\flo@gsbodypt{10}{0.12}{-0.45}\flo@gsbodypt{11}{0.05}{-0.7}%
  \flo@smoothprep{11}\flo@keep{gsb}%
  \flo@range\flo@gstb{0.5}{0.6}\global\let\flo@gstbg\flo@gstb
  \flo@vtone{flo@c}{\flo@gstb}\flo@vfill{flo@c}{1}{0}{\flo@kept{gsb}}%
  \begin{pgfscope}\flo@kept{gsb}\pgfusepath{clip}%
    \ifnum\flo@fine=1
      \flo@calc\flo@ta{\flo@gstb-0.25}\flo@calc\flo@tb{\flo@gstb+0.15}%
      \flo@vmottle{-0.1}{-0.8}{0.3}{0.8}{5}{0.1}\flo@ta\flo@tb{10}%
    \fi
    \flo@vtone{flo@c}{0.15}\flo@vfill{flo@c}{0.35}{1}{\pgfpathmoveto{\flo@P{-0.05}{-0.8}}\pgfpathlineto{\flo@P{-0.05}{0.7}}%
      \pgfpathlineto{\flo@P{0.04}{0.7}}\pgfpathlineto{\flo@P{0.04}{-0.8}}\pgfpathclose}%
    \flo@vtone{flo@c}{0.08}\flo@calc\flo@t{0.1*\flo@gsu*28.3465}\flo@vstroke{flo@c}{\flo@t}{0.4}{1}{\flo@kept{gsb}}%
  \end{pgfscope}}
% feelers: two long ones with eyes, a short one; #1 #2 the root, #3 #4 the tip at full length
\def\flo@gsfeeler#1#2#3#4#5{%
  \flo@calc\flo@ya{(#2)*(0.75+0.3*\flo@gsx)}\flo@calc\flo@t{0.55+0.5*\flo@gsx}%
  \flo@calc\flo@xd{#1+((#3)-(#1))*\flo@t}\flo@calc\flo@yd{\flo@ya+((#4)-(#2))*\flo@t}%
  \flo@calc\flo@xb{#1+0.02}\flo@calc\flo@yb{\flo@ya+0.12}\flo@calc\flo@xc{\flo@xd-0.04}\flo@calc\flo@yc{\flo@yd-0.1}%
  \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{#5}{1}{0}{\pgfpathmoveto{\flo@P{#1}\flo@ya}%
    \pgfpathcurveto{\flo@P\flo@xb\flo@yb}{\flo@P\flo@xc\flo@yc}{\flo@P\flo@xd\flo@yd}}}
\def\flo@gsfeelers{%
  \flo@calc\flo@gsw{max(0.35,0.3*\flo@gsu)}\flo@calc\flo@gsv{max(0.28,0.24*\flo@gsu)}%
  \flo@gsfeeler{0.17}{0.66}{0.36}{1.02}\flo@gsw
  \flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P\flo@xd\flo@yd}{0.028pt}}%
  \flo@gsfeeler{0.1}{0.7}{0.18}{1.04}\flo@gsw
  \flo@vtone{flo@c}{0.05}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P\flo@xd\flo@yd}{0.028pt}}%
  \flo@gsfeeler{0.05}{0.68}{0}{0.84}\flo@gsv}
\newcount\flo@gsj \newcount\flo@gsb \newcount\flo@gsr \newcount\flo@gsq
% \flo@gsring{th}: the ring at growth angle th (0 the mouth): its center \flo@grcx/cy, the
% offset to the whorl's outer edge \flo@grex/ey (the inner edge is the other way) with the
% edge's wobble, the coil's direction \flo@grtx/ty, and the edge's place on the ring's
% ellipse (\flo@grcp, \flo@grsp, its cosine and sine)
\def\flo@gsring#1{%
  \flo@calc\flo@grlam{pow(\flo@gsW,(#1)/360)}\flo@calc\flo@gra{(#1)+(\flo@gsph)}%
  \flo@calc\flo@grc{cos(\flo@gra)}\flo@calc\flo@grs{sin(\flo@gra)}%
  \flo@calc\flo@gruo{\flo@gsyo*(\flo@grc)}\flo@calc\flo@grvo{\flo@gsyo*(\flo@grs)*\flo@gsca-\flo@gsxo*\flo@gssa}%
  \flo@calc\flo@grtx{\flo@gsk*(\flo@gruo)-\flo@gsyo*(\flo@grs)}%
  \flo@calc\flo@grty{\flo@gsk*(\flo@grvo)+\flo@gsyo*(\flo@grc)*\flo@gsca}%
  \flo@calc\flo@grl{veclen(\flo@grtx,\flo@grty)}%
  \flo@calc\flo@grp{((\flo@grty)*(\flo@grc)-(\flo@grtx)*(\flo@grs)*\flo@gsca)/\flo@grl}%
  \flo@calc\flo@grq{-(\flo@grtx)*\flo@gsS*\flo@gssa/\flo@grl}%
  \flo@calc\flo@grh{veclen(\flo@grp,\flo@grq)}%
  \flo@calc\flo@grw{\flo@grlam*(1+0.025*sin(3*(\flo@gra)+\flo@gswa)+0.018*sin(5*(\flo@gra)+\flo@gswb))/\flo@grh}%
  \flo@calc\flo@grcx{\flo@grlam*(\flo@gruo)}\flo@calc\flo@grcy{\flo@grlam*(\flo@grvo)}%
  \flo@calc\flo@grex{\flo@grw*(\flo@grc)*(\flo@grp)}%
  \flo@calc\flo@grey{\flo@grw*((\flo@grs)*\flo@gsca*(\flo@grp)+\flo@gsS*\flo@gssa*(\flo@grq))}%
  \flo@calc\flo@grcp{(\flo@grp)/\flo@grh}\flo@calc\flo@grsp{(\flo@grq)/\flo@grh}}
% point #3 of edge #1 (O the outer, I the inner, S the suture on it; M the mouth) of whorl #2
\def\flo@gsput#1#2#3#4#5{\expandafter\edef\csname flo@g#1x#2:#3\endcsname{#4}\expandafter\edef\csname flo@g#1y#2:#3\endcsname{#5}}
\def\flo@gsgx#1#2#3{\csname flo@g#1x#2:#3\endcsname}
\def\flo@gsgy#1#2#3{\csname flo@g#1y#2:#3\endcsname}
% \flo@gswhorl{j}: whorl j (1 the body whorl, ending at the mouth), 19 rings: its edges, the
% outer edge of the whorl before it (the suture on this one), and the light on it (the
% outward normal toward the upper left of the page)
\def\flo@gswhorl#1{%
  \flo@calc\flo@gta{max(-360*\flo@gsn,-360*(#1))}\flo@calc\flo@gtb{-360*((#1)-1)}%
  \expandafter\let\csname flo@gta#1\endcsname\flo@gta\expandafter\let\csname flo@gtb#1\endcsname\flo@gtb
  \flo@loop{gsw}\flo@gsb{0}{18}{%
    \flo@calc\flo@gth{\flo@gta+(\flo@gtb-(\flo@gta))*\the\flo@gsb/18}%
    \flo@gsring\flo@gth
    \edef\flo@k{\the\numexpr\flo@gsb+1\relax}%
    \flo@calc\flo@xa{\flo@grcx+(\flo@grex)}\flo@calc\flo@ya{\flo@grcy+(\flo@grey)}\flo@gsput O{#1}\flo@k\flo@xa\flo@ya
    \flo@calc\flo@xa{\flo@grcx-(\flo@grex)}\flo@calc\flo@ya{\flo@grcy-(\flo@grey)}\flo@gsput I{#1}\flo@k\flo@xa\flo@ya
    \flo@calc\flo@t{((\flo@grty)*\flo@gslx-(\flo@grtx)*\flo@gsly)/veclen(\flo@grtx,\flo@grty)}%
    \expandafter\let\csname flo@gL#1:\flo@k\endcsname\flo@t
    \flo@calc\flo@gth{\flo@gth-360}\flo@gsring\flo@gth
    \flo@calc\flo@xa{\flo@grcx+(\flo@grex)}\flo@calc\flo@ya{\flo@grcy+(\flo@grey)}\flo@gsput S{#1}\flo@k\flo@xa\flo@ya}}
% the box around the shell, turned to the page (\flo@gbx..) and in its own frame (\flo@gbu..)
\def\flo@gsbound#1#2{%
  \edef\flo@gx{#1}\edef\flo@gy{#2}%
  \flo@calc\flo@xa{(\flo@gx)*cos(-130)-(\flo@gy)*sin(-130)}\flo@calc\flo@ya{(\flo@gx)*sin(-130)+(\flo@gy)*cos(-130)}%
  \flo@calc\flo@gbxa{min(\flo@gbxa,\flo@xa)}\flo@calc\flo@gbxb{max(\flo@gbxb,\flo@xa)}%
  \flo@calc\flo@gbya{min(\flo@gbya,\flo@ya)}\flo@calc\flo@gbyb{max(\flo@gbyb,\flo@ya)}%
  \flo@calc\flo@gbua{min(\flo@gbua,\flo@gx)}\flo@calc\flo@gbub{max(\flo@gbub,\flo@gx)}%
  \flo@calc\flo@gbva{min(\flo@gbva,\flo@gy)}\flo@calc\flo@gbvb{max(\flo@gbvb,\flo@gy)}}
% the point at angle #1 on the mouth's ellipse, #2 times its size: \flo@xa/ya
\def\flo@gsringpt#1#2{%
  \flo@calc\flo@xa{\flo@gsmcx+(#2)*cos(#1)*\flo@gsax}%
  \flo@calc\flo@ya{\flo@gsmcy+(#2)*(cos(#1)*\flo@gsay+sin(#1)*\flo@gsby)}}
% the points #1 of the way from the suture to the outer edge of the whorl being drawn, rings
% #2 to #3, as points 1..\flo@gsm
\def\flo@gsacross#1#2#3{%
  \flo@m=0
  \flo@loop{gsac}\flo@gsr{#2}{#3}{\advance\flo@m by1
    \edef\flo@gsk@{\the\flo@gsr}%
    \flo@calc\flo@xa{\flo@gsgx S\flo@gj\flo@gsk@+(#1)*(\flo@gsgx O\flo@gj\flo@gsk@-(\flo@gsgx S\flo@gj\flo@gsk@))}%
    \flo@calc\flo@ya{\flo@gsgy S\flo@gj\flo@gsk@+(#1)*(\flo@gsgy O\flo@gj\flo@gsk@-(\flo@gsgy S\flo@gj\flo@gsk@))}%
    \flo@put{\the\flo@m}\flo@xa\flo@ya}%
  \edef\flo@gsm{\the\flo@m}}
% a whorl's detail, inside its clip: blotches, the shadow under the suture, the light on the
% shoulder, color bands, ribs or cords, growth lines near the mouth
\def\flo@gsdecor{%
  \def\flo@gbxa{9999}\def\flo@gbxb{-9999}\def\flo@gbya{9999}\def\flo@gbyb{-9999}%
  \flo@loop{gsdb}\flo@gsb{1}{\flo@gsN}{%
    \flo@calc\flo@gbxa{min(\flo@gbxa,\flo@x{\the\flo@gsb})}\flo@calc\flo@gbxb{max(\flo@gbxb,\flo@x{\the\flo@gsb})}%
    \flo@calc\flo@gbya{min(\flo@gbya,\flo@y{\the\flo@gsb})}\flo@calc\flo@gbyb{max(\flo@gbyb,\flo@y{\the\flo@gsb})}}%
  \ifnum\flo@gsj<3
    \flo@calc\flo@gmsz{0.2*(\flo@gbxb-(\flo@gbxa))}\flo@calc\flo@gmta{\flo@gst-0.16}\flo@calc\flo@gmtb{\flo@gst+0.2}%
    \ifnum\flo@fine=1 \flo@vmottle\flo@gbxa\flo@gbya\flo@gbxb\flo@gbyb{4}\flo@gmsz\flo@gmta\flo@gmtb{6}%
    \else\flo@vmottle\flo@gbxa\flo@gbya\flo@gbxb\flo@gbyb{2}\flo@gmsz\flo@gmta\flo@gmtb{0}\fi
  \fi
  \def\flo@gsbw{0}%
  \flo@loop{gssw}\flo@gsb{1}{19}{%
    \edef\flo@gsk@{\the\flo@gsb}%
    \flo@calc\flo@gsbw{\flo@gsbw+veclen(\flo@gsgx O\flo@gj\flo@gsk@-(\flo@gsgx S\flo@gj\flo@gsk@),\flo@gsgy O\flo@gj\flo@gsk@-(\flo@gsgy S\flo@gj\flo@gsk@))}}%
  \flo@calc\flo@gsbw{\flo@gsbw/19}%
  \flo@loop{gsss}\flo@gsb{1}{19}{\flo@put{\the\flo@gsb}{\flo@gsgx S\flo@gj{\the\flo@gsb}}{\flo@gsgy S\flo@gj{\the\flo@gsb}}}%
  \flo@calc\flo@gsba{\flo@gsbw*(0.15+0.3*\flo@xget{suture})}\flo@calc\flo@gsbo{0.12+0.2*\flo@xget{suture}}%
  \flo@vtone{flo@c}{0.08}\flo@vstreak{19}\flo@gsba\flo@gsba{flo@c}\flo@gsbo
  \def\flo@gsla{0}\def\flo@gslb{0}%
  \flo@loop{gslt}\flo@gsb{1}{19}{%
    \ifdim\csname flo@gL\flo@gj:\the\flo@gsb\endcsname pt>0.15pt
      \ifnum\flo@gsla=0 \edef\flo@gsla{\the\flo@gsb}\fi\edef\flo@gslb{\the\flo@gsb}\fi}%
  \ifnum\flo@gsj<4 \ifnum\flo@gsla>0 \ifnum\numexpr\flo@gslb-\flo@gsla\relax>2
    \flo@gsacross{0.62}\flo@gsla\flo@gslb
    \flo@calc\flo@gsba{\flo@gsbw*0.06}\flo@calc\flo@gsbb{\flo@gsbw*0.24}%
    \ifnum\flo@gsj=1 \def\flo@gsbo{0.6}\else\def\flo@gsbo{0.42}\fi
    \flo@vstreak\flo@gsm\flo@gsba\flo@gsbb{white}\flo@gsbo
  \fi\fi\fi
  \ifnum\flo@gsj<3 \ifnum\flo@xget{shellbands}>0
    \flo@loop{gsbn}\flo@gsq{1}{\flo@xget{shellbands}}{%
      \flo@calc\flo@gsf{0.15+0.7*\the\flo@gsq/(\flo@xget{shellbands}+1)}%
      \flo@gsacross\flo@gsf{1}{19}%
      \flo@calc\flo@gsbb{\flo@gsbw*0.7/(\flo@xget{shellbands}+1)}%
      \flo@vtone{flo@c}{0.06}\flo@vstreak{19}{0.003}\flo@gsbb{flo@c}{0.38}}%
  \fi\fi
  \edef\flo@gssc@{\flo@xget{sculpture}}\def\flo@tmp{ribs}%
  \ifx\flo@gssc@\flo@tmp
    \ifnum\flo@xget{ribs}>0 % ribs only when there are some (a fixed ribs=0 is smooth)
    \flo@calc\flo@t{\flo@gsz*3.14159/\flo@xget{ribs}}%
    \ifdim\flo@t pt>0.05pt
      \ifnum\flo@gsj<\flo@gsJ\space\edef\flo@gsnr{\flo@xget{ribs}}%
      \else\pgfmathtruncatemacro\flo@gsnr{floor(\flo@xget{ribs}*(\csname flo@gtb\flo@gj\endcsname-(\csname flo@gta\flo@gj\endcsname))/360+0.5)}\fi
      \flo@loop{gsrb}\flo@gsq{1}{\flo@gsnr}{%
        \edef\flo@gsk@{\the\numexpr1+(18*(2*\flo@gsq-1))/(2*\flo@gsnr)\relax}%
        \flo@vtone{flo@c}{0.05}\flo@calc\flo@t{0.25*\flo@gslw}%
        \flo@vstroke{flo@c}{\flo@t}{0.3}{1}{\pgfpathmoveto{\flo@P{\flo@gsgx S\flo@gj\flo@gsk@}{\flo@gsgy S\flo@gj\flo@gsk@}}%
          \pgfpathlineto{\flo@P{\flo@gsgx O\flo@gj\flo@gsk@}{\flo@gsgy O\flo@gj\flo@gsk@}}}}%
    \fi\fi
  \else\def\flo@tmp{cords}\ifx\flo@gssc@\flo@tmp
    \ifdim\flo@gsz pt>0.25pt
      \flo@loop{gscd}\flo@gsq{1}{3}{%
        \flo@calc\flo@gsf{\the\flo@gsq/4}\flo@gsacross\flo@gsf{1}{19}%
        \flo@vtone{flo@c}{0.05}\flo@calc\flo@t{0.3*\flo@gslw}%
        \flo@vstroke{flo@c}{\flo@t}{0.35}{1}{\flo@smoothopen{19}}}%
    \fi
  \fi\fi
  \ifnum\flo@gsj=1 \ifnum\flo@fine=1
    \flo@loop{gsgl}\flo@gsq{1}{3}{%
      \flo@chance{0.375}%
      \edef\flo@gsk@{\the\numexpr19-\flo@gsq\ifflo@yes-1\fi\relax}%
      \flo@vtone{flo@c}{0.1}\flo@calc\flo@t{0.3*\flo@gslw}%
      \flo@vstroke{flo@c}{\flo@t}{0.18}{1}{\pgfpathmoveto{\flo@P{\flo@gsgx S\flo@gj\flo@gsk@}{\flo@gsgy S\flo@gj\flo@gsk@}}%
        \pgfpathlineto{\flo@P{\flo@gsgx O\flo@gj\flo@gsk@}{\flo@gsgy O\flo@gj\flo@gsk@}}}}%
  \fi\fi}
% the mouth: the snail's body in it, or the pale seal of one withdrawn; the lip
\def\flo@gsmouth{%
  \flo@loop{gsmo}\flo@gsb{1}{12}{%
    \flo@calc\flo@xa{\flo@gsmcx+0.7*(\flo@gsgx M0{\the\flo@gsb}-(\flo@gsmcx))}%
    \flo@calc\flo@ya{\flo@gsmcy+0.7*(\flo@gsgy M0{\the\flo@gsb}-(\flo@gsmcy))}%
    \flo@put{\the\flo@gsb}\flo@xa\flo@ya}%
  \flo@smoothprep{12}%
  \begingroup\def\flo@rampname{flo@ramp}%
    \ifnum\flo@xget{withdrawn}=1 \flo@vtone{flo@c}{0.9}\flo@vfill{flo@c}{0.95}{0}{\flo@smoothpath}%
    \else\flo@calc\flo@t{\flo@gstbg-0.18}\flo@vtone{flo@c}{\flo@t}\flo@vfill{flo@c}{1}{0}{\flo@smoothpath}\fi
  \endgroup
  \flo@vtone{flo@c}{0.05}\flo@calc\flo@t{0.7*\flo@gslw}\flo@vstroke{flo@c}{\flo@t}{0.55}{1}{\flo@smoothpath}%
  \ifnum\flo@xget{lip}=1
    \flo@loop{gslp}\flo@gsb{0}{6}{%
      \flo@calc\flo@t{\flo@gsfs+\flo@gsdir*\the\flo@gsb}\flo@gsringpt\flo@t{0.9}%
      \flo@put{\the\numexpr\flo@gsb+1\relax}\flo@xa\flo@ya}%
    \flo@vstreak{7}{0.03}{0.06}{white}{0.8}%
  \fi}
% the shell. Draws: the tilt, the edge's two wobbles; then for each whorl its tone, and for the
% two outer whorls their blotches; three growth lines
\def\flo@gsshell{%
  \edef\flo@gsW{\flo@xget{expansion}}\edef\flo@gsn{\flo@xget{whorls}}\edef\flo@gsS{\flo@xget{aperture}}%
  \ifnum\flo@xget{opencoil}=1 \flo@calc\flo@gsD{1.15/\flo@gsW}\else\def\flo@gsD{0.03}\fi
  \flo@calc\flo@gsyo{(1+\flo@gsD)/(1-\flo@gsD)}%
  \flo@calc\flo@gsxo{3*\flo@xget{spire}/\flo@gsW*\flo@gsyo}%
  \flo@calc\flo@gsk{ln(\flo@gsW)/6.28319}%
  \flo@range\flo@t{34}{50}\flo@calc\flo@gsca{cos(\flo@t)}\flo@calc\flo@gssa{sin(\flo@t)}%
  \def\flo@gsph{-35}%
  \flo@range\flo@gswa{0}{360}\flo@range\flo@gswb{0}{360}%
  \flo@calc\flo@gslx{cos(265)}\flo@calc\flo@gsly{sin(265)}%
  \pgfmathtruncatemacro\flo@gsJ{ceil(\flo@gsn)}%
  \flo@loop{gswh}\flo@gsj{1}{\flo@gsJ}{\expandafter\flo@gswhorl\expandafter{\the\flo@gsj}}%
  \flo@gsring{0}\let\flo@gsmcx\flo@grcx\let\flo@gsmcy\flo@grcy
  \flo@calc\flo@gsax{cos(\flo@gsph)}\flo@calc\flo@gsay{sin(\flo@gsph)*\flo@gsca}\flo@calc\flo@gsby{\flo@gsS*\flo@gssa}%
  \flo@calc\flo@gsfs{atan2(\flo@grsp,\flo@grcp)}%
  \flo@calc\flo@t{(-(\flo@gsax)*(\flo@grsp))*(\flo@grtx)+(-(\flo@gsay)*(\flo@grsp)+\flo@gsby*(\flo@grcp))*(\flo@grty)}%
  \ifdim\flo@t pt>0pt \def\flo@gsdir{30}\else\def\flo@gsdir{-30}\fi
  \flo@loop{gsmp}\flo@gsb{0}{11}{%
    \flo@calc\flo@t{30*\the\flo@gsb}\flo@gsringpt\flo@t{1}\flo@gsput M0{\the\numexpr\flo@gsb+1\relax}\flo@xa\flo@ya}%
  % the frame: the spire toward -40 degrees on the page, the coil 0.98 across
  \def\flo@gbxa{9999}\def\flo@gbxb{-9999}\def\flo@gbya{9999}\def\flo@gbyb{-9999}%
  \def\flo@gbua{9999}\def\flo@gbub{-9999}\def\flo@gbva{9999}\def\flo@gbvb{-9999}%
  \flo@loop{gsbj}\flo@gsj{1}{\flo@gsJ}{\flo@loop{gsbb}\flo@gsb{1}{19}{%
    \flo@gsbound{\flo@gsgx O{\the\flo@gsj}{\the\flo@gsb}}{\flo@gsgy O{\the\flo@gsj}{\the\flo@gsb}}}}%
  \flo@loop{gsbm}\flo@gsb{1}{12}{\flo@gsbound{\flo@gsgx M0{\the\flo@gsb}}{\flo@gsgy M0{\the\flo@gsb}}}%
  \flo@calc\flo@gssc{0.98/max(\flo@gbub-(\flo@gbua),0.7*(\flo@gbvb-(\flo@gbva)))}%
  \flo@calc\flo@xa{0.4-(\flo@gbxa+(\flo@gbxb))/2*\flo@gssc}\flo@calc\flo@ya{-0.03-(\flo@gbya+(\flo@gbyb))/2*\flo@gssc}%
  \begin{pgfscope}%
    \pgftransformshift{\flo@P\flo@xa\flo@ya}\pgftransformrotate{-130}\pgftransformscale{\flo@gssc}%
    \flo@calc\flo@gsuu{\flo@gsu*\flo@gssc}\flo@calc\flo@gslw{0.06*\flo@gsu*28.3465}%
    \flo@loop{gssh}\flo@gsj{1}{\flo@gsJ}{%
      \edef\flo@gj{\the\flo@gsj}%
      \flo@loop{gsp1}\flo@gsb{1}{19}{\flo@put{\the\flo@gsb}{\flo@gsgx O\flo@gj{\the\flo@gsb}}{\flo@gsgy O\flo@gj{\the\flo@gsb}}}%
      \flo@m=19
      \ifnum\flo@gsj=1
        \flo@loop{gsp2}\flo@gsb{1}{5}{\advance\flo@m by1
          \flo@calc\flo@t{\flo@gsfs+\flo@gsdir*\the\flo@gsb}\flo@gsringpt\flo@t{1}\flo@put{\the\flo@m}\flo@xa\flo@ya}%
      \fi
      \flo@loop{gsp3}\flo@gsb{1}{19}{\advance\flo@m by1
        \edef\flo@gsk@{\the\numexpr20-\flo@gsb\relax}\flo@put{\the\flo@m}{\flo@gsgx I\flo@gj\flo@gsk@}{\flo@gsgy I\flo@gj\flo@gsk@}}%
      \edef\flo@gsN{\the\flo@m}%
      \flo@calc\flo@gsz{(\flo@gsyo+1)*pow(\flo@gsW,-(\the\flo@gsj-1))*\flo@gsuu}%
      \flo@sym\flo@t{0.03}\flo@calc\flo@gst{\flo@gstn+\flo@t}%
      \ifdim\flo@gsz pt>0.02pt
        \flo@smoothprep\flo@gsN\flo@keep{gsw}%
        \flo@vtone{flo@c}{\flo@gst}\flo@vfill{flo@c}{1}{0}{\flo@kept{gsw}}%
        \begin{pgfscope}\flo@kept{gsw}\pgfusepath{clip}%
          \ifdim\flo@gsz pt>0.12pt \flo@gsdecor\fi
          \flo@loop{gsoe}\flo@gsb{1}{19}{\flo@put{\the\flo@gsb}{\flo@gsgx O\flo@gj{\the\flo@gsb}}{\flo@gsgy O\flo@gj{\the\flo@gsb}}}%
          \flo@vtone{flo@c}{0.05}\flo@vstroke{flo@c}{\flo@gslw}{0.55}{1}{\flo@smoothopen{19}}%
        \end{pgfscope}%
      \fi
      \ifnum\flo@gsj=1 \flo@gsmouth\fi}%
  \end{pgfscope}}
% a snail; #1 its shell's width on the page in pt
\def\flo@snail#1{%
  \flo@calc\flo@gsu{(#1)/28.45276}%
  \ifdim\flo@gsu pt>0.25pt \def\flo@fine{1}\else\def\flo@fine{0}\fi
  \edef\flo@gsx{\flo@xget{extension}}\edef\flo@gsground{\flo@xget{ground}}%
  \flo@calc\flo@gstn{\flo@xget{tone}-0.06}%
  \def\flo@tmp{pale}\ifx\flo@gsground\flo@tmp\flo@calc\flo@gstn{min(0.72,\flo@gstn+0.25)}\fi
  \gdef\flo@gstbg{0.55}%
  \begin{pgfscope}%
    \edef\flo@t{\flo@xget{hand}}\def\flo@tmp{sinistral}\ifx\flo@t\flo@tmp\pgftransformxscale{-1}\fi
    \ifnum\flo@xget{withdrawn}=0
      \begin{pgfscope}\def\flo@rampname{flo@ramp}\flo@gsbody\flo@gsfeelers\end{pgfscope}%
    \fi
    \def\flo@tmp{copper}\ifx\flo@gsground\flo@tmp\def\flo@rampname{flo@aramp}\fi
    \flo@gsshell
  \end{pgfscope}}
% ---------------------------------------------------------------- birds
% A bird: flora's small songbird, seen from the side facing +x, its feet at the origin, in
% units of its length from tail to beak. A seed-eater perches with a short conical bill
% and speckled breast; a nectar bird (a hummingbird or a sunbird) has a long thin bill,
% straight or curved, a copper throat, and perches or hovers, tilted up with its wings a
% blur above its back and its tail fanned. A crest, and the tail's length, by the genome.
% a tail feather from the root along +y, #1 long: a blade, narrow at the root, round at the tip
\def\flo@avfeather#1{%
  \flo@put1{0}{0}\flo@calc\flo@ya{#1}\flo@put7{0}\flo@ya
  \flo@loop{avf}\flo@Wb{1}{5}{%
    \flo@calc\flo@v{\ifcase\flo@Wb\or0.12\or0.35\or0.6\or0.82\or0.95\fi}%
    \flo@calc\flo@xa{0.055*pow(sin(180*pow(\flo@v,0.4)),0.6)}\flo@calc\flo@xb{-\flo@xa}\flo@calc\flo@ya{\flo@v*(#1)}%
    \flo@put{\the\numexpr\flo@Wb+1\relax}\flo@xa\flo@ya\flo@put{\the\numexpr13-\flo@Wb\relax}\flo@xb\flo@ya}%
  \flo@smoothprep{12}}
\def\flo@avbodypt#1#2#3{\flo@sym\flo@t{0.012}\flo@calc\flo@xa{#2+\flo@t}\flo@sym\flo@t{0.012}\flo@calc\flo@ya{#3+\flo@t}%
  \flo@put{#1}\flo@xa\flo@ya}
% the tail, the body (breast, mottle, specks or a copper throat, the cap, the rim)
\def\flo@avbody{%
  \flo@calc\flo@avlw{max(0.3,0.3*\flo@avu)}%
  \flo@loop{avt}\flo@Wa{1}{4}{%
    \flo@calc\flo@t{\flo@xget{tail}-0.03}\flo@calc\flo@v{\flo@xget{tail}+0.03}\flo@range\flo@avL\flo@t\flo@v
    \flo@range\flo@t{-150}{-140}\flo@calc\flo@ava{\flo@t+\flo@avfan*\the\flo@Wa-90}%
    \begin{pgfscope}\pgftransformshift{\flo@P{-0.26}{0.28}}\pgftransformrotate{\flo@ava}%
      \flo@avfeather\flo@avL\flo@keep{avf}%
      \flo@calc\flo@t{0.12+0.05*\the\flo@Wa}\flo@vtone{flo@c}\flo@t\flo@vfill{flo@c}{1}{0}{\flo@kept{avf}}%
      \flo@vtone{flo@c}{0.05}\flo@vstroke{flo@c}{\flo@avlw}{0.5}{0}{\flo@kept{avf}}%
    \end{pgfscope}}%
  \flo@avbodypt1{0.37}{0.56}\flo@avbodypt2{0.3}{0.665}\flo@avbodypt3{0.15}{0.64}\flo@avbodypt4{-0.03}{0.54}%
  \flo@avbodypt5{-0.22}{0.4}\flo@avbodypt6{-0.31}{0.3}\flo@avbodypt7{-0.27}{0.22}\flo@avbodypt8{-0.08}{0.12}%
  \flo@avbodypt9{0.12}{0.12}\flo@avbodypt{10}{0.27}{0.27}\flo@avbodypt{11}{0.35}{0.42}%
  \flo@smoothprep{11}\flo@keep{avb}%
  \flo@vtone{flo@c}{\flo@avt}\flo@vfill{flo@c}{1}{0}{\flo@kept{avb}}%
  \begin{pgfscope}\flo@kept{avb}\pgfusepath{clip}%
    \flo@loop{avbr}\flo@Wa{1}{4}{%
      \flo@calc\flo@xa{0.08+0.04*\the\flo@Wa}\flo@calc\flo@ya{0.06+0.03*\the\flo@Wa}%
      \flo@vblob{0.17}{0.27}\flo@xa\flo@ya{0.2}{9}\flo@vfill{white}{0.2}{0}{\flo@smoothpath}}%
    \flo@calc\flo@ta{\flo@avt-0.2}\flo@calc\flo@tb{\flo@avt+0.2}%
    \ifnum\flo@fine=1 \flo@vmottle{-0.35}{0.1}{0.4}{0.7}{10}{0.07}\flo@ta\flo@tb{10}%
    \else\flo@vmottle{-0.35}{0.1}{0.4}{0.7}{4}{0.07}\flo@ta\flo@tb{0}\fi
    \def\flo@tmp{hummingbird}\ifx\flo@avk\flo@tmp
      \flo@vblob{0.3}{0.47}{0.075}{0.05}{0.15}{8}\flo@vaccent{flo@c}{0}\flo@vfill{flo@c}{0.85}{0}{\flo@smoothpath}%
      \ifnum\flo@fine=1 \flo@vblob{0.31}{0.49}{0.03}{0.016}{0.2}{7}\flo@vfill{white}{0.5}{0}{\flo@smoothpath}\fi
    \else\ifnum\flo@fine=1
      \flo@vtone{flo@c}{0.1}\flo@vfill{flo@c}{0.7}{0}{\flo@loop{avsp}\flo@Wa{1}{14}{%
        \flo@range\flo@xa{0.08}{0.3}\flo@range\flo@ya{0.16}{0.42}\flo@range\flo@t{-20}{20}%
        \flo@calc\flo@xb{0.012*cos(\flo@t)}\flo@calc\flo@yb{0.012*sin(\flo@t)}%
        \flo@calc\flo@xc{-0.022*sin(\flo@t)}\flo@calc\flo@yc{0.022*cos(\flo@t)}%
        \pgfpathellipse{\flo@P\flo@xa\flo@ya}{\flo@P\flo@xb\flo@yb}{\flo@P\flo@xc\flo@yc}}}%
    \fi\fi
    \flo@vblob{0.24}{0.66}{0.15}{0.08}{0.1}{9}\flo@vtone{flo@c}{0.08}\flo@vfill{flo@c}{0.6}{1}{\flo@smoothpath}%
    \flo@vtone{flo@c}{0.05}\flo@calc\flo@t{0.07*\flo@avu*28.3465}\flo@vstroke{flo@c}{\flo@t}{0.5}{1}{\flo@kept{avb}}%
  \end{pgfscope}}
% the folded wing: a dark blade with feather tips, white lifted along the feathers
\def\flo@avwing{%
  \flo@put1{0.17}{0.47}\flo@put2{0.04}{0.52}\flo@put3{-0.12}{0.45}\flo@put4{-0.28}{0.33}\flo@put5{-0.44}{0.22}%
  \flo@put6{-0.35}{0.23}\flo@put7{-0.38}{0.19}\flo@put8{-0.26}{0.21}\flo@put9{-0.28}{0.17}\flo@put{10}{-0.12}{0.23}%
  \flo@put{11}{0.05}{0.31}\flo@put{12}{0.15}{0.4}\flo@smoothprepT{12}{0.8}\flo@keep{avw}%
  \flo@calc\flo@avtw{\flo@avt-0.1}%
  \flo@vtone{flo@c}{\flo@avtw}\flo@vfill{flo@c}{1}{0}{\flo@kept{avw}}%
  \begin{pgfscope}\flo@kept{avw}\pgfusepath{clip}%
    \flo@calc\flo@ta{\flo@avtw-0.15}\flo@calc\flo@tb{\flo@avtw+0.2}%
    \ifnum\flo@fine=1 \def\flo@avnm{6}\else\def\flo@avnm{3}\fi
    \flo@vmottle{-0.45}{0.15}{0.2}{0.6}\flo@avnm{0.07}\flo@ta\flo@tb{0}%
    \def\flo@twa{0.025}\def\flo@twb{0.003}%
    \flo@loop{avws}\flo@Wa{1}{5}{%
      \flo@calc\flo@ya{0.28+0.04*\the\flo@Wa}%
      \flo@calc\flo@yb{\flo@ya+0.05}\flo@calc\flo@yc{\flo@ya+0.03}\flo@calc\flo@yd{\flo@ya-0.03}%
      \flo@calc\flo@xe{-0.3-0.02*\the\flo@Wa}\flo@calc\flo@ye{\flo@ya-0.1-0.01*\the\flo@Wa}%
      \flo@range\flo@t{0.45}{0.7}%
      \flo@vfill{white}{\flo@t}{0}{\flo@vtaper{0.12}\flo@yb{0}\flo@yc{-0.15}\flo@yd\flo@xe\flo@ye}}%
    \flo@vtone{flo@c}{0.04}\flo@calc\flo@t{0.06*\flo@avu*28.3465}\flo@vstroke{flo@c}{\flo@t}{0.5}{1}{\flo@kept{avw}}%
  \end{pgfscope}}
% a hovering bird's wings: three passes of a long wing above its back, the middle one firmer
\def\flo@avhover{%
  \flo@put1{0}{0.02}\flo@put2{0.12}{0.07}\flo@put3{0.32}{0.085}\flo@put4{0.5}{0.05}%
  \flo@put5{0.56}{0}\flo@put6{0.48}{-0.03}\flo@put7{0.28}{-0.045}\flo@put8{0.08}{-0.03}%
  \flo@smoothprep{8}\flo@keep{avh}\flo@calc\flo@avtw{\flo@avt-0.1}%
  \flo@loop{avhw}\flo@Wa{1}{3}{\begin{pgfscope}%
    \flo@calc\flo@t{70+25*\the\flo@Wa}\pgftransformshift{\flo@P{0.06}{0.5}}\pgftransformrotate{\flo@t}%
    \flo@vtone{flo@c}{\flo@avtw}%
    \ifnum\flo@Wa=2 \flo@vfill{flo@c}{0.4}{0}{\flo@kept{avh}}%
      \flo@vtone{flo@c}{0.05}\flo@vstroke{flo@c}{\flo@avlw}{0.4}{0}{\flo@kept{avh}}%
    \else\flo@vfill{flo@c}{0.18}{0}{\flo@kept{avh}}\fi
  \end{pgfscope}}}
% a crest of four feathers on the back of the head
\def\flo@avcrest{%
  \def\flo@twa{0.03}\def\flo@twb{0.004}%
  \flo@vtone{flo@c}{0.1}\flo@vfill{flo@c}{1}{0}{\flo@loop{avc}\flo@Wa{1}{4}{%
    \flo@range\flo@avL{0.08}{0.12}%
    \flo@calc\flo@xa{0.26-0.04*\the\flo@Wa}\flo@calc\flo@ya{0.65-0.01*\the\flo@Wa}%
    \flo@calc\flo@t{140+8*\the\flo@Wa}%
    \flo@calc\flo@xd{\flo@xa+\flo@avL*cos(\flo@t)}\flo@calc\flo@yd{\flo@ya+\flo@avL*sin(\flo@t)}%
    \flo@lgseg\flo@xa\flo@ya\flo@xd\flo@yd}}}
% the bill: a seed-eater's cone, a nectar bird's straight or curved one
\def\flo@avbill{%
  \edef\flo@t{\flo@xget{bill}}\flo@vtone{flo@c}{0.05}%
  \def\flo@tmp{conical}\ifx\flo@t\flo@tmp
    \flo@vfill{flo@c}{1}{0}{\pgfpathmoveto{\flo@P{0.355}{0.585}}\pgfpathlineto{\flo@P{0.47}{0.545}}%
      \pgfpathlineto{\flo@P{0.36}{0.51}}\pgfpathclose}%
    \flo@vstroke{white}{0.2}{0.6}{0}{\pgfpathmoveto{\flo@P{0.36}{0.548}}\pgfpathlineto{\flo@P{0.45}{0.546}}}%
  \fi
  \def\flo@tmp{straight}\ifx\flo@t\flo@tmp
    \flo@vfill{flo@c}{1}{0}{\pgfpathmoveto{\flo@P{0.35}{0.575}}\pgfpathlineto{\flo@P{0.69}{0.55}}%
      \pgfpathlineto{\flo@P{0.352}{0.538}}\pgfpathclose}%
  \fi
  \def\flo@tmp{curved}\ifx\flo@t\flo@tmp
    \def\flo@twa{0.036}\def\flo@twb{0.006}%
    \flo@vfill{flo@c}{1}{0}{\flo@vtaper{0.35}{0.556}{0.46}{0.562}{0.58}{0.535}{0.66}{0.475}}%
  \fi}
% a bird; #1 its length on the page in pt
\def\flo@bird#1{%
  \flo@calc\flo@avu{(#1)/28.45276}%
  \ifdim\flo@avu pt>0.3pt \def\flo@fine{1}\else\def\flo@fine{0}\fi
  \edef\flo@avk{\flo@xget{kind}}\edef\flo@avpose{\flo@xget{pose}}\edef\flo@avground{\flo@xget{ground}}%
  \edef\flo@avt{\flo@xget{tone}}%
  \def\flo@tmp{dark}\ifx\flo@avground\flo@tmp\flo@calc\flo@avt{\flo@avt-0.12}\fi
  \def\flo@tmp{copper}\ifx\flo@avground\flo@tmp\def\flo@rampname{flo@aramp}\fi
  \def\flo@avfan{7}%
  \begin{pgfscope}%
    \def\flo@tmp{hover}\ifx\flo@avpose\flo@tmp\def\flo@avfan{14}%
      \pgftransformshift{\flo@P{0.05}{0.35}}\pgftransformrotate{22}\pgftransformshift{\flo@P{-0.05}{-0.35}}\fi
    \flo@avbody
    \ifnum\flo@xget{crest}=1 \flo@avcrest\fi
    \def\flo@tmp{hover}\ifx\flo@avpose\flo@tmp\flo@avhover\else\flo@avwing\fi
    \flo@avbill
    \flo@vfill{white}{0.95}{0}{\pgfpathcircle{\flo@P{0.285}{0.585}}{0.03pt}}%
    \flo@vtone{flo@c}{0.03}\flo@vfill{flo@c}{1}{0}{\pgfpathcircle{\flo@P{0.29}{0.585}}{0.018pt}}%
    \flo@vfill{white}{1}{0}{\pgfpathcircle{\flo@P{0.284}{0.592}}{0.006pt}}%
    \def\flo@tmp{hover}\ifx\flo@avpose\flo@tmp\else
      \flo@calc\flo@t{max(0.4,0.3*\flo@avu)}\flo@vtone{flo@c}{0.06}%
      \flo@vstroke{flo@c}{\flo@t}{1}{0}{\pgfpathmoveto{\flo@P{0.02}{0.14}}\pgfpathlineto{\flo@P00}%
        \pgfpathmoveto{\flo@P{-0.05}{0}}\pgfpathlineto{\flo@P{0.05}{0.005}}%
        \pgfpathmoveto{\flo@P{0.1}{0.14}}\pgfpathlineto{\flo@P{0.08}{0}}%
        \pgfpathmoveto{\flo@P{0.03}{0}}\pgfpathlineto{\flo@P{0.13}{0.005}}}%
    \fi
  \end{pgfscope}}
% a visitor of the kind last drawn; #1 its size on the page in pt (a wingspan, a length)
\def\flo@visitor#1{%
  \edef\flo@vg{\flo@xget{group}}%
  \def\flo@tmp{lepidoptera}\ifx\flo@vg\flo@tmp\flo@calc\flo@t{(#1)/2}\pgftransformscale{\flo@t}\flo@lepid{#1}\fi
  \def\flo@tmp{bee}\ifx\flo@vg\flo@tmp\pgftransformscale{#1}\flo@bee{#1}\fi
  \def\flo@tmp{fly}\ifx\flo@vg\flo@tmp\pgftransformscale{#1}\flo@bee{#1}\fi
  \def\flo@tmp{odonate}\ifx\flo@vg\flo@tmp\pgftransformscale{#1}\flo@odo{#1}\fi
  \def\flo@tmp{beetle}\ifx\flo@vg\flo@tmp\pgftransformscale{#1}\flo@beetle{#1}\fi
  \def\flo@tmp{larva}\ifx\flo@vg\flo@tmp\pgftransformscale{#1}\flo@caterpillar{#1}\fi
  \def\flo@tmp{snail}\ifx\flo@vg\flo@tmp\pgftransformscale{#1}\flo@snail{#1}\fi
  \def\flo@tmp{bird}\ifx\flo@vg\flo@tmp\pgftransformscale{#1}\flo@bird{#1}\fi}
% sample the visitor, then reseed for the drawing
\def\flo@vispicsetup#1{%
  \pgfkeys{/florilegium,#1}\flo@colors\flo@intof\flo@o@seed\flo@o@seed
  \edef\flo@tmp{\noexpand\florilegiumvisitor[{\flo@o@traits}]{\flo@o@seed}{\flo@o@role}}\flo@tmp
  \edef\flo@o@seed{\flo@xget{seed}}\edef\flo@o@role{\flo@xget{role}}% as the sampler settled them
  \ifx\flo@o@draw\pgfutil@empty
    \edef\flo@o@draw{\the\numexpr\ifnum\flo@o@seed=2147483646 1\else\flo@o@seed+1\fi\relax}\fi
  \flo@drawseed\flo@o@draw
  \pgfmathsetlength\pgf@x{\flo@o@size}\edef\flo@sizept{\pgf@sys@tonumber\pgf@x}}
% \pic {florilegium visitor={seed=7, role=butterfly, size=3cm}}: a visitor of the role
% (or a kind: role=moth, role=ladybird), size its wingspan or length
\tikzset{pics/florilegium visitor/.style={code={\flo@engine{#1}{visitor}{%
  \flo@vispicsetup{#1}\pgfsetroundcap\pgfsetroundjoin\flo@visitor\flo@sizept}}}}

% ================================================================ tracery, drawn
% florilegium-tracery.lua's drawing, step for step and draw for draw: a window in local
% units, a hundred to its width (\pgftransformscale), so that pgfmath's squares of the
% coordinates stay under its range; line widths absolute, in bp, as there. A chain of
% arcs is \flo@c@<name>@<i> = {cx}{cy}{r}{a0}{a1}{convex} (angles in degrees), its count
% \flo@cn@<name>; the right half of an arch is the chain mirrored about the axis, walked
% from the apex down. The drawing's random draws (the wash's blotches, foliage) are the
% library's own, one a line, from \flo@drawseed's stream, as the Lua side draws them.
\newcount\flo@tci \newcount\flo@tcj \newcount\flo@tck \newcount\flo@tcl \newcount\flo@tcm \newcount\flo@tcn
\definecolor{flo@paper}{rgb}{0.995,0.993,0.985}
% ---------------------------------------------------------------- arcs and chains
% an arc of the circle (#1,#2) of radius #3 from angle #4 to #5, Bezier pieces of a
% quarter turn at most (ink's arcto); #6 1 moves to its start first
\def\flo@arcto#1#2#3#4#5#6{%
  \flo@calc\flo@aa{#4}\flo@calc\flo@ab{#5}\flo@calc\flo@ar{#3}\flo@calc\flo@acx{#1}\flo@calc\flo@acy{#2}%
  \pgfmathtruncatemacro\flo@an{max(1,ceil(abs(\flo@ab-\flo@aa)/90-0.00001))}%
  \flo@calc\flo@ada{(\flo@ab-\flo@aa)/\flo@an}%
  \flo@calc\flo@ak{4/3*tan(\flo@ada/4)}%
  \ifnum#6=1 \flo@calc\flo@xa{\flo@acx+\flo@ar*cos(\flo@aa)}\flo@calc\flo@ya{\flo@acy+\flo@ar*sin(\flo@aa)}%
    \pgfpathmoveto{\flo@P\flo@xa\flo@ya}\fi
  \flo@loop{tarc}\flo@tcm{1}{\flo@an}{%
    \flo@calc\flo@ab{\flo@aa+\flo@ada}%
    \flo@calc\flo@ca{cos(\flo@aa)}\flo@calc\flo@sa{sin(\flo@aa)}\flo@calc\flo@cb{cos(\flo@ab)}\flo@calc\flo@sb{sin(\flo@ab)}%
    \flo@calc\flo@xa{\flo@acx+\flo@ar*(\flo@ca-\flo@ak*\flo@sa)}\flo@calc\flo@ya{\flo@acy+\flo@ar*(\flo@sa+\flo@ak*\flo@ca)}%
    \flo@calc\flo@xb{\flo@acx+\flo@ar*(\flo@cb+\flo@ak*\flo@sb)}\flo@calc\flo@yb{\flo@acy+\flo@ar*(\flo@sb-\flo@ak*\flo@cb)}%
    \flo@calc\flo@xc{\flo@acx+\flo@ar*\flo@cb}\flo@calc\flo@yc{\flo@acy+\flo@ar*\flo@sb}%
    \pgfpathcurveto{\flo@P\flo@xa\flo@ya}{\flo@P\flo@xb\flo@yb}{\flo@P\flo@xc\flo@yc}%
    \let\flo@aa\flo@ab}}
% sqrt(#1^2 - #2^2), or 0, scaled down first so that the squares stay in pgfmath's range: \flo@sqd
\def\flo@sqdiff#1#2{\pgfmathparse{abs(#1)>1000}\ifdim\pgfmathresult pt>0pt
    % Past a thousand the eighths' squares leave pgfmath's range too, and a depressed
    % ogee's crown can be forty spans. Take the roots of the sum and the difference there.
    \flo@calc\flo@sqd{sqrt(max(0,abs(#1)-abs(#2)))*sqrt(abs(#1)+abs(#2))}%
  \else\flo@calc\flo@sqd{8*sqrt(max(0,((#1)/8)*((#1)/8)-((#2)/8)*((#2)/8)))}\fi}
% chains: piece #2 of chain #1 set from six values, or read into \flo@px \flo@py \flo@pr
% \flo@pa \flo@pb \flo@pv
\def\flo@cset#1#2#3#4#5#6#7#8{\expandafter\edef\csname flo@c@#1@#2\endcsname{{#3}{#4}{#5}{#6}{#7}{#8}}}
\def\flo@cget#1#2{\expandafter\expandafter\expandafter\flo@cget@\csname flo@c@#1@#2\endcsname}
\def\flo@cget@#1#2#3#4#5#6{\def\flo@px{#1}\def\flo@py{#2}\def\flo@pr{#3}\def\flo@pa{#4}\def\flo@pb{#5}\def\flo@pv{#6}}
\def\flo@cnumset#1#2{\expandafter\edef\csname flo@cn@#1\endcsname{#2}}
\def\flo@cnum#1{\csname flo@cn@#1\endcsname}
\def\flo@ccopy#1#2{\flo@cnumset{#2}{\flo@cnum{#1}}%
  \flo@loop{tcc}\flo@tcl{1}{\flo@cnum{#1}}{\expandafter\let\csname flo@c@#2@\the\flo@tcl\expandafter\endcsname\csname flo@c@#1@\the\flo@tcl\endcsname}}
% the chain #1 mirrored about x = #3 into #2, walked from the apex down
\def\flo@cmirror#1#2#3{\flo@cnumset{#2}{\flo@cnum{#1}}%
  \flo@loop{tcm}\flo@tcl{1}{\flo@cnum{#1}}{\flo@cget{#1}{\the\numexpr\flo@cnum{#1}+1-\flo@tcl\relax}%
    \flo@calc\flo@t{2*(#3)-\flo@px}\flo@calc\flo@ta{180-\flo@pb}\flo@calc\flo@tb{180-\flo@pa}%
    \flo@cset{#2}{\the\flo@tcl}\flo@t\flo@py\flo@pr\flo@ta\flo@tb\flo@pv}}
% a chain written to the log, for debugging
\def\flo@cdump#1{\flo@loop{tcd}\flo@tcl{1}{\flo@cnum{#1}}{\flo@cget{#1}{\the\flo@tcl}%
  \typeout{chain #1 \the\flo@tcl: \flo@px\space\flo@py\space\flo@pr\space\flo@pa\space\flo@pb\space\flo@pv}}}
% the point of the piece read last at angle #1: \flo@atx \flo@aty
\def\flo@tat#1{\flo@calc\flo@atx{\flo@px+\flo@pr*cos(#1)}\flo@calc\flo@aty{\flo@py+\flo@pr*sin(#1)}}
% the angle, from (#1,#2), of the upper (#5 0) or lower (#5 1) point where the circle of
% radius #3 meets the vertical x = #4: \flo@axa, \ifflo@yes false if it does not reach it
\def\flo@angleatx#1#2#3#4#5{%
  \flo@calc\flo@axt{(#4)-(#1)}%
  \pgfmathparse{abs(\flo@axt)>(#3)}\ifdim\pgfmathresult pt>0pt \flo@yesfalse\else\flo@yestrue
    \flo@sqdiff{#3}\flo@axt
    \ifnum#5=1 \flo@calc\flo@axa{atan2(-\flo@sqd,\flo@axt)}\else\flo@calc\flo@axa{atan2(\flo@sqd,\flo@axt)}\fi\fi}
% the apex of chain #1: \flo@apy (the last piece's end)
\def\flo@apex#1{\flo@cget{#1}{\flo@cnum{#1}}\flo@tat\flo@pb\let\flo@apy\flo@aty}
% the arch's head: chain #1 from its start, then its mirror about #2; #3 1 moves first
\def\flo@headpath#1#2#3{\edef\flo@hpn{\flo@cnum{#1}}\edef\flo@hpxm{#2}\edef\flo@hpfirst{#3}%
  \flo@loop{thpa}\flo@tcl{1}{\flo@hpn}{\flo@cget{#1}{\the\flo@tcl}%
    \flo@arcto\flo@px\flo@py\flo@pr\flo@pa\flo@pb{\ifnum\flo@tcl=1 \flo@hpfirst\else0\fi}}%
  \flo@loop{thpb}\flo@tcl{1}{\flo@hpn}{\flo@cget{#1}{\the\numexpr\flo@hpn+1-\flo@tcl\relax}%
    \flo@calc\flo@t{2*\flo@hpxm-\flo@px}\flo@calc\flo@ta{180-\flo@pb}\flo@calc\flo@tb{180-\flo@pa}%
    \flo@arcto\flo@t\flo@py\flo@pr\flo@ta\flo@tb{0}}}
% A depressed ogee's shoulders turned #1 degrees. This finds where they end (\flo@tex,
% \flo@tey), the tangent there and the apex as seen from it. The shoulders turn 80 degrees
% and then one more at a time, up to 90, until the apex lies above the tangent and the
% crown's radius is within forty spans. florilegium-tracery.lua's half_arch does the same.
% At a fixed 80 the apex could lie below the tangent, so the radius came out negative and
% the moldings and figures left the page.
\def\flo@haturn#1{%
  \flo@calc\flo@haae{180-#1}%
  \flo@calc\flo@tex{\flo@tcx+\flo@har*cos(\flo@haae)}\flo@calc\flo@tey{\flo@hays+\flo@har*sin(\flo@haae)}%
  \flo@calc\flo@tux{cos(\flo@haae)}\flo@calc\flo@tuy{sin(\flo@haae)}%
  \flo@calc\flo@tdx{\flo@haxm-\flo@tex}\flo@calc\flo@tdy{\flo@hays+\flo@hah-\flo@tey}%
  \flo@calc\flo@hadot{\flo@tdx*\flo@tux+\flo@tdy*\flo@tuy}%
  \flo@calc\flo@hadd{\flo@tdx*\flo@tdx+\flo@tdy*\flo@tdy}%
  \let\flo@tmp\relax
  \ifnum#1<90 \flo@calc\flo@t{\flo@hadd/(80*\flo@has)-\flo@hadot}%
    \ifdim\flo@t pt>0pt \edef\flo@tmp{\noexpand\flo@haturn{\the\numexpr#1+1\relax}}\fi\fi
  \flo@tmp}
% the left half of an arch over [#2, #3] springing at #4, as its construction line, into
% chain #1: kind #5, excess #6, ogee #7, rise #8, shoulder #9 (the traits, or a head's own)
\def\flo@halfarch#1#2#3#4#5#6#7#8#9{%
  \flo@calc\flo@has{(#3)-(#2)}\flo@calc\flo@haxm{((#2)+(#3))/2}\edef\flo@hays{#4}\edef\flo@haxl{#2}%
  \edef\flo@t{#5}\def\flo@tmp{round}%
  \ifx\flo@t\flo@tmp
    \flo@calc\flo@tr{\flo@has/2}\flo@cset{#1}{1}\flo@haxm\flo@hays\flo@tr{180}{90}{1}\flo@cnumset{#1}{1}%
  \else\def\flo@tmp{segmental}\ifx\flo@t\flo@tmp
    \flo@calc\flo@tr{max(#6,0.52)*\flo@has}\flo@calc\flo@t{\flo@has/2}\flo@sqdiff\flo@tr\flo@t\flo@calc\flo@tcy{\flo@hays-\flo@sqd}%
    \flo@angleatx\flo@haxm\flo@tcy\flo@tr\flo@haxl{0}%
    \flo@cset{#1}{1}\flo@haxm\flo@tcy\flo@tr\flo@axa{90}{1}\flo@cnumset{#1}{1}%
  \else\def\flo@tmp{fourcentered}\ifx\flo@t\flo@tmp
    % the four-centered arch: shoulders of radius r1 at the springing, the crown
    % arcs centered on the axis below them, tangent, meeting at the apex
    \flo@calc\flo@hah{(#8)*\flo@has}\flo@calc\flo@har{min((#9)*\flo@has,0.9*\flo@hah)}%
    \flo@calc\flo@tdx{\flo@has/2-\flo@har}%
    \flo@calc\flo@tR{(\flo@tdx*\flo@tdx+\flo@hah*\flo@hah-\flo@har*\flo@har)/(2*(\flo@hah-\flo@har))}%
    \flo@calc\flo@tcx{\flo@haxl+\flo@har}\flo@calc\flo@tcy{\flo@hays+\flo@hah-\flo@tR}%
    \flo@calc\flo@tux{\flo@tcx-\flo@haxm}\flo@calc\flo@tuy{\flo@hays-\flo@tcy}%
    \flo@calc\flo@td{veclen(\flo@tux,\flo@tuy)}\flo@calc\flo@tux{\flo@tux/\flo@td}\flo@calc\flo@tuy{\flo@tuy/\flo@td}%
    \flo@calc\flo@tex{\flo@haxm+\flo@tR*\flo@tux}\flo@calc\flo@tey{\flo@tcy+\flo@tR*\flo@tuy}%
    \flo@calc\flo@ta{atan2(\flo@tey-\flo@hays,\flo@tex-\flo@tcx)}%
    \flo@cset{#1}{1}\flo@tcx\flo@hays\flo@har{180}\flo@ta{1}%
    \flo@calc\flo@ta{atan2(\flo@tey-\flo@tcy,\flo@tex-\flo@haxm)}%
    \flo@cset{#1}{2}\flo@haxm\flo@tcy\flo@tR\flo@ta{90}{1}\flo@cnumset{#1}{2}%
  \else\def\flo@tmp{ogee}\ifx\flo@t\flo@tmp
    % a pointed arch reversed above its inflection: the lower arcs rise to the angle the
    % genome gives, then arcs the other way, tangent there, meet at the apex
    \flo@calc\flo@tR{(#6)*\flo@has}\flo@calc\flo@tcx{\flo@haxl+\flo@tR}%
    \flo@calc\flo@tphi{180-90*(#7)}%
    \flo@calc\flo@tix{\flo@tcx+\flo@tR*cos(\flo@tphi)}\flo@calc\flo@tiy{\flo@hays+\flo@tR*sin(\flo@tphi)}%
    \flo@calc\flo@tux{cos(\flo@tphi)}\flo@calc\flo@tuy{sin(\flo@tphi)}%
    \flo@calc\flo@tdx{\flo@haxm-\flo@tix}\flo@calc\flo@trm{\flo@tdx/(1-abs(\flo@tux))}%
    \flo@calc\flo@tRu{max(1.4*\flo@trm,\flo@tR)}%
    \flo@calc\flo@tcux{\flo@tix+\flo@tRu*\flo@tux}\flo@calc\flo@tcuy{\flo@tiy+\flo@tRu*\flo@tuy}%
    \flo@calc\flo@tdx{\flo@haxm-\flo@tcux}%
    \flo@sqdiff\flo@tRu\flo@tdx\flo@calc\flo@tay{\flo@tcuy-\flo@sqd}%
    \flo@cset{#1}{1}\flo@tcx\flo@hays\flo@tR{180}\flo@tphi{1}%
    \flo@calc\flo@ta{atan2(\flo@tiy-\flo@tcuy,\flo@tix-\flo@tcux)}\flo@calc\flo@tb{atan2(\flo@tay-\flo@tcuy,\flo@tdx)}%
    \flo@cset{#1}{2}\flo@tcux\flo@tcuy\flo@tRu\flo@ta\flo@tb{0}\flo@cnumset{#1}{2}%
  \else\def\flo@tmp{depressed}\ifx\flo@t\flo@tmp
    % a headpiece's ogee: shoulders as the four-centered arch's, then reversed crowns, the
    % crown's radius at most forty spans (pgfmath's range; the Lua side caps it the same)
    \flo@calc\flo@har{(#9)*\flo@has}\flo@calc\flo@hah{(#8)*\flo@has}\flo@calc\flo@tcx{\flo@haxl+\flo@har}%
    \flo@haturn{80}%
    \flo@calc\flo@tRu{min(40*\flo@has,\flo@hadd/(2*\flo@hadot))}%
    \flo@calc\flo@tcux{\flo@tex+\flo@tRu*\flo@tux}\flo@calc\flo@tcuy{\flo@tey+\flo@tRu*\flo@tuy}%
    \flo@cset{#1}{1}\flo@tcx\flo@hays\flo@har{180}\flo@haae{1}%
    \flo@calc\flo@ta{atan2(\flo@tey-\flo@tcuy,\flo@tex-\flo@tcux)}%
    \flo@angleatx\flo@tcux\flo@tcuy\flo@tRu\flo@haxm{1}%
    \ifflo@yes\else\flo@calc\flo@axa{atan2(\flo@hays+\flo@hah-\flo@tcuy,\flo@haxm-\flo@tcux)}\fi
    \flo@cset{#1}{2}\flo@tcux\flo@tcuy\flo@tRu\flo@ta\flo@axa{0}\flo@cnumset{#1}{2}%
  \else
    % two-centered: drop, equilateral, lancet
    \flo@calc\flo@tR{(#6)*\flo@has}\flo@calc\flo@tcx{\flo@haxl+\flo@tR}%
    \flo@calc\flo@t{\flo@has/2-\flo@tR}\flo@sqdiff\flo@tR\flo@t\flo@calc\flo@ta{atan2(\flo@sqd,\flo@t)}%
    \flo@cset{#1}{1}\flo@tcx\flo@hays\flo@tR{180}\flo@ta{1}\flo@cnumset{#1}{1}%
  \fi\fi\fi\fi\fi}
% the arch in the window's manner: \flo@ha@<kind, excess, ogee, rise, shoulder> are the
% traits unless a head sets its own (\flo@haset)
\def\flo@hafromtraits{\edef\flo@ha@kind{\flo@tget{arch}}\edef\flo@ha@excess{\flo@tget{excess}}%
  \edef\flo@ha@ogee{\flo@tget{ogee}}\edef\flo@ha@rise{\flo@tget{rise}}\edef\flo@ha@shoulder{\flo@tget{shoulder}}}
\def\flo@haset#1#2#3#4#5{\def\flo@ha@kind{#1}\edef\flo@ha@excess{#2}\edef\flo@ha@ogee{#3}\edef\flo@ha@rise{#4}\edef\flo@ha@shoulder{#5}}
\def\flo@harch#1#2#3#4{\flo@halfarch{#1}{#2}{#3}{#4}{\flo@ha@kind}{\flo@ha@excess}{\flo@ha@ogee}{\flo@ha@rise}{\flo@ha@shoulder}}
% chain #1 with its circles' radii moved so the curve moves #3 toward the opening into
% #2 (convex pieces shrink, concave ones grow); the ends on the jamb line #4 and the axis
% #5 are found again, tangent joins keep their angles; #6 the springing, or empty
\def\flo@coffset#1#2#3#4#5#6{%
  \edef\flo@con{\flo@cnum{#1}}\flo@cnumset{#2}{\flo@con}\flo@calc\flo@cooff{#3}\edef\flo@coxj{#4}\edef\flo@coxm{#5}\edef\flo@coys{#6}%
  \flo@loop{tco}\flo@tcl{1}{\flo@con}{\flo@cget{#1}{\the\flo@tcl}%
    \ifnum\flo@pv=1 \flo@calc\flo@tr{\flo@pr-\flo@cooff}\else\flo@calc\flo@tr{\flo@pr+\flo@cooff}\fi
    \let\flo@ta\flo@pa\let\flo@tb\flo@pb
    \ifnum\flo@tcl=1
      \flo@yesfalse
      \ifx\flo@coys\pgfutil@empty\else
        \pgfmathparse{and(\flo@py<\flo@coys-0.000001,abs(\flo@coys-\flo@py)<\flo@tr)}\ifdim\pgfmathresult pt>0pt \flo@yestrue\fi\fi
      \ifflo@yes
        % a center below the springing (segmental): the arc starts on the springing line
        \flo@calc\flo@t{\flo@coys-\flo@py}\flo@sqdiff\flo@tr\flo@t\flo@calc\flo@ta{atan2(\flo@t,-\flo@sqd)}%
      \else
        \flo@angleatx\flo@px\flo@py\flo@tr\flo@coxj{\ifnum\flo@pv=1 0\else1\fi}\ifflo@yes\let\flo@ta\flo@axa\fi
      \fi
    \fi
    \ifnum\flo@tcl=\flo@con\relax
      \flo@angleatx\flo@px\flo@py\flo@tr\flo@coxm{\ifnum\flo@pv=1 0\else1\fi}\ifflo@yes\let\flo@tb\flo@axa\fi
    \fi
    \flo@cset{#2}{\the\flo@tcl}\flo@px\flo@py\flo@tr\flo@ta\flo@tb\flo@pv}%
  % a ring outside a reversed apex (an ogee's): parallel arcs would meet in a spire, or
  % not at all, so the reversed arc is struck again from the ring's inflection, tangent
  % there, to an apex -off above the arch's own
  \ifnum\flo@con>1
    \flo@cget{#1}{\flo@con}%
    \ifnum\flo@pv=0 \ifdim\flo@cooff pt<0pt
      \flo@tat\flo@pb\let\flo@coay\flo@aty
      \flo@cget{#2}{\the\numexpr\flo@con-1\relax}\flo@tat\flo@pb
      \flo@calc\flo@tux{cos(\flo@pb)}\flo@calc\flo@tuy{sin(\flo@pb)}\let\flo@tix\flo@atx\let\flo@tiy\flo@aty
      \flo@calc\flo@tdx{\flo@coxm-\flo@tix}\flo@calc\flo@tdy{\flo@coay-\flo@cooff-\flo@tiy}%
      \flo@calc\flo@tdot{\flo@tdx*\flo@tux+\flo@tdy*\flo@tuy}%
      \ifdim\flo@tdot pt>0.000001pt
        \flo@calc\flo@td{veclen(\flo@tdx,\flo@tdy)}%
        \flo@calc\flo@tt{min(20*\flo@td,\flo@td/(2*\flo@tdot/\flo@td))}%
        \flo@calc\flo@tcx{\flo@tix+\flo@tt*\flo@tux}\flo@calc\flo@tcy{\flo@tiy+\flo@tt*\flo@tuy}%
        \flo@calc\flo@ta{atan2(\flo@tiy-\flo@tcy,\flo@tix-\flo@tcx)}\flo@calc\flo@tb{atan2(\flo@coay-\flo@cooff-\flo@tcy,\flo@coxm-\flo@tcx)}%
        \flo@calc\flo@td{\flo@tb-\flo@ta}%
        \pgfmathparse{\flo@td>180}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@td{\flo@td-360}\fi
        \pgfmathparse{\flo@td<-180}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@td{\flo@td+360}\fi
        \flo@calc\flo@tb{\flo@ta+\flo@td}%
        \flo@cset{#2}{\flo@con}\flo@tcx\flo@tcy\flo@tt\flo@ta\flo@tb{0}%
      \fi
    \fi\fi
  \fi}
% a point on chain #1 at parameter #2 in 0..1 (by angle along the pieces), and the inward
% normal there: \flo@cpx \flo@cpy \flo@cnx \flo@cny
\def\flo@chainpoint#1#2{%
  \def\flo@cptot{0}%
  \flo@loop{tcpa}\flo@tck{1}{\flo@cnum{#1}}{\flo@cget{#1}{\the\flo@tck}\flo@calc\flo@cptot{\flo@cptot+abs(\flo@pb-\flo@pa)}}%
  \flo@calc\flo@cpw{(#2)*\flo@cptot}\flo@yesfalse
  \flo@loop{tcpb}\flo@tck{1}{\flo@cnum{#1}}{\ifflo@yes\else
    \flo@cget{#1}{\the\flo@tck}\flo@calc\flo@cpl{abs(\flo@pb-\flo@pa)}%
    \pgfmathparse{\flo@cpw<=\flo@cpl+0.0000001}\ifdim\pgfmathresult pt>0pt
      \flo@yestrue
      \ifdim\flo@cpl pt>0pt \flo@calc\flo@ta{\flo@pa+(\flo@pb-\flo@pa)*\flo@cpw/\flo@cpl}\else\let\flo@ta\flo@pa\fi
      \flo@tat\flo@ta\let\flo@cpx\flo@atx\let\flo@cpy\flo@aty
      \ifnum\flo@pv=1 \flo@calc\flo@cnx{-cos(\flo@ta)}\flo@calc\flo@cny{-sin(\flo@ta)}%
      \else\flo@calc\flo@cnx{cos(\flo@ta)}\flo@calc\flo@cny{sin(\flo@ta)}\fi
    \else\flo@calc\flo@cpw{\flo@cpw-\flo@cpl}\fi\fi}%
  \ifflo@yes\else\flo@cget{#1}{\flo@cnum{#1}}\flo@tat\flo@pb\let\flo@cpx\flo@atx\let\flo@cpy\flo@aty
    \flo@calc\flo@cnx{-cos(\flo@pb)}\flo@calc\flo@cny{-sin(\flo@pb)}\fi
  \flo@yestrue}
% the y of an arch (chain #1 mirrored about #2) at x = #3: \flo@cyv, \ifflo@yes false outside it
\def\flo@chainy#1#2#3{%
  \flo@calc\flo@cyx{#3}\pgfmathparse{\flo@cyx>(#2)}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@cyx{2*(#2)-\flo@cyx}\fi
  \flo@yesfalse
  \flo@loop{tcy}\flo@tcl{1}{\flo@cnum{#1}}{\ifflo@yes\else
    \flo@cget{#1}{\the\flo@tcl}\flo@calc\flo@tdx{\flo@cyx-\flo@px}%
    \pgfmathparse{abs(\flo@tdx)<=\flo@pr}\ifdim\pgfmathresult pt>0pt
      \flo@sqdiff\flo@pr\flo@tdx\let\flo@tdy\flo@sqd
      \ifnum\flo@pv=1 \flo@calc\flo@cyv{\flo@py+\flo@tdy}\else\flo@calc\flo@cyv{\flo@py-\flo@tdy}\fi
      \flo@calc\flo@ta{atan2(\flo@cyv-\flo@py,\flo@tdx)}%
      \pgfmathparse{and(\flo@ta>=min(\flo@pa,\flo@pb)-0.0000001,\flo@ta<=max(\flo@pa,\flo@pb)+0.0000001)}%
      \ifdim\pgfmathresult pt>0pt \flo@yestrue\fi
    \fi\fi}}
% ---------------------------------------------------------------- cusps
% the head of an opening with cusps (Havemann and Fellner's foliation): each side of chain
% #1 in k + 1 lobes with a cusp between them #4 into the opening; a lobe is a circle
% tangent to the arch, at its outer end for the first and last lobes and at its middle for
% the others, curling in to the cusps; #2 the axis, #3 the cusps, #5 1 moves first
\def\flo@cuspedhead#1#2#3#4#5{%
  \pgfmathtruncatemacro\flo@chk{floor((#3)/2)}\edef\flo@chn{\the\numexpr\flo@chk+1\relax}%
  \edef\flo@chdepth{#4}\edef\flo@chxm{#2}%
  \flo@cmirror{#1}{tcm}{#2}%
  \flo@cuspside{#1}{#5}\flo@cuspside{tcm}{0}}
% the circle tangent to chain #1 at parameter #2, through (#3,#4), its radius at most fifty
% times the reach (the Lua side caps it the same): \flo@lbx \flo@lby \flo@lbr, the tangent point \flo@lbtx \flo@lbty
\def\flo@lobe#1#2#3#4{\flo@chainpoint{#1}{#2}%
  \let\flo@lbtx\flo@cpx\let\flo@lbty\flo@cpy
  \flo@calc\flo@tvx{(#3)-\flo@cpx}\flo@calc\flo@tvy{(#4)-\flo@cpy}%
  \flo@calc\flo@tdot{\flo@tvx*\flo@cnx+\flo@tvy*\flo@cny}\flo@calc\flo@td{veclen(\flo@tvx,\flo@tvy)}%
  \pgfmathparse{abs(\flo@tdot)<\flo@td/100}\ifdim\pgfmathresult pt>0pt
    \pgfmathparse{\flo@tdot<0}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tdot{-\flo@td/100}\else\flo@calc\flo@tdot{\flo@td/100}\fi\fi
  \flo@calc\flo@trho{\flo@td/(2*\flo@tdot/\flo@td)}%
  \flo@calc\flo@lbx{\flo@cpx+\flo@cnx*\flo@trho}\flo@calc\flo@lby{\flo@cpy+\flo@cny*\flo@trho}\flo@calc\flo@lbr{abs(\flo@trho)}}
\def\flo@short#1#2{\flo@calc\flo@tsh{(#2)-(#1)}%
  \pgfmathparse{\flo@tsh>180}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tsh{\flo@tsh-360}\fi
  \pgfmathparse{\flo@tsh<-180}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tsh{\flo@tsh+360}\fi}
\def\flo@cuspside#1#2{%
  \flo@chainpoint{#1}{0}\let\flo@csx\flo@cpx\let\flo@csy\flo@cpy
  \flo@chainpoint{#1}{1/\flo@chn}%
  \flo@calc\flo@csd{min(\flo@chdepth,0.3*veclen(\flo@cpx-\flo@csx,\flo@cpy-\flo@csy))}%
  \flo@loop{tcsq}\flo@tcj{0}{\flo@chn}{%
    \flo@chainpoint{#1}{\the\flo@tcj/\flo@chn}%
    \ifnum\flo@tcj=0 \def\flo@t{0}\else\ifnum\flo@tcj=\flo@chn\relax\def\flo@t{0}\else\let\flo@t\flo@csd\fi\fi
    \flo@calc\flo@ta{\flo@cpx+\flo@cnx*\flo@t}\flo@calc\flo@tb{\flo@cpy+\flo@cny*\flo@t}%
    \expandafter\let\csname flo@csqx\the\flo@tcj\endcsname\flo@ta\expandafter\let\csname flo@csqy\the\flo@tcj\endcsname\flo@tb}%
  \flo@loop{tcsl}\flo@tcj{1}{\flo@chn}{%
    \edef\flo@qax{\csname flo@csqx\the\numexpr\flo@tcj-1\relax\endcsname}\edef\flo@qay{\csname flo@csqy\the\numexpr\flo@tcj-1\relax\endcsname}%
    \edef\flo@qbx{\csname flo@csqx\the\flo@tcj\endcsname}\edef\flo@qby{\csname flo@csqy\the\flo@tcj\endcsname}%
    \ifnum\flo@chn=1
      % one lobe a side: tangent at the springing, through the apex
      \flo@lobe{#1}{0}\flo@qbx\flo@qby
      \flo@calc\flo@ta{atan2(\flo@qay-\flo@lby,\flo@qax-\flo@lbx)}\flo@calc\flo@tb{atan2(\flo@qby-\flo@lby,\flo@qbx-\flo@lbx)}%
      \flo@short\flo@ta\flo@tb\flo@calc\flo@tb{\flo@ta+\flo@tsh}%
      \flo@arcto\flo@lbx\flo@lby\flo@lbr\flo@ta\flo@tb{\ifnum#2=1 \ifnum\flo@tcj=1 1\else0\fi\else0\fi}%
    \else\ifnum\flo@tcj=1
      \flo@lobe{#1}{0}\flo@qbx\flo@qby
      \flo@calc\flo@ta{atan2(\flo@qay-\flo@lby,\flo@qax-\flo@lbx)}\flo@calc\flo@tb{atan2(\flo@qby-\flo@lby,\flo@qbx-\flo@lbx)}%
      \flo@short\flo@ta\flo@tb\flo@calc\flo@tb{\flo@ta+\flo@tsh}%
      \flo@arcto\flo@lbx\flo@lby\flo@lbr\flo@ta\flo@tb{#2}%
    \else\ifnum\flo@tcj=\flo@chn\relax
      \flo@lobe{#1}{1}\flo@qax\flo@qay
      \flo@calc\flo@ta{atan2(\flo@qay-\flo@lby,\flo@qax-\flo@lbx)}\flo@calc\flo@tb{atan2(\flo@qby-\flo@lby,\flo@qbx-\flo@lbx)}%
      \flo@short\flo@ta\flo@tb\flo@calc\flo@tb{\flo@ta+\flo@tsh}%
      \flo@arcto\flo@lbx\flo@lby\flo@lbr\flo@ta\flo@tb{0}%
    \else
      \flo@lobe{#1}{(\the\flo@tcj-0.5)/\flo@chn}\flo@qax\flo@qay
      \flo@calc\flo@ta{atan2(\flo@qay-\flo@lby,\flo@qax-\flo@lbx)}\flo@calc\flo@tam{atan2(\flo@lbty-\flo@lby,\flo@lbtx-\flo@lbx)}%
      \flo@calc\flo@tb{atan2(\flo@qby-\flo@lby,\flo@qbx-\flo@lbx)}%
      \flo@short\flo@ta\flo@tam\let\flo@tda\flo@tsh\flo@short\flo@tam\flo@tb\let\flo@tdb\flo@tsh
      \flo@calc\flo@tb{\flo@ta+\flo@tda}\flo@arcto\flo@lbx\flo@lby\flo@lbr\flo@ta\flo@tb{0}%
      \flo@calc\flo@ta{\flo@ta+\flo@tda}\flo@calc\flo@tb{\flo@ta+\flo@tdb}\flo@arcto\flo@lbx\flo@lby\flo@lbr\flo@ta\flo@tb{0}%
    \fi\fi\fi}}
% ---------------------------------------------------------------- the wash
% the current path (clipped by the caller) washed in the ink: darker toward the top in six
% faint bands, and blotches from the drawing's stream; (#1,#2)-(#3,#4) its box
\def\flo@twash#1#2#3#4{%
  \flo@calc\flo@tt{\flo@ttone+0.3}\flo@vtone{flo@c}{\flo@tt}%
  \flo@calc\flo@twa{(#1)-1}\flo@calc\flo@twb{(#2)-1}\flo@calc\flo@twc{(#3)+1}\flo@calc\flo@twd{(#4)+1}%
  \flo@vfill{flo@c}{1}{0}{\pgfpathrectanglecorners{\flo@P\flo@twa\flo@twb}{\flo@P\flo@twc\flo@twd}}%
  \flo@calc\flo@twh{(#4)-(#2)}%
  \ifdim\flo@twh pt>0pt
    \flo@calc\flo@tt{\flo@ttone+0.05}\flo@vtone{flo@c}{\flo@tt}%
    \flo@loop{twb}\flo@tcn{1}{6}{\flo@calc\flo@tyk{(#2)+\flo@twh*(0.25+0.12*\the\flo@tcn)}%
      \flo@vfill{flo@c}{0.14}{1}{\pgfpathrectanglecorners{\flo@P\flo@twa\flo@tyk}{\flo@P\flo@twc\flo@twd}}}%
  \fi
  \ifnum\flo@tdetail>0
    \pgfmathtruncatemacro\flo@twn{max(2,floor((((#3)-(#1))/\flo@tcell)*(((#4)-(#2))/\flo@tcell)/2))}%
    \ifnum\flo@twn>40 \def\flo@twn{40}\fi
    \flo@loop{twm}\flo@tcn{1}{\flo@twn}{%
      \flo@range\flo@tmx{#1}{#3}\flo@range\flo@tmy{#2}{#4}\flo@range\flo@t{0.5}{1.3}\flo@calc\flo@tmr{\flo@tcell*\flo@t}%
      \flo@range\flo@t{0.5}{1}\flo@calc\flo@tms{\flo@tmr*\flo@t}%
      \flo@vblob\flo@tmx\flo@tmy\flo@tmr\flo@tms{0.4}{7}%
      \flo@chance{0.6}%
      \ifflo@yes\flo@sym\flo@t{0.06}\flo@calc\flo@tt{\flo@ttone+\flo@t}\flo@vtone{flo@c}{\flo@tt}\flo@range\flo@op{0.08}{0.16}%
        \flo@vfill{flo@c}{\flo@op}{1}{\flo@smoothpath}%
      \else\flo@sym\flo@t{0.06}\flo@calc\flo@tt{\flo@ttone+0.4+\flo@t}\flo@vtone{flo@c}{\flo@tt}\flo@range\flo@op{0.1}{0.2}%
        \flo@vfill{flo@c}{\flo@op}{0}{\flo@smoothpath}\fi}%
  \fi}
% an opening: the path #1 builds, washed and outlined in the pen's line; #2..#5 its box
\def\flo@topening#1#2#3#4#5{%
  \ifdefined\flo@tracerydebug\typeout{OPEN \pgfmath@rnd@z\space box #2 #3 #4 #5}\fi
  \begin{pgfscope}#1\pgfpathclose\pgfusepath{clip}\flo@twash{#2}{#3}{#4}{#5}\end{pgfscope}%
  \flo@vtone{flo@c}{0.08}\flo@vstroke{flo@c}{\flo@tpen}{0.9}{0}{#1\pgfpathclose}}
% a bar through stone, drawn by its two edges: the path #1 builds stroked wide in the
% pen's ink, then as wide as the bar (half-width #2) in paper, so bars that cross join
\def\flo@tbars#1#2{%
  \flo@vtone{flo@c}{0.08}\flo@calc\flo@t{2*(#2)*\flo@tbp+2*\flo@tpen}\flo@vstroke{flo@c}{\flo@t}{0.9}{0}{#1}%
  \flo@calc\flo@t{2*(#2)*\flo@tbp}\flo@vstroke{flo@paper}{\flo@t}{1}{0}{#1}}
% ---------------------------------------------------------------- lights
% a head arch over [#2, #3] springing at #4 into chain #1, flattened step by step
% (equilateral, drop, round, segmental) until it fits under the arch above it: chain
% \flo@lt@lim (mirrored about \flo@lt@limxm) less two bars, or no limit when empty.
% \ifflo@flat afterward: a segmental head (no cusps on it)
\def\flo@flatter#1{\ifcase#1 \flo@haset{equilateral}{1}{0}{0}{0}\or\flo@haset{drop}{0.75}{0}{0}{0}%
  \or\flo@haset{round}{0.5}{0}{0}{0}\else\flo@haset{segmental}{0.55}{0}{0}{0}\fi}
\newif\ifflo@flat
\def\flo@subarch#1#2#3#4{%
  \edef\flo@sadst{#1}\edef\flo@saxa{#2}\edef\flo@saxb{#3}\edef\flo@says{#4}\flo@calc\flo@saxm{((#2)+(#3))/2}%
  \flo@hafromtraits\flo@sawant
  \def\flo@t{none}\ifx\flo@ha@kind\flo@t\flo@flatter0\fi
  \def\flo@t{fourcentered}\ifx\flo@ha@kind\flo@t\flo@flatter0\fi
  \def\flo@t{segmental}\ifx\flo@ha@kind\flo@t\flo@flatter0\fi
  \flo@harch\flo@sadst\flo@saxa\flo@saxb\flo@says
  \flo@safits
  \ifflo@yes\else
    \flo@flatter0\flo@harch\flo@sadst\flo@saxa\flo@saxb\flo@says\flo@safits
    \ifflo@yes\else\flo@flatter1\flo@harch\flo@sadst\flo@saxa\flo@saxb\flo@says\flo@safits
    \ifflo@yes\else\flo@flatter2\flo@harch\flo@sadst\flo@saxa\flo@saxb\flo@says\flo@safits
    \ifflo@yes\else\flo@flatter3\flo@harch\flo@sadst\flo@saxa\flo@saxb\flo@says\fi\fi\fi
  \fi
  \def\flo@t{segmental}\ifx\flo@ha@kind\flo@t\flo@flattrue\else\flo@flatfalse\fi}
\let\flo@sawant\relax                      % a head's own arch, set by the caller (\flo@haset) or nothing
% does the chain fit under the limit? \ifflo@yes
\def\flo@safits{\flo@yestrue
  \ifx\flo@lt@lim\pgfutil@empty\else
    \flo@loop{tsaf}\flo@tcj{0}{8}{\ifflo@yes
      \flo@chainpoint{\flo@sadst}{\the\flo@tcj/8}\let\flo@tfx\flo@cpx\let\flo@tfy\flo@cpy
      \flo@chainy{\flo@lt@lim}{\flo@lt@limxm}{\flo@tfx}%
      \ifflo@yes\pgfmathparse{\flo@tfy>\flo@cyv-2*\flo@tbw}\ifdim\pgfmathresult pt>0pt \flo@yesfalse\else\flo@yestrue\fi\else\flo@yestrue\fi
      \ifflo@yes
        \flo@calc\flo@t{2*\flo@saxm-\flo@tfx}\flo@chainy{\flo@lt@lim}{\flo@lt@limxm}{\flo@t}%
        \ifflo@yes\pgfmathparse{\flo@tfy>\flo@cyv-2*\flo@tbw}\ifdim\pgfmathresult pt>0pt \flo@yesfalse\else\flo@yestrue\fi\else\flo@yestrue\fi
      \fi\fi}%
  \fi}
% one light: its jambs, its own small arch head (cusped), above a sill; reads \flo@lt@xa
% x1 y0 ys cusps depth lim limxm bl br off head rows, leaves its head chain in #1
\def\flo@tlight#1{%
  \edef\flo@ltdst{#1}\flo@calc\flo@ltxm{(\flo@lt@xa+\flo@lt@xb)/2}%
  \ifx\flo@lt@head\pgfutil@empty\flo@subarch{tlh}{\flo@lt@xa}{\flo@lt@xb}{\flo@lt@ys}\else\flo@ccopy{\flo@lt@head}{tlh}\flo@flatfalse\fi
  \flo@calc\flo@t{\flo@lt@xa+\flo@lt@bl}\flo@coffset{tlh}{#1}{\flo@lt@off}{\flo@t}{\flo@ltxm}{\flo@lt@ys}%
  \edef\flo@ltcusps{\flo@lt@cusps}\ifflo@flat\def\flo@ltcusps{0}\fi
  \edef\flo@ltdepth{\flo@lt@depth}%
  \flo@apex{#1}\let\flo@ltay\flo@apy
  \flo@cget{#1}{1}\flo@tat\flo@pa\let\flo@ltlx\flo@atx\let\flo@ltly\flo@aty
  \flo@calc\flo@ltxa{\flo@lt@xa+\flo@lt@bl}\flo@calc\flo@ltxb{\flo@lt@xb-\flo@lt@br}\edef\flo@ltya{\flo@lt@ya}%
  % transoms: the rows below the top one are plain openings, the head's row stands on the last
  \ifnum\flo@lt@rows>1
    \flo@loop{tltr}\flo@tcj{0}{\flo@lt@rows-2}{%
      \flo@calc\flo@tya{\flo@lt@ya+(\flo@lt@ys-\flo@lt@ya)*\the\flo@tcj/\flo@lt@rows+\ifnum\flo@tcj>0 \flo@tbw\else0\fi}%
      \flo@calc\flo@tyb{\flo@lt@ya+(\flo@lt@ys-\flo@lt@ya)*(\the\flo@tcj+1)/\flo@lt@rows-\flo@tbw}%
      \flo@topening{\pgfpathrectanglecorners{\flo@P\flo@ltxa\flo@tya}{\flo@P\flo@ltxb\flo@tyb}}\flo@ltxa\flo@tya\flo@ltxb\flo@tyb}%
    \flo@calc\flo@ltya{\flo@lt@ya+(\flo@lt@ys-\flo@lt@ya)*(\flo@lt@rows-1)/\flo@lt@rows+\flo@tbw}%
  \fi
  \flo@topening{\flo@ltbuild}\flo@ltxa\flo@ltya\flo@ltxb\flo@ltay}
\def\flo@ltbuild{\pgfpathmoveto{\flo@P\flo@ltxa\flo@ltya}\pgfpathlineto{\flo@P\flo@ltlx\flo@ltly}%
  \ifnum\flo@ltcusps>0 \flo@cuspedhead{\flo@ltdst}{\flo@ltxm}{\flo@ltcusps}{\flo@ltdepth}{0}%
  \else\flo@headpath{\flo@ltdst}{\flo@ltxm}{0}\fi
  \pgfpathlineto{\flo@P\flo@ltxb\flo@ltya}}
% ---------------------------------------------------------------- the group of lights
% the group [#1, #2] of #3 lights over the sill #4 springing at #5 under the region whose
% chain is #6 (springing #7, axis #8), at level \flo@lvl (0 under the main arch): the
% lights, the sub-arches as bars, the figures found in what is left. State a level needs
% after the groups under it ran is kept per level (\flo@gset, \flo@gget)
\def\flo@gset#1#2{\expandafter\edef\csname flo@g\flo@lvl @#1\endcsname{#2}}
\def\flo@gget#1{\csname flo@g\flo@lvl @#1\endcsname}
\def\flo@lvl{0}
\def\flo@tgroup#1#2#3#4#5#6#7#8{%
  \flo@gset{x0}{#1}\flo@gset{x1}{#2}\flo@gset{n}{#3}\flo@gset{y0}{#4}\flo@gset{ys}{#5}%
  \flo@gset{rch}{#6}\flo@gset{rys}{#7}\flo@gset{rxm}{#8}%
  \flo@calc\flo@t{((#2)-(#1))/(#3)}\flo@gset{lw}{\flo@t}%
  \flo@calc\flo@t{((#1)+(#2))/2}\flo@gset{xm}{\flo@t}%
  \ifnum\flo@tladder>0 \flo@gset{cusps}{0}\else\flo@gset{cusps}{\flo@tget{cusps}}\fi
  \flo@yesfalse
  \ifnum#3=1 \flo@yestrue\fi
  \ifnum\flo@lvl<\flo@tget{depth}\relax\else\flo@yestrue\fi
  \edef\flo@t{\flo@tget{branch}}\def\flo@tmp{subarch}\ifx\flo@t\flo@tmp\else\flo@yestrue\fi
  \ifflo@yes\expandafter\flo@tgrouplights\else\expandafter\flo@tgroupsubs\fi}
% the lights, each with its own head; the outer ones against the main arch's bar; one
% light alone under an arch has that arch for its head; a screen's heads spring below the
% main arch's springing and rise into its head; flowing tracery springs from ogee heads
\def\flo@tgrouplights{%
  \flo@gset{screen}{0}\flo@gset{flowing}{0}%
  \ifnum\flo@lvl=0 \ifnum\flo@gget{n}>1
    \edef\flo@t{\flo@tget{branch}}\def\flo@tmp{screen}\ifx\flo@t\flo@tmp\flo@gset{screen}{1}\fi
    \def\flo@tmp{flowing}\ifx\flo@t\flo@tmp\flo@gset{flowing}{1}\fi\fi\fi
  \ifnum\flo@gget{screen}=1 \flo@calc\flo@t{\flo@gget{ys}-0.7*\flo@gget{lw}}\flo@gset{ysl}{\flo@t}\else\flo@gset{ysl}{\flo@gget{ys}}\fi
  \edef\flo@t{\the\numexpr\flo@tget{transoms}+1\relax}\flo@gset{rows}{\flo@t}%
  \flo@loop{tgl}\flo@tci{0}{\flo@gget{n}-1}{%
    \flo@calc\flo@lt@xa{\flo@gget{x0}+\the\flo@tci*\flo@gget{lw}}\flo@calc\flo@lt@xb{\flo@gget{x0}+(\the\flo@tci+1)*\flo@gget{lw}}%
    \edef\flo@lt@ya{\flo@gget{y0}}\edef\flo@lt@ys{\flo@gget{ysl}}\edef\flo@lt@cusps{\flo@gget{cusps}}%
    \flo@calc\flo@lt@depth{\flo@tget{cuspdepth}*\flo@gget{lw}}%
    \ifnum\flo@lvl=0 \ifnum\flo@tci=0 \edef\flo@lt@bl{\flo@tBw}\else\edef\flo@lt@bl{\flo@tbw}\fi\else\edef\flo@lt@bl{\flo@tbw}\fi
    \ifnum\flo@lvl=0 \ifnum\flo@tci=\numexpr\flo@gget{n}-1\relax\edef\flo@lt@br{\flo@tBw}\else\edef\flo@lt@br{\flo@tbw}\fi\else\edef\flo@lt@br{\flo@tbw}\fi
    \ifnum\flo@lvl=0 \ifnum\flo@gget{n}=1 \edef\flo@lt@off{\flo@tBw}\else\edef\flo@lt@off{\flo@tbw}\fi\else\edef\flo@lt@off{\flo@tbw}\fi
    \ifnum\flo@gget{n}=1 \edef\flo@lt@head{\flo@gget{rch}}\let\flo@lt@lim\pgfutil@empty
    \else\let\flo@lt@head\pgfutil@empty\edef\flo@lt@lim{\flo@gget{rch}}\edef\flo@lt@limxm{\flo@gget{rxm}}\fi
    \edef\flo@lt@rows{\flo@gget{rows}}%
    \ifnum\flo@gget{flowing}=1 \def\flo@sawant{\flo@calc\flo@t{max(\flo@tget{excess},0.85)}\flo@haset{ogee}{\flo@t}{0.5}{0}{0}}\else\let\flo@sawant\relax\fi
    \flo@tlight{g\flo@lvl h\the\flo@tci}%
    \let\flo@sawant\relax}%
  % the figures between the heads (a screen) or above them (flowing)
  \flo@tgroupfigures}
% sub-groups: the lights in two halves, a center light with the rest each side, or one
% by one, each under a sub-arch set down a little, a bar through the stone, its jambs
% down to the sill, under the lights
\def\flo@tgroupsubs{%
  \edef\flo@t{\flo@tget{split}}\def\flo@tmp{binary}%
  \ifx\flo@t\flo@tmp
    \ifodd\flo@gget{n}
      \edef\flo@tk@{\the\numexpr(\flo@gget{n}-1)/2\relax}\flo@gset{np}{3}%
      \flo@gset{p1a}{\flo@gget{x0}}\flo@calc\flo@t{\flo@gget{x0}+\flo@tk@*\flo@gget{lw}}\flo@gset{p1b}{\flo@t}\flo@gset{p1n}{\flo@tk@}%
      \flo@gset{p2a}{\flo@t}\flo@calc\flo@t{\flo@gget{x0}+(\flo@tk@+1)*\flo@gget{lw}}\flo@gset{p2b}{\flo@t}\flo@gset{p2n}{1}%
      \flo@gset{p3a}{\flo@t}\flo@gset{p3b}{\flo@gget{x1}}\flo@gset{p3n}{\flo@tk@}%
    \else
      \flo@gset{np}{2}\flo@gset{p1a}{\flo@gget{x0}}\flo@gset{p1b}{\flo@gget{xm}}\edef\flo@t{\the\numexpr\flo@gget{n}/2\relax}\flo@gset{p1n}{\flo@t}%
      \flo@gset{p2a}{\flo@gget{xm}}\flo@gset{p2b}{\flo@gget{x1}}\flo@gset{p2n}{\flo@t}%
    \fi
  \else\def\flo@tmp{center}\ifx\flo@t\flo@tmp
    \edef\flo@tk@{\the\numexpr(\flo@gget{n}-1)/2\relax}%
    \ifnum\flo@tk@=0 \flo@gset{np}{1}\flo@gset{p1a}{\flo@gget{x0}}\flo@gset{p1b}{\flo@gget{x1}}\flo@gset{p1n}{1}%
    \else\flo@gset{np}{3}%
      \flo@gset{p1a}{\flo@gget{x0}}\flo@calc\flo@t{\flo@gget{x0}+\flo@tk@*\flo@gget{lw}}\flo@gset{p1b}{\flo@t}\flo@gset{p1n}{\flo@tk@}%
      \flo@gset{p2a}{\flo@t}\flo@calc\flo@t{\flo@gget{x0}+(\flo@tk@+1)*\flo@gget{lw}}\flo@gset{p2b}{\flo@t}\flo@gset{p2n}{1}%
      \flo@gset{p3a}{\flo@t}\flo@gset{p3b}{\flo@gget{x1}}\flo@gset{p3n}{\flo@tk@}\fi
  \else
    \flo@gset{np}{\flo@gget{n}}%
    \flo@loop{tgsp}\flo@tci{1}{\flo@gget{n}}{%
      \flo@calc\flo@t{\flo@gget{x0}+(\the\flo@tci-1)*\flo@gget{lw}}\flo@gset{p\the\flo@tci a}{\flo@t}%
      \flo@calc\flo@t{\flo@gget{x0}+\the\flo@tci*\flo@gget{lw}}\flo@gset{p\the\flo@tci b}{\flo@t}\flo@gset{p\the\flo@tci n}{1}}%
  \fi\fi
  \flo@calc\flo@t{\flo@gget{ys}-\flo@tget{setdown}*(\flo@gget{x1}-\flo@gget{x0})}\flo@gset{ys1}{\flo@t}%
  \flo@loop{tgs}\flo@tci{1}{\flo@gget{np}}{%
    \edef\flo@tpa{\flo@gget{p\the\flo@tci a}}\edef\flo@tpb{\flo@gget{p\the\flo@tci b}}\edef\flo@tpn{\flo@gget{p\the\flo@tci n}}%
    \flo@calc\flo@tpm{(\flo@tpa+\flo@tpb)/2}%
    \edef\flo@lt@lim{\flo@gget{rch}}\edef\flo@lt@limxm{\flo@gget{rxm}}%
    \flo@subarch{g\flo@lvl s\the\flo@tci}{\flo@tpa}{\flo@tpb}{\flo@gget{ys1}}%
    % the sub-arch as a bar through the stone, its jambs down to the sill, under the lights
    \edef\flo@tbxa{\flo@tpa}\edef\flo@tbxb{\flo@tpb}\edef\flo@tbxm{\flo@tpm}\flo@calc\flo@tby{\flo@gget{y0}+\flo@tbw}\edef\flo@tbch{g\flo@lvl s\the\flo@tci}%
    \flo@tbars{\flo@tsubbar}{\flo@tbw}%
    % the group under it, a level down; the loop's counter is kept in this level's state
    % (a group two levels down would clobber a plain macro), and the level comes back by one
    \flo@gset{savei}{\the\flo@tci}\edef\flo@tsub{\the\flo@tci}%
    \edef\flo@lvlup{\flo@lvl}\edef\flo@lvl{\the\numexpr\flo@lvl+1\relax}%
    \edef\flo@tmp{\noexpand\flo@tgroup{\flo@tpa}{\flo@tpb}{\flo@tpn}{\csname flo@g\flo@lvlup @y0\endcsname}{\csname flo@g\flo@lvlup @ys1\endcsname}{g\flo@lvlup s\flo@tsub}{\csname flo@g\flo@lvlup @ys1\endcsname}{\flo@tpm}}%
    \flo@tmp
    \edef\flo@lvl{\the\numexpr\flo@lvl-1\relax}\flo@tci=\flo@gget{savei}\relax}%
  % the figure in the head above this group's sub-arches, and the spandrels each side
  \flo@tgroupheadfigure}
\def\flo@tsubbar{\pgfpathmoveto{\flo@P\flo@tbxa\flo@tby}\flo@cget{\flo@tbch}{1}\flo@tat\flo@pa
  \pgfpathlineto{\flo@P\flo@atx\flo@aty}\flo@headpath{\flo@tbch}{\flo@tbxm}{0}\pgfpathlineto{\flo@P\flo@tbxb\flo@tby}}
% ---------------------------------------------------------------- the window
% the band of stone between two offsets #1 and #2 of the main arch (#1 outside #2, both
% negative outward), round the head and down both jambs to the sill, as one closed path
\def\flo@tband#1#2{\edef\flo@tboa{#1}\edef\flo@tbob{#2}%
  \flo@calc\flo@tbt{\flo@twxl+\flo@tboa}\flo@coffset{main}{tbA}{\flo@tboa}{\flo@tbt}{\flo@twxm}{\flo@twys}%
  \flo@calc\flo@tbt{\flo@twxl+\flo@tbob}\flo@coffset{main}{tbC}{\flo@tbob}{\flo@tbt}{\flo@twxm}{\flo@twys}%
  \flo@cget{tbA}{1}\flo@tat\flo@pa\let\flo@tbax\flo@atx\let\flo@tbay\flo@aty
  \flo@cget{tbC}{1}\flo@tat\flo@pa\let\flo@tbcx\flo@atx\let\flo@tbcy\flo@aty
  \pgfpathmoveto{\flo@P\flo@tbax\flo@twya}\pgfpathlineto{\flo@P\flo@tbax\flo@tbay}%
  \flo@headpath{tbA}{\flo@twxm}{0}%
  \flo@calc\flo@t{2*\flo@twxm-\flo@tbax}\pgfpathlineto{\flo@P\flo@t\flo@twya}%
  \flo@calc\flo@t{2*\flo@twxm-\flo@tbcx}\pgfpathlineto{\flo@P\flo@t\flo@twya}\pgfpathlineto{\flo@P\flo@t\flo@tbcy}%
  % the inner edge back: the mirrored chain reversed, then the chain reversed
  \flo@loop{tbd1}\flo@tcl{1}{\flo@cnum{tbC}}{\flo@cget{tbC}{\the\flo@tcl}%
    \flo@calc\flo@t{2*\flo@twxm-\flo@px}\flo@calc\flo@ta{180-\flo@pa}\flo@calc\flo@tb{180-\flo@pb}%
    \flo@arcto\flo@t\flo@py\flo@pr\flo@ta\flo@tb{0}}%
  \flo@loop{tbd2}\flo@tcl{1}{\flo@cnum{tbC}}{\flo@cget{tbC}{\the\numexpr\flo@cnum{tbC}+1-\flo@tcl\relax}%
    \flo@arcto\flo@px\flo@py\flo@pr\flo@pb\flo@pa{0}}%
  \pgfpathlineto{\flo@P\flo@tbcx\flo@twya}\pgfpathclose}
% the moldings painted as stone: a roll from the outermost line (#1) in to #2, washed pale
% and shaded darker toward both edges, so that it stands off the page as a shaft
\def\flo@troll#1#2{\edef\flo@troa{#1}\edef\flo@trob{#2}%
  \flo@calc\flo@tt{\flo@ttone+0.62}\flo@vtone{flo@c}{\flo@tt}\flo@vfill{flo@c}{0.7}{0}{\flo@tband{\flo@troa}{\flo@trob}}%
  \flo@calc\flo@trd{(\flo@trob-\flo@troa)*0.3}%
  \flo@calc\flo@tt{\flo@ttone+0.3}\flo@vtone{flo@c}{\flo@tt}%
  \flo@calc\flo@troc{\flo@troa+\flo@trd}\flo@vfill{flo@c}{0.22}{1}{\flo@tband{\flo@troa}{\flo@troc}}%
  \flo@calc\flo@troc{\flo@trob-\flo@trd}\flo@vfill{flo@c}{0.14}{1}{\flo@tband{\flo@troc}{\flo@trob}}}
% the main window over [#1, #2] with the sill at #3 and the springing at #4: lights and
% head under the main arch, orders and hood outside
\def\flo@twindow#1#2#3#4{%
  \edef\flo@twxl{#1}\edef\flo@twxr{#2}\edef\flo@twya{#3}\edef\flo@twys{#4}%
  \flo@calc\flo@tws{\flo@twxr-\flo@twxl}\flo@calc\flo@twxm{(\flo@twxl+\flo@twxr)/2}%
  \flo@hafromtraits
  \edef\flo@t{\flo@tget{kind}}\def\flo@tmp{headpiece}\ifx\flo@t\flo@tmp\edef\flo@t{\flo@tget{arch}}\def\flo@tmp{ogee}\ifx\flo@t\flo@tmp\def\flo@ha@kind{depressed}\fi\fi
  \flo@harch{main}\flo@twxl\flo@twxr\flo@twys
  \flo@calc\flo@t{\flo@twxl+\flo@tBw}\flo@coffset{main}{inner}{\flo@tBw}{\flo@t}{\flo@twxm}{\flo@twys}%
  \flo@apex{inner}\let\flo@tway\flo@apy
  \def\flo@placedn{0}%
  \pgfmathtruncatemacro\flo@twn{max(1,\flo@tget{lights})}\flo@calc\flo@twlw{\flo@tws/\flo@twn}%
  \edef\flo@t{\flo@tget{branch}}\def\flo@tmp{Y}\def\flo@tmpb{intersecting}\def\flo@tmpc{reticulated}\def\flo@tmpd{panel}%
  \ifx\flo@t\flo@tmp\flo@twnet\else\ifx\flo@t\flo@tmpb\flo@twnet\else\ifx\flo@t\flo@tmpc\flo@twnet\else\ifx\flo@t\flo@tmpd\flo@twpanels\else
    \def\flo@lvl{0}\flo@tgroup{\flo@twxl}{\flo@twxr}{\flo@twn}{\flo@twya}{\flo@twys}{inner}{\flo@twys}{\flo@twxm}%
  \fi\fi\fi\fi
  % orders: rings outside the main arch, and the hood mold over them
  \ifnum\flo@tladder>1 \def\flo@tworders{1}\else\edef\flo@tworders{\flo@tget{orders}}\fi
  \flo@calc\flo@twstep{0.8*\flo@tBw}%
  \edef\flo@t{\flo@tget{hood}}\def\flo@tmp{none}\ifx\flo@t\flo@tmp\def\flo@twhood{0}\else\ifnum\flo@tladder<2 \def\flo@twhood{1}\else\def\flo@twhood{0}\fi\fi
  \flo@calc\flo@twxo{\flo@twxl-(\flo@tBw+\flo@tworders*\flo@twstep+\ifnum\flo@twhood=1 0.6*\flo@tBw\else0\fi)}%
  % the bundle of moldings as one shaded roll, from the outermost line to half the frame's
  % width inside the main arch
  \flo@calc\flo@t{-(\flo@tBw+\flo@tworders*\flo@twstep+\ifnum\flo@twhood=1 0.6*\flo@tBw\else0\fi)}\flo@calc\flo@tmp{0.5*\flo@tBw}%
  \flo@troll{\flo@t}{\flo@tmp}%
  \flo@loop{twor}\flo@tck{1}{\flo@tworders}{%
    \flo@calc\flo@two{-(\flo@tBw+\the\flo@tck*\flo@twstep)}\flo@calc\flo@t{\flo@twxl+\flo@two}%
    \flo@coffset{main}{tord}{\flo@two}{\flo@t}{\flo@twxm}{\flo@twys}%
    \flo@cget{tord}{1}\flo@tat\flo@pa\let\flo@twox\flo@atx\let\flo@twoy\flo@aty
    \ifnum\flo@tck=\flo@tworders\relax\def\flo@twk{1.3}\else\def\flo@twk{0.8}\fi
    \flo@vtone{flo@c}{0.12}\flo@calc\flo@t{\flo@tpen*\flo@twk}%
    \flo@vstroke{flo@c}{\flo@t}{0.85}{0}{\pgfpathmoveto{\flo@P\flo@twox\flo@twoy}\flo@headpath{tord}{\flo@twxm}{0}}%
    % the jambs down to the sill
    \flo@calc\flo@tmp{2*\flo@twxm-\flo@twox}%
    \flo@vstroke{flo@c}{\flo@t}{0.85}{0}{\pgfpathmoveto{\flo@P\flo@twox\flo@twoy}\pgfpathlineto{\flo@P\flo@twox\flo@twya}%
      \pgfpathmoveto{\flo@P\flo@tmp\flo@twoy}\pgfpathlineto{\flo@P\flo@tmp\flo@twya}}}%
  \ifnum\flo@twhood=1
    \flo@calc\flo@two{-(\flo@tBw+\flo@tworders*\flo@twstep+0.6*\flo@tBw)}\flo@calc\flo@t{\flo@twxl+\flo@two}%
    \flo@coffset{main}{thood}{\flo@two}{\flo@t}{\flo@twxm}{\flo@twys}%
    \flo@cget{thood}{1}\flo@tat\flo@pa\let\flo@twhx\flo@atx\let\flo@twhy\flo@aty
    \flo@vtone{flo@c}{0.1}\flo@calc\flo@t{\flo@tpen*1.6}%
    \flo@vstroke{flo@c}{\flo@t}{0.9}{0}{\pgfpathmoveto{\flo@P\flo@twhx\flo@twhy}\flo@headpath{thood}{\flo@twxm}{0}}%
    \edef\flo@t{\flo@tget{hood}}\def\flo@tmp{stops}\ifx\flo@t\flo@tmp
      \flo@calc\flo@twq{0.9*\flo@tBw}%
      \flo@calc\flo@twsa{\flo@twhx-\flo@twq}\flo@calc\flo@twsb{\flo@twhx+\flo@twq}\flo@calc\flo@twsc{\flo@twhy-\flo@twq}\flo@calc\flo@twsd{\flo@twhy+\flo@twq}%
      \flo@calc\flo@twse{2*\flo@twxm-\flo@twhx-\flo@twq}\flo@calc\flo@twsf{2*\flo@twxm-\flo@twhx+\flo@twq}%
      \edef\flo@t{\flo@tget{accent}}\ifx\flo@t\flo@tmp\flo@vaccent{flo@c}{-0.1}\def\flo@twsop{0.9}\else\flo@vtone{flo@c}{0.3}\def\flo@twsop{0.8}\fi
      \flo@vfill{flo@c}{\flo@twsop}{0}{\pgfpathrectanglecorners{\flo@P\flo@twsa\flo@twsc}{\flo@P\flo@twsb\flo@twsd}}%
      \flo@vtone{flo@c}{0.08}\flo@vstroke{flo@c}{\flo@tpen}{0.9}{0}{\pgfpathrectanglecorners{\flo@P\flo@twsa\flo@twsc}{\flo@P\flo@twsb\flo@twsd}}%
      \edef\flo@t{\flo@tget{accent}}\ifx\flo@t\flo@tmp\flo@vaccent{flo@c}{-0.1}\else\flo@vtone{flo@c}{0.3}\fi
      \flo@vfill{flo@c}{\flo@twsop}{0}{\pgfpathrectanglecorners{\flo@P\flo@twse\flo@twsc}{\flo@P\flo@twsf\flo@twsd}}%
      \flo@vtone{flo@c}{0.08}\flo@vstroke{flo@c}{\flo@tpen}{0.9}{0}{\pgfpathrectanglecorners{\flo@P\flo@twse\flo@twsc}{\flo@P\flo@twsf\flo@twsd}}%
    \fi
  \fi
  % the sill, over the bars' feet, as wide as the moldings
  \flo@vtone{flo@c}{0.1}\flo@calc\flo@t{\flo@tpen*2}\flo@calc\flo@tmp{2*\flo@twxm-\flo@twxo}%
  \flo@vstroke{flo@c}{\flo@t}{0.9}{0}{\pgfpathmoveto{\flo@P\flo@twxo\flo@twya}\pgfpathlineto{\flo@P\flo@tmp\flo@twya}}%
  % the copper boss at the main figure's center
  \edef\flo@t{\flo@tget{accent}}\def\flo@tmp{center}\ifx\flo@t\flo@tmp\ifnum\flo@placedn>0
    \flo@calc\flo@t{max(0.06*\flo@placedr{1},1.2*\flo@tbw)}\flo@vaccent{flo@c}{-0.05}%
    \flo@vfill{flo@c}{0.95}{0}{\pgfpathcircle{\flo@P{\flo@placedx{1}}{\flo@placedy{1}}}{\flo@t pt}}\fi\fi}
\def\flo@placedx#1{\csname flo@tpl@#1@x\endcsname}\def\flo@placedy#1{\csname flo@tpl@#1@y\endcsname}\def\flo@placedr#1{\csname flo@tpl@#1@r\endcsname}
% ---------------------------------------------------------------- the pic
% \pic {florilegium tracery={seed=7, role=window, size=4cm}}: sample the window, reseed for
% the drawing, and draw it a hundred units wide, scaled to its size (florilegium-tracery.lua:
% M.draw). The level of detail follows the width of one light on the page (\flo@tladder:
% under 8 mm no cusps, under 5 plain figures and one order, under 3 the arch and its figure alone)
\def\flo@tracerypic#1{%
  \pgfkeys{/florilegium,#1}\flo@colors\flo@intof\flo@o@seed\flo@o@seed
  \edef\flo@tmp{\noexpand\florilegiumtracery[{\flo@o@traits}]{\flo@o@seed}{\flo@o@role}}\flo@tmp
  \edef\flo@o@seed{\flo@tget{seed}}%
  \ifx\flo@o@draw\pgfutil@empty
    \edef\flo@o@draw{\the\numexpr\ifnum\flo@o@seed=2147483646 1\else\flo@o@seed+1\fi\relax}\fi
  \flo@drawseed\flo@o@draw
  \pgfmathsetlength\pgf@x{\flo@o@size}\edef\flo@sizept{\pgf@sys@tonumber\pgf@x}%
  \pgfsetroundcap\pgfsetroundjoin
  \flo@calc\flo@tu{\flo@sizept/100}\pgftransformscale{\flo@tu}%
  \flo@calc\flo@tunit{\flo@tu/28.45276}%            cm per local unit
  \flo@calc\flo@tbp{\flo@tu*72/72.27}%                bp per local unit
  \flo@calc\flo@tpen{max(0.3,min(0.6,1.6*\flo@tbp))}% the pen's line, in bp
  \flo@calc\flo@tcell{3.698859/\flo@tu}%              the wash's blotches, 1.3 mm
  \edef\flo@ttone{\flo@tget{tone}}%
  \edef\flo@t{\flo@tget{kind}}\def\flo@tmp{rose}\def\flo@tmpb{foil}\def\flo@tmpc{arcade}%
  \ifx\flo@t\flo@tmp\flo@trosepic\else\ifx\flo@t\flo@tmpb\flo@trosepic\else
    \pgfmathtruncatemacro\flo@twn{max(1,\flo@tget{lights})}%
    % the span: the width less the orders and the hood outside the main arch
    \edef\flo@tmpd{\flo@tget{hood}}\def\flo@tmpe{none}\ifx\flo@tmpd\flo@tmpe\def\flo@thk{0}\else\def\flo@thk{0.6}\fi
    \flo@calc\flo@tout{\flo@tget{border}*(1.9+0.8*\flo@tget{orders}+\flo@thk)*min(1,3/\flo@twn)}%
    \flo@calc\flo@tws{100/(1+2*\flo@tout)}\flo@calc\flo@twlw{\flo@tws/\flo@twn}%
    \flo@calc\flo@tmm{\flo@twlw*\flo@tunit*10}%
    \pgfmathtruncatemacro\flo@tladder{\flo@tmm<3?3:(\flo@tmm<5?2:(\flo@tmm<8?1:0))}%
    \ifnum\flo@tladder<2 \def\flo@tdetail{1}\else\def\flo@tdetail{0}\fi
    \flo@calc\flo@tmod{min(\flo@tws,3*\flo@twlw)}%
    \flo@calc\flo@tbw{\flo@tget{bar}*\flo@tmod}\flo@calc\flo@tBw{\flo@tget{border}*\flo@tmod}%
    \flo@calc\flo@txl{-\flo@tws/2}\flo@calc\flo@txr{\flo@tws/2}%
    \ifx\flo@t\flo@tmpc\flo@tarcade\else
      \flo@calc\flo@tys{\flo@tget{jamb}*\flo@tws}%
      \def\flo@tmp{headpiece}\ifx\flo@t\flo@tmp\flo@calc\flo@tys{max(\flo@tys,3*\flo@tBw)}\fi
      \flo@twindow{\flo@txl}{\flo@txr}{0}{\flo@tys}%
    \fi
  \fi\fi
  \ifdefined\flo@tracerydebug\flo@tracerydebug\fi}
% ---------------------------------------------------------------- arcades
% a pier as the same roll as the moldings, a rectangle (#1,#3)-(#2,#4) shaded toward both edges
\def\flo@tpier#1#2#3#4{%
  \flo@calc\flo@tpd{((#2)-(#1))*0.3}\flo@calc\flo@tpxa{(#1)+\flo@tpd}\flo@calc\flo@tpxb{(#2)-\flo@tpd}%
  \flo@calc\flo@tt{\flo@ttone+0.62}\flo@vtone{flo@c}{\flo@tt}\flo@vfill{flo@c}{0.7}{0}{\pgfpathrectanglecorners{\flo@P{#1}{#3}}{\flo@P{#2}{#4}}}%
  \flo@calc\flo@tt{\flo@ttone+0.3}\flo@vtone{flo@c}{\flo@tt}%
  \flo@vfill{flo@c}{0.22}{1}{\pgfpathrectanglecorners{\flo@P{#1}{#3}}{\flo@P\flo@tpxa{#4}}}%
  \flo@vfill{flo@c}{0.14}{1}{\pgfpathrectanglecorners{\flo@P\flo@tpxb{#3}}{\flo@P{#2}{#4}}}}
% an arcade: n bays side by side over [\flo@txl, \flo@txr], each a window of one light,
% under a straight molding
\def\flo@tarcade{%
  \flo@calc\flo@tabw{(\flo@txr-\flo@txl)/\flo@twn}\flo@calc\flo@tays{\flo@tget{jamb}*\flo@tabw}%
  \ifnum\flo@tladder>0 \def\flo@tacusps{0}\else\edef\flo@tacusps{\flo@tget{cusps}}\fi
  \def\flo@tatop{0}\flo@hafromtraits
  \flo@loop{tarc}\flo@tcj{0}{\flo@twn-1}{%
    \flo@calc\flo@lt@xa{\flo@txl+\the\flo@tcj*\flo@tabw}\flo@calc\flo@lt@xb{\flo@txl+(\the\flo@tcj+1)*\flo@tabw}%
    \edef\flo@lt@bl{\flo@tbw}\edef\flo@lt@br{\flo@tbw}\edef\flo@lt@off{\flo@tbw}\edef\flo@lt@cusps{\flo@tacusps}%
    \flo@calc\flo@lt@depth{\flo@tget{cuspdepth}*\flo@tabw}\def\flo@lt@ya{0}\edef\flo@lt@ys{\flo@tays}\def\flo@lt@rows{1}%
    \let\flo@lt@lim\pgfutil@empty\let\flo@lt@head\pgfutil@empty
    \edef\flo@tsave{\the\flo@tcj}%
    \flo@tlight{tabay}\flo@apex{tabay}\flo@calc\flo@tatop{max(\flo@tatop,\flo@apy)}%
    % the bay's arch as a bar: outer edge over the stone
    \flo@hafromtraits\flo@harch{tabo}\flo@lt@xa\flo@lt@xb\flo@tays
    \flo@calc\flo@taxm{(\flo@lt@xa+\flo@lt@xb)/2}\flo@calc\flo@t{-\flo@tbw}\flo@calc\flo@tmp{\flo@lt@xa-\flo@tbw}%
    \flo@coffset{tabo}{tabof}{\flo@t}{\flo@tmp}{\flo@taxm}{}%
    \flo@cget{tabof}{1}\flo@tat\flo@pa\let\flo@taox\flo@atx\let\flo@taoy\flo@aty
    \flo@vtone{flo@c}{0.12}\flo@vstroke{flo@c}{\flo@tpen}{0.85}{0}{\pgfpathmoveto{\flo@P\flo@taox\flo@taoy}\flo@headpath{tabof}{\flo@taxm}{0}}%
    \flo@tcj=\flo@tsave\relax}%
  % the molding along the top and the piers' feet; the outer piers as shaded stone
  \flo@calc\flo@tay@{\flo@tatop+2.5*\flo@tBw}\flo@calc\flo@tayb{\flo@tay@-1.2*\flo@tBw}%
  \flo@calc\flo@taxa{\flo@txl-\flo@tBw}\flo@calc\flo@taxb{\flo@txl+\flo@tbw}\flo@tpier\flo@taxa\flo@taxb{0}\flo@tayb
  \flo@calc\flo@taxc{\flo@txr-\flo@tbw}\flo@calc\flo@taxd{\flo@txr+\flo@tBw}\flo@tpier\flo@taxc\flo@taxd{0}\flo@tayb
  \flo@vtone{flo@c}{0.1}\flo@calc\flo@t{\flo@tpen*1.6}%
  \flo@vstroke{flo@c}{\flo@t}{0.9}{0}{\pgfpathmoveto{\flo@P\flo@taxa\flo@tay@}\pgfpathlineto{\flo@P\flo@taxd\flo@tay@}}%
  \flo@vtone{flo@c}{0.12}\flo@calc\flo@t{\flo@tpen*0.8}%
  \flo@vstroke{flo@c}{\flo@t}{0.85}{0}{\pgfpathmoveto{\flo@P\flo@taxa\flo@tayb}\pgfpathlineto{\flo@P\flo@taxd\flo@tayb}}%
  \flo@vtone{flo@c}{0.1}\flo@calc\flo@t{\flo@tpen*1.3}%
  \flo@vstroke{flo@c}{\flo@t}{0.9}{0}{\pgfpathmoveto{\flo@P\flo@taxa{0}}\pgfpathlineto{\flo@P\flo@taxd{0}}}%
  % spandrel trefoils between the bays
  \edef\flo@t{\flo@tget{spandrel}}\def\flo@tmp{trefoil}\ifx\flo@t\flo@tmp\ifnum\flo@tladder<2
    \flo@calc\flo@tasy{\flo@tayb-\flo@tbw}%
    \flo@loop{tasp}\flo@tcj{1}{\flo@twn-1}{%
      \flo@calc\flo@tasx{\flo@txl+\the\flo@tcj*\flo@tabw}\edef\flo@tsave{\the\flo@tcj}%
      \flo@calc\flo@t{\flo@tasx-\flo@tabw}\flo@hafromtraits\flo@harch{tasl}\flo@t\flo@tasx\flo@tays
      \flo@calc\flo@tmp{\flo@tasx+\flo@tabw}\flo@harch{tasr}\flo@tasx\flo@tmp\flo@tays
      \flo@rgnew{tasr}\flo@calc\flo@tmp{\flo@tasx-\flo@tabw/2}\flo@rgarch{tasr}{tasl}{\flo@tays}{\flo@tmp}{1}%
      \flo@calc\flo@tmp{\flo@tasx+\flo@tabw/2}\flo@rgarch{tasr}{tasr}{\flo@tays}{\flo@tmp}{1}%
      \flo@rgplane{tasr}{0}{\flo@tasy}{0}{-1}%
      \flo@calc\flo@t{\flo@tasx-\flo@tabw/2}\flo@calc\flo@tmp{\flo@tasx+\flo@tabw/2}%
      \flo@biggest{tasr}{\flo@t}{\flo@tays}{\flo@tmp}{\flo@tay@}{\flo@tasx}%
      \pgfmathparse{\flo@bgr>3*\flo@tbw}\ifdim\pgfmathresult pt>0pt \flo@fgtrefoil\flo@tfigure{foiled}\flo@bgx\flo@bgy\flo@bgr{}\fi
      \flo@tcj=\flo@tsave\relax}%
  \fi\fi}
% ---------------------------------------------------------------- roses and foils
% an arc from (#1,#2) through (#3,#4) to (#5,#6) around the circle through them, computed
% about the first point so that pgfmath's squares stay in range; a line when they are in
% line; #7 moves first
\def\flo@arcthrough#1#2#3#4#5#6#7{%
  % in sixteenths about the first point, so that pgfmath's products stay in range
  \flo@calc\flo@tbx{((#3)-(#1))/16}\flo@calc\flo@tby{((#4)-(#2))/16}\flo@calc\flo@tcx{((#5)-(#1))/16}\flo@calc\flo@tcy{((#6)-(#2))/16}%
  \flo@calc\flo@td{2*(\flo@tbx*\flo@tcy-\flo@tcx*\flo@tby)}%
  \pgfmathparse{abs(\flo@td)<0.0000001}\ifdim\pgfmathresult pt>0pt
    \ifnum#7=1 \pgfpathmoveto{\flo@P{#1}{#2}}\fi\pgfpathlineto{\flo@P{#3}{#4}}\pgfpathlineto{\flo@P{#5}{#6}}%
  \else
    \flo@calc\flo@tbb{\flo@tbx*\flo@tbx+\flo@tby*\flo@tby}\flo@calc\flo@tcc{\flo@tcx*\flo@tcx+\flo@tcy*\flo@tcy}%
    \flo@calc\flo@tux{(\flo@tcy*\flo@tbb-\flo@tby*\flo@tcc)/\flo@td}\flo@calc\flo@tuy{(\flo@tbx*\flo@tcc-\flo@tcx*\flo@tbb)/\flo@td}%
    \flo@calc\flo@tr{16*veclen(\flo@tux,\flo@tuy)}%
    \flo@calc\flo@ta{atan2(-\flo@tuy,-\flo@tux)}\flo@calc\flo@tam{atan2(\flo@tby-\flo@tuy,\flo@tbx-\flo@tux)}\flo@calc\flo@tb{atan2(\flo@tcy-\flo@tuy,\flo@tcx-\flo@tux)}%
    \flo@calc\flo@tux{16*\flo@tux}\flo@calc\flo@tuy{16*\flo@tuy}%
    \flo@fwd\flo@ta\flo@tam\let\flo@tfa\flo@tfw\flo@fwd\flo@ta\flo@tb\let\flo@tfb\flo@tfw
    \flo@calc\flo@tux{\flo@tux+(#1)}\flo@calc\flo@tuy{\flo@tuy+(#2)}%
    \pgfmathparse{\flo@tfa<\flo@tfb}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tb{\flo@ta+\flo@tfb}%
    \else\flo@fwd\flo@tb\flo@ta\flo@calc\flo@tb{\flo@ta-\flo@tfw}\fi
    \flo@arcto\flo@tux\flo@tuy\flo@tr\flo@ta\flo@tb{#7}%
  \fi}
% a rose: spokes from a foiled eye to the rim, a second ring of sectors when the genome
% asks, every sector an opening; the rim and its orders; (\flo@trcx, \flo@trcy) its center,
% \flo@trR its radius, \flo@tbw the bars' half-width
\def\flo@trsector#1#2#3#4{% r0 r1 k head
  \flo@calc\flo@tsth{(#3)*\flo@tra+90}\flo@calc\flo@tsthb{((#3)+1)*\flo@tra+90}%
  \flo@calc\flo@tsga{\flo@tbw/(#1)*57.29578}\flo@calc\flo@tsgb{\flo@tbw/(#2)*57.29578}% the gap for the spoke's bar, as an angle at each radius
  \flo@calc\flo@tspax{\flo@trcx+(#1)*cos(\flo@tsth+\flo@tsga)}\flo@calc\flo@tspay{\flo@trcy+(#1)*sin(\flo@tsth+\flo@tsga)}%
  \flo@calc\flo@tspbx{\flo@trcx+(#1)*cos(\flo@tsthb-\flo@tsga)}\flo@calc\flo@tspby{\flo@trcy+(#1)*sin(\flo@tsthb-\flo@tsga)}%
  \flo@calc\flo@tsqax{\flo@trcx+(#2)*cos(\flo@tsth+\flo@tsgb)}\flo@calc\flo@tsqay{\flo@trcy+(#2)*sin(\flo@tsth+\flo@tsgb)}%
  \flo@calc\flo@tsqbx{\flo@trcx+(#2)*cos(\flo@tsthb-\flo@tsgb)}\flo@calc\flo@tsqby{\flo@trcy+(#2)*sin(\flo@tsthb-\flo@tsgb)}%
  \edef\flo@tsra{#1}\edef\flo@tsrb{#2}\edef\flo@tshead{#4}%
  \flo@calc\flo@tsmx{\flo@trcx+(#2)*cos((\flo@tsth+\flo@tsthb)/2)}\flo@calc\flo@tsmy{\flo@trcy+(#2)*sin((\flo@tsth+\flo@tsthb)/2)}%
  \flo@calc\flo@tsaa{\flo@tsth+\flo@tsgb}\flo@calc\flo@tsab{\flo@tsthb-\flo@tsgb}\flo@calc\flo@tsac{\flo@tsthb-\flo@tsga}\flo@calc\flo@tsad{\flo@tsth+\flo@tsga}%
  \flo@calc\flo@tsxa{\flo@trcx-(#2)}\flo@calc\flo@tsya{\flo@trcy-(#2)}\flo@calc\flo@tsxb{\flo@trcx+(#2)}\flo@calc\flo@tsyb{\flo@trcy+(#2)}%
  \flo@topening{\flo@trsectorpath}\flo@tsxa\flo@tsya\flo@tsxb\flo@tsyb}
\def\flo@trsectorpath{\pgfpathmoveto{\flo@P\flo@tspax\flo@tspay}\pgfpathlineto{\flo@P\flo@tsqax\flo@tsqay}%
  \ifnum\flo@tshead=1 \flo@arcthrough\flo@tsqax\flo@tsqay\flo@tsmx\flo@tsmy\flo@tsqbx\flo@tsqby{0}%
  \else\flo@arcto\flo@trcx\flo@trcy\flo@tsrb\flo@tsaa\flo@tsab{0}\fi
  \pgfpathlineto{\flo@P\flo@tspbx\flo@tspby}\flo@arcto\flo@trcx\flo@trcy\flo@tsra\flo@tsac\flo@tsad{0}}
\def\flo@trose{%
  \pgfmathtruncatemacro\flo@trn{\flo@tget{spokes}}\flo@calc\flo@tro{\flo@trR-1.5*\flo@tbw}\flo@calc\flo@tre{\flo@tget{oculus}*\flo@trR}%
  \ifnum\flo@tladder>1 \def\flo@trrings{1}\else\edef\flo@trrings{\flo@tget{rings}}\fi
  \ifnum\flo@trrings>1 \flo@calc\flo@trmid{\flo@tre+0.55*(\flo@tro-\flo@tre)}\fi
  \flo@calc\flo@tra{360/\flo@trn}%
  \flo@loop{tros}\flo@tcj{0}{\flo@trn-1}{\edef\flo@tsave{\the\flo@tcj}%
    \ifnum\flo@trrings>1
      \flo@calc\flo@t{\flo@tre+\flo@tbw}\flo@calc\flo@tmp{\flo@trmid-\flo@tbw}\flo@trsector\flo@t\flo@tmp{\flo@tsave}{0}%
      \flo@calc\flo@t{\flo@trmid+\flo@tbw}\flo@trsector\flo@t\flo@tro{\flo@tsave}{1}%
    \else
      \flo@calc\flo@t{\flo@tre+\flo@tbw}\flo@trsector\flo@t\flo@tro{\flo@tsave}{1}%
    \fi
    \flo@tcj=\flo@tsave\relax}%
  % the eye
  \pgfmathtruncatemacro\flo@trfoils{min(8,max(3,floor(\flo@trn/2)))}\ifnum\flo@tladder>1 \ifnum\flo@trfoils>4 \def\flo@trfoils{4}\fi\fi
  \flo@calc\flo@trei{\flo@tre-\flo@tbw}%
  \pgfmathparse{\flo@trei>2*\flo@tbw}\ifdim\pgfmathresult pt>0pt
    \flo@calc\flo@tsxa{\flo@trcx-\flo@trei}\flo@calc\flo@tsya{\flo@trcy-\flo@trei}\flo@calc\flo@tsxb{\flo@trcx+\flo@trei}\flo@calc\flo@tsyb{\flo@trcy+\flo@trei}%
    \flo@topening{\flo@foiledpath\flo@trcx\flo@trcy\flo@trei\flo@trfoils{0}{1}}\flo@tsxa\flo@tsya\flo@tsxb\flo@tsyb
  \else
    \flo@calc\flo@t{max(\flo@trei,\flo@tbw)}%
    \flo@calc\flo@tsxa{\flo@trcx-\flo@tre}\flo@calc\flo@tsya{\flo@trcy-\flo@tre}\flo@calc\flo@tsxb{\flo@trcx+\flo@tre}\flo@calc\flo@tsyb{\flo@trcy+\flo@tre}%
    \flo@topening{\pgfpathcircle{\flo@P\flo@trcx\flo@trcy}{\flo@t pt}}\flo@tsxa\flo@tsya\flo@tsxb\flo@tsyb
  \fi
  % the rim and its orders
  \ifnum\flo@tladder>1 \def\flo@tworders{1}\else\edef\flo@tworders{\flo@tget{orders}}\fi
  \flo@loop{trorb}\flo@tcj{0}{\flo@tworders}{%
    \flo@calc\flo@t{\flo@trR+\the\flo@tcj*1.2*\flo@tbw}\ifnum\flo@tcj=0 \flo@calc\flo@tmp{\flo@tpen*1.4}\else\flo@calc\flo@tmp{\flo@tpen*0.9}\fi
    \flo@vtone{flo@c}{0.1}\flo@vstroke{flo@c}{\flo@tmp}{0.9}{0}{\pgfpathcircle{\flo@P\flo@trcx\flo@trcy}{\flo@t pt}}}%
  \edef\flo@t{\flo@tget{accent}}\def\flo@tmp{center}\ifx\flo@t\flo@tmp
    \flo@calc\flo@t{max(0.25*\flo@trei,\flo@tbw)}\flo@vaccent{flo@c}{-0.05}\flo@vfill{flo@c}{0.95}{0}{\pgfpathcircle{\flo@P\flo@trcx\flo@trcy}{\flo@t pt}}\fi}
% a foil alone: a foiled circle with its rings
\def\flo@tfoil{%
  \flo@calc\flo@tro{\flo@trR-1.5*\flo@tbw}\pgfmathtruncatemacro\flo@trn{\flo@tget{foils}}%
  \ifnum\flo@tladder>1 \ifnum\flo@trn>4 \def\flo@trn{4}\fi\fi
  \edef\flo@t{\flo@tget{foilshape}}\def\flo@tmp{pointed}\ifx\flo@t\flo@tmp\def\flo@trpt{1}\else\def\flo@trpt{0}\fi
  \flo@calc\flo@tsxa{\flo@trcx-\flo@tro}\flo@calc\flo@tsya{\flo@trcy-\flo@tro}\flo@calc\flo@tsxb{\flo@trcx+\flo@tro}\flo@calc\flo@tsyb{\flo@trcy+\flo@tro}%
  \flo@topening{\flo@foiledpath\flo@trcx\flo@trcy\flo@tro\flo@trn\flo@trpt{1}}\flo@tsxa\flo@tsya\flo@tsxb\flo@tsyb
  \ifnum\flo@tladder>1 \def\flo@tworders{1}\else\edef\flo@tworders{\flo@tget{orders}}\fi
  \flo@loop{tforb}\flo@tcj{0}{\flo@tworders-1}{%
    \flo@calc\flo@t{\flo@trR+\the\flo@tcj*1.2*\flo@tbw}\ifnum\flo@tcj=0 \flo@calc\flo@tmp{\flo@tpen*1.4}\else\flo@calc\flo@tmp{\flo@tpen*0.9}\fi
    \flo@vtone{flo@c}{0.1}\flo@vstroke{flo@c}{\flo@tmp}{0.9}{0}{\pgfpathcircle{\flo@P\flo@trcx\flo@trcy}{\flo@t pt}}}%
  \edef\flo@t{\flo@tget{accent}}\def\flo@tmp{center}\ifx\flo@t\flo@tmp
    \flo@calc\flo@t{max(0.1*\flo@tro,\flo@tbw)}\flo@vaccent{flo@c}{-0.05}\flo@vfill{flo@c}{0.95}{0}{\pgfpathcircle{\flo@P\flo@trcx\flo@trcy}{\flo@t pt}}\fi}
% a rose or a foil, a hundred units wide, standing on the origin
\def\flo@trosepic{%
  \def\flo@trcx{0}\def\flo@trcy{50}\flo@calc\flo@tbw{max(\flo@tget{bar},0.015)*60}\flo@calc\flo@trR{50-\flo@tbw}%
  \flo@calc\flo@tmm{1000*\flo@tunit}%
  \pgfmathtruncatemacro\flo@tladder{\flo@tmm<6?3:(\flo@tmm<10?2:(\flo@tmm<16?1:0))}%
  \ifnum\flo@tladder<2 \def\flo@tdetail{1}\else\def\flo@tdetail{0}\fi
  \edef\flo@t{\flo@tget{kind}}\def\flo@tmp{rose}\ifx\flo@t\flo@tmp\flo@trose\else\flo@tfoil\fi}

% ---------------------------------------------------------------- regions
% A region is a list of constraints; a point's signed distance to the region is the least
% of its signed distances to each (positive inside). \flo@rg@<name>@<j> = {type}{a}{b}{c}{d}:
% a (an arch: chain, springing or empty, axis, outside 0/1), c (a circle: x y r outside),
% h (a half-plane: x y nx ny, inside along the normal)
\def\flo@rgnew#1{\expandafter\def\csname flo@rgn@#1\endcsname{0}}
\def\flo@rgn#1{\csname flo@rgn@#1\endcsname}
\def\flo@rgadd#1#2#3#4#5#6{%
  \expandafter\edef\csname flo@rgn@#1\endcsname{\the\numexpr\flo@rgn{#1}+1\relax}%
  \expandafter\edef\csname flo@rg@#1@\flo@rgn{#1}\endcsname{{#2}{#3}{#4}{#5}{#6}}}
\def\flo@rgarch#1#2#3#4#5{\flo@rgadd{#1}{a}{#2}{#3}{#4}{#5}}
\def\flo@rgcircle#1#2#3#4#5{\flo@rgadd{#1}{c}{#2}{#3}{#4}{#5}}
\def\flo@rgplane#1#2#3#4#5{\flo@rgadd{#1}{h}{#2}{#3}{#4}{#5}}
\def\flo@rgcopy#1#2{\flo@rgnew{#2}\flo@loop{trgc}\flo@tcn{1}{\flo@rgn{#1}}{%
    \expandafter\let\csname flo@rg@#2@\the\flo@tcn\expandafter\endcsname\csname flo@rg@#1@\the\flo@tcn\endcsname}%
  \expandafter\edef\csname flo@rgn@#2\endcsname{\flo@rgn{#1}}}
\def\flo@rgget#1#2{\expandafter\expandafter\expandafter\flo@rgget@\csname flo@rg@#1@#2\endcsname}
\def\flo@rgget@#1#2#3#4#5{\def\flo@rt{#1}\def\flo@ra{#2}\def\flo@rb{#3}\def\flo@rc{#4}\def\flo@rd{#5}}
\newif\ifflo@sdfound \newif\ifflo@tfgo
% the signed distance of (\flo@sdx, \flo@sdy) to the piece read last (within its sector)
% into \flo@sdbest, and to its ends into \flo@sdend
\def\flo@sdpiece{%
  \flo@calc\flo@tdx{\flo@sdx-\flo@px}\flo@calc\flo@tdy{\flo@sdy-\flo@py}%
  \flo@calc\flo@tang{atan2(\flo@tdy,\flo@tdx)}%
  \flo@calc\flo@tlo{min(\flo@pa,\flo@pb)}\flo@calc\flo@thi{max(\flo@pa,\flo@pb)}%
  \pgfmathparse{\flo@tang<\flo@tlo-0.0000001}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tang{\flo@tang+360}\fi
  \pgfmathparse{and(\flo@tang>=\flo@tlo-0.0000001,\flo@tang<=\flo@thi+0.0000001)}%
  \ifdim\pgfmathresult pt>0pt
    \flo@calc\flo@td{\flo@pr-veclen(\flo@tdx,\flo@tdy)}\ifnum\flo@pv=0 \flo@calc\flo@td{-\flo@td}\fi
    \flo@calc\flo@sdbest{min(\flo@sdbest,\flo@td)}\flo@sdfoundtrue
  \fi
  \flo@tat\flo@pa\flo@calc\flo@sdend{min(\flo@sdend,veclen(\flo@sdx-\flo@atx,\flo@sdy-\flo@aty))}%
  \flo@tat\flo@pb\flo@calc\flo@sdend{min(\flo@sdend,veclen(\flo@sdx-\flo@atx,\flo@sdy-\flo@aty))}}
% signed distance to the inside of an arch (\flo@ra chain, \flo@rb springing, \flo@rc axis,
% \flo@rd outside): within a piece's sector, to that piece; outside every sector, to the
% nearest corner, outside
\def\flo@sdarch{%
  \def\flo@sdbest{16000}\def\flo@sdend{16000}\flo@sdfoundfalse
  \flo@loop{tsda}\flo@tck{1}{\flo@cnum{\flo@ra}}{\flo@cget{\flo@ra}{\the\flo@tck}\flo@sdpiece
    \flo@calc\flo@px{2*\flo@rc-\flo@px}\flo@calc\flo@ta{180-\flo@pb}\flo@calc\flo@pb{180-\flo@pa}\let\flo@pa\flo@ta\flo@sdpiece}%
  \ifx\flo@rb\pgfutil@empty\else\flo@calc\flo@sdbest{min(\flo@sdbest,\flo@sdy-\flo@rb)}\fi
  \ifflo@sdfound\else\flo@calc\flo@sdbest{min(\flo@sdbest,-\flo@sdend)}\fi
  \ifnum\flo@rd=1 \flo@calc\flo@sdv{-\flo@sdbest}\else\let\flo@sdv\flo@sdbest\fi}
% the signed distance of (#2, #3) to region #1: \flo@sdv
\def\flo@sd#1#2#3{\edef\flo@sdx{#2}\edef\flo@sdy{#3}\def\flo@sdr{16000}%
  \flo@loop{tsd}\flo@tcn{1}{\flo@rgn{#1}}{\flo@rgget{#1}{\the\flo@tcn}%
    \def\flo@t{a}\ifx\flo@rt\flo@t\flo@sdarch
    \else\def\flo@t{c}\ifx\flo@rt\flo@t
      \flo@calc\flo@td{veclen(\flo@sdx-\flo@ra,\flo@sdy-\flo@rb)}%
      \ifnum\flo@rd=1 \flo@calc\flo@sdv{\flo@td-\flo@rc}\else\flo@calc\flo@sdv{\flo@rc-\flo@td}\fi
    \else\flo@calc\flo@sdv{\flo@rc*(\flo@sdx-\flo@ra)+\flo@rd*(\flo@sdy-\flo@rb)}\fi\fi
    \flo@calc\flo@sdr{min(\flo@sdr,\flo@sdv)}}%
  \let\flo@sdv\flo@sdr}
% the largest circle inside region #1, searched over the box (#2,#3)-(#4,#5): 25 by 25,
% then three times 9 by 9 at a quarter of the step; an x in #6 pins the center to it:
% \flo@bgx \flo@bgy \flo@bgr
\def\flo@bgtry#1#2{\flo@sd{\flo@bgreg}{#1}{#2}%
  \pgfmathparse{\flo@sdv>\flo@bgr+\flo@bgeps}\ifdim\pgfmathresult pt>0pt \edef\flo@bgx{#1}\edef\flo@bgy{#2}\let\flo@bgr\flo@sdv\fi}
\def\flo@biggest#1#2#3#4#5#6{\edef\flo@bgreg{#1}\def\flo@bgr{-16000}\edef\flo@bgaxis{#6}%
  \flo@calc\flo@bgeps{((#4)-(#2))*0.00001}% a later point wins only by more than rounding (the Lua side does the same)
  \flo@calc\flo@bgsx{((#4)-(#2))/24}\flo@calc\flo@bgsy{((#5)-(#3))/24}\edef\flo@bgxa{#2}\edef\flo@bgya{#3}%
  \ifx\flo@bgaxis\pgfutil@empty
    \flo@loop{tbgi}\flo@tcj{0}{24}{\flo@calc\flo@bgtx{\flo@bgxa+\flo@bgsx*\the\flo@tcj}%
      \flo@loop{tbgj}\flo@tcl{0}{24}{\flo@calc\flo@bgty{\flo@bgya+\flo@bgsy*\the\flo@tcl}\flo@bgtry\flo@bgtx\flo@bgty}}%
  \else
    \flo@loop{tbgja}\flo@tcl{0}{24}{\flo@calc\flo@bgty{\flo@bgya+\flo@bgsy*\the\flo@tcl}\flo@bgtry\flo@bgaxis\flo@bgty}%
  \fi
  \flo@loop{tbgr}\flo@tcm{1}{3}{%
    \let\flo@bgcx\flo@bgx\let\flo@bgcy\flo@bgy
    \flo@calc\flo@bgsx{\flo@bgsx/4}\flo@calc\flo@bgsy{\flo@bgsy/4}%
    \flo@loop{tbgri}\flo@tcj{-4}{4}{%
      \ifx\flo@bgaxis\pgfutil@empty\flo@calc\flo@bgtx{\flo@bgcx+\flo@bgsx*\the\flo@tcj}\flo@yestrue
      \else\ifnum\flo@tcj=0 \let\flo@bgtx\flo@bgaxis\flo@yestrue\else\flo@yesfalse\fi\fi
      \ifflo@yes\flo@loop{tbgrj}\flo@tcl{-4}{4}{\flo@calc\flo@bgty{\flo@bgcy+\flo@bgsy*\the\flo@tcl}\flo@bgtry\flo@bgtx\flo@bgty}\fi}}}
% ---------------------------------------------------------------- figures
% a foiled circle: #4 lobes inside the circle (#1,#2) of radius #3, tangent to it and to
% each other (foil radius r sin(a/2) / (1 + sin(a/2)), a = 360/n, after Havemann and
% Fellner); a lobe stands on the top of the axis. Pointed (#5 1): each lobe is two arcs
% from circles whose centers are moved out along the lines to the tangent feet; #6 moves first
\def\flo@foiledpath#1#2#3#4#5#6{%
  \flo@calc\flo@fpa{360/(#4)}\flo@calc\flo@fps{sin(\flo@fpa/2)}%
  \flo@calc\flo@fprf{(#3)*\flo@fps/(1+\flo@fps)}\flo@calc\flo@fpd{(#3)-\flo@fprf}%
  \ifnum#5=1 \def\flo@fpf{1.15}%
    % the points reach past the circle: scale the foils so they just touch it
    \flo@calc\flo@fpc{\flo@fpd*cos(\flo@fpa/2)}%
    \flo@calc\flo@tax{\flo@fpc*cos(-\flo@fpa/2)}\flo@calc\flo@tay{\flo@fpc*sin(-\flo@fpa/2)}%
    \flo@calc\flo@tcx{\flo@tax+\flo@fpf*(\flo@fpd-\flo@tax)}\flo@calc\flo@tcy{\flo@tay-\flo@fpf*\flo@tay}%
    \flo@calc\flo@thd{abs(\flo@tcy)}\flo@calc\flo@t{\flo@fpf*\flo@fprf}\flo@sqdiff\flo@t\flo@thd
    \flo@calc\flo@tk@{(#3)/(\flo@tcx+\flo@sqd)}\flo@calc\flo@fprf{\flo@fprf*\flo@tk@}\flo@calc\flo@fpd{\flo@fpd*\flo@tk@}%
  \else\def\flo@fpf{1}\fi
  \flo@calc\flo@fpc{\flo@fpd*cos(\flo@fpa/2)}%
  \flo@loop{tfp}\flo@tcl{0}{#4-1}{%
    \flo@calc\flo@fpth{90+\the\flo@tcl*\flo@fpa}%
    \flo@calc\flo@fplx{(#1)+\flo@fpd*cos(\flo@fpth)}\flo@calc\flo@fply{(#2)+\flo@fpd*sin(\flo@fpth)}%
    \ifnum#5=0
      \flo@calc\flo@ta{\flo@fpth-90-\flo@fpa/2}\flo@calc\flo@tb{\flo@fpth+90+\flo@fpa/2}%
      \flo@arcto\flo@fplx\flo@fply\flo@fprf\flo@ta\flo@tb{\ifnum#6=1 \ifnum\flo@tcl=0 1\else0\fi\else0\fi}%
    \else
      \flo@calc\flo@tax{(#1)+\flo@fpc*cos(\flo@fpth-\flo@fpa/2)}\flo@calc\flo@tay{(#2)+\flo@fpc*sin(\flo@fpth-\flo@fpa/2)}%
      \flo@calc\flo@tbx{(#1)+\flo@fpc*cos(\flo@fpth+\flo@fpa/2)}\flo@calc\flo@tby{(#2)+\flo@fpc*sin(\flo@fpth+\flo@fpa/2)}%
      % two circles through the feet, tangent to the lobe's there, meeting on the lobe's axis
      \flo@calc\flo@tcx{\flo@tax+\flo@fpf*(\flo@fplx-\flo@tax)}\flo@calc\flo@tcy{\flo@tay+\flo@fpf*(\flo@fply-\flo@tay)}%
      \flo@calc\flo@tdx{\flo@tbx+\flo@fpf*(\flo@fplx-\flo@tbx)}\flo@calc\flo@tdy{\flo@tby+\flo@fpf*(\flo@fply-\flo@tby)}%
      \flo@calc\flo@trr{\flo@fpf*\flo@fprf}%
      \flo@calc\flo@tmx{(\flo@tcx+\flo@tdx)/2}\flo@calc\flo@tmy{(\flo@tcy+\flo@tdy)/2}%
      \flo@calc\flo@thd{veclen(\flo@tdx-\flo@tcx,\flo@tdy-\flo@tcy)/2}\flo@sqdiff\flo@trr\flo@thd
      \flo@calc\flo@tpx{\flo@tmx+\flo@sqd*cos(\flo@fpth)}\flo@calc\flo@tpy{\flo@tmy+\flo@sqd*sin(\flo@fpth)}%
      \flo@calc\flo@ta{atan2(\flo@tay-\flo@tcy,\flo@tax-\flo@tcx)}\flo@calc\flo@tb{atan2(\flo@tpy-\flo@tcy,\flo@tpx-\flo@tcx)}%
      \pgfmathparse{\flo@tb<\flo@ta}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tb{\flo@tb+360}\fi
      \flo@arcto\flo@tcx\flo@tcy\flo@trr\flo@ta\flo@tb{\ifnum#6=1 \ifnum\flo@tcl=0 1\else0\fi\else0\fi}%
      \flo@calc\flo@ta{atan2(\flo@tpy-\flo@tdy,\flo@tpx-\flo@tdx)}\flo@calc\flo@tb{atan2(\flo@tby-\flo@tdy,\flo@tbx-\flo@tdx)}%
      \pgfmathparse{\flo@tb<\flo@ta}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tb{\flo@tb+360}\fi
      \flo@arcto\flo@tdx\flo@tdy\flo@trr\flo@ta\flo@tb{0}%
    \fi}}
% a dagger standing on the axis: a round head (#1,#2) of radius #3 below, a tail of two
% arcs tangent to it meeting at the tip (#4,#5); #6 bends the tail to one side (a
% mouchette); #7 moves first
\def\flo@daggerside#1{% sign; the tail circle's center \flo@dkx \flo@dky, radius \flo@dkr, tangent point \flo@dtx \flo@dty
  \flo@calc\flo@dkr{\flo@dgrh*(4+\flo@dgbend*(#1)*1.5)}%
  \flo@calc\flo@tdx{\flo@dgtx-\flo@dgcx}\flo@calc\flo@tdy{\flo@dgty-\flo@dgcy}\flo@calc\flo@tD{veclen(\flo@tdx,\flo@tdy)}%
  \flo@calc\flo@tra{\flo@dkr+\flo@dgrh}%
  \flo@calc\flo@taa{(\flo@tra*\flo@tra-\flo@dkr*\flo@dkr+\flo@tD*\flo@tD)/(2*\flo@tD)}%
  \flo@sqdiff\flo@tra\flo@taa
  \flo@calc\flo@tmx{\flo@dgcx+\flo@taa*\flo@tdx/\flo@tD}\flo@calc\flo@tmy{\flo@dgcy+\flo@taa*\flo@tdy/\flo@tD}%
  \flo@calc\flo@dkx{\flo@tmx+(#1)*\flo@sqd*(-\flo@tdy/\flo@tD)}\flo@calc\flo@dky{\flo@tmy+(#1)*\flo@sqd*(\flo@tdx/\flo@tD)}%
  \flo@calc\flo@dtx{\flo@dgcx+\flo@dgrh*(\flo@dkx-\flo@dgcx)/\flo@tra}\flo@calc\flo@dty{\flo@dgcy+\flo@dgrh*(\flo@dky-\flo@dgcy)/\flo@tra}}
\def\flo@fwd#1#2{\flo@calc\flo@tfw{(#2)-(#1)}\pgfmathparse{\flo@tfw<0}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tfw{\flo@tfw+360}\fi}
\def\flo@daggerpath#1#2#3#4#5#6#7{%
  \edef\flo@dgcx{#1}\edef\flo@dgcy{#2}\edef\flo@dgrh{#3}\edef\flo@dgtx{#4}\edef\flo@dgty{#5}\edef\flo@dgbend{#6}%
  \flo@daggerside{1}\let\flo@dax\flo@dkx\let\flo@day\flo@dky\let\flo@dar\flo@dkr\let\flo@dtax\flo@dtx\let\flo@dtay\flo@dty
  \flo@daggerside{-1}\let\flo@dbx\flo@dkx\let\flo@dby\flo@dky\let\flo@dbr\flo@dkr\let\flo@dtbx\flo@dtx\let\flo@dtby\flo@dty
  % from tangent point 1, round the head away from the tip, to tangent point 2
  \flo@calc\flo@ta{atan2(\flo@dtay-\flo@dgcy,\flo@dtax-\flo@dgcx)}\flo@calc\flo@tb{atan2(\flo@dtby-\flo@dgcy,\flo@dtbx-\flo@dgcx)}%
  \flo@calc\flo@tat@{atan2(\flo@dgty-\flo@dgcy,\flo@dgtx-\flo@dgcx)}%
  \flo@fwd\flo@ta\flo@tat@\let\flo@tfa\flo@tfw\flo@fwd\flo@ta\flo@tb\let\flo@tfb\flo@tfw
  \pgfmathparse{\flo@tfa<\flo@tfb}\ifdim\pgfmathresult pt>0pt
    \flo@fwd\flo@tb\flo@ta\flo@calc\flo@tb{\flo@ta-\flo@tfw}\flo@arcto\flo@dgcx\flo@dgcy\flo@dgrh\flo@ta\flo@tb{#7}%
  \else\flo@calc\flo@tb{\flo@ta+\flo@tfb}\flo@arcto\flo@dgcx\flo@dgcy\flo@dgrh\flo@ta\flo@tb{#7}\fi
  % up side 2 to the tip, then down side 1
  \flo@calc\flo@ta{atan2(\flo@dtby-\flo@dby,\flo@dtbx-\flo@dbx)}\flo@calc\flo@tb{atan2(\flo@dgty-\flo@dby,\flo@dgtx-\flo@dbx)}%
  \flo@short\flo@ta\flo@tb\flo@calc\flo@tb{\flo@ta+\flo@tsh}\flo@arcto\flo@dbx\flo@dby\flo@dbr\flo@ta\flo@tb{0}%
  \flo@calc\flo@ta{atan2(\flo@dgty-\flo@day,\flo@dgtx-\flo@dax)}\flo@calc\flo@tb{atan2(\flo@dtay-\flo@day,\flo@dtax-\flo@dax)}%
  \flo@short\flo@ta\flo@tb\flo@calc\flo@tb{\flo@ta+\flo@tsh}\flo@arcto\flo@dax\flo@day\flo@dar\flo@ta\flo@tb{0}}
% a spherical triangle (three arcs bowed out, each struck from the opposite corner),
% scaled to sit in the circle (#1,#2) of radius #3, a corner up; #4 moves first
\def\flo@trianglepath#1#2#3#4{%
  \flo@calc\flo@trR{(#3)/1.12}\flo@calc\flo@trside{\flo@trR*sqrt(3)}%
  \flo@loop{ttrp}\flo@tcl{0}{2}{\flo@calc\flo@t{90+\the\flo@tcl*120}%
    \expandafter\edef\csname flo@trpx\the\flo@tcl\endcsname{\flo@calc\flo@tmp{(#1)+\flo@trR*cos(\flo@t)}}%
    \flo@calc\flo@tmp{(#1)+\flo@trR*cos(\flo@t)}\expandafter\let\csname flo@trpx\the\flo@tcl\endcsname\flo@tmp
    \flo@calc\flo@tmp{(#2)+\flo@trR*sin(\flo@t)}\expandafter\let\csname flo@trpy\the\flo@tcl\endcsname\flo@tmp}%
  \flo@loop{ttra}\flo@tcl{0}{2}{%
    \edef\flo@tax{\csname flo@trpx\the\flo@tcl\endcsname}\edef\flo@tay{\csname flo@trpy\the\flo@tcl\endcsname}%
    \edef\flo@tbx{\csname flo@trpx\the\numexpr(\flo@tcl+1)-3*((\flo@tcl+1)/3)\relax\endcsname}%
    \edef\flo@tby{\csname flo@trpy\the\numexpr(\flo@tcl+1)-3*((\flo@tcl+1)/3)\relax\endcsname}%
    \edef\flo@tox{\csname flo@trpx\the\numexpr(\flo@tcl+2)-3*((\flo@tcl+2)/3)\relax\endcsname}%
    \edef\flo@toy{\csname flo@trpy\the\numexpr(\flo@tcl+2)-3*((\flo@tcl+2)/3)\relax\endcsname}%
    \flo@calc\flo@ta{atan2(\flo@tay-\flo@toy,\flo@tax-\flo@tox)}\flo@calc\flo@tb{atan2(\flo@tby-\flo@toy,\flo@tbx-\flo@tox)}%
    \pgfmathparse{\flo@tb<\flo@ta}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tb{\flo@tb+360}\fi
    \pgfmathparse{\flo@tb-\flo@ta>180}\ifdim\pgfmathresult pt>0pt \flo@calc\flo@tb{\flo@tb-360}\fi
    \flo@arcto\flo@tox\flo@toy\flo@trside\flo@ta\flo@tb{\ifnum#4=1 \ifnum\flo@tcl=0 1\else0\fi\else0\fi}}}
% a circle's figure in the head: foiled, an oculus, a triangle, a dagger, two mouchettes,
% a soufflet; (#2,#3,#4) is the construction circle, the opening a bar in; #5 a tip's y
% for a dagger or mouchettes, or empty; \flo@fg@foils and \flo@fg@shape the foils
\def\flo@tfigure#1#2#3#4#5{%
  \flo@calc\flo@fgro{(#4)-\flo@tbw}%
  \ifdim\flo@fgro pt>0pt
    \edef\flo@fgcx{#2}\edef\flo@fgcy{#3}\edef\flo@fgup{#5}\edef\flo@fgkind{#1}%
    \edef\flo@fgn{\flo@fg@foils}\ifnum\flo@tladder>1 \ifnum\flo@fgn>4 \def\flo@fgn{4}\fi\fi
    \def\flo@tmp{pointed}\ifx\flo@fg@shape\flo@tmp\def\flo@fgpt{1}\else\def\flo@fgpt{0}\fi
    \flo@calc\flo@fgxa{\flo@fgcx-\flo@fgro}\flo@calc\flo@fgya{\flo@fgcy-\flo@fgro}\flo@calc\flo@fgxb{\flo@fgcx+\flo@fgro}\flo@calc\flo@fgyb{\flo@fgcy+\flo@fgro}%
    \def\flo@tmp{foiled}\ifx\flo@fgkind\flo@tmp\ifnum\flo@fgn<3 \def\flo@fgkind{oculus}\fi\fi
    \def\flo@tmp{foiled}\ifx\flo@fgkind\flo@tmp
      \flo@topening{\flo@foiledpath\flo@fgcx\flo@fgcy\flo@fgro\flo@fgn\flo@fgpt{1}}\flo@fgxa\flo@fgya\flo@fgxb\flo@fgyb
    \else\def\flo@tmp{soufflet}\ifx\flo@fgkind\flo@tmp
      \flo@topening{\flo@foiledpath\flo@fgcx\flo@fgcy\flo@fgro{4}{1}{1}}\flo@fgxa\flo@fgya\flo@fgxb\flo@fgyb
    \else\def\flo@tmp{triangle}\ifx\flo@fgkind\flo@tmp
      \flo@topening{\flo@trianglepath\flo@fgcx\flo@fgcy\flo@fgro{1}}\flo@fgxa\flo@fgya\flo@fgxb\flo@fgyb
      \ifnum\flo@fgn=3 \ifnum\flo@tladder<2
        \flo@calc\flo@fgri{\flo@fgro*0.62}\flo@calc\flo@fgcyb{\flo@fgcy-0.03*\flo@fgro}%
        \flo@calc\flo@fgxa{\flo@fgcx-\flo@fgri}\flo@calc\flo@fgya{\flo@fgcy-\flo@fgri}\flo@calc\flo@fgxb{\flo@fgcx+\flo@fgri}\flo@calc\flo@fgyb{\flo@fgcy+\flo@fgri}%
        \flo@topening{\flo@foiledpath\flo@fgcx\flo@fgcyb\flo@fgri{3}{0}{1}}\flo@fgxa\flo@fgya\flo@fgxb\flo@fgyb\fi\fi
    \else\def\flo@tmp{dagger}\ifx\flo@fgkind\flo@tmp
      \flo@calc\flo@fgrh{\flo@fgro*0.55}\flo@calc\flo@fghy{\flo@fgcy-(\flo@fgro-\flo@fgrh)}%
      \ifx\flo@fgup\pgfutil@empty\flo@calc\flo@fgty{\flo@fgcy+\flo@fgro}\else\let\flo@fgty\flo@fgup\fi
      \flo@calc\flo@fgxa{\flo@fgcx-\flo@fgrh}\flo@calc\flo@fgya{\flo@fghy-\flo@fgrh}\flo@calc\flo@fgxb{\flo@fgcx+\flo@fgrh}%
      \flo@topening{\flo@daggerpath\flo@fgcx\flo@fghy\flo@fgrh\flo@fgcx\flo@fgty{0}{1}}\flo@fgxa\flo@fgya\flo@fgxb\flo@fgty
    \else\def\flo@tmp{mouchettes}\ifx\flo@fgkind\flo@tmp
      \flo@calc\flo@fgrh{\flo@fgro*0.42}%
      \flo@loop{tfgm}\flo@tcm{-1}{1}{\ifnum\flo@tcm=0 \else
        \flo@calc\flo@fghx{\flo@fgcx+\the\flo@tcm*(\flo@fgro-\flo@fgrh)*0.9}\flo@calc\flo@fghy{\flo@fgcy-(\flo@fgro-\flo@fgrh)*0.35}%
        \flo@calc\flo@fgtx{\flo@fgcx+\the\flo@tcm*0.12*\flo@fgro}%
        \ifx\flo@fgup\pgfutil@empty\flo@calc\flo@fgty{\flo@fgcy+\flo@fgro}\else\let\flo@fgty\flo@fgup\fi
        \flo@calc\flo@fgbend{\the\flo@tcm*0.8}%
        \flo@calc\flo@fgxa{min(\flo@fghx,\flo@fgtx)-\flo@fgrh}\flo@calc\flo@fgya{\flo@fghy-\flo@fgrh}\flo@calc\flo@fgxb{max(\flo@fghx,\flo@fgtx)+\flo@fgrh}%
        \edef\flo@tsave{\the\flo@tcm}%
        \flo@topening{\flo@daggerpath\flo@fghx\flo@fghy\flo@fgrh\flo@fgtx\flo@fgty\flo@fgbend{1}}\flo@fgxa\flo@fgya\flo@fgxb\flo@fgty
        \flo@tcm=\flo@tsave\relax\fi}%
    \else
      \flo@topening{\pgfpathcircle{\flo@P\flo@fgcx\flo@fgcy}{\flo@fgro pt}}\flo@fgxa\flo@fgya\flo@fgxb\flo@fgyb
    \fi\fi\fi\fi\fi
  \fi}
% the figure's foils from the traits, or a trefoil's, or flowing tracery's pointed quatrefoil
\def\flo@fgtraits{\edef\flo@fg@foils{\flo@tget{foils}}\edef\flo@fg@shape{\flo@tget{foilshape}}}
\def\flo@fgtrefoil{\def\flo@fg@foils{3}\def\flo@fg@shape{round}}
\def\flo@fgflowing{\def\flo@fg@foils{4}\def\flo@fg@shape{pointed}}
% a figure placed: the first gets the copper boss
\def\flo@placed#1#2#3{\edef\flo@placedn{\the\numexpr\flo@placedn+1\relax}%
  \expandafter\edef\csname flo@tpl@\flo@placedn @x\endcsname{#1}\expandafter\edef\csname flo@tpl@\flo@placedn @y\endcsname{#2}%
  \expandafter\edef\csname flo@tpl@\flo@placedn @r\endcsname{#3}}
% foliage carved in the stone where a figure would go: a sprig of three leaflets rising
% from the foot of the circle (#1,#2,#3), one up and one leaning out each side
\def\flo@tfoliage#1#2#3{%
  \let\flo@vl@W\pgfutil@empty\let\flo@vl@tone\pgfutil@empty
  \flo@calc\flo@tfy{(#2)-0.85*(#3)}%
  \begin{pgfscope}\pgftransformshift{\flo@P{#1}{\flo@tfy}}%
    \flo@loop{tfol}\flo@tcm{-1}{1}{\ifnum\flo@tcm=0 \else
      \flo@range\flo@t{30}{45}\flo@calc\flo@tfa{\the\flo@tcm*\flo@t}\flo@calc\flo@tfs{1.15*(#3)}\flo@calc\flo@vl@u{\flo@tfs*\flo@tunit}%
      \edef\flo@tsave{\the\flo@tcm}%
      \begin{pgfscope}\pgftransformrotate{\flo@tfa}\pgftransformscale{\flo@tfs}\flo@vleaflet\end{pgfscope}%
      \flo@tcm=\flo@tsave\relax\fi}%
    \flo@sym\flo@tfa{6}\flo@calc\flo@tfs{1.5*(#3)}\flo@calc\flo@vl@u{\flo@tfs*\flo@tunit}%
    \begin{pgfscope}\pgftransformrotate{\flo@tfa}\pgftransformscale{\flo@tfs}\flo@vleaflet\end{pgfscope}%
  \end{pgfscope}}
% the figures of a group of lights without sub-arches: a screen's small figure, or the
% spandrels' trefoil or foliage, in the stone between each two heads; flowing tracery's
% pair of mouchettes curling up to the apex, then a soufflet, more mouchettes, a dagger
% and pointed quatrefoils in what room is left
\def\flo@tgroupfigures{%
  \flo@rgnew{g\flo@lvl r}\flo@rgarch{g\flo@lvl r}{\flo@gget{rch}}{\flo@gget{rys}}{\flo@gget{rxm}}{0}%
  \flo@loop{tgfr}\flo@tcn{0}{\flo@gget{n}-1}{\flo@calc\flo@t{\flo@gget{x0}+(\the\flo@tcn+0.5)*\flo@gget{lw}}%
    \flo@rgarch{g\flo@lvl r}{g\flo@lvl h\the\flo@tcn}{\flo@gget{ysl}}{\flo@t}{1}}%
  \flo@apex{\flo@gget{rch}}\flo@gset{top}{\flo@apy}%
  \ifnum\flo@gget{screen}=1
    \edef\flo@t{\flo@tget{figure}}\def\flo@tmp{none}\edef\flo@tmpb{\flo@tget{spandrel}}\def\flo@tmpc{blank}%
    \flo@yesfalse\ifx\flo@t\flo@tmp\else\flo@yestrue\fi\ifx\flo@tmpb\flo@tmpc\else\flo@yestrue\fi
    \ifnum\flo@tladder>2 \flo@yesfalse\fi
    \ifflo@yes
      \flo@loop{tgsf}\flo@tci{1}{\flo@gget{n}-1}{%
        \flo@calc\flo@tfxa{\flo@gget{x0}+(\the\flo@tci-0.5)*\flo@gget{lw}}\flo@calc\flo@tfxb{\flo@gget{x0}+(\the\flo@tci+0.5)*\flo@gget{lw}}%
        \edef\flo@tsave{\the\flo@tci}%
        \flo@biggest{g\flo@lvl r}{\flo@tfxa}{\flo@gget{ys}}{\flo@tfxb}{\flo@gget{top}}{}%
        \pgfmathparse{\flo@bgr>2.5*\flo@tbw}\ifdim\pgfmathresult pt>0pt
          \edef\flo@t{\flo@tget{figure}}\def\flo@tmp{none}\ifx\flo@t\flo@tmp
            \edef\flo@t{\flo@tget{spandrel}}\def\flo@tmp{foliage}\ifx\flo@t\flo@tmp\flo@tfoliage\flo@bgx\flo@bgy\flo@bgr
            \else\flo@fgtrefoil\flo@tfigure{foiled}\flo@bgx\flo@bgy\flo@bgr{}\fi
          \else\flo@fgtraits\flo@tfigure{\flo@t}\flo@bgx\flo@bgy\flo@bgr{}\fi
          \flo@placed\flo@bgx\flo@bgy\flo@bgr\flo@rgcircle{g\flo@lvl r}{\flo@bgx}{\flo@bgy}{\flo@bgr}{1}%
        \fi
        \flo@tci=\flo@tsave\relax}%
    \fi
  \fi
  \ifnum\flo@gget{flowing}=1 \ifnum\flo@tladder<2
    \flo@fgflowing\def\flo@tfkinds{mouchettes,soufflet,mouchettes,dagger,foiled,foiled}\def\flo@tfk{0}\flo@tfgotrue
    \pgfutil@for\flo@tfkind:=\flo@tfkinds\do{\ifflo@tfgo
      \edef\flo@tfk{\the\numexpr\flo@tfk+1\relax}%
      \ifnum\flo@tfk=1 \edef\flo@tfaxis{\flo@gget{xm}}\flo@calc\flo@tfup{\flo@gget{top}-\flo@tbw}\else\def\flo@tfaxis{}\def\flo@tfup{}\fi
      \edef\flo@tfkindk{\flo@tfkind}%
      \flo@biggest{g\flo@lvl r}{\flo@gget{x0}}{\flo@gget{ys}}{\flo@gget{x1}}{\flo@gget{top}}{\flo@tfaxis}%
      \pgfmathparse{\flo@bgr<3*\flo@tbw}\ifdim\pgfmathresult pt>0pt \flo@tfgofalse\else
        \flo@fgflowing\flo@tfigure{\flo@tfkindk}\flo@bgx\flo@bgy\flo@bgr{\flo@tfup}%
        \flo@placed\flo@bgx\flo@bgy\flo@bgr\flo@rgcircle{g\flo@lvl r}{\flo@bgx}{\flo@bgy}{\flo@bgr}{1}\fi\fi}%
  \fi\fi}
% the figure in the head above a group's sub-arches, and the spandrels each side:
% trefoils, daggers or foliage where there is room (level 0 only)
\def\flo@tgroupheadfigure{%
  \flo@rgnew{g\flo@lvl r}\flo@rgarch{g\flo@lvl r}{\flo@gget{rch}}{\flo@gget{rys}}{\flo@gget{rxm}}{0}%
  \flo@loop{tghr}\flo@tcn{1}{\flo@gget{np}}{\flo@calc\flo@t{(\flo@gget{p\the\flo@tcn a}+\flo@gget{p\the\flo@tcn b})/2}%
    \flo@rgarch{g\flo@lvl r}{g\flo@lvl s\the\flo@tcn}{\flo@gget{ys1}}{\flo@t}{1}}%
  \flo@apex{\flo@gget{rch}}\flo@gset{top}{\flo@apy}%
  \edef\flo@t{\flo@tget{figure}}\def\flo@tmp{none}\ifx\flo@t\flo@tmp\flo@yesfalse\else\flo@yestrue\fi
  \ifnum\flo@lvl=0 \else\ifnum\flo@tladder=0 \else\flo@yesfalse\fi\fi
  \ifflo@yes
    \flo@biggest{g\flo@lvl r}{\flo@gget{x0}}{\flo@gget{ys1}}{\flo@gget{x1}}{\flo@gget{top}}{\flo@gget{xm}}%
    \pgfmathparse{\flo@bgr>2.5*\flo@tbw}\ifdim\pgfmathresult pt>0pt
      \edef\flo@tfkindk{\flo@tget{figure}}%
      \ifnum\flo@tladder>2 \def\flo@tmp{foiled}\ifx\flo@tfkindk\flo@tmp\else\def\flo@tfkindk{oculus}\fi\fi
      \def\flo@tfup{}\def\flo@tmp{dagger}\ifx\flo@tfkindk\flo@tmp\flo@calc\flo@tfup{\flo@gget{top}-\flo@tbw}\fi
      \def\flo@tmp{mouchettes}\ifx\flo@tfkindk\flo@tmp\flo@calc\flo@tfup{\flo@gget{top}-\flo@tbw}\fi
      \flo@fgtraits\flo@tfigure{\flo@tfkindk}\flo@bgx\flo@bgy\flo@bgr{\flo@tfup}%
      \flo@placed\flo@bgx\flo@bgy\flo@bgr\flo@rgcircle{g\flo@lvl r}{\flo@bgx}{\flo@bgy}{\flo@bgr}{1}%
    \fi
  \fi
  \ifnum\flo@lvl=0 \ifnum\flo@tladder<2 \ifnum\flo@gget{np}>1
    \edef\flo@t{\flo@tget{spandrel}}\def\flo@tmp{blank}\ifx\flo@t\flo@tmp\else
      \flo@loop{tgsp}\flo@tcm{-1}{1}{\ifnum\flo@tcm=0 \else
        \edef\flo@tsave{\the\flo@tcm}%
        \ifnum\flo@tcm<0 \edef\flo@tsxa{\flo@gget{x0}}\edef\flo@tsxb{\flo@gget{xm}}\else\edef\flo@tsxa{\flo@gget{xm}}\edef\flo@tsxb{\flo@gget{x1}}\fi
        \flo@rgcopy{g\flo@lvl r}{g\flo@lvl rs}\flo@rgplane{g\flo@lvl rs}{\flo@gget{xm}}{0}{\the\flo@tcm}{0}%
        \flo@biggest{g\flo@lvl rs}{\flo@tsxa}{\flo@gget{ys1}}{\flo@tsxb}{\flo@gget{top}}{}%
        \pgfmathparse{\flo@bgr>3*\flo@tbw}\ifdim\pgfmathresult pt>0pt
          \edef\flo@t{\flo@tget{spandrel}}\def\flo@tmp{trefoil}\def\flo@tmpb{foliage}%
          \ifx\flo@t\flo@tmp\flo@fgtrefoil\flo@tfigure{foiled}\flo@bgx\flo@bgy\flo@bgr{}%
          \else\ifx\flo@t\flo@tmpb\flo@tfoliage\flo@bgx\flo@bgy\flo@bgr
          \else\flo@calc\flo@tfup{\flo@bgy+1.5*\flo@bgr}\flo@fgtraits\flo@tfigure{dagger}\flo@bgx\flo@bgy\flo@bgr{\flo@tfup}\fi\fi
        \fi
        \flo@tcm=\flo@tsave\relax\fi}%
    \fi
  \fi\fi\fi}
% ---------------------------------------------------------------- nets, reticulation, panels
% the net of Y and intersecting tracery: from each mullion's top two arcs of the main
% arch's radius, their centers shifted by one light either way, clipped to the head
\def\flo@tnet{%
  \flo@calc\flo@tnR{(\flo@tget{excess}>0?\flo@tget{excess}:1)*\flo@tws}%
  \edef\flo@t{\flo@tget{branch}}\def\flo@tmp{Y}%
  \ifx\flo@t\flo@tmp
    \ifodd\flo@twn\def\flo@tnn{2}\flo@calc\flo@tnfa{\flo@twxm-\flo@twlw/2}\flo@calc\flo@tnfb{\flo@twxm+\flo@twlw/2}%
    \else\def\flo@tnn{1}\edef\flo@tnfa{\flo@twxm}\fi
  \else
    \edef\flo@tnn{\the\numexpr\flo@twn-1\relax}%
    \flo@loop{tnfk}\flo@tcl{1}{\flo@tnn}{\flo@calc\flo@t{\flo@twxl+\the\flo@tcl*\flo@twlw}\expandafter\let\csname flo@tnf\the\flo@tcl\endcsname\flo@t}%
    \let\flo@tnfa\relax
  \fi
  \ifx\flo@tnfa\relax\else\expandafter\let\csname flo@tnf1\endcsname\flo@tnfa
    \ifnum\flo@tnn=2 \expandafter\let\csname flo@tnf2\endcsname\flo@tnfb\fi\fi
  \flo@loop{tnet}\flo@tck{1}{\flo@tnn}{\edef\flo@tnfx{\csname flo@tnf\the\flo@tck\endcsname}%
    % rising to the right: center at fx + R, the arc from angle 180 upward; and to the left
    \flo@calc\flo@tncx{\flo@tnfx+\flo@tnR}\flo@angleatx\flo@tncx\flo@twys\flo@tnR\flo@twxr{0}%
    \ifflo@yes\flo@calc\flo@tna{max(\flo@axa,90)}\else\def\flo@tna{90}\fi
    \flo@tbars{\flo@arcto\flo@tncx\flo@twys\flo@tnR{180}\flo@tna{1}}{\flo@tbw}%
    \flo@calc\flo@tncx{\flo@tnfx-\flo@tnR}\flo@angleatx\flo@tncx\flo@twys\flo@tnR\flo@twxl{0}%
    \ifflo@yes\flo@calc\flo@tna{min(\flo@axa,90)}\else\def\flo@tna{90}\fi
    \flo@tbars{\flo@arcto\flo@tncx\flo@twys\flo@tnR{0}\flo@tna{1}}{\flo@tbw}}}
% reticulated tracery: the lights' ogee heads repeated up the head in rows, each row
% staggered by half a light and springing where the row below reaches its apexes, so
% that the heads of one row bound the meshes of the next from below; clipped to the head
\def\flo@tretarch{\flo@haset{ogee}{0.85}{0.5}{0}{0}\flo@calc\flo@t{\flo@trcx+\flo@twlw}\flo@harch{tret}\flo@trcx\flo@t\flo@trys
  \flo@cget{tret}{1}\flo@tat\flo@pa\pgfpathmoveto{\flo@P\flo@atx\flo@aty}\flo@calc\flo@t{\flo@trcx+\flo@twlw/2}\flo@headpath{tret}{\flo@t}{0}}
\def\flo@treticulation{%
  \flo@haset{ogee}{0.85}{0.5}{0}{0}\flo@harch{tret}{0}\flo@twlw{0}\flo@apex{tret}\let\flo@trh\flo@apy
  \def\flo@trk{0}\flo@tfgotrue
  \loop
    \flo@calc\flo@trys{\flo@twys+\flo@trk*\flo@trh}%
    \pgfmathparse{\flo@trys<\flo@tway}\ifdim\pgfmathresult pt>0pt \else\flo@tfgofalse\fi
    \ifnum\flo@trk<12 \else\flo@tfgofalse\fi
  \ifflo@tfgo
    \ifodd\flo@trk\flo@calc\flo@trsh{\flo@twlw/2}\else\def\flo@trsh{0}\fi
    \flo@loop{tretr}\flo@tcj{-1}{\flo@twn}{%
      \flo@calc\flo@trcx{\flo@twxl+\the\flo@tcj*\flo@twlw+\flo@trsh}%
      \pgfmathparse{and(\flo@trcx+\flo@twlw>\flo@twxl,\flo@trcx<\flo@twxr)}\ifdim\pgfmathresult pt>0pt
        \flo@tbars{\flo@tretarch}{\flo@tbw}\fi}%
    \edef\flo@trk{\the\numexpr\flo@trk+1\relax}%
  \repeat}
% the head as one opening, the lights below it as rectangles, the bars over them
\def\flo@twheadpath{\pgfpathmoveto{\flo@P\flo@twhxa\flo@twys}\pgfpathlineto{\flo@P\flo@twlx\flo@twly}\flo@headpath{inner}{\flo@twxm}{0}\pgfpathlineto{\flo@P\flo@twhxb\flo@twys}}
\def\flo@twnet{%
  \flo@cget{inner}{1}\flo@tat\flo@pa\let\flo@twlx\flo@atx\let\flo@twly\flo@aty
  \flo@calc\flo@twhxa{\flo@twxl+\flo@tBw}\flo@calc\flo@twhxb{\flo@twxr-\flo@tBw}%
  \flo@topening{\flo@twheadpath}\flo@twhxa\flo@twys\flo@twhxb\flo@tway
  % the lights: rectangles up to the springing (transoms split them)
  \edef\flo@twrows{\the\numexpr\flo@tget{transoms}+1\relax}%
  \flo@loop{twli}\flo@tcj{0}{\flo@twn-1}{%
    \flo@calc\flo@twra{\flo@twxl+\the\flo@tcj*\flo@twlw+\flo@tbw}\flo@calc\flo@twrb{\flo@twxl+(\the\flo@tcj+1)*\flo@twlw-\flo@tbw}%
    \ifnum\flo@tcj=0 \let\flo@twra\flo@twhxa\fi\ifnum\flo@tcj=\numexpr\flo@twn-1\relax\let\flo@twrb\flo@twhxb\fi
    \flo@loop{twlk}\flo@tcl{0}{\flo@twrows-1}{%
      \flo@calc\flo@twrc{\flo@twya+(\flo@twys-\flo@twya)*\the\flo@tcl/\flo@twrows+\ifnum\flo@tcl>0 \flo@tbw\else0\fi}%
      \flo@calc\flo@twrd{\flo@twya+(\flo@twys-\flo@twya)*(\the\flo@tcl+1)/\flo@twrows-\ifnum\flo@tcl<\numexpr\flo@twrows-1\relax\flo@tbw\else0\fi+\ifnum\flo@tcl=\numexpr\flo@twrows-1\relax\flo@tbw\else0\fi}%
      \flo@topening{\pgfpathrectanglecorners{\flo@P\flo@twra\flo@twrc}{\flo@P\flo@twrb\flo@twrd}}\flo@twra\flo@twrc\flo@twrb\flo@twrd}}%
  % the mullions through the head, within it; the springing: a bar across under the net
  \begin{pgfscope}\flo@twheadpath\pgfpathclose\pgfusepath{clip}%
    \edef\flo@t{\flo@tget{branch}}\def\flo@tmp{reticulated}\ifx\flo@t\flo@tmp\flo@treticulation\else\flo@tnet\fi
    \flo@tbars{\pgfpathmoveto{\flo@P\flo@twxl\flo@twys}\pgfpathlineto{\flo@P\flo@twxr\flo@twys}}{\flo@tbw}%
  \end{pgfscope}%
  % the head's edge again over the bars' ends
  \flo@vtone{flo@c}{0.08}\flo@vstroke{flo@c}{\flo@tpen}{0.9}{0}{\pgfpathmoveto{\flo@P\flo@twlx\flo@twly}\flo@headpath{inner}{\flo@twxm}{0}}}
% Perpendicular panels: every light has a cusped four-centered head reaching the
% springing, and the mullions run on through the head, which is cut into a row of panels
% with heads of their own fitted under the arch; the stone is left where the arch leaves
% a panel too little room
\def\flo@twpanels{%
  \ifnum\flo@tladder>0 \def\flo@tpcusps{0}\else\edef\flo@tpcusps{\flo@tget{cusps}}\fi
  \flo@calc\flo@tpdepth{\flo@tget{cuspdepth}*\flo@twlw}%
  \edef\flo@tprows{\the\numexpr\flo@tget{transoms}+1\relax}%
  \pgfmathparse{\flo@tget{rise}>0?\flo@tget{rise}:0.3}\let\flo@tprise\pgfmathresult
  \pgfmathparse{\flo@tget{shoulder}>0?\flo@tget{shoulder}:0.18}\let\flo@tpshoulder\pgfmathresult
  \flo@haset{fourcentered}{0}{0}{\flo@tprise}{\flo@tpshoulder}\flo@harch{tpan}{0}\flo@twlw{0}\flo@apex{tpan}%
  \flo@calc\flo@tpysl{\flo@twys-2*\flo@tbw-\flo@apy}%
  \flo@loop{tpan}\flo@tcj{0}{\flo@twn-1}{%
    \flo@calc\flo@lt@xa{\flo@twxl+\the\flo@tcj*\flo@twlw}\flo@calc\flo@lt@xb{\flo@twxl+(\the\flo@tcj+1)*\flo@twlw}%
    \ifnum\flo@tcj=0 \edef\flo@lt@bl{\flo@tBw}\else\edef\flo@lt@bl{\flo@tbw}\fi
    \ifnum\flo@tcj=\numexpr\flo@twn-1\relax\edef\flo@lt@br{\flo@tBw}\else\edef\flo@lt@br{\flo@tbw}\fi
    \edef\flo@lt@off{\flo@tbw}\edef\flo@lt@cusps{\flo@tpcusps}\edef\flo@lt@depth{\flo@tpdepth}%
    \edef\flo@lt@ya{\flo@twya}\edef\flo@lt@ys{\flo@tpysl}\edef\flo@lt@rows{\flo@tprows}\let\flo@lt@lim\pgfutil@empty
    \flo@haset{fourcentered}{0}{0}{\flo@tprise}{\flo@tpshoulder}\flo@harch{tphead}\flo@lt@xa\flo@lt@xb\flo@tpysl
    \def\flo@lt@head{tphead}\edef\flo@tsave{\the\flo@tcj}%
    \flo@tlight{tpl}%
    % the panel above, if the arch leaves it room at its outer edge
    \flo@calc\flo@t{\flo@lt@xa+\flo@lt@bl}\flo@chainy{inner}{\flo@twxm}{\flo@t}\ifflo@yes\let\flo@tpla\flo@cyv\else\def\flo@tpla{0}\fi
    \flo@calc\flo@t{\flo@lt@xb-\flo@lt@br}\flo@chainy{inner}{\flo@twxm}{\flo@t}\ifflo@yes\let\flo@tplb\flo@cyv\else\def\flo@tplb{0}\fi
    \flo@calc\flo@tplo{min(\flo@tpla,\flo@tplb)-2*\flo@tbw}%
    \pgfmathparse{\flo@tplo-\flo@twys>0.3*\flo@twlw}\ifdim\pgfmathresult pt>0pt
      \flo@calc\flo@lt@ys{max(\flo@twys+0.1*\flo@twlw,\flo@tplo-0.45*\flo@twlw)}\edef\flo@lt@ya{\flo@twys}\def\flo@lt@rows{1}%
      \def\flo@lt@lim{inner}\edef\flo@lt@limxm{\flo@twxm}\let\flo@lt@head\pgfutil@empty
      \flo@tlight{tpu}\fi
    \flo@tcj=\flo@tsave\relax}}

% ================================================================ shells, drawn
% florilegium-shell.lua's drawing, step for step and draw for draw (board #5339): a shell
% sampled by \florilegiumshell, in the local unit of its own frame (a few units across,
% scaled to its size on the page), from \flo@drawseed's stream, with the library's tones,
% mottle, streaks, tapers and blobs, as the Lua side draws with florilegium-native.lua's
% twins of them. Points are kept in named lists, \flo@kdput{list}{i}{x}{y} with
% \flo@kdN@<list> of them; line widths are absolute, in bp. The macros are \flo@kd...
% (k is the shells' namespace, d their drawing); a name never ends in a digit.
\newcount\flo@kdi \newcount\flo@kdj \newcount\flo@kdk \newcount\flo@kdl \newcount\flo@kdm \newcount\flo@kdq
% ---------------------------------------------------------------- lists of points
\def\flo@kdput#1#2#3#4{\expandafter\edef\csname flo@kdX@#1@#2\endcsname{#3}\expandafter\edef\csname flo@kdY@#1@#2\endcsname{#4}}
\def\flo@kdx#1#2{\csname flo@kdX@#1@#2\endcsname}
\def\flo@kdy#1#2{\csname flo@kdY@#1@#2\endcsname}
\def\flo@kdsetn#1#2{\expandafter\edef\csname flo@kdN@#1\endcsname{\the\numexpr#2\relax}}
\def\flo@kdn#1{\csname flo@kdN@#1\endcsname}
% a value kept by name and index (a band's angles, widths, light)
\def\flo@kdvset#1#2#3{\expandafter\edef\csname flo@kdV@#1@#2\endcsname{#3}}
\def\flo@kdv#1#2{\csname flo@kdV@#1@#2\endcsname}
% list #1 into flo@X/Y 1..n, where the library's curves, streaks and normals read
\def\flo@kdtoxy#1{\edef\flo@kdtn{\flo@kdn{#1}}%
  \flo@loop{kdxy}\flo@kdm{1}{\flo@kdtn}{\flo@put{\the\flo@kdm}{\flo@kdx{#1}{\the\flo@kdm}}{\flo@kdy{#1}{\the\flo@kdm}}}}
% list #2 is list #1 reversed; points #2 to #3 of list #1 as list #4; list #4 the points #3
% of the way from list #1 to list #2, pointwise; a copy
\def\flo@kdrev#1#2{\edef\flo@kdtn{\flo@kdn{#1}}\flo@kdsetn{#2}{\flo@kdtn}%
  \flo@loop{kdrv}\flo@kdm{1}{\flo@kdtn}{%
    \edef\flo@t{\the\numexpr\flo@kdtn+1-\flo@kdm\relax}\flo@kdput{#2}{\the\flo@kdm}{\flo@kdx{#1}\flo@t}{\flo@kdy{#1}\flo@t}}}
\def\flo@kdslice#1#2#3#4{\flo@kdsetn{#4}{(#3)-(#2)+1}%
  \flo@loop{kdsl}\flo@kdm{1}{\flo@kdn{#4}}{%
    \edef\flo@t{\the\numexpr\flo@kdm+(#2)-1\relax}\flo@kdput{#4}{\the\flo@kdm}{\flo@kdx{#1}\flo@t}{\flo@kdy{#1}\flo@t}}}
\def\flo@kdacross#1#2#3#4{\flo@kdsetn{#4}{\flo@kdn{#1}}\flo@calc\flo@kdf{#3}%
  \flo@loop{kdac}\flo@kdm{1}{\flo@kdn{#1}}{%
    \flo@calc\flo@kdax{\flo@kdx{#1}{\the\flo@kdm}+\flo@kdf*(\flo@kdx{#2}{\the\flo@kdm}-(\flo@kdx{#1}{\the\flo@kdm}))}%
    \flo@calc\flo@kday{\flo@kdy{#1}{\the\flo@kdm}+\flo@kdf*(\flo@kdy{#2}{\the\flo@kdm}-(\flo@kdy{#1}{\the\flo@kdm}))}%
    \flo@kdput{#4}{\the\flo@kdm}{\flo@kdax}{\flo@kday}}}
% ---------------------------------------------------------------- paths
% curve: an open Catmull-Rom curve through list #1, its ends held; #2 1 starts it with a
% moveto, 0 joins it to the path with a line (florilegium-shell.lua: curve)
\def\flo@kdcurve#1#2{\edef\flo@kdcn{\flo@kdn{#1}}%
  \ifnum#2=1 \pgfpathmoveto{\flo@P{\flo@kdx{#1}1}{\flo@kdy{#1}1}}\else\pgfpathlineto{\flo@P{\flo@kdx{#1}1}{\flo@kdy{#1}1}}\fi
  \flo@loop{kdcv}\flo@kdm{1}{\flo@kdcn-1}{%
    \edef\flo@ia{\the\numexpr\ifnum\flo@kdm=1 1\else\flo@kdm-1\fi\relax}\edef\flo@ib{\the\numexpr\flo@kdm+1\relax}%
    \edef\flo@ic{\the\numexpr\ifnum\flo@kdm=\numexpr\flo@kdcn-1\relax\flo@kdcn\else\flo@kdm+2\fi\relax}%
    \edef\flo@t{\the\flo@kdm}%
    \flo@calc\flo@kdca{\flo@kdx{#1}\flo@t+(\flo@kdx{#1}\flo@ib-(\flo@kdx{#1}\flo@ia))/6}%
    \flo@calc\flo@kdcb{\flo@kdy{#1}\flo@t+(\flo@kdy{#1}\flo@ib-(\flo@kdy{#1}\flo@ia))/6}%
    \flo@calc\flo@kdcc{\flo@kdx{#1}\flo@ib-(\flo@kdx{#1}\flo@ic-(\flo@kdx{#1}\flo@t))/6}%
    \flo@calc\flo@kdcd{\flo@kdy{#1}\flo@ib-(\flo@kdy{#1}\flo@ic-(\flo@kdy{#1}\flo@t))/6}%
    \pgfpathcurveto{\flo@P\flo@kdca\flo@kdcb}{\flo@P\flo@kdcc\flo@kdcd}{\flo@P{\flo@kdx{#1}\flo@ib}{\flo@kdy{#1}\flo@ib}}}}
% a closed Catmull-Rom curve through list #1 (ink.smooth), or a polygon (ink.poly), #2 1 closed
\def\flo@kdsmooth#1{\flo@kdtoxy{#1}\flo@smoothprep{\flo@kdtn}\flo@smoothpath}
\def\flo@kdpoly#1#2{\pgfpathmoveto{\flo@P{\flo@kdx{#1}1}{\flo@kdy{#1}1}}%
  \flo@loop{kdpl}\flo@kdm{2}{\flo@kdn{#1}}{\pgfpathlineto{\flo@P{\flo@kdx{#1}{\the\flo@kdm}}{\flo@kdy{#1}{\the\flo@kdm}}}}%
  \ifnum#2=1 \pgfpathclose\fi}
% fill and stroke in tone #1 of the current ramp (\flo@rampname: the ink's or the accent's),
% #2 the opacity, #3 1 to multiply; #4 the path. A stroke's width #2 in bp
\def\flo@kdfill#1#2#3#4{\flo@vtone{flo@kdc}{#1}\flo@vfill{flo@kdc}{#2}{#3}{#4}}
\def\flo@kdstroke#1#2#3#4#5{\flo@vtone{flo@kdc}{#1}\flo@calc\flo@kdlw{#2}\flo@vstroke{flo@kdc}{\flo@kdlw}{#3}{#4}{#5}}
\def\flo@kdwstroke#1#2#3{\flo@calc\flo@kdlw{#1}\flo@vstroke{white}{\flo@kdlw}{#2}{0}{#3}}
% a rectangle (ink.flood's), as the corners #1 #2 #3 #4
\def\flo@kdrect#1#2#3#4{\pgfpathrectanglecorners{\flo@P{#1}{#2}}{\flo@P{#3}{#4}}}
% a streak along list #1 (native's streak, \flo@vstreak): widths #2 to #3, color #4, opacity #5
\def\flo@kdstreak#1#2#3#4#5{\flo@calc\flo@kdswa{#2}\flo@calc\flo@kdswb{#3}\flo@calc\flo@kdsop{#5}%
  \flo@kdtoxy{#1}\flo@vstreak{\flo@kdtn}{\flo@kdswa}{\flo@kdswb}{#4}{\flo@kdsop}}
% swell: a streak along list #1 thin at both ends and #2 wide in the middle, color #3, opacity #4
\def\flo@kdswell#1#2#3#4{\flo@calc\flo@kdsww{#2}\flo@calc\flo@kdsop{#4}\flo@kdtoxy{#1}\edef\flo@kdsn{\flo@kdtn}%
  \flo@normals{\flo@kdsn}%
  \def\flo@acc{0}\expandafter\def\csname flo@S1\endcsname{0}%
  \flo@loop{kdsw}\flo@kdm{2}{\flo@kdsn}{%
    \edef\flo@ia{\the\numexpr\flo@kdm-1\relax}%
    \flo@calc\flo@acc{\flo@acc+veclen(\flo@x{\the\flo@kdm}-(\flo@x\flo@ia),\flo@y{\the\flo@kdm}-(\flo@y\flo@ia))}%
    \expandafter\let\csname flo@S\the\flo@kdm\endcsname\flo@acc}%
  \ifdim\flo@acc pt=0pt \def\flo@acc{1}\fi
  \flo@loop{kdsx}\flo@kdm{1}{\flo@kdsn}{%
    \flo@calc\flo@w{\flo@kdsww*sin(180*\csname flo@S\the\flo@kdm\endcsname/\flo@acc)/2}%
    \flo@calc\flo@xl{\flo@x{\the\flo@kdm}+\csname flo@NX\the\flo@kdm\endcsname*\flo@w}%
    \flo@calc\flo@yl{\flo@y{\the\flo@kdm}+\csname flo@NY\the\flo@kdm\endcsname*\flo@w}%
    \flo@calc\flo@xr{\flo@x{\the\flo@kdm}-\csname flo@NX\the\flo@kdm\endcsname*\flo@w}%
    \flo@calc\flo@yr{\flo@y{\the\flo@kdm}-\csname flo@NY\the\flo@kdm\endcsname*\flo@w}%
    \expandafter\let\csname flo@RX\the\flo@kdm\endcsname\flo@xl\expandafter\let\csname flo@RY\the\flo@kdm\endcsname\flo@yl
    \expandafter\let\csname flo@QX\the\flo@kdm\endcsname\flo@xr\expandafter\let\csname flo@QY\the\flo@kdm\endcsname\flo@yr}%
  \flo@loop{kdsy}\flo@kdm{1}{\flo@kdsn}{%
    \flo@put{\the\flo@kdm}{\csname flo@RX\the\flo@kdm\endcsname}{\csname flo@RY\the\flo@kdm\endcsname}%
    \flo@put{\the\numexpr2*\flo@kdsn+1-\flo@kdm\relax}{\csname flo@QX\the\flo@kdm\endcsname}{\csname flo@QY\the\flo@kdm\endcsname}}%
  \flo@smoothprep{\the\numexpr2*\flo@kdsn\relax}\flo@vfill{#3}{\flo@kdsop}{0}{\flo@smoothpath}}
% taperpts: native's taper along the four points of list #1, widths #2 #3, multiplied in
% color #4 at opacity #5
\def\flo@kdtaper#1#2#3#4#5{\flo@calc\flo@twa{#2}\flo@calc\flo@twb{#3}%
  \flo@vfill{#4}{#5}{1}{\flo@vtaper{\flo@kdx{#1}1}{\flo@kdy{#1}1}{\flo@kdx{#1}2}{\flo@kdy{#1}2}%
    {\flo@kdx{#1}3}{\flo@kdy{#1}3}{\flo@kdx{#1}4}{\flo@kdy{#1}4}}}
% the bounding box of list #1 into \flo@kdbxa \flo@kdbxb \flo@kdbya \flo@kdbyb (x0 x1 y0 y1)
\def\flo@kdbox#1{\def\flo@kdbxa{16000}\def\flo@kdbxb{-16000}\def\flo@kdbya{16000}\def\flo@kdbyb{-16000}\flo@kdboxadd{#1}}
\def\flo@kdboxadd#1{\flo@loop{kdbx}\flo@kdm{1}{\flo@kdn{#1}}{%
    \flo@calc\flo@kdbxa{min(\flo@kdbxa,\flo@kdx{#1}{\the\flo@kdm})}\flo@calc\flo@kdbxb{max(\flo@kdbxb,\flo@kdx{#1}{\the\flo@kdm})}%
    \flo@calc\flo@kdbya{min(\flo@kdbya,\flo@kdy{#1}{\the\flo@kdm})}\flo@calc\flo@kdbyb{max(\flo@kdbyb,\flo@kdy{#1}{\the\flo@kdm})}}}
% run: the longest run of indexes 1..#1 where the test #2 holds of \flo@kdri (each index in
% turn, as \flo@kdri), as \flo@kdra and \flo@kdrb (0 if none); the first of equal runs
\newif\ifflo@kdok
\def\flo@kdrun#1#2{\def\flo@kdra{0}\def\flo@kdrb{0}\def\flo@kdrc{0}%
  \flo@loop{kdrn}\flo@kdq{1}{#1}{\edef\flo@kdri{\the\flo@kdq}#2%
    \ifflo@kdok
      \ifnum\flo@kdrc=0 \edef\flo@kdrc{\the\flo@kdq}\fi
      \ifnum\flo@kdra=0 \edef\flo@kdra{\flo@kdrc}\edef\flo@kdrb{\the\flo@kdq}%
      \else\ifnum\numexpr\flo@kdq-\flo@kdrc\relax>\numexpr\flo@kdrb-\flo@kdra\relax
        \edef\flo@kdra{\flo@kdrc}\edef\flo@kdrb{\the\flo@kdq}\fi\fi
    \else\def\flo@kdrc{0}\fi}}
% the frame: shift and scale so the shell's box (\flo@kdbx..) is \flo@sizept across at most,
% centered on the y axis, its base on the x axis; then its cm and bp per unit, its level of
% detail (2 under 5 mm across, 1 under 12 mm) and its pen
\def\flo@kdframe{%
  \flo@calc\flo@kdsc{\flo@sizept/max(\flo@kdbxb-\flo@kdbxa,\flo@kdbyb-\flo@kdbya)}%
  \flo@calc\flo@kdtx{-(\flo@kdbxa+\flo@kdbxb)/2*\flo@kdsc}\flo@calc\flo@kdty{-\flo@kdbya*\flo@kdsc}%
  \pgftransformshift{\flo@P\flo@kdtx\flo@kdty}\pgftransformscale{\flo@kdsc}%
  \flo@calc\flo@kdcm{\flo@kdsc/28.45276}%
  \ifdim\flo@kdacm pt<0.5pt \def\flo@kdlod{2}\else\ifdim\flo@kdacm pt<1.2pt \def\flo@kdlod{1}\else\def\flo@kdlod{0}\fi\fi
  \flo@calc\flo@kdpen{max(0.3,min(0.85,0.028*\flo@kdacm*28.3465))}}
% the base tone from the genome's tone and ground (into \flo@kdt)
\def\flo@kdtone{\flo@calc\flo@kdt{\flo@kget{tone}-0.04}%
  \edef\flo@t{\flo@kget{ground}}\def\flo@tmp{pale}\def\flo@tmpb{dark}%
  \ifx\flo@t\flo@tmp\flo@calc\flo@kdt{min(0.72,\flo@kdt+0.25)}\else\ifx\flo@t\flo@tmpb\flo@calc\flo@kdt{\flo@kdt-0.12}\fi\fi}
\def\flo@kdaccent#1{\ifnum#1=1 \def\flo@rampname{flo@aramp}\else\def\flo@rampname{flo@ramp}\fi}

% ---------------------------------------------------------------- planispirals
% Seen from the side, down the axis: whorl k's band runs from its inner edge to the edge it
% shows to (its own outer edge on the last turn, the next whorl's inner edge before), the
% bands tiling the disc. rad(th, f) into \flo@kdr; pt(th, r) into \flo@kdpx \flo@kdpy;
% vout(th, k) into \flo@kdro
\def\flo@kdrad#1#2{\flo@calc\flo@kdr{pow(\flo@kdPW,(#1)/360)*(\flo@kdPy-1+2*(#2))}}
\def\flo@kdpt#1#2{\flo@calc\flo@kdpr{#2}\flo@calc\flo@kdpa{\flo@kdPph+\flo@kdPs*(#1)}%
  \flo@calc\flo@kdpx{\flo@kdpr*cos(\flo@kdpa)}\flo@calc\flo@kdpy{\flo@kdpr*sin(\flo@kdpa)}}
\def\flo@kdvout#1#2{\ifnum#2=0 \flo@kdrad{#1}{1}\else\flo@kdrad{(#1)+360}{0}\fi\let\flo@kdro\flo@kdr}
% band(k): lists I<k> and O<k>, values TH<k>, W<k>, L<k> at each point, t0 t1 into
% \flo@kdV@T<k>@0, @1
\def\flo@kdband#1{%
  \flo@calc\flo@kdtb{\flo@kdPtm-360*#1}\flo@calc\flo@kdta{max(\flo@kdPtmin,\flo@kdtb-360)}%
  \flo@kdvset{T#1}{0}{\flo@kdta}\flo@kdvset{T#1}{1}{\flo@kdtb}%
  \pgfmathtruncatemacro\flo@kdbn{max(2,ceil((\flo@kdtb-\flo@kdta)/10))}%
  \flo@loop{kdbd}\flo@kdm{0}{\flo@kdbn}{%
    \edef\flo@kdbi{\the\numexpr\flo@kdm+1\relax}%
    \flo@calc\flo@kdth{\flo@kdta+(\flo@kdtb-\flo@kdta)*\the\flo@kdm/\flo@kdbn}%
    \flo@kdrad\flo@kdth{0}\let\flo@kdri\flo@kdr\flo@kdvout\flo@kdth{#1}%
    \flo@kdvset{TH#1}{\flo@kdbi}{\flo@kdth}%
    \flo@kdpt\flo@kdth\flo@kdri\flo@kdput{I#1}{\flo@kdbi}{\flo@kdpx}{\flo@kdpy}%
    \flo@kdpt\flo@kdth\flo@kdro\flo@kdput{O#1}{\flo@kdbi}{\flo@kdpx}{\flo@kdpy}%
    \flo@calc\flo@t{\flo@kdro-(\flo@kdri)}\flo@kdvset{W#1}{\flo@kdbi}{\flo@t}%
    \flo@calc\flo@t{cos(\flo@kdPph+\flo@kdPs*\flo@kdth-135)}\flo@kdvset{L#1}{\flo@kdbi}{\flo@t}}%
  \flo@kdsetn{I#1}{\flo@kdbn+1}\flo@kdsetn{O#1}{\flo@kdbn+1}}
\def\flo@kdbandpath#1{\flo@kdcurve{O#1}1\flo@kdrev{I#1}{kdtmp}\flo@kdcurve{kdtmp}0\pgfpathclose}
% ribpts(B, th, u0, u1, lean, turn) as list #7: a rib across band #1 at growth angle #2 from
% u #3 to #4, leaning #5 toward the mouth, turned #6 degrees at its outer end
\def\flo@kdribpts#1#2#3#4#5#6#7{\flo@kdsetn{#7}{4}%
  \flo@calc\flo@kdua{#3}\flo@calc\flo@kdub{#4}\flo@calc\flo@kdul{#5}\flo@calc\flo@kdut{#6}\flo@calc\flo@kdrth{#2}%
  \flo@loop{kdrp}\flo@kdm{0}{3}{%
    \flo@calc\flo@kdu{\flo@kdua+(\flo@kdub-\flo@kdua)*\the\flo@kdm/3}%
    \flo@calc\flo@kdra{\flo@kdrth+\flo@kdul*(pow(\flo@kdu,1.6)-0.25*sin(180*\flo@kdu))+\flo@kdut*pow((\flo@kdu-\flo@kdua)/max(0.00002,\flo@kdub-\flo@kdua),1.5)}%
    \flo@kdrad\flo@kdra{0}\let\flo@kdri\flo@kdr\flo@kdvout\flo@kdra{#1}%
    \flo@kdpt\flo@kdra{\flo@kdri+\flo@kdu*(\flo@kdro-(\flo@kdri))}%
    \flo@kdput{#7}{\the\numexpr\flo@kdm+1\relax}{\flo@kdpx}{\flo@kdpy}}}
% the ribs on band #1 (\flo@kdbk its index k): simple, forking or knobbed, where they stand
% at least half a millimeter apart on the page; a mold's softer
\def\flo@kdribs#1{%
  \edef\flo@kdrn{\flo@kget{ribs}}\flo@calc\flo@kdd{360/\flo@kdrn}%
  \pgfmathtruncatemacro\flo@kdmid{floor(\flo@kdn{O#1}/2)+1}%
  \flo@calc\flo@kdrout{veclen(\flo@kdx{O#1}\flo@kdmid,\flo@kdy{O#1}\flo@kdmid)}%
  \flo@calc\flo@kdgap{\flo@kdrout*\flo@kdd*0.0174533}%
  \flo@calc\flo@t{\flo@kdgap*\flo@kdcm}%
  \ifdim\flo@t pt<0.05pt\else
    \edef\flo@t{\flo@kget{preservation}}\def\flo@tmp{mold}%
    \ifx\flo@t\flo@tmp\def\flo@kdmold{1}\def\flo@kdrop{0.3}\else\def\flo@kdmold{0}\def\flo@kdrop{0.42}\fi
    \flo@calc\flo@kdlean{0.45*\flo@kdd}%
    \ifnum\flo@kdlod=0 \ifnum\flo@kdmold=0 \def\flo@kdlight{1}\else\def\flo@kdlight{0}\fi\else\def\flo@kdlight{0}\fi
    \flo@range\flo@t{0}{0.4}\flo@calc\flo@kdrth{\flo@kdv{T#1}{1}-\flo@kdd*(0.5+\flo@t)}%
    \edef\flo@kdsc@{\flo@kget{sculpture}}\def\flo@kdbr{branching}\def\flo@kdtu{tubercles}%
    \flo@kdribloop{#1}\fi}
% one rib after another, toward the older whorls, while the angle stays in the band
\def\flo@kdribloop#1{%
  \flo@calc\flo@t{\flo@kdv{T#1}{0}+0.2*\flo@kdd}%
  \ifdim\flo@kdrth pt>\flo@t pt \flo@kdribstep{#1}\def\flo@kdnext{\flo@kdribloop{#1}}\else\let\flo@kdnext\relax\fi
  \flo@kdnext}
\def\flo@kdribstep#1{%
    \flo@range\flo@t{0.12}{0.17}\flo@calc\flo@kdwb{\flo@kdgap*\flo@t}%
    \edef\flo@kdthr{\flo@kdrth}%
    \ifx\flo@kdsc@\flo@kdbr
      \flo@kdribpts{#1}{\flo@kdthr}{0}{0.5}{\flo@kdlean}{0}{kdrb}%
      \flo@vtone{flo@kdc}{\flo@kdt-0.18}\flo@kdtaper{kdrb}{0.03*\flo@kdgap}{0.9*\flo@kdwb}{flo@kdc}{\flo@kdrop}%
      \ifnum\flo@kdlight=1 \flo@kdribpts{#1}{\flo@kdthr-0.22*\flo@kdd}{0.05}{0.5}{\flo@kdlean}{0}{kdrb}%
        \flo@kdtaper{kdrb}{0.01*\flo@kdgap}{0.5*\flo@kdwb}{white}{0.4}\fi
      \flo@calc\flo@kdfa{\flo@kdthr+\flo@kdlean*(pow(0.5,1.6)-0.25)}%
      \flo@kdforkside{#1}{-1}\flo@kdforkside{#1}{1}%
    \else
      \flo@kdribpts{#1}{\flo@kdthr}{0}{1}{\flo@kdlean}{0}{kdrb}%
      \flo@vtone{flo@kdc}{\flo@kdt-0.18}\flo@kdtaper{kdrb}{0.03*\flo@kdgap}{\flo@kdwb}{flo@kdc}{\flo@kdrop}%
      \ifnum\flo@kdlight=1 \flo@kdribpts{#1}{\flo@kdthr-0.25*\flo@kdd}{0.05}{1}{\flo@kdlean}{0}{kdrb}%
        \flo@kdtaper{kdrb}{0.01*\flo@kdgap}{0.6*\flo@kdwb}{white}{0.45}\fi
      \ifx\flo@kdsc@\flo@kdtu
        \flo@kdknob{#1}{0.3}%
        \ifnum\flo@kdbk=0 \flo@kdknob{#1}{0.85}\fi
      \fi
    \fi
    \flo@range\flo@t{0.85}{1.15}\flo@calc\flo@kdrth{\flo@kdthr-\flo@kdd*\flo@t}}
\def\flo@kdforkside#1#2{%
  \flo@kdribpts{#1}{\flo@kdfa}{0.5}{1}{\flo@kdlean*0.5}{(#2)*0.2*\flo@kdd}{kdrb}%
  \flo@vtone{flo@kdc}{\flo@kdt-0.18}\flo@kdtaper{kdrb}{0.6*\flo@kdwb}{\flo@kdwb}{flo@kdc}{\flo@kdrop}%
  \ifnum\flo@kdlight=1 \flo@kdribpts{#1}{\flo@kdfa-0.18*\flo@kdd}{0.5}{1}{\flo@kdlean*0.5}{(#2)*0.2*\flo@kdd}{kdrb}%
    \flo@kdtaper{kdrb}{0.3*\flo@kdwb}{0.55*\flo@kdwb}{white}{0.4}\fi}
% a tubercle on a rib at u #2
\def\flo@kdknob#1#2{%
  \flo@calc\flo@kdka{\flo@kdthr+\flo@kdlean*pow(#2,1.3)}%
  \flo@kdrad\flo@kdka{0}\let\flo@kdri\flo@kdr\flo@kdvout\flo@kdka{#1}%
  \flo@kdpt\flo@kdka{\flo@kdri+(#2)*(\flo@kdro-(\flo@kdri))}\let\flo@kdkx\flo@kdpx\let\flo@kdky\flo@kdpy
  \flo@range\flo@t{0.26}{0.36}\flo@calc\flo@kdkr{\flo@kdgap*\flo@t}%
  \flo@vblob\flo@kdkx\flo@kdky\flo@kdkr{0.85*\flo@kdkr}{0.2}{7}%
  \flo@kdfill{\flo@kdt-0.2}{\flo@kdrop+0.1}{1}{\flo@smoothpath}%
  \flo@calc\flo@t{\flo@kdkx-0.35*\flo@kdkr}\flo@calc\flo@tmp{\flo@kdky+0.35*\flo@kdkr}\flo@calc\flo@tmpb{0.22*\flo@kdkr}%
  \ifnum\flo@kdmold=1 \def\flo@tmpc{0.25}\else\def\flo@tmpc{0.45}\fi
  \flo@vfill{white}{\flo@tmpc}{0}{\pgfpathcircle{\flo@P\flo@t\flo@tmp}{\flo@tmpb pt}}}
% the shading of band #1: a shadow along the edge it shows to and along its inner edge, the
% venter darker toward the lower right, the light on the flank toward the upper left
\def\flo@kdshade#1{%
  \edef\flo@kdsn{\flo@kdn{I#1}}%
  \edef\flo@kdwa{\flo@kdv{W#1}{1}}\edef\flo@kdwz{\flo@kdv{W#1}{\flo@kdsn}}%
  \flo@vtone{flo@kdc}{0.08}\flo@kdstreak{O#1}{0.34*\flo@kdwa}{0.34*\flo@kdwz}{flo@kdc}{0.28}%
  \flo@vtone{flo@kdc}{0.1}\flo@kdstreak{I#1}{0.16*\flo@kdwa}{0.16*\flo@kdwz}{flo@kdc}{0.16}%
  \ifnum#1=0
    \flo@kdrun{\flo@kdsn}{\ifdim\flo@kdv{L#1}{\flo@kdri}pt<-0.2pt \flo@kdoktrue\else\flo@kdokfalse\fi}%
    \ifnum\flo@kdra>0 \ifnum\numexpr\flo@kdrb-\flo@kdra\relax>2
      \flo@kdslice{O#1}{\flo@kdra}{\flo@kdrb}{kdsh}%
      \flo@vtone{flo@kdc}{0.06}\flo@kdstreak{kdsh}{0.2*\flo@kdv{W#1}{\flo@kdra}}{0.5*\flo@kdv{W#1}{\flo@kdrb}}{flo@kdc}{0.24}\fi\fi
  \fi
  \ifnum#1<3 \ifnum\flo@kdmold=0
    \flo@kdrun{\flo@kdsn}{\ifdim\flo@kdv{L#1}{\flo@kdri}pt>0.15pt \flo@kdoktrue\else\flo@kdokfalse\fi}%
    \ifnum\flo@kdra>0 \ifnum\numexpr\flo@kdrb-\flo@kdra\relax>2
      \flo@kdacross{I#1}{O#1}{0.42}{kdmid}\flo@kdslice{kdmid}{\flo@kdra}{\flo@kdrb}{kdsh}%
      \pgfmathtruncatemacro\flo@kdsi{floor((\flo@kdra+\flo@kdrb)/2)}%
      \ifnum#1=0 \def\flo@tmp{0.5}\else\def\flo@tmp{0.35}\fi
      \flo@kdswell{kdsh}{0.17*\flo@kdv{W#1}{\flo@kdsi}}{white}{\flo@tmp}\fi\fi
  \fi\fi}
% a mold's suture lines across band #1, up to the body chamber: saddles forward and lobes
% back, zigzag (goniatitic), the lobes toothed (ceratitic), or frilled all over (ammonitic)
\def\flo@kdsepta#1{%
  \flo@range\flo@t{0.2}{0.8}\flo@calc\flo@kdsth{min(\flo@kdv{T#1}{1},\flo@kdPtm-\flo@kdchamber)-30*\flo@t}%
  \ifnum\flo@kdlod=0 \def\flo@kdnp{64}\else\def\flo@kdnp{32}\fi
  \flo@range\flo@kdsfa{0}{360}\flo@range\flo@kdsfb{0}{360}%
  \edef\flo@kdst{\flo@kget{septa}}\def\flo@kdgo{goniatitic}\def\flo@kdce{ceratitic}%
  \flo@kdseptaloop{#1}}
\def\flo@kdseptaloop#1{\flo@calc\flo@t{\flo@kdv{T#1}{0}+9}%
  \ifdim\flo@kdsth pt>\flo@t pt \flo@kdseptum{#1}\def\flo@kdnext{\flo@kdseptaloop{#1}}\else\let\flo@kdnext\relax\fi\flo@kdnext}
\def\flo@kdseptum#1{%
  \flo@kdvout\flo@kdsth{#1}\flo@kdrad\flo@kdsth{0}\flo@calc\flo@kdhw{\flo@kdro-(\flo@kdr)}\let\flo@kdrio\flo@kdr
  \flo@loop{kdsp}\flo@kdl{0}{\flo@kdnp}{%
    \flo@calc\flo@kdu{\the\flo@kdl/\flo@kdnp}\flo@calc\flo@kdbase{sin(900*\flo@kdu)}%
    \ifdim\flo@kdbase pt>0pt \flo@calc\flo@kdw{0.75*pow(\flo@kdbase,0.7)}\else\flo@calc\flo@kdw{-1.15*pow(abs(\flo@kdbase),1.3)}\fi
    \ifx\flo@kdst\flo@kdgo
      \ifdim\flo@kdbase pt>0pt\else\flo@calc\flo@kdw{-1.2*(1-acos(-(\flo@kdbase))/90)}\fi
    \else\ifx\flo@kdst\flo@kdce
      \ifdim\flo@kdbase pt<0pt \flo@calc\flo@kdw{\flo@kdw+0.25*sin(4500*\flo@kdu+\flo@kdsfa)*abs(\flo@kdbase)}\fi
    \else
      \flo@calc\flo@kdfr{0.3*sin(3600*\flo@kdu+\flo@kdsfa)}%
      \ifnum\flo@kdlod=0 \flo@calc\flo@kdfr{\flo@kdfr+0.14*sin(9900*\flo@kdu+\flo@kdsfb)}\fi
      \flo@calc\flo@kdw{\flo@kdw+\flo@kdfr*(0.35+0.65*abs(\flo@kdbase))}%
    \fi\fi
    \flo@calc\flo@kda{\flo@kdsth+0.16*\flo@kdhw*\flo@kdw/(\flo@kdrio+\flo@kdu*\flo@kdhw)*57.29578}%
    \flo@kdrad\flo@kda{0}\let\flo@kdri\flo@kdr\flo@kdvout\flo@kda{#1}%
    \flo@kdpt\flo@kda{\flo@kdri+\flo@kdu*(\flo@kdro-(\flo@kdri))}\flo@kdput{kdsp}{\the\numexpr\flo@kdl+1\relax}{\flo@kdpx}{\flo@kdpy}}%
  \flo@kdsetn{kdsp}{\flo@kdnp+1}%
  \flo@kdstroke{0.06}{0.4*\flo@kdpen}{0.55}{1}{\flo@kdcurve{kdsp}1}%
  \flo@range\flo@t{0.85}{1.15}\flo@calc\flo@kdsth{\flo@kdsth-30*\flo@t}}
% a nautilus's flame stripes across the older part of band #1, fading toward the mouth
\def\flo@kdflames#1{%
  \flo@range\flo@t{10}{15}\pgfmathtruncatemacro\flo@kdfn{floor(\flo@t)}%
  \flo@loop{kdfl}\flo@kdl{1}{\flo@kdfn}{%
    \flo@range\flo@t{0.3}{0.7}\flo@calc\flo@kdfth{\flo@kdv{T#1}{0}+223.2*(\the\flo@kdl-\flo@t)/\flo@kdfn}%
    \flo@calc\flo@kdfade{1-(\flo@kdfth-(\flo@kdv{T#1}{0}))/223.2}%
    \flo@loop{kdfp}\flo@kdq{0}{5}{%
      \flo@calc\flo@kdu{0.04+0.92*\the\flo@kdq/5}\flo@sym\flo@t{2.5}\flo@calc\flo@kda{\flo@kdfth+4*\flo@kdu+\flo@t}%
      \flo@kdrad\flo@kda{0}\let\flo@kdri\flo@kdr\flo@kdvout\flo@kda{0}%
      \flo@kdpt\flo@kda{\flo@kdri+\flo@kdu*(\flo@kdro-(\flo@kdri))}\flo@kdput{kdfl}{\the\numexpr\flo@kdq+1\relax}{\flo@kdpx}{\flo@kdpy}}%
    \flo@kdsetn{kdfl}{6}%
    \flo@kdrad\flo@kdfth{1}\flo@calc\flo@kdgap{\flo@kdr*(223.2/\flo@kdfn)*0.0174533}%
    \flo@range\flo@t{0.4}{0.65}\flo@calc\flo@kdfw{\flo@kdgap*\flo@t}%
    \flo@vtone{flo@kdc}{\flo@kdt-0.36}%
    \flo@kdstreak{kdfl}{0.1*\flo@kdgap}{\flo@kdfw}{flo@kdc}{(0.35+0.5*\flo@kget{contrast})*(0.3+0.7*\flo@kdfade)}}}
% worn through to the nacre on the last whorl (band 0): a copper patch out to a ragged edge,
% and a glint
\def\flo@kdnacre{%
  \flo@kdaccent1\edef\flo@kdsn{\flo@kdn{I0}}%
  \flo@range\flo@t{0.45}{0.6}\pgfmathtruncatemacro\flo@kdia{floor(\flo@kdsn*\flo@t)}%
  \flo@range\flo@t{0.35}{0.5}\flo@kdacross{I0}{O0}{\flo@t}{kdedge}%
  \flo@kdsetn{kdpatch}{2*\flo@kdia}%
  \flo@loop{kdna}\flo@kdl{1}{\flo@kdia}{%
    \flo@calc\flo@kdw{0.05*\flo@kdv{W0}{\the\flo@kdl}}%
    \flo@sym\flo@t{\flo@kdw}\flo@calc\flo@kdax{\flo@kdx{kdedge}{\the\flo@kdl}+\flo@t}%
    \flo@sym\flo@t{\flo@kdw}\flo@calc\flo@kday{\flo@kdy{kdedge}{\the\flo@kdl}+\flo@t}%
    \flo@kdput{kdpatch}{\the\flo@kdl}{\flo@kdax}{\flo@kday}}%
  \flo@loop{kdnb}\flo@kdl{1}{\flo@kdia}{\edef\flo@t{\the\numexpr\flo@kdia+1-\flo@kdl\relax}%
    \flo@kdput{kdpatch}{\the\numexpr\flo@kdia+\flo@kdl\relax}{\flo@kdx{I0}\flo@t}{\flo@kdy{I0}\flo@t}}%
  \flo@kdfill{\flo@kdt+0.18}{0.4}{0}{\flo@kdsmooth{kdpatch}}%
  \flo@kdacross{I0}{O0}{0.18}{kdedge}\flo@kdslice{kdedge}{2}{\flo@kdia-1}{kdsh}%
  \pgfmathtruncatemacro\flo@kdsi{floor(\flo@kdia/2)}%
  \flo@kdswell{kdsh}{0.08*\flo@kdv{W0}{\flo@kdsi}}{white}{0.45}%
  \flo@kdaccent0}
% a whorl's band #1: its wash, then in its clip the shading, the grain or mottle, the
% stripes, ribs and suture lines; too small, a flat wash
\def\flo@kdwhorl#1{%
  \ifnum\flo@kdacc=1 \flo@kdaccent1\else\ifnum\flo@kdnac=1 \ifnum#1>0 \flo@kdaccent1\else\flo@kdaccent0\fi\else\flo@kdaccent0\fi\fi
  \flo@sym\flo@t{0.03}\flo@calc\flo@kdtk{\flo@kdt+\flo@t}%
  \flo@calc\flo@kdbw{\flo@kdv{W#1}{\flo@kdn{O#1}}*\flo@kdcm}%
  \flo@kdbox{O#1}\let\flo@kdba\flo@kdbxa\let\flo@kdbb\flo@kdbxb\let\flo@kdbc\flo@kdbya\let\flo@kdbd\flo@kdbyb
  \def\flo@kddet{0}\ifnum\flo@kdlod<2 \ifdim\flo@kdbw pt>0.03pt \def\flo@kddet{1}\fi\fi
  \ifnum\flo@kddet=1
    \begin{pgfscope}\flo@kdbandpath{#1}\pgfusepath{clip}%
      \flo@kdfill{\flo@kdtk}{1}{0}{\flo@kdrect\flo@kdba\flo@kdbc\flo@kdbb\flo@kdbd}%
      \flo@kdshade{#1}%
      \ifnum\flo@kdlod=0 \ifdim\flo@kdbw pt>0.12pt
        \flo@calc\flo@kdms{0.12*(\flo@kdbb-(\flo@kdba))}%
        \ifnum\flo@kdmold=1 \flo@vmottle\flo@kdba\flo@kdbc\flo@kdbb\flo@kdbd{7}\flo@kdms{\flo@kdtk-0.14}{\flo@kdtk+0.18}{14}%
        \else\flo@vmottle\flo@kdba\flo@kdbc\flo@kdbb\flo@kdbd{4}\flo@kdms{\flo@kdtk-0.14}{\flo@kdtk+0.18}{4}\fi
      \fi\fi
      \edef\flo@t{\flo@kget{kind}}\def\flo@tmp{nautilus}%
      \ifx\flo@t\flo@tmp\ifnum#1=0 \flo@kdflames{#1}\else\ifdim\flo@kdbw pt>0.1pt \flo@kdflames{#1}\fi\fi\fi
      \ifnum\flo@kget{ribs}>0 \flo@kdribs{#1}\fi
      \ifnum\flo@kdmold=1 \ifnum\flo@kdlod=0 \ifdim\flo@kdbw pt>0.1pt \flo@kdsepta{#1}\fi\fi\fi
      \ifnum#1=0 \ifnum\flo@kdnac=1 \flo@kdnacre\fi\fi
    \end{pgfscope}%
  \else
    \flo@kdfill{\flo@kdtk}{1}{0}{\flo@kdbandpath{#1}}%
  \fi}
% a planispiral: an ammonite or a nautilus
\def\flo@kdplanispiral{%
  \edef\flo@kdPW{\flo@kget{expansion}}%
  \flo@calc\flo@kdPy{(1+\flo@kget{umbilicus})/(1-\flo@kget{umbilicus})}%
  \flo@chance{0.5}\ifflo@yes\def\flo@kdPs{1}\else\def\flo@kdPs{-1}\fi
  \flo@range\flo@kdPph{20}{80}%
  \ifnum\flo@kget{broken}=1 \flo@range\flo@t{40}{110}\flo@calc\flo@kdPtm{-\flo@t}\else\def\flo@kdPtm{0}\fi
  \flo@calc\flo@kdPtmin{\flo@kdPtm-360*\flo@kget{whorls}}%
  \pgfmathtruncatemacro\flo@kdJ{ceil(\flo@kget{whorls})}%
  \flo@loop{kdbs}\flo@kdk{0}{\flo@kdJ-1}{\expandafter\flo@kdband\expandafter{\the\flo@kdk}}%
  \flo@kdbox{O0}\flo@kdframe
  \edef\flo@kdpres{\flo@kget{preservation}}%
  \def\flo@tmp{mold}\ifx\flo@kdpres\flo@tmp\def\flo@kdmold{1}\else\def\flo@kdmold{0}\fi
  \def\flo@tmp{nacre}\ifx\flo@kdpres\flo@tmp\def\flo@kdnac{1}\else\def\flo@kdnac{0}\fi
  \flo@kdtone
  \ifnum\flo@kdmold=1 \flo@calc\flo@kdt{min(0.74,\flo@kdt+0.16)}\fi
  \def\flo@tmp{pyrite}\ifx\flo@kdpres\flo@tmp\def\flo@kdacc{1}\flo@calc\flo@kdt{\flo@kdt+0.04}\else\def\flo@kdacc{0}\fi
  \flo@range\flo@kdchamber{180}{260}%
  \flo@loop{kdwh}\flo@kdk{1}{\flo@kdJ}{%
    \edef\flo@kdbk{\the\numexpr\flo@kdJ-\flo@kdk\relax}\expandafter\flo@kdwhorl\expandafter{\flo@kdbk}}%
  \flo@kdaccent\flo@kdacc
  % the lines: each whorl's inner edge (the suture on the whorl before it), the last whorl's
  % outer edge, a keel inside it, and the mouth
  \flo@loop{kdln}\flo@kdk{1}{\flo@kdJ}{%
    \edef\flo@kdbk{\the\numexpr\flo@kdJ-\flo@kdk\relax}%
    \def\flo@t{0}\ifnum\flo@kdlod<2 \def\flo@t{1}\fi\ifnum\flo@kdbk<2 \def\flo@t{1}\fi
    \ifnum\flo@t=1 \ifnum\flo@kdbk=0 \def\flo@tmp{0.75}\else\def\flo@tmp{0.6}\fi
      \flo@kdstroke{0.06}{\flo@tmp*\flo@kdpen}{0.75}{1}{\flo@kdcurve{I\flo@kdbk}1}\fi}%
  \edef\flo@t{\flo@kget{keel}}\def\flo@tmp{none}%
  \ifx\flo@t\flo@tmp\else\ifnum\flo@kdlod<2
    \flo@kdacross{I0}{O0}{0.94}{kdkeel}\flo@kdstroke{0.08}{0.45*\flo@kdpen}{0.6}{1}{\flo@kdcurve{kdkeel}1}%
    \def\flo@tmp{grooved}\ifx\flo@t\flo@tmp
      \flo@kdacross{I0}{O0}{0.88}{kdkeel}\flo@kdstroke{0.06}{0.4*\flo@kdpen}{0.55}{1}{\flo@kdcurve{kdkeel}1}\fi
  \fi\fi
  \flo@kdstroke{0.05}{\flo@kdpen}{0.85}{1}{\flo@kdcurve{O0}1}%
  % the mouth across the tube at its last ring, bowed toward the mouth (a nautilus's back at
  % its outer edge), a pale lip behind it; a broken shell's edge jagged
  \edef\flo@kdkind{\flo@kget{kind}}\def\flo@kdnau{nautilus}\edef\flo@kdbroken{\flo@kget{broken}}%
  \flo@loop{kdmo}\flo@kdl{0}{6}{%
    \flo@calc\flo@kdu{\the\flo@kdl/6}\edef\flo@kda{\flo@kdPtm}%
    \ifnum\flo@kdbroken=1 \ifnum\flo@kdl>0 \ifnum\flo@kdl<6 \flo@sym\flo@t{5}\flo@calc\flo@kda{\flo@kda+\flo@t}\fi\fi
    \else\ifx\flo@kdkind\flo@kdnau\flo@calc\flo@kda{\flo@kda-9*\flo@kdu*\flo@kdu}%
    \else\flo@calc\flo@kda{\flo@kda+3.5*sin(180*\flo@kdu)}\fi\fi
    \flo@kdrad\flo@kda{0}\let\flo@kdri\flo@kdr\flo@kdrad\flo@kda{1}%
    \flo@kdpt\flo@kda{\flo@kdri+\flo@kdu*(\flo@kdr-(\flo@kdri))}\flo@kdput{kdmouth}{\the\numexpr\flo@kdl+1\relax}{\flo@kdpx}{\flo@kdpy}}%
  \flo@kdsetn{kdmouth}{7}%
  % the opening, seen a little from the front past the mouth's line
  \flo@kdrad\flo@kdPtm{1}\let\flo@kdrb@\flo@kdr\flo@kdrad\flo@kdPtm{0}\flo@calc\flo@kdhw{\flo@kdrb@-(\flo@kdr)}%
  \flo@calc\flo@kda{\flo@kdPph+\flo@kdPs*\flo@kdPtm}%
  \flo@calc\flo@kdmx{-sin(\flo@kda)*\flo@kdPs}\flo@calc\flo@kdmy{cos(\flo@kda)*\flo@kdPs}%
  \ifnum\flo@kdbroken=1 \def\flo@kdmk{0.05}\else\def\flo@kdmk{0.1}\fi
  \flo@loop{kdin}\flo@kdl{0}{6}{%
    \edef\flo@kdmi{\the\numexpr7-\flo@kdl\relax}\flo@calc\flo@kdu{(6-\the\flo@kdl)/6}%
    \flo@calc\flo@kdh{\flo@kdhw*\flo@kdmk*sin(180*\flo@kdu)*(0.35+0.65*\flo@kdu)}%
    \flo@calc\flo@kdax{\flo@kdx{kdmouth}\flo@kdmi+\flo@kdh*\flo@kdmx}\flo@calc\flo@kday{\flo@kdy{kdmouth}\flo@kdmi+\flo@kdh*\flo@kdmy}%
    \flo@kdput{kdinside}{\the\numexpr\flo@kdl+1\relax}{\flo@kdax}{\flo@kday}}%
  \flo@kdsetn{kdinside}{7}%
  \ifnum\flo@kdbroken=0 \flo@kdfill{0.16}{0.8}{0}{\flo@kdcurve{kdmouth}1\flo@kdcurve{kdinside}0\pgfpathclose}\fi
  \ifnum\flo@kdbroken=1
    \flo@kdstroke{0.05}{0.9*\flo@kdpen}{0.85}{1}{\flo@kdpoly{kdmouth}0}%
  \else
    \flo@kdstroke{0.05}{1.1*\flo@kdpen}{0.85}{1}{\flo@kdcurve{kdmouth}1}%
    \ifnum\flo@kdlod<2
      \flo@loop{kdlp}\flo@kdl{0}{6}{%
        \flo@calc\flo@kdu{\the\flo@kdl/6}%
        \ifx\flo@kdkind\flo@kdnau\flo@calc\flo@kda{\flo@kdPtm-2.5-9*\flo@kdu*\flo@kdu}\else\flo@calc\flo@kda{\flo@kdPtm-2.5+3.5*sin(180*\flo@kdu)}\fi
        \flo@kdrad\flo@kda{0}\let\flo@kdri\flo@kdr\flo@kdrad\flo@kda{1}%
        \flo@kdpt\flo@kda{\flo@kdri+\flo@kdu*(\flo@kdr-(\flo@kdri))}\flo@kdput{kdlip}{\the\numexpr\flo@kdl+1\relax}{\flo@kdpx}{\flo@kdpy}}%
      \flo@kdsetn{kdlip}{7}\flo@kdswell{kdlip}{0.025*\flo@kdhw}{white}{0.45}%
    \fi
  \fi
  % the center: the first whorl, or a nautilus's dark callus where it would be
  \ifx\flo@kdkind\flo@kdnau
    \flo@kdrad{\flo@kdPtm-360}{0.04}\let\flo@kdcr\flo@kdr
    \flo@vblob{0}{0}\flo@kdcr{0.9*\flo@kdcr}{0.2}{9}\flo@kdfill{0.1}{0.6}{1}{\flo@smoothpath}%
  \else
    \flo@kdrad\flo@kdPtmin{1}\let\flo@kdcr\flo@kdr
    \flo@kdfill{\flo@kdt-0.1}{1}{0}{\pgfpathcircle{\flo@P00}{\flo@kdcr pt}}%
  \fi}
% \pic {florilegium shell={...}}: sample the shell, reseed for the drawing (draw=, or the
% seed + 1), and draw it by its group (florilegium-shell.lua: M.draw)
\def\flo@shellpic#1{%
  \pgfkeys{/florilegium,#1}\flo@colors\flo@intof\flo@o@seed\flo@o@seed
  \edef\flo@tmp{\noexpand\florilegiumshell[{\flo@o@traits}]{\flo@o@seed}{\flo@o@role}}\flo@tmp
  \edef\flo@o@seed{\flo@kget{seed}}%
  \ifx\flo@o@draw\pgfutil@empty
    \edef\flo@o@draw{\the\numexpr\ifnum\flo@o@seed=2147483646 1\else\flo@o@seed+1\fi\relax}\fi
  \flo@drawseed\flo@o@draw
  \pgfmathsetlength\pgf@x{\flo@o@size}\edef\flo@sizept{\pgf@sys@tonumber\pgf@x}%
  \pgfsetroundcap\pgfsetroundjoin\def\flo@lift{0}\def\flo@rampname{flo@ramp}%
  \flo@calc\flo@kdacm{\flo@sizept/28.45276}%    the shell across on the page, in cm
  \edef\flo@t{\flo@kget{group}}\def\flo@tmp{planispiral}\def\flo@tmpb{bivalve}%
  \edef\flo@tmpc{\flo@kget{kind}}\def\flo@tmpd{cowrie}%
  \ifx\flo@t\flo@tmp\flo@kdplanispiral
  \else\ifx\flo@t\flo@tmpb\flo@kdbivalve
  \else\ifx\flo@tmpc\flo@tmpd\flo@kdcowrie
  \else\flo@kdgastropod\fi\fi\fi}

% ---------------------------------------------------------------- bivalves
% One valve from its outline, its beak up (florilegium-shell.lua: valve_shape): an ellipse
% and the beak joined by the two lines from the beak that just touch it. The beak is
% (\flo@kdVbx, \flo@kdVby), the ellipse's half-axes \flo@kdVa \flo@kdVb, the valve \flo@kdVH
% high; the margin between the touching points is list kdarc, its light \flo@kdV@VL@<i>.
% tobeak(p, t) into \flo@kdox \flo@kdoy: the point t of the way from the beak to p
\def\flo@kdtobeak#1#2#3{\flo@calc\flo@kdtt{#3}%
  \flo@calc\flo@kdox{\flo@kdVbx+\flo@kdtt*((#1)-(\flo@kdVbx))}\flo@calc\flo@kdoy{\flo@kdVby+\flo@kdtt*((#2)-(\flo@kdVby))}}
% shrink: list #3 is list #1 drawn #2 of the way toward the beak
\def\flo@kdshrink#1#2#3{\flo@calc\flo@kdst{#2}\flo@kdsetn{#3}{\flo@kdn{#1}}%
  \flo@loop{kdsk}\flo@kdm{1}{\flo@kdn{#1}}{%
    \flo@kdtobeak{\flo@kdx{#1}{\the\flo@kdm}}{\flo@kdy{#1}{\the\flo@kdm}}\flo@kdst
    \flo@kdput{#3}{\the\flo@kdm}{\flo@kdox}{\flo@kdoy}}}
% the lengths along list #1 into values #2 (lengths), the last into \flo@kdtotal
\def\flo@kdlengths#1#2{\flo@kdvset{#2}{1}{0}\def\flo@kdtotal{0}%
  \flo@loop{kdlg}\flo@kdm{2}{\flo@kdn{#1}}{%
    \edef\flo@ia{\the\numexpr\flo@kdm-1\relax}%
    \flo@calc\flo@kdtotal{\flo@kdtotal+veclen(\flo@kdx{#1}{\the\flo@kdm}-(\flo@kdx{#1}\flo@ia),\flo@kdy{#1}{\the\flo@kdm}-(\flo@kdy{#1}\flo@ia))}%
    \flo@kdvset{#2}{\the\flo@kdm}{\flo@kdtotal}}}
% along: the point #3 along list #1 (its lengths the values #2) into \flo@kdox \flo@kdoy
\def\flo@kdalong#1#2#3{\flo@calc\flo@kdad{#3}\def\flo@kddone{0}%
  \flo@loop{kdal}\flo@kdm{2}{\flo@kdn{#1}}{%
    \ifnum\flo@kddone=0
      \def\flo@kdhit{0}\ifdim\flo@kdv{#2}{\the\flo@kdm}pt<\flo@kdad pt\else\def\flo@kdhit{1}\fi
      \ifnum\flo@kdm=\flo@kdn{#1} \def\flo@kdhit{1}\fi
      \ifnum\flo@kdhit=1 \def\flo@kddone{1}%
        \edef\flo@ia{\the\numexpr\flo@kdm-1\relax}%
        \flo@calc\flo@kdaf{max(0,min(1,(\flo@kdad-(\flo@kdv{#2}\flo@ia))/max(0.00002,\flo@kdv{#2}{\the\flo@kdm}-(\flo@kdv{#2}\flo@ia))))}%
        \flo@calc\flo@kdox{\flo@kdx{#1}\flo@ia+\flo@kdaf*(\flo@kdx{#1}{\the\flo@kdm}-(\flo@kdx{#1}\flo@ia))}%
        \flo@calc\flo@kdoy{\flo@kdy{#1}\flo@ia+\flo@kdaf*(\flo@kdy{#1}{\the\flo@kdm}-(\flo@kdy{#1}\flo@ia))}%
      \fi
    \fi}}
% outward: the point (#1,#2) moved #3 away from the beak, into \flo@kdox \flo@kdoy
\def\flo@kdoutward#1#2#3{\flo@calc\flo@kddx{(#1)-(\flo@kdVbx)}\flo@calc\flo@kddy{(#2)-(\flo@kdVby)}%
  \flo@calc\flo@kdol{max(0.00002,veclen(\flo@kddx,\flo@kddy))}\flo@calc\flo@kdod{#3}%
  \flo@calc\flo@kdox{(#1)+\flo@kdod*\flo@kddx/\flo@kdol}\flo@calc\flo@kdoy{(#2)+\flo@kdod*\flo@kddy/\flo@kdol}}
% line: #3 + 1 points from (#4,#5) to (#6,#7) appended to list #1 after its point #2
\def\flo@kdline#1#2#3#4#5#6#7{\flo@loop{kdli}\flo@kdq{0}{#3}{%
    \flo@calc\flo@kdax{(#4)+((#6)-(#4))*\the\flo@kdq/(#3)}\flo@calc\flo@kday{(#5)+((#7)-(#5))*\the\flo@kdq/(#3)}%
    \flo@kdput{#1}{\the\numexpr#2+\flo@kdq+1\relax}{\flo@kdax}{\flo@kday}}}
% valve_outline: list #2 from the beak along list #1's margin and back
\def\flo@kdvalveoutline#1#2{%
  \ifnum\flo@kdVround=1 \def\flo@kdvk{2}\else\def\flo@kdvk{6}\fi
  \edef\flo@kdvn{\flo@kdn{#1}}%
  \edef\flo@kdva{\flo@kdx{#1}1}\edef\flo@kdvb{\flo@kdy{#1}1}%
  \flo@kdline{#2}{0}{\flo@kdvk}\flo@kdVbx\flo@kdVby\flo@kdva\flo@kdvb
  \flo@loop{kdvo}\flo@kdm{2}{\flo@kdvn-1}{%
    \flo@kdput{#2}{\the\numexpr\flo@kdvk+\flo@kdm\relax}{\flo@kdx{#1}{\the\flo@kdm}}{\flo@kdy{#1}{\the\flo@kdm}}}%
  \edef\flo@kdva{\flo@kdx{#1}\flo@kdvn}\edef\flo@kdvb{\flo@kdy{#1}\flo@kdvn}%
  \flo@kdline{#2}{\flo@kdvk+\flo@kdvn-1}{\flo@kdvk}\flo@kdva\flo@kdvb\flo@kdVbx\flo@kdVby
  \flo@kdsetn{#2}{2*\flo@kdvk+\flo@kdvn}}
% outlinepath: a point at the beak (a scallop's, a mussel's), or an umbo rounded through it
\def\flo@kdoutlinepath#1{\ifnum\flo@kdVround=1 \flo@kdslice{#1}{1}{\flo@kdn{#1}-1}{kdop}\flo@kdsmooth{kdop}%
  \else\flo@kdcurve{#1}1\pgfpathclose\fi}
% the valve's shape for its kind; #1 1 or -1, the side its front is on
\def\flo@kdvalveshape#1{%
  \edef\flo@kdH{\flo@kget{aspect}}\edef\flo@kdkind{\flo@kget{kind}}\def\flo@kdVa{0.5}%
  \def\flo@tmp{mussel}%
  \ifx\flo@kdkind\flo@tmp
    \flo@calc\flo@kdVb{\flo@kdH/2}\flo@calc\flo@kdVbx{-0.64+\flo@kget{beak}}\flo@calc\flo@kdVby{-0.7*\flo@kdVb}%
  \else
    \def\flo@tmp{scallop}\def\flo@tmpb{oyster}\def\flo@tmpc{clam}\def\flo@tmpd{cockle}%
    \ifx\flo@kdkind\flo@tmp\flo@calc\flo@kdu{0.2*\flo@kdH}\else\ifx\flo@kdkind\flo@tmpb\def\flo@kdu{0.12}\else
      \ifx\flo@kdkind\flo@tmpc\def\flo@kdu{0.06}\else\def\flo@kdu{0.035}\fi\fi\fi
    \ifx\flo@kdkind\flo@tmp\def\flo@kdlean{0}\else\ifx\flo@kdkind\flo@tmpd\def\flo@kdlean{0.6}\else\def\flo@kdlean{0.9}\fi\fi
    \flo@calc\flo@kdVb{(\flo@kdH-\flo@kdu)/2}%
    \flo@calc\flo@kdVbx{(\flo@kget{beak}-0.5)*\flo@kdlean}\flo@calc\flo@kdVby{\flo@kdVb+\flo@kdu}%
  \fi
  \flo@calc\flo@kdVbx{\flo@kdVbx*(#1)}\flo@calc\flo@kdVH{max(\flo@kdH,2*\flo@kdVb)}%
  \flo@calc\flo@kduu{\flo@kdVbx/\flo@kdVa}\flo@calc\flo@kdvv{\flo@kdVby/\flo@kdVb}%
  \flo@calc\flo@kdph{atan2(\flo@kdvv,\flo@kduu)}\flo@calc\flo@kdde{acos(1/sqrt(\flo@kduu*\flo@kduu+\flo@kdvv*\flo@kdvv))}%
  \flo@calc\flo@kdta{\flo@kdph+\flo@kdde}\flo@calc\flo@kdtb{\flo@kdph-\flo@kdde+360}%
  \pgfmathtruncatemacro\flo@kdvn{ceil((\flo@kdtb-\flo@kdta)/4)}%
  % an oyster's edge is lumpy and ragged
  \flo@range\flo@kdpa{0}{360}\flo@range\flo@kdpb{0}{360}\flo@range\flo@kdpc{0}{360}\flo@range\flo@kdpd{0}{360}%
  \def\flo@tmp{oyster}%
  \flo@loop{kdvs}\flo@kdm{0}{\flo@kdvn}{%
    \flo@calc\flo@kdth{\flo@kdta+(\flo@kdtb-\flo@kdta)*(\the\flo@kdm/\flo@kdvn)}%   (in pgfmath's range)
    \flo@calc\flo@kdax{\flo@kdVa*cos(\flo@kdth)}\flo@calc\flo@kday{\flo@kdVb*sin(\flo@kdth)}%
    \ifx\flo@kdkind\flo@tmp
      \flo@calc\flo@kdok{1+0.06*sin(3*\flo@kdth+\flo@kdpa)+0.04*sin(5*\flo@kdth+\flo@kdpb)+0.02*sin(11*\flo@kdth+\flo@kdpc)+0.012*sin(23*\flo@kdth+\flo@kdpd)}%
      \flo@calc\flo@kdax{\flo@kdax*\flo@kdok}\flo@calc\flo@kday{\flo@kday*\flo@kdok}%
    \fi
    \flo@kdput{kdarc}{\the\numexpr\flo@kdm+1\relax}{\flo@kdax}{\flo@kday}%
    \flo@calc\flo@t{cos(atan2(sin(\flo@kdth)/\flo@kdVb,cos(\flo@kdth)/\flo@kdVa)-135)}\flo@kdvset{VL}{\the\numexpr\flo@kdm+1\relax}{\flo@t}}%
  \flo@kdsetn{kdarc}{\flo@kdvn+1}%
  \def\flo@kdVround{1}\def\flo@tmp{scallop}\def\flo@tmpb{mussel}%
  \ifx\flo@kdkind\flo@tmp\def\flo@kdVround{0}\fi\ifx\flo@kdkind\flo@tmpb\def\flo@kdVround{0}\fi}
% a scallop's ears: flat wings on the straight hinge either side of the beak, the front one
% the larger when they are unequal, with the notch for the byssus under it; side #2, lists
% kdear<side> (side a or b), their size \flo@kdV@e@<side>
\def\flo@kdear#1#2{%
  \edef\flo@t{\flo@kget{ears}}\def\flo@tmp{unequal}%
  \ifx\flo@t\flo@tmp\def\flo@kdfront{0.3}\def\flo@kdback{0.2}\def\flo@kdunq{1}\else\def\flo@kdfront{0.25}\def\flo@kdback{0.25}\def\flo@kdunq{0}\fi
  \ifnum#2=\numexpr-\flo@kdmm\relax\let\flo@kde\flo@kdfront\else\let\flo@kde\flo@kdback\fi
  \flo@kdvset{e}{#1}{\flo@kde}\flo@kdvset{side}{#1}{#2}%
  \ifnum#2<0 \def\flo@kdti{1}\else\edef\flo@kdti{\flo@kdn{kdarc}}\fi
  \flo@calc\flo@t{(\flo@kdx{kdarc}\flo@kdti-(\flo@kdVbx))*(#2)}%
  \ifdim\flo@t pt<0pt \ifnum#2<0 \edef\flo@kdti{\flo@kdn{kdarc}}\else\def\flo@kdti{1}\fi\fi
  \edef\flo@kdtx{\flo@kdx{kdarc}\flo@kdti}\edef\flo@kdty{\flo@kdy{kdarc}\flo@kdti}%
  \flo@calc\flo@kdf{min(0.9,0.17*\flo@kdVH/max(0.00002,\flo@kdVby-(\flo@kdty)))}%
  \flo@kdput{kdear#1}{1}{\flo@kdVbx}{\flo@kdVby}%
  \flo@calc\flo@kdax{\flo@kdVbx+(#2)*\flo@kde}\flo@calc\flo@kday{\flo@kdVby+0.01*\flo@kdVH}\flo@kdput{kdear#1}{2}{\flo@kdax}{\flo@kday}%
  \flo@calc\flo@kdax{\flo@kdVbx+(#2)*\flo@kde*0.9}\flo@calc\flo@kday{\flo@kdVby-0.1*\flo@kdVH}\flo@kdput{kdear#1}{3}{\flo@kdax}{\flo@kday}%
  \def\flo@kdne{3}%
  \ifnum\flo@kdunq=1 \ifnum#2=\numexpr-\flo@kdmm\relax
    \flo@calc\flo@kdax{\flo@kdVbx+(#2)*\flo@kde*0.62}\flo@calc\flo@kday{\flo@kdVby-0.075*\flo@kdVH}\flo@kdput{kdear#1}{4}{\flo@kdax}{\flo@kday}%
    \flo@calc\flo@kdax{\flo@kdVbx+(#2)*\flo@kde*0.5}\flo@calc\flo@kday{\flo@kdVby-0.11*\flo@kdVH}\flo@kdput{kdear#1}{5}{\flo@kdax}{\flo@kday}%
    \def\flo@kdne{5}\fi\fi
  \flo@calc\flo@kdax{\flo@kdVbx+\flo@kdf*(\flo@kdtx-(\flo@kdVbx))}\flo@calc\flo@kday{\flo@kdVby+\flo@kdf*(\flo@kdty-(\flo@kdVby))}%
  \flo@kdput{kdear#1}{\the\numexpr\flo@kdne+1\relax}{\flo@kdax}{\flo@kday}\flo@kdsetn{kdear#1}{\flo@kdne+1}}
% an ear (list kdear#1) drawn behind the valve: its wash, the hinge's lines and the ribs
% fanning on it, its outline
\def\flo@kdeardraw#1{%
  \edef\flo@kde{\flo@kdv{e}{#1}}\edef\flo@kdside{\flo@kdv{side}{#1}}%
  \flo@sym\flo@t{0.02}\flo@kdfill{\flo@kdt+\flo@t}{1}{0}{\flo@kdpoly{kdear#1}1}%
  \ifnum\flo@kdlod<2
    \begin{pgfscope}\flo@kdpoly{kdear#1}1\pgfusepath{clip}%
      \flo@loop{kdeh}\flo@kdq{1}{2}{%
        \flo@calc\flo@kday{\flo@kdVby-0.045*\flo@kdVH*\the\flo@kdq}\flo@calc\flo@kdax{\flo@kdVbx+\flo@kdside*\flo@kde*1.1}%
        \flo@kdstroke{0.08}{0.3*\flo@kdpen}{0.28}{1}{\pgfpathmoveto{\flo@P\flo@kdVbx\flo@kday}\pgfpathlineto{\flo@P\flo@kdax\flo@kday}}}%
      \ifnum\flo@kdlod=0
        \flo@calc\flo@kday{\flo@kdVby-0.14*\flo@kdVH}%
        \flo@loop{kder}\flo@kdq{1}{4}{%
          \flo@calc\flo@kdax{\flo@kdVbx+\flo@kdside*\flo@kde*\the\flo@kdq/4.5}%
          \flo@kdstroke{0.1}{0.3*\flo@kdpen}{0.25}{1}{\pgfpathmoveto{\flo@P\flo@kdVbx\flo@kdVby}\pgfpathlineto{\flo@P\flo@kdax\flo@kday}}}%
      \fi
    \end{pgfscope}%
  \fi
  \flo@kdstroke{0.05}{0.8*\flo@kdpen}{0.85}{1}{\flo@kdpoly{kdear#1}1}}
% the valve's pattern, outside: concentric bands, rays from the beak, zigzag lines, or spots
\def\flo@kdpattern{%
  \edef\flo@t{\flo@kget{pattern}}\edef\flo@kdct{\flo@kget{contrast}}%
  \def\flo@tmp{bands}\def\flo@tmpb{rays}\def\flo@tmpc{zigzags}%
  \ifx\flo@t\flo@tmp
    \flo@range\flo@t{2}{4.99}\pgfmathtruncatemacro\flo@kdnb{floor(\flo@t)}%
    \flo@loop{kdpb}\flo@kdl{1}{\flo@kdnb}{%
      \flo@calc\flo@kdpta{0.3+0.65*(\the\flo@kdl-0.5)/\flo@kdnb}\flo@range\flo@t{0.04}{0.09}\flo@calc\flo@kdptb{\flo@kdpta+\flo@t}%
      \flo@kdshrink{kdmarc}{min(1,\flo@kdptb)}{kdsa}\flo@kdshrink{kdmarc}{\flo@kdpta}{kdsb}\flo@kdrev{kdsb}{kdsc}%
      \flo@kdfill{\flo@kdt-0.22}{0.3+0.35*\flo@kdct}{0}{\flo@kdcurve{kdsa}1\flo@kdcurve{kdsc}0\pgfpathclose}}%
  \else\ifx\flo@t\flo@tmpb
    \flo@range\flo@t{3}{6.99}\pgfmathtruncatemacro\flo@kdnb{floor(\flo@t)}%
    \flo@loop{kdpr}\flo@kdl{1}{\flo@kdnb}{%
      \flo@range\flo@t{0.75}{0.95}\flo@calc\flo@kdda{\flo@kdtotal*(\the\flo@kdl-\flo@t)/\flo@kdnb}%
      \flo@range\flo@t{0.05}{0.1}\flo@calc\flo@kddb{\flo@kdda+\flo@kdtotal*\flo@t}%
      \flo@kdput{kdray}{1}{\flo@kdVbx}{\flo@kdVby}%
      \flo@loop{kdpq}\flo@kdq{0}{4}{%
        \flo@kdalong{kdmarc}{acc}{\flo@kdda+(\flo@kddb-\flo@kdda)*\the\flo@kdq/4}%
        \flo@kdput{kdray}{\the\numexpr\flo@kdq+2\relax}{\flo@kdox}{\flo@kdoy}}%
      \flo@kdsetn{kdray}{6}%
      \flo@kdfill{\flo@kdt-0.2}{0.2+0.3*\flo@kdct}{1}{\flo@kdpoly{kdray}1}}%
  \else\ifx\flo@t\flo@tmpc
    \flo@loop{kdpz}\flo@kdl{1}{4}{%
      \flo@calc\flo@kdtj{0.35+0.6*\the\flo@kdl/4.5}\def\flo@kdzn{0}%
      \flo@loop{kdpy}\flo@kdq{1}{\flo@kdn{kdmarc}}{%
        \ifodd\flo@kdq
          \ifodd\numexpr(\flo@kdq-1)/2\relax\def\flo@t{-0.035}\else\def\flo@t{0.035}\fi
          \flo@kdtobeak{\flo@kdx{kdmarc}{\the\flo@kdq}}{\flo@kdy{kdmarc}{\the\flo@kdq}}{\flo@kdtj+\flo@t}%
          \edef\flo@kdzn{\the\numexpr\flo@kdzn+1\relax}\flo@kdput{kdzig}{\flo@kdzn}{\flo@kdox}{\flo@kdoy}%
        \fi}%
      \flo@kdsetn{kdzig}{\flo@kdzn}%
      \flo@kdstroke{\flo@kdt-0.26}{0.6*\flo@kdpen}{0.3+0.4*\flo@kdct}{1}{\flo@kdpoly{kdzig}0}}%
  \else
    \flo@range\flo@t{14}{30}\pgfmathtruncatemacro\flo@kdnb{floor(\flo@t)}%
    \flo@loop{kdpd}\flo@kdl{1}{\flo@kdnb}{%
      \flo@range\flo@t{0}{\flo@kdtotal}\flo@kdalong{kdmarc}{acc}{\flo@t}%
      \let\flo@kdpx\flo@kdox\let\flo@kdpy\flo@kdoy
      \flo@range\flo@t{0.3}{0.95}\flo@kdtobeak\flo@kdpx\flo@kdpy\flo@t
      \flo@range\flo@t{0.018}{0.035}\flo@calc\flo@kdr{\flo@kdVH*\flo@t}%
      \flo@vblob\flo@kdox\flo@kdoy\flo@kdr{\flo@kdr*0.8}{0.25}{7}%
      \flo@kdfill{\flo@kdt-0.24}{0.35+0.4*\flo@kdct}{1}{\flo@smoothpath}}%
  \fi\fi\fi}
% a bivalve: a scallop, a cockle, a mussel, a clam or an oyster
\def\flo@kdbivalve{%
  \flo@chance{0.5}\ifflo@yes\def\flo@kdmm{1}\else\def\flo@kdmm{-1}\fi
  \flo@kdvalveshape\flo@kdmm
  \edef\flo@kdribn{\flo@kget{ribs}}%
  \flo@kdlengths{kdarc}{acc}%
  \ifnum\flo@kdribn>0 \flo@calc\flo@kdgap{\flo@kdtotal/\flo@kdribn}\else\def\flo@kdgap{0}\fi
  \def\flo@tmp{scallop}\ifx\flo@kdkind\flo@tmp\def\flo@kdsk{0.1}\def\flo@kdscal{1}\else\def\flo@kdsk{0.08}\def\flo@kdscal{0}\fi
  \ifnum\flo@kdribn>0
    \flo@kdsetn{kdmarc}{\flo@kdn{kdarc}}%
    \flo@loop{kdmr}\flo@kdl{1}{\flo@kdn{kdarc}}{%
      \flo@calc\flo@t{cos(360*(\flo@kdv{acc}{\the\flo@kdl}-0.5*\flo@kdgap)/\flo@kdgap)}%
      \flo@kdoutward{\flo@kdx{kdarc}{\the\flo@kdl}}{\flo@kdy{kdarc}{\the\flo@kdl}}{\flo@kdsk*\flo@kdgap*\flo@t}%
      \flo@kdput{kdmarc}{\the\flo@kdl}{\flo@kdox}{\flo@kdoy}}%
  \else\flo@kdslice{kdarc}{1}{\flo@kdn{kdarc}}{kdmarc}\fi
  \flo@kdvalveoutline{kdmarc}{kdoutline}%
  \flo@kdbox{kdoutline}%
  \ifnum\flo@kdscal=1 \flo@kdear{a}{-1}\flo@kdear{b}{1}\flo@kdboxadd{kdeara}\flo@kdboxadd{kdearb}\fi
  \let\flo@kdfxa\flo@kdbxa\let\flo@kdfxb\flo@kdbxb\let\flo@kdfya\flo@kdbya\let\flo@kdfyb\flo@kdbyb
  \flo@kdframe
  \edef\flo@t{\flo@kget{view}}\def\flo@tmpb{inside}\ifx\flo@t\flo@tmpb\def\flo@kdin{1}\else\def\flo@kdin{0}\fi
  \flo@kdtone\ifnum\flo@kdin=1 \flo@calc\flo@kdt{min(0.8,\flo@kdt+0.26)}\fi
  \def\flo@kdshowribs{0}%
  \ifnum\flo@kdribn>0 \ifnum\flo@kdlod<2 \flo@calc\flo@t{\flo@kdgap*\flo@kdcm}\ifdim\flo@t pt>0.05pt \def\flo@kdshowribs{1}\fi\fi\fi
  % the ears, behind the valve
  \ifnum\flo@kdscal=1 \flo@kdeardraw{a}\flo@kdeardraw{b}\fi
  % the valve: its wash, then in its clip the light, the grain, the pattern, the ribs or
  % ridges, the growth lines; inside up, the pale nacre or porcelain, the rim, the scars
  \def\flo@kdnac{0}\ifnum\flo@kdin=1 \def\flo@tmpc{oyster}\def\flo@tmpd{mussel}%
    \ifx\flo@kdkind\flo@tmpc\def\flo@kdnac{1}\fi\ifx\flo@kdkind\flo@tmpd\def\flo@kdnac{1}\fi\fi
  \begin{pgfscope}\flo@kdoutlinepath{kdoutline}\pgfusepath{clip}%
    \flo@kdfill{\flo@kdt}{1}{0}{\flo@kdrect\flo@kdfxa\flo@kdfya\flo@kdfxb\flo@kdfyb}%
    \edef\flo@kdvn{\flo@kdn{kdmarc}}%
    \def\flo@tmpc{oyster}\ifx\flo@kdkind\flo@tmpc\flo@kdlayers\fi
    \ifnum\flo@kdnac=1
      \flo@kdaccent1\flo@kdshrink{kdmarc}{0.86}{kdsa}\flo@kdvalveoutline{kdsa}{kdsb}%
      \flo@kdfill{\flo@kdt+0.1}{0.6}{0}{\flo@kdoutlinepath{kdsb}}\flo@kdaccent0%
    \fi
    \ifnum\flo@kdlod<2 \flo@kdvalvedetail\fi
  \end{pgfscope}%
  % the outline, and the beak's tip
  \flo@kdstroke{0.05}{\flo@kdpen}{0.85}{1}{\flo@kdoutlinepath{kdoutline}}%
  \def\flo@tmpd{mussel}%
  \ifnum\flo@kdlod<2 \ifx\flo@kdkind\flo@tmpd\else
    \flo@calc\flo@kdr{0.035*\flo@kdVH}%
    \flo@calc\flo@kdxa{\flo@kdVbx-\flo@kdmm*\flo@kdr}\flo@calc\flo@kdya{\flo@kdVby-0.6*\flo@kdr}%
    \flo@calc\flo@kdxb{\flo@kdVbx-\flo@kdmm*0.3*\flo@kdr}\flo@calc\flo@kdyb{\flo@kdVby+0.4*\flo@kdr}%
    \flo@calc\flo@kdxc{\flo@kdVbx+\flo@kdmm*0.5*\flo@kdr}\flo@calc\flo@kdyc{\flo@kdVby+0.3*\flo@kdr}%
    \flo@kdstroke{0.05}{0.7*\flo@kdpen}{0.7}{1}{\pgfpathmoveto{\flo@P\flo@kdxa\flo@kdya}%
      \pgfpathcurveto{\flo@P\flo@kdxb\flo@kdyb}{\flo@P\flo@kdxc\flo@kdyc}{\flo@P\flo@kdVbx\flo@kdVby}}%
  \fi\fi}
% an oyster's layers, stacked toward the beak, each edge ragged
\def\flo@kdlayers{%
  \edef\flo@kdnl{\flo@kget{ridges}}%
  \flo@loop{kdly}\flo@kdl{1}{\flo@kdnl}{%
    \flo@calc\flo@kdtj{1-0.62*\the\flo@kdl/(\flo@kdnl+1)}%
    \flo@kdshrink{kdmarc}{\flo@kdtj}{kdsa}%
    \flo@kdsetn{kdsb}{\flo@kdn{kdsa}}%
    \flo@loop{kdlz}\flo@kdq{1}{\flo@kdn{kdsa}}{%
      \flo@sym\flo@t{0.012*\flo@kdVH}\flo@calc\flo@kdax{\flo@kdx{kdsa}{\the\flo@kdq}+\flo@t}%
      \flo@sym\flo@t{0.012*\flo@kdVH}\flo@calc\flo@kday{\flo@kdy{kdsa}{\the\flo@kdq}+\flo@t}%
      \flo@kdput{kdsb}{\the\flo@kdq}{\flo@kdax}{\flo@kday}}%
    \flo@kdvalveoutline{kdsb}{kdsc}%
    \ifodd\flo@kdl\def\flo@t{-0.03}\else\def\flo@t{0.05}\fi
    \flo@kdfill{\flo@kdt+\flo@t}{0.5}{0}{\flo@kdoutlinepath{kdsc}}%
    \ifnum\flo@kdlod<2 \flo@kdstroke{0.08}{0.4*\flo@kdpen}{0.5}{1}{\flo@kdcurve{kdsb}1}\fi}}
% the valve's shading, grain, pattern, ribs, ridges and growth lines, and inside, the rim,
% the pallial line, the muscle scars and the hinge (levels of detail 0 and 1)
\def\flo@kdvalvedetail{%
  % the dome: shadow along the margin toward the lower right (inside: the upper left)
  \ifnum\flo@kdin=1
    \flo@kdrun{\flo@kdvn}{\ifdim\flo@kdv{VL}{\flo@kdri}pt>0.2pt \flo@kdoktrue\else\flo@kdokfalse\fi}%
  \else
    \flo@kdrun{\flo@kdvn}{\ifdim\flo@kdv{VL}{\flo@kdri}pt<-0.2pt \flo@kdoktrue\else\flo@kdokfalse\fi}%
  \fi
  \ifnum\flo@kdra>0 \ifnum\numexpr\flo@kdrb-\flo@kdra\relax>2
    \ifnum\flo@kdin=1 \flo@calc\flo@kdw{\flo@kdVH*0.14}\def\flo@kdop{0.28}%
    \else\flo@calc\flo@kdw{\flo@kdVH*(0.08+0.18*\flo@kget{inflation})}\flo@calc\flo@kdop{0.18+0.3*\flo@kget{inflation}}\fi
    \flo@kdslice{kdmarc}{\flo@kdra}{\flo@kdrb}{kdsh}%
    \flo@vtone{flo@kdc}{0.08}\flo@kdstreak{kdsh}{0.4*\flo@kdw}{\flo@kdw}{flo@kdc}{\flo@kdop}%
  \fi\fi
  % where the margin faces the light most (inside: least), toward the beak
  \def\flo@kdli{1}%
  \flo@loop{kdlt}\flo@kdq{2}{\flo@kdvn}{%
    \ifnum\flo@kdin=1
      \ifdim\flo@kdv{VL}{\the\flo@kdq}pt<\flo@kdv{VL}{\flo@kdli}pt \edef\flo@kdli{\the\flo@kdq}\fi
    \else
      \ifdim\flo@kdv{VL}{\the\flo@kdq}pt>\flo@kdv{VL}{\flo@kdli}pt \edef\flo@kdli{\the\flo@kdq}\fi
    \fi}%
  \edef\flo@kdlx{\flo@kdx{kdarc}\flo@kdli}\edef\flo@kdly{\flo@kdy{kdarc}\flo@kdli}%
  \flo@loop{kdhl}\flo@kdq{0}{4}{\flo@kdtobeak\flo@kdlx\flo@kdly{0.18+0.5*\the\flo@kdq/4}%
    \flo@kdput{kdhl}{\the\numexpr\flo@kdq+1\relax}{\flo@kdox}{\flo@kdoy}}\flo@kdsetn{kdhl}{5}%
  \ifnum\flo@kdin=1 \def\flo@t{0.35}\else\def\flo@t{0.42}\fi
  \flo@kdswell{kdhl}{0.1*\flo@kdVH}{white}{\flo@t}%
  \ifnum\flo@kdin=1
    \flo@loop{kddp}\flo@kdq{0}{3}{\flo@kdtobeak{0}{0}{0.05+0.4*\the\flo@kdq/3}%
      \flo@kdput{kddeep}{\the\numexpr\flo@kdq+1\relax}{\flo@kdox}{\flo@kdoy}}\flo@kdsetn{kddeep}{4}%
    \flo@vtone{flo@kdd}{0.1}\flo@kdswell{kddeep}{0.1*\flo@kdVH}{flo@kdd}{0.14}%
  \fi
  \ifnum\flo@kdlod=0
    \flo@calc\flo@kdms{0.12*\flo@kdVH}%
    \flo@vmottle\flo@kdfxa\flo@kdfya\flo@kdfxb\flo@kdfyb{5}\flo@kdms{\flo@kdt-0.14}{\flo@kdt+0.18}{4}%
  \fi
  \ifnum\flo@kdin=0 \edef\flo@t{\flo@kget{pattern}}\def\flo@tmp{none}\ifx\flo@t\flo@tmp\else\flo@kdpattern\fi\fi
  % ribs: a groove between each two, from the beak to a trough of the margin, a light crest
  % along each; inside, the grooves show faintly
  \ifnum\flo@kdshowribs=1
    \flo@loop{kdrv}\flo@kdl{1}{\flo@kdribn}{%
      \flo@kdalong{kdarc}{acc}{(\the\flo@kdl-0.5)*\flo@kdgap}\let\flo@kdpx\flo@kdox\let\flo@kdpy\flo@kdoy
      \ifnum\flo@kdl<\flo@kdribn
        \flo@kdalong{kdarc}{acc}{\the\flo@kdl*\flo@kdgap}%
        \flo@kdoutward\flo@kdox\flo@kdoy{-\flo@kdsk*\flo@kdgap}\let\flo@kdqx\flo@kdox\let\flo@kdqy\flo@kdoy
        \flo@kdtobeak\flo@kdqx\flo@kdqy{0.06}\flo@kdput{kdg}{1}{\flo@kdox}{\flo@kdoy}%
        \flo@kdtobeak\flo@kdqx\flo@kdqy{0.37}\flo@kdput{kdg}{2}{\flo@kdox}{\flo@kdoy}%
        \flo@kdtobeak\flo@kdqx\flo@kdqy{0.68}\flo@kdput{kdg}{3}{\flo@kdox}{\flo@kdoy}%
        \flo@kdput{kdg}{4}{\flo@kdqx}{\flo@kdqy}\flo@kdsetn{kdg}{4}%
        \ifnum\flo@kdin=1 \def\flo@t{0.15}\else\def\flo@t{0.36}\fi
        \flo@vtone{flo@kdc}{\flo@kdt-0.2}\flo@kdtaper{kdg}{0.02*\flo@kdgap}{0.34*\flo@kdgap}{flo@kdc}{\flo@t}%
      \fi
      \ifnum\flo@kdlod=0 \ifnum\flo@kdin=0
        \flo@loop{kdcr}\flo@kdq{0}{4}{\flo@kdtobeak\flo@kdpx\flo@kdpy{0.15+0.8*\the\flo@kdq/4}%
          \flo@kdput{kdcrest}{\the\numexpr\flo@kdq+1\relax}{\flo@kdox}{\flo@kdoy}}\flo@kdsetn{kdcrest}{5}%
        \flo@kdswell{kdcrest}{0.16*\flo@kdgap}{white}{0.32}%
      \fi\fi}%
  \fi
  % concentric ridges (a clam's), closer together toward the margin; growth lines elsewhere
  \edef\flo@t{\flo@kget{sculpture}}\def\flo@tmp{ridges}%
  \ifx\flo@t\flo@tmp
    \edef\flo@kdnl{\flo@kget{ridges}}%
    \flo@loop{kdrd}\flo@kdl{1}{\flo@kdnl}{%
      \flo@calc\flo@kdtj{0.22+0.76*pow(\the\flo@kdl/(\flo@kdnl+0.6),0.8)}%
      \flo@kdshrink{kdmarc}{\flo@kdtj}{kdsa}\flo@kdstroke{\flo@kdt-0.2}{0.45*\flo@kdpen}{0.42}{1}{\flo@kdcurve{kdsa}1}%
      \ifnum\flo@kdlod=0 \flo@kdshrink{kdmarc}{\flo@kdtj+0.012}{kdsa}\flo@kdwstroke{0.4*\flo@kdpen}{0.4}{\flo@kdcurve{kdsa}1}\fi}%
  \else\ifnum\flo@kdlod=0 \def\flo@tmpc{oyster}\ifx\flo@kdkind\flo@tmpc\else
    \ifdim\flo@kdt pt<0.32pt \def\flo@kdlit{1}\else\def\flo@kdlit{0}\fi
    \flo@kdgrowth{0.94}\flo@kdgrowth{0.87}\flo@kdgrowth{0.78}\flo@kdgrowth{0.66}%
  \fi\fi\fi
  \ifnum\flo@kdin=1 \flo@kdinside\fi}
% a growth line at #1 of the way out from the beak, a little uneven
\def\flo@kdgrowth#1{\flo@sym\flo@t{0.015}\flo@kdshrink{kdmarc}{#1+\flo@t}{kdsa}%
  \ifnum\flo@kdlit=1 \flo@kdwstroke{0.3*\flo@kdpen}{0.22}{\flo@kdcurve{kdsa}1}%
  \else\flo@kdstroke{\flo@kdt-0.15}{0.3*\flo@kdpen}{0.25}{1}{\flo@kdcurve{kdsa}1}\fi}
% a valve lying open: the rim, the pallial line, the muscle scars, the hinge's teeth, a glint
% of nacre
\def\flo@kdinside{%
  \flo@vtone{flo@kdd}{\flo@kdt-0.12}\flo@kdstreak{kdmarc}{0.03*\flo@kdVH}{0.03*\flo@kdVH}{flo@kdd}{0.45}%
  \def\flo@tmp{scallop}\def\flo@tmpb{oyster}\def\flo@tmpc{mussel}%
  \ifx\flo@kdkind\flo@tmp\else\ifx\flo@kdkind\flo@tmpb\else
    \flo@kdshrink{kdmarc}{0.8}{kdsa}\flo@kdstroke{0.1}{0.45*\flo@kdpen}{0.35}{1}{\flo@kdcurve{kdsa}1}\fi\fi
  \ifx\flo@kdkind\flo@tmp\flo@kdscar{0.12*\flo@kdmm}{-0.05}{0.11}%
  \else\ifx\flo@kdkind\flo@tmpb\flo@kdscar{0.12*\flo@kdmm}{-0.05}{0.11}%
  \else\ifx\flo@kdkind\flo@tmpc\flo@kdscar{0.22*\flo@kdmm}{0.04*\flo@kdVH}{0.1}\flo@kdscar{-0.38*\flo@kdmm}{-0.1*\flo@kdVH}{0.04}%
  \else\flo@kdscar{-0.3*\flo@kdmm}{0.25*\flo@kdVH}{0.07}\flo@kdscar{0.3*\flo@kdmm}{0.25*\flo@kdVH}{0.08}\fi\fi\fi
  \ifnum\flo@kdlod=0 \ifx\flo@kdkind\flo@tmpb\else
    \flo@kdtooth{-2}\flo@kdtooth{-1}\flo@kdtooth{1}\flo@kdtooth{2}\fi\fi
  \ifnum\flo@kdnac=1 \ifnum\flo@kdlod=0
    \flo@kdaccent1\flo@kdalong{kdarc}{acc}{\flo@kdtotal*0.6}\let\flo@kdpx\flo@kdox\let\flo@kdpy\flo@kdoy
    \flo@loop{kdgl}\flo@kdq{0}{4}{\flo@kdtobeak\flo@kdpx\flo@kdpy{0.3+0.4*\the\flo@kdq/4}%
      \flo@kdput{kdglint}{\the\numexpr\flo@kdq+1\relax}{\flo@kdox}{\flo@kdoy}}\flo@kdsetn{kdglint}{5}%
    \flo@kdswell{kdglint}{0.06*\flo@kdVH}{white}{0.5}\flo@kdaccent0%
  \fi\fi}
\def\flo@kdscar#1#2#3{\flo@calc\flo@kdscx{#1}\flo@calc\flo@kdscy{#2}\flo@calc\flo@kdr{0.8*(#3)*\flo@kdVH}%
  \flo@vblob\flo@kdscx\flo@kdscy\flo@kdr{0.75*\flo@kdr}{0.25}{7}\flo@kdfill{\flo@kdt-0.16}{0.26}{1}{\flo@smoothpath}}
\def\flo@kdtooth#1{%
  \ifnum#1<0 \def\flo@t{1}\else\edef\flo@t{\flo@kdn{kdarc}}\fi
  \flo@kdtobeak{\flo@kdx{kdarc}\flo@t}{\flo@kdy{kdarc}\flo@t}{0.06*abs(#1)+0.03}\let\flo@kdpx\flo@kdox\let\flo@kdpy\flo@kdoy
  \flo@kdtobeak\flo@kdpx\flo@kdpy{0.82}%
  \flo@calc\flo@kdya{\flo@kdpy-0.012*\flo@kdVH}\flo@calc\flo@kdyb{\flo@kdoy-0.03*\flo@kdVH}%
  \flo@kdstroke{0.08}{0.6*\flo@kdpen}{0.55}{1}{\pgfpathmoveto{\flo@P\flo@kdpx\flo@kdya}\pgfpathlineto{\flo@P\flo@kdox\flo@kdyb}}}

% ---------------------------------------------------------------- gastropods
% A sea snail's shell from the side, its axis upright, turned \flo@kdGph about it so the
% mouth faces a little forward (florilegium-shell.lua: gastropod). The ring of growth angle
% th sits y0 l from the axis at height -x0 l (l = W^(th/360)). gc(psi): the ring's point at
% psi into \flo@kdgcx \flo@kdgcy (a circle S tall, a shoulder, a flat base, a whelk's egg)
\def\flo@kdgc#1{\flo@calc\flo@kdpsi{#1}%
  \flo@calc\flo@kdgcx{cos(\flo@kdpsi)}\flo@calc\flo@kdgcy{\flo@kdGS*sin(\flo@kdpsi)}%
  \ifx\flo@kdGsh\flo@kdangular
    \flo@calc\flo@t{0.55*\flo@kdGS}\ifdim\flo@kdgcy pt>\flo@t pt
      \flo@calc\flo@kdgcy{\flo@t+0.3*(\flo@kdgcy-\flo@t)}\flo@calc\flo@kdgcx{\flo@kdgcx*1.06}\fi
  \else\ifx\flo@kdGsh\flo@kdrounded
    \flo@calc\flo@t{0.7*\flo@kdGS}\ifdim\flo@kdgcy pt>\flo@t pt \flo@calc\flo@kdgcy{\flo@t+0.6*(\flo@kdgcy-\flo@t)}\fi
  \fi\fi
  \ifnum\flo@kdGflat=1 \flo@calc\flo@t{-0.45*\flo@kdGS}\ifdim\flo@kdgcy pt<\flo@t pt
    \flo@calc\flo@kdgcy{\flo@t+0.12*(\flo@kdgcy-(\flo@t))}\fi\fi
  \ifnum\flo@kdGegg=1
    \flo@calc\flo@t{\flo@kdpsi-360*floor(\flo@kdpsi/360)}%
    \ifdim\flo@t pt>180pt \flo@calc\flo@kdgk{-sin(\flo@kdpsi)}%
      \flo@calc\flo@kdgcy{\flo@kdgcy*(1+0.35*\flo@kdgk)}\flo@calc\flo@kdgcx{\flo@kdgcx*(1-0.18*\flo@kdgk)}\fi
  \fi}
\def\flo@kdangular{angular}\def\flo@kdrounded{rounded}
% gp(th, psi) into \flo@kdpx \flo@kdpy; gcenter(th) into \flo@kdcx \flo@kdcy
\def\flo@kdgp#1#2{\flo@calc\flo@kdgth{#1}\flo@kdgc{#2}\flo@calc\flo@kdlam{pow(\flo@kdGW,\flo@kdgth/360)}%
  \flo@calc\flo@kdpx{\flo@kdGhx*(\flo@kdGy+\flo@kdgcx)*\flo@kdlam*cos(\flo@kdGph-\flo@kdgth)}%
  \flo@calc\flo@kdpy{(\flo@kdgcy-\flo@kdGx)*\flo@kdlam}}
\def\flo@kdgcenter#1{\flo@calc\flo@kdgth{#1}\flo@calc\flo@kdlam{pow(\flo@kdGW,\flo@kdgth/360)}%
  \flo@calc\flo@kdcx{\flo@kdGhx*\flo@kdGy*\flo@kdlam*cos(\flo@kdGph-\flo@kdgth)}\flo@calc\flo@kdcy{-\flo@kdGx*\flo@kdlam}}
% whorl #1's front half (0 the body whorl): lists top<j> bot<j> (left to right), rcap<j>
% (top to bottom), lcap<j> (bottom to top); values tb, ta, ab, h and its box
\def\flo@kdgwhorl#1{%
  \ifnum#1=0 \def\flo@kdwb{0}\edef\flo@kdwab{\flo@kdGph}\else\flo@calc\flo@kdwb{\flo@kdGph-360*#1}\def\flo@kdwab{0}\fi
  \flo@calc\flo@kdwa{\flo@kdGph-180-360*#1}%
  \flo@kdvset{gtb}{#1}{\flo@kdwb}\flo@kdvset{gta}{#1}{\flo@kdwa}\flo@kdvset{gab}{#1}{\flo@kdwab}%
  \flo@loop{kdgw}\flo@kdm{0}{18}{%
    \flo@calc\flo@kdwth{\flo@kdwa+(\flo@kdwb-\flo@kdwa)*\the\flo@kdm/18}%
    \flo@kdgp\flo@kdwth{90}\flo@kdput{top#1}{\the\numexpr\flo@kdm+1\relax}{\flo@kdpx}{\flo@kdpy}%
    \flo@kdgp\flo@kdwth{-90}\flo@kdput{bot#1}{\the\numexpr\flo@kdm+1\relax}{\flo@kdpx}{\flo@kdpy}}%
  \flo@loop{kdgx}\flo@kdm{0}{12}{%
    \flo@kdgp\flo@kdwb{90-180*\the\flo@kdm/12}\flo@kdput{rcap#1}{\the\numexpr\flo@kdm+1\relax}{\flo@kdpx}{\flo@kdpy}%
    \flo@kdgp\flo@kdwa{-90+180*\the\flo@kdm/12}\flo@kdput{lcap#1}{\the\numexpr\flo@kdm+1\relax}{\flo@kdpx}{\flo@kdpy}}%
  \flo@kdsetn{top#1}{19}\flo@kdsetn{bot#1}{19}\flo@kdsetn{rcap#1}{13}\flo@kdsetn{lcap#1}{13}%
  \flo@calc\flo@t{\flo@kdy{top#1}{10}-(\flo@kdy{bot#1}{10})}\flo@kdvset{gh}{#1}{\flo@t}%
  \flo@kdbox{top#1}\flo@kdboxadd{bot#1}\flo@kdboxadd{rcap#1}\flo@kdboxadd{lcap#1}%
  \flo@kdvset{gxa}{#1}{\flo@kdbxa}\flo@kdvset{gxb}{#1}{\flo@kdbxb}\flo@kdvset{gya}{#1}{\flo@kdbya}\flo@kdvset{gyb}{#1}{\flo@kdbyb}}
% thin: list #2 is every other point of list #1 and its last
\def\flo@kdthin#1#2{\def\flo@kdtn{0}%
  \flo@loop{kdth}\flo@kdm{1}{\flo@kdn{#1}}{\ifodd\flo@kdm
    \edef\flo@kdtn{\the\numexpr\flo@kdtn+1\relax}\flo@kdput{#2}{\flo@kdtn}{\flo@kdx{#1}{\the\flo@kdm}}{\flo@kdy{#1}{\the\flo@kdm}}\fi}%
  \ifodd\flo@kdn{#1} \else\edef\flo@kdtn{\the\numexpr\flo@kdtn+1\relax}%
    \flo@kdput{#2}{\flo@kdtn}{\flo@kdx{#1}{\flo@kdn{#1}}}{\flo@kdy{#1}{\flo@kdn{#1}}}\fi
  \flo@kdsetn{#2}{\flo@kdtn}}
% the whorl's outline (thinned when small, #2 1)
\def\flo@kdgpath#1#2{%
  \ifnum#2=1 \flo@kdthin{rcap#1}{kdga}\flo@kdthin{bot#1}{kdgb}\flo@kdthin{lcap#1}{kdgc}\flo@kdthin{top#1}{kdgd}%
  \else\flo@kdslice{rcap#1}{1}{13}{kdga}\flo@kdslice{bot#1}{1}{19}{kdgb}\flo@kdslice{lcap#1}{1}{13}{kdgc}\flo@kdslice{top#1}{1}{19}{kdgd}\fi
  \flo@kdrev{kdgb}{kdge}%
  \flo@kdcurve{kdga}1\flo@kdcurve{kdge}0\flo@kdcurve{kdgc}0\flo@kdcurve{kdgd}0\pgfpathclose}
% its outline but for the bottom edge, which a canal hides
\def\flo@kdglinenobase#1{\flo@kdslice{lcap#1}{3}{13}{kdga}\flo@kdcurve{kdga}1\flo@kdcurve{top#1}0\flo@kdcurve{rcap#1}0}
% gacross: a rib's line across the whorl at growth angle #1 as list #2; galong: a cord's
% along whorl #1 at psi #2 from polar angle #3 to #4, as list #5
\def\flo@kdgacross#1#2{\flo@calc\flo@kdgat{#1}%
  \flo@kdgp\flo@kdgat{80}\flo@kdput{#2}{1}{\flo@kdpx}{\flo@kdpy}\flo@kdgp\flo@kdgat{28}\flo@kdput{#2}{2}{\flo@kdpx}{\flo@kdpy}%
  \flo@kdgp\flo@kdgat{-28}\flo@kdput{#2}{3}{\flo@kdpx}{\flo@kdpy}\flo@kdgp\flo@kdgat{-80}\flo@kdput{#2}{4}{\flo@kdpx}{\flo@kdpy}%
  \flo@kdsetn{#2}{4}}
\def\flo@kdgalong#1#2#3#4#5{\flo@calc\flo@kdgpsi{#2}%
  \flo@calc\flo@kdgaa{max(#3,\flo@kdv{gab}{#1})}\flo@calc\flo@kdgab{max(#4,\flo@kdv{gab}{#1})}%
  \flo@loop{kdga}\flo@kdq{0}{12}{%
    \flo@calc\flo@kdgat{\flo@kdv{gtb}{#1}+\flo@kdv{gab}{#1}-(\flo@kdgaa+(\flo@kdgab-\flo@kdgaa)*\the\flo@kdq/12)}%
    \flo@kdgp\flo@kdgat\flo@kdgpsi\flo@kdput{#5}{\the\numexpr\flo@kdq+1\relax}{\flo@kdpx}{\flo@kdpy}}%
  \flo@kdsetn{#5}{13}}
% the whorl's surface (#1 its index): its shading, light, grain, pattern and sculpture
\def\flo@kdgsurface#1{%
  \edef\flo@kdh{\flo@kdv{gh}{#1}}%
  \flo@vtone{flo@kdd}{0.08}\flo@kdstreak{top#1}{0.14*\flo@kdh}{0.2*\flo@kdh}{flo@kdd}{0.28}%
  \flo@kdrev{bot#1}{kdsa}\flo@kdstreak{kdsa}{0.18*\flo@kdh}{0.3*\flo@kdh}{flo@kdd}{0.22}%
  \ifnum\flo@kdGhx>0 \flo@kdstreak{rcap#1}{0.25*\flo@kdh}{0.25*\flo@kdh}{flo@kdd}{0.24}%
  \else\flo@kdstreak{lcap#1}{0.25*\flo@kdh}{0.25*\flo@kdh}{flo@kdd}{0.24}\fi
  \ifnum\flo@kdGhx>0 \flo@kdgalong{#1}{25}{165}{100}{kdlit}\else\flo@kdgalong{#1}{25}{15}{80}{kdlit}\fi
  \ifnum#1=0 \def\flo@t{0.45}\else\def\flo@t{0.35}\fi
  \flo@kdswell{kdlit}{0.22*\flo@kdh}{white}{\flo@t}%
  \ifnum\flo@kdlod=0 \flo@calc\flo@t{\flo@kdh*\flo@kdcm}\ifdim\flo@t pt>0.3pt
    \flo@kdbox{top#1}\let\flo@kdmxa\flo@kdbxa\let\flo@kdmxb\flo@kdbxb\let\flo@kdmyb\flo@kdbyb
    \flo@kdbox{bot#1}\let\flo@kdmya\flo@kdbya
    \flo@calc\flo@kdms{0.25*\flo@kdh}%
    \flo@vmottle\flo@kdmxa\flo@kdmya\flo@kdmxb\flo@kdmyb{3}\flo@kdms{\flo@kdt-0.14}{\flo@kdt+0.18}{3}%
  \fi\fi
  % the pattern
  \edef\flo@kdct{\flo@kget{contrast}}\edef\flo@t{\flo@kget{pattern}}%
  \def\flo@tmp{bands}\def\flo@tmpb{flammules}\def\flo@tmpc{dots}%
  \ifx\flo@t\flo@tmp
    \flo@loop{kdgb}\flo@kdl{1}{2}{%
      \flo@calc\flo@kdpz{50-70*\the\flo@kdl/2}%
      \flo@kdgalong{#1}{\flo@kdpz}{0}{180}{kdsa}\flo@kdgalong{#1}{\flo@kdpz-16}{0}{180}{kdsb}\flo@kdrev{kdsb}{kdsc}%
      \flo@kdfill{\flo@kdt-0.22}{0.25+0.35*\flo@kdct}{0}{\flo@kdcurve{kdsa}1\flo@kdcurve{kdsc}0\pgfpathclose}}%
  \else\ifx\flo@t\flo@tmpb
    \flo@loop{kdgf}\flo@kdl{1}{7}{%
      \flo@range\flo@t{0.3}{0.7}\flo@calc\flo@kdfa{180*(\the\flo@kdl-\flo@t)/7}%
      \flo@calc\flo@kdfth{\flo@kdv{gtb}{#1}+\flo@kdv{gab}{#1}-max(\flo@kdv{gab}{#1},\flo@kdfa)}%
      \flo@loop{kdgg}\flo@kdq{0}{4}{%
        \flo@sym\flo@t{6}\flo@kdgp{\flo@kdfth-\flo@t}{80-160*\the\flo@kdq/4}%
        \flo@kdput{kdfl}{\the\numexpr\flo@kdq+1\relax}{\flo@kdpx}{\flo@kdpy}}%
      \flo@kdsetn{kdfl}{5}%
      \flo@range\flo@t{0.7}{1.3}\flo@calc\flo@kdfw{0.12*\flo@kdh*\flo@t}%
      \flo@vtone{flo@kdc}{\flo@kdt-0.26}\flo@kdstreak{kdfl}{0.04*\flo@kdh}{\flo@kdfw}{flo@kdc}{0.25+0.4*\flo@kdct}}%
  \else\ifx\flo@t\flo@tmpc
    \flo@range\flo@t{6}{12}\pgfmathtruncatemacro\flo@kdnb{floor(\flo@t)}%
    \flo@loop{kdgd}\flo@kdl{1}{\flo@kdnb}{%
      \flo@calc\flo@t{max(15,\flo@kdv{gab}{#1})}\flo@range\flo@kdfa{\flo@t}{165}%
      \flo@range\flo@kdpz{-60}{60}%
      \flo@kdgp{\flo@kdv{gtb}{#1}+\flo@kdv{gab}{#1}-\flo@kdfa}{\flo@kdpz}%
      \let\flo@kdox\flo@kdpx\let\flo@kdoy\flo@kdpy
      \flo@range\flo@t{0.04}{0.07}\flo@calc\flo@kdr{\flo@kdh*\flo@t}%
      \flo@vblob\flo@kdox\flo@kdoy\flo@kdr{0.8*\flo@kdr}{0.25}{7}%
      \flo@kdfill{\flo@kdt-0.26}{0.35+0.4*\flo@kdct}{1}{\flo@smoothpath}}%
  \fi\fi\fi
  % the sculpture: axial ribs where they stand 0.5 mm apart, cords along, knobs on the shoulder
  \flo@calc\flo@kdlam{pow(\flo@kdGW,\flo@kdv{gtb}{#1}/360)}%
  \edef\flo@kdscu{\flo@kget{sculpture}}\def\flo@tmp{ribs}\def\flo@tmpb{cancellate}\def\flo@tmpc{nodes}%
  \def\flo@kdribby{0}\ifx\flo@kdscu\flo@tmp\def\flo@kdribby{1}\fi\ifx\flo@kdscu\flo@tmpb\def\flo@kdribby{1}\fi
  \ifx\flo@kdscu\flo@tmpc\def\flo@kdribby{1}\fi
  \ifnum\flo@kdribby=1 \ifnum\flo@kget{ribs}>0
    \flo@calc\flo@kdhalf{\flo@kget{ribs}/2}%
    \flo@calc\flo@kdgap{\flo@kdGy*\flo@kdlam*(180/\flo@kdhalf)*0.0174533}%
    \flo@calc\flo@t{\flo@kdgap*\flo@kdcm}%
    \ifdim\flo@t pt>0.05pt
      \ifx\flo@kdscu\flo@tmpb\def\flo@kdwide{0.14}\else\def\flo@kdwide{0.22}\fi
      \pgfmathtruncatemacro\flo@kdnb{floor(\flo@kdhalf+0.5)}%
      \flo@loop{kdgr}\flo@kdl{1}{\flo@kdnb}{%
        \flo@calc\flo@kdra{max(\flo@kdv{gab}{#1},180*(\the\flo@kdl-0.5)/\flo@kdhalf)}%
        \flo@calc\flo@kdrth{\flo@kdv{gtb}{#1}+\flo@kdv{gab}{#1}-\flo@kdra}%
        \flo@calc\flo@kdf{max(0.15,sin(\flo@kdra))}%
        \ifx\flo@kdscu\flo@tmpc
          \flo@kdgp\flo@kdrth{62}\let\flo@kdox\flo@kdpx\let\flo@kdoy\flo@kdpy
          \flo@calc\flo@kdr{0.3*\flo@kdgap*\flo@kdf}%
          \flo@vblob\flo@kdox\flo@kdoy\flo@kdr{0.8*\flo@kdr}{0.2}{7}\flo@kdfill{\flo@kdt-0.2}{0.45}{1}{\flo@smoothpath}%
          \flo@calc\flo@kdxa{\flo@kdox-0.3*\flo@kdr}\flo@calc\flo@kdya{\flo@kdoy+0.3*\flo@kdr}\flo@calc\flo@kdxb{0.3*\flo@kdr}%
          \flo@vfill{white}{0.4}{0}{\pgfpathcircle{\flo@P\flo@kdxa\flo@kdya}{\flo@kdxb pt}}%
        \else
          \flo@kdgacross\flo@kdrth{kdrib}\flo@vtone{flo@kdc}{\flo@kdt-0.2}%
          \flo@kdswell{kdrib}{\flo@kdwide*\flo@kdgap*\flo@kdf}{flo@kdc}{0.38}%
          \ifnum\flo@kdlod=0 \flo@kdgacross{\flo@kdrth+\flo@kdGhx*4}{kdrib}%
            \flo@kdswell{kdrib}{0.4*\flo@kdwide*\flo@kdgap*\flo@kdf}{white}{0.35}\fi
        \fi}%
    \fi
  \fi\fi
  \def\flo@kdcrd{0}\def\flo@tmp{cords}\ifx\flo@kdscu\flo@tmp\def\flo@kdcrd{1}\fi\ifx\flo@kdscu\flo@tmpb\def\flo@kdcrd{1}\fi
  \ifnum\flo@kdcrd=1 \ifnum\flo@kget{cords}>0 \flo@calc\flo@t{\flo@kdh*\flo@kdcm}\ifdim\flo@t pt>0.12pt
    \edef\flo@kdnc{\flo@kget{cords}}%
    \flo@loop{kdgc}\flo@kdl{1}{\flo@kdnc}{%
      \flo@calc\flo@kdpz{75-150*\the\flo@kdl/(\flo@kdnc+1)}%
      \flo@kdgalong{#1}{\flo@kdpz}{3}{177}{kdsa}\flo@kdstroke{\flo@kdt-0.2}{0.45*\flo@kdpen}{0.42}{1}{\flo@kdcurve{kdsa}1}%
      \ifnum\flo@kdlod=0 \flo@kdgalong{#1}{\flo@kdpz+5}{3}{177}{kdsa}\flo@kdwstroke{0.35*\flo@kdpen}{0.35}{\flo@kdcurve{kdsa}1}\fi}%
  \fi\fi\fi}
% the canal: the body whorl's base drawn down under the mouth to a tip bent a little toward
% the axis; its tip into \flo@kdtipx \flo@kdtipy
\def\flo@kdgcanaltip{%
  \edef\flo@t{\flo@kget{canal}}\def\flo@tmp{long}%
  \ifx\flo@t\flo@tmp\flo@calc\flo@kdclen{1.5*\flo@kdGS}\else\flo@calc\flo@kdclen{0.6*\flo@kdGS}\fi
  \flo@kdgp{0}{-90}\flo@calc\flo@kdtipx{\flo@kdpx-\flo@kdGhx*0.3}\flo@calc\flo@kdtipy{\flo@kdpy-\flo@kdclen}}
\def\flo@kdgcanalpath{\flo@kdcurve{kdca}1\flo@kdcurve{kdcb}0\pgfpathclose}
\def\flo@kdgcanal{%
  \flo@kdgcanaltip
  \edef\flo@kdcax{\flo@kdx{lcap0}3}\edef\flo@kdcay{\flo@kdy{lcap0}3}%
  \flo@kdgp{0}{-40}\let\flo@kdcox\flo@kdpx\let\flo@kdcoy\flo@kdpy
  \flo@calc\flo@kdcmx{0.45*\flo@kdcax+0.55*\flo@kdtipx+\flo@kdGhx*0.1}\flo@calc\flo@kdcmy{0.5*(\flo@kdcay+\flo@kdtipy)}%
  \flo@calc\flo@kdcnx{0.5*(\flo@kdcox+\flo@kdtipx)+\flo@kdGhx*0.05}\flo@calc\flo@kdcny{0.45*\flo@kdcoy+0.55*\flo@kdtipy}%
  \flo@kdput{kdca}{1}\flo@kdcax\flo@kdcay\flo@kdput{kdca}{2}\flo@kdcmx\flo@kdcmy\flo@kdput{kdca}{3}\flo@kdtipx\flo@kdtipy\flo@kdsetn{kdca}{3}%
  \flo@kdput{kdcb}{1}\flo@kdtipx\flo@kdtipy\flo@kdput{kdcb}{2}\flo@kdcnx\flo@kdcny\flo@kdput{kdcb}{3}\flo@kdcox\flo@kdcoy\flo@kdsetn{kdcb}{3}%
  \flo@sym\flo@t{0.02}\flo@kdfill{\flo@kdt+\flo@t}{1}{0}{\flo@kdgcanalpath}%
  \ifnum\flo@kdlod<2
    \begin{pgfscope}\flo@kdgcanalpath\pgfusepath{clip}%
      \flo@kdput{kdcc}{1}\flo@kdcox\flo@kdcoy\flo@kdput{kdcc}{2}\flo@kdcnx\flo@kdcny\flo@kdput{kdcc}{3}\flo@kdtipx\flo@kdtipy\flo@kdsetn{kdcc}{3}%
      \flo@vtone{flo@kdd}{0.08}\flo@kdstreak{kdcc}{0.35}{0.05}{flo@kdd}{0.3}%
      \flo@kdswell{kdca}{0.12}{white}{0.3}%
    \end{pgfscope}%
  \fi
  \flo@kdstroke{0.05}{0.9*\flo@kdpen}{0.85}{1}{\flo@kdgcanalpath}}
% the canal's open channel, on from the mouth: porcelain, its left edge the columella's
\def\flo@kdgchannel{%
  \flo@kdgcanaltip\flo@kdgp{0}{-90}%
  \flo@kdput{kdch}{1}\flo@kdpx\flo@kdpy
  \flo@calc\flo@kdcmx{0.5*(\flo@kdpx+\flo@kdtipx)+\flo@kdGhx*0.06}\flo@calc\flo@kdcmy{0.5*(\flo@kdpy+\flo@kdtipy)}%
  \flo@kdput{kdch}{2}\flo@kdcmx\flo@kdcmy
  \flo@calc\flo@kdcnx{\flo@kdtipx+\flo@kdGhx*0.03}\flo@calc\flo@kdcny{\flo@kdtipy+0.12*\flo@kdclen}%
  \flo@kdput{kdch}{3}\flo@kdcnx\flo@kdcny\flo@kdsetn{kdch}{3}%
  \flo@vtone{flo@kdd}{min(0.82,\flo@kdt+0.3)}\flo@kdstreak{kdch}{0.32}{0.04}{flo@kdd}{1}%
  \flo@calc\flo@kdax{\flo@kdpx-\flo@kdGhx*0.12}\flo@calc\flo@kday{\flo@kdpy+0.05}\flo@kdput{kdce}{1}\flo@kdax\flo@kday
  \flo@calc\flo@kdax{\flo@kdcmx-\flo@kdGhx*0.08}\flo@kdput{kdce}{2}\flo@kdax\flo@kdcmy
  \flo@kdput{kdce}{3}\flo@kdcnx\flo@kdcny\flo@kdsetn{kdce}{3}%
  \flo@kdstroke{0.08}{0.6*\flo@kdpen}{0.7}{1}{\flo@kdcurve{kdce}1}}
% a point of the mouth's ring at psi #1, drawn #2 (in x) and #3 (in y) of the way out from
% its center, appended to list #4 as point #5
\def\flo@kdgring#1#2#3#4#5{\flo@kdgp{0}{#1}%
  \flo@calc\flo@kdax{\flo@kdcx+(#2)*(\flo@kdpx-\flo@kdcx)}\flo@calc\flo@kday{\flo@kdcy+(#3)*(\flo@kdpy-\flo@kdcy)}%
  \flo@kdput{#4}{#5}{\flo@kdax}{\flo@kday}}
% the mouth, face on: the dark inside, the pale callus along the columella with its folds,
% the lip thickened or flared
\def\flo@kdgmouth{%
  \flo@loop{kdgm}\flo@kdq{0}{23}{\flo@kdgp{0}{15*\the\flo@kdq}\flo@kdput{kdring}{\the\numexpr\flo@kdq+1\relax}{\flo@kdpx}{\flo@kdpy}}%
  \flo@kdsetn{kdring}{24}%
  \flo@kdgcenter{0}%
  \edef\flo@kdlip{\flo@kget{lip}}\def\flo@tmp{flared}%
  \ifx\flo@kdlip\flo@tmp
    \flo@loop{kdgn}\flo@kdq{0}{10}{\flo@kdgring{14*(\the\flo@kdq-5)}{1.2}{1.06}{kdflange}{\the\numexpr\flo@kdq+1\relax}%
      \flo@kdgp{0}{14*(5-\the\flo@kdq)}\flo@kdput{kdinner}{\the\numexpr\flo@kdq+1\relax}{\flo@kdpx}{\flo@kdpy}}%
    \flo@kdsetn{kdflange}{11}\flo@kdsetn{kdinner}{11}%
    \flo@kdfill{\flo@kdt+0.06}{1}{0}{\flo@kdcurve{kdflange}1\flo@kdcurve{kdinner}0\pgfpathclose}%
    \flo@kdstroke{0.05}{0.8*\flo@kdpen}{0.85}{1}{\flo@kdcurve{kdflange}1}%
  \fi
  \flo@kdfill{min(0.82,\flo@kdt+0.3)}{1}{0}{\flo@kdsmooth{kdring}}%
  \ifnum\flo@kdlod<2
    \flo@loop{kdgo}\flo@kdq{0}{6}{%
      \flo@kdgring{95+110*\the\flo@kdq/6}{0.72}{0.75}{kddeep}{\the\numexpr\flo@kdq+1\relax}%
      \flo@kdgring{-60+120*\the\flo@kdq/6}{0.72}{0.78}{kdglow}{\the\numexpr\flo@kdq+1\relax}}%
    \flo@kdsetn{kddeep}{7}\flo@kdsetn{kdglow}{7}%
    \begin{pgfscope}\flo@kdsmooth{kdring}\pgfusepath{clip}%
      \flo@vtone{flo@kdd}{0.12}\flo@kdswell{kddeep}{0.5}{flo@kdd}{0.45}%
      \flo@vtone{flo@kdd}{0.08}\flo@kdswell{kddeep}{0.25}{flo@kdd}{0.35}%
      \flo@kdswell{kdglow}{0.3}{white}{0.45}%
    \end{pgfscope}%
    \flo@loop{kdgp}\flo@kdq{0}{6}{\flo@kdgring{125+110*\the\flo@kdq/6}{0.82}{0.88}{kdcol}{\the\numexpr\flo@kdq+1\relax}}%
    \flo@kdsetn{kdcol}{7}\flo@kdswell{kdcol}{0.22}{white}{0.35}%
    \ifnum\flo@kdlod=0 \ifnum\flo@kget{folds}>0
      % columella folds: short ridges slanting down into the mouth
      \edef\flo@kdnf{\flo@kget{folds}}%
      \flo@loop{kdgq}\flo@kdq{1}{\flo@kdnf}{%
        \flo@kdgp{0}{200+14*(\the\flo@kdq-(\flo@kdnf+1)/2)}%
        \flo@calc\flo@kdax{\flo@kdcx+0.82*(\flo@kdpx-\flo@kdcx)}\flo@calc\flo@kday{\flo@kdpy-0.12}%
        \flo@kdwstroke{0.6*\flo@kdpen}{0.45}{\pgfpathmoveto{\flo@P\flo@kdpx\flo@kdpy}\pgfpathlineto{\flo@P\flo@kdax\flo@kday}}}%
    \fi\fi
    \def\flo@tmp{thick}\ifx\flo@kdlip\flo@tmp
      \flo@loop{kdgt}\flo@kdq{0}{10}{\flo@kdgring{14*(\the\flo@kdq-5)}{0.9}{0.94}{kdlipr}{\the\numexpr\flo@kdq+1\relax}}%
      \flo@kdsetn{kdlipr}{11}\flo@kdswell{kdlipr}{0.16}{white}{0.55}%
    \fi
  \fi
  \flo@kdstroke{0.05}{\flo@kdpen}{0.85}{1}{\flo@kdsmooth{kdring}}}
% a sea snail: a whelk, a turret shell or a topshell
\def\flo@kdgastropod{%
  \edef\flo@kdGW{\flo@kget{expansion}}\edef\flo@kdGS{\flo@kget{aperture}}\edef\flo@kdGsh{\flo@kget{shoulder}}%
  \flo@calc\flo@kdGy{(1+\flo@kget{umbilicus})/(1-\flo@kget{umbilicus})}\flo@calc\flo@kdGx{\flo@kget{spire}*\flo@kdGy}%
  \edef\flo@kdkind{\flo@kget{kind}}\def\flo@tmp{topshell}\def\flo@tmpb{whelk}%
  \ifx\flo@kdkind\flo@tmp\def\flo@kdGflat{1}\else\def\flo@kdGflat{0}\fi
  \ifx\flo@kdkind\flo@tmpb\def\flo@kdGegg{1}\else\def\flo@kdGegg{0}\fi
  \edef\flo@t{\flo@kget{view}}\def\flo@tmp{back}\ifx\flo@t\flo@tmp\def\flo@kdback{1}\else\def\flo@kdback{0}\fi
  \edef\flo@t{\flo@kget{hand}}\def\flo@tmp{sinistral}%
  \ifx\flo@t\flo@tmp\def\flo@kdGhx{-1}\else\def\flo@kdGhx{1}\fi
  \ifnum\flo@kdback=1 \edef\flo@kdGhx{\the\numexpr-\flo@kdGhx\relax}\fi
  \flo@range\flo@kdGph{18}{30}%
  % the whorls, the shell's own count
  \pgfmathtruncatemacro\flo@kdJ{ceil(\flo@kget{whorls})}%
  \flo@loop{kdgv}\flo@kdk{0}{\flo@kdJ-1}{\expandafter\flo@kdgwhorl\expandafter{\the\flo@kdk}}%
  \def\flo@kdbxa{16000}\def\flo@kdbxb{-16000}\def\flo@kdbya{16000}\def\flo@kdbyb{-16000}%
  \flo@loop{kdgy}\flo@kdk{0}{\flo@kdJ-1}{%
    \flo@kdboxadd{top\the\flo@kdk}\flo@kdboxadd{bot\the\flo@kdk}\flo@kdboxadd{rcap\the\flo@kdk}\flo@kdboxadd{lcap\the\flo@kdk}}%
  \edef\flo@t{\flo@kget{canal}}\def\flo@tmp{none}\ifx\flo@t\flo@tmp\def\flo@kdcanal{0}\else\def\flo@kdcanal{1}\fi
  \ifnum\flo@kdcanal=1 \flo@kdgcanaltip\flo@kdput{kdbx}{1}\flo@kdtipx\flo@kdtipy\flo@kdsetn{kdbx}{1}\flo@kdboxadd{kdbx}\fi
  \edef\flo@t{\flo@kget{lip}}\def\flo@tmp{flared}\ifx\flo@t\flo@tmp
    \flo@kdgcenter{0}\flo@calc\flo@kdax{\flo@kdcx+\flo@kdGhx*1.2*1.06}\flo@kdput{kdbx}{1}\flo@kdax\flo@kdcy\flo@kdsetn{kdbx}{1}\flo@kdboxadd{kdbx}\fi
  \flo@kdput{kdbx}{1}{0}{0}\flo@kdsetn{kdbx}{1}\flo@kdboxadd{kdbx}% the apex
  \flo@kdframe
  \flo@kdtone
  \ifnum\flo@kdcanal=1 \flo@kdgcanal\fi
  \edef\flo@kdpres{\flo@kget{preservation}}\def\flo@tmp{nacre}%
  \ifx\flo@kdpres\flo@tmp\def\flo@kdnacp{1}\else\def\flo@kdnacp{0}\fi
  \flo@loop{kdgz}\flo@kdk{1}{\flo@kdJ}{%
    \edef\flo@kdbk{\the\numexpr\flo@kdJ-\flo@kdk\relax}% the whorl's index, oldest first
    \flo@calc\flo@t{\flo@kdv{gh}{\flo@kdbk}*\flo@kdcm}\edef\flo@kdhcm{\flo@t}%
    \def\flo@kdgo{0}\ifdim\flo@kdhcm pt>0.02pt \def\flo@kdgo{1}\fi\ifnum\flo@kdbk=0 \def\flo@kdgo{1}\fi
    \ifnum\flo@kdgo=1 \expandafter\flo@kdgdraw\expandafter{\flo@kdbk}\fi}%
  % the apex's tip, where the whorls are too small to draw
  \flo@kdgp{-360*\flo@kdJ}{90}\flo@calc\flo@kdr{0.02/max(0.00002,\flo@kdcm)}%
  \flo@kdfill{0.08}{0.8}{0}{\pgfpathcircle{\flo@P{0}\flo@kdpy}{\flo@kdr pt}}%
  \ifnum\flo@kdback=0 \flo@kdgmouth\ifnum\flo@kdcanal=1 \flo@kdgchannel\fi\fi}
% whorl #1 painted: its wash, in its clip the surface; its outline
\def\flo@kdgdraw#1{%
  % worn to its nacre at the apex
  \def\flo@kdnac{0}\ifnum\flo@kdnacp=1 \ifnum\numexpr#1+1\relax>\numexpr\flo@kdJ-3\relax\def\flo@kdnac{1}\fi\fi
  \flo@kdaccent\flo@kdnac
  \def\flo@kdsmall{0}\ifdim\flo@kdhcm pt<0.3pt \def\flo@kdsmall{1}\fi
  \flo@sym\flo@t{0.03}\flo@calc\flo@kdtw{\flo@kdt+\flo@t}%
  \def\flo@kddet{0}\ifnum\flo@kdlod<2 \ifdim\flo@kdhcm pt>0.08pt \def\flo@kddet{1}\fi\fi
  \ifnum\flo@kddet=1
    \begin{pgfscope}\flo@kdgpath{#1}\flo@kdsmall\pgfusepath{clip}%
      \flo@kdfill{\flo@kdtw}{1}{0}{\flo@kdrect{\flo@kdv{gxa}{#1}}{\flo@kdv{gya}{#1}}{\flo@kdv{gxb}{#1}}{\flo@kdv{gyb}{#1}}}%
      \flo@kdgsurface{#1}%
    \end{pgfscope}%
  \else
    \flo@kdfill{\flo@kdtw}{1}{0}{\flo@kdgpath{#1}\flo@kdsmall}%
  \fi
  \flo@kdaccent0%
  \ifnum#1=0 \def\flo@t{1}\else\def\flo@t{0.75}\fi
  \ifnum#1=0 \ifnum\flo@kdcanal=1
    \flo@kdstroke{0.05}{\flo@t*\flo@kdpen}{0.85}{1}{\flo@kdglinenobase{#1}}%
  \else\flo@kdstroke{0.05}{\flo@t*\flo@kdpen}{0.85}{1}{\flo@kdgpath{#1}\flo@kdsmall}\fi
  \else\flo@kdstroke{0.05}{\flo@t*\flo@kdpen}{0.85}{1}{\flo@kdgpath{#1}\flo@kdsmall}\fi}

% ---------------------------------------------------------------- cowries
% a glossy egg 1 long and aspect wide, lying along x: from above its dome, its spots and the
% pale line where the mantle met; from beneath its paler base and the long toothed slit
\def\flo@kdcowrie{%
  \edef\flo@kdA{\flo@kget{aspect}}%
  \flo@loop{kdcw}\flo@kdq{0}{35}{%
    \flo@calc\flo@kdax{0.5*cos(10*\the\flo@kdq)}\flo@calc\flo@kday{0.5*\flo@kdA*sin(10*\the\flo@kdq)*(1+0.08*cos(10*\the\flo@kdq))}%
    \flo@kdput{kdegg}{\the\numexpr\flo@kdq+1\relax}{\flo@kdax}{\flo@kday}}%
  \flo@kdsetn{kdegg}{36}%
  \flo@calc\flo@kdty{0.5*\flo@kdA*1.08*\flo@sizept}%
  \pgftransformshift{\flo@P{0}\flo@kdty}\pgftransformscale{\flo@sizept}%
  \flo@calc\flo@kdcm{\flo@sizept/28.45276}%
  \ifdim\flo@kdacm pt<0.5pt \def\flo@kdlod{2}\else\ifdim\flo@kdacm pt<1.2pt \def\flo@kdlod{1}\else\def\flo@kdlod{0}\fi\fi
  \flo@calc\flo@kdpen{max(0.3,min(0.85,0.028*\flo@kdacm*28.3465))}%
  \flo@kdtone
  \edef\flo@t{\flo@kget{view}}\def\flo@tmp{mouth}\ifx\flo@t\flo@tmp\def\flo@kdunder{1}\flo@calc\flo@kdt{min(0.78,\flo@kdt+0.22)}\else\def\flo@kdunder{0}\fi
  \flo@kdfill{\flo@kdt}{1}{0}{\flo@kdsmooth{kdegg}}%
  \ifnum\flo@kdlod<2
    \begin{pgfscope}\flo@kdsmooth{kdegg}\pgfusepath{clip}%
      \flo@kdslice{kdegg}{21}{33}{kdsa}\flo@vtone{flo@kdd}{0.08}\flo@kdstreak{kdsa}{0.04*\flo@kdA}{0.12*\flo@kdA}{flo@kdd}{0.3}%
      \ifnum\flo@kdunder=1
        \flo@vtone{flo@kdd}{\flo@kdt-0.3}\flo@kdstreak{kdegg}{0.1*\flo@kdA}{0.1*\flo@kdA}{flo@kdd}{0.35}%
        \flo@loop{kdcs}\flo@kdq{0}{8}{%
          \flo@calc\flo@kdax{-0.46+0.92*\the\flo@kdq/8}\flo@calc\flo@kday{0.04*\flo@kdA*sin(180*\the\flo@kdq/8)-0.02*\flo@kdA}%
          \flo@kdput{kdslit}{\the\numexpr\flo@kdq+1\relax}{\flo@kdax}{\flo@kday}}%
        \flo@kdsetn{kdslit}{9}\flo@vtone{flo@kdd}{0.08}\flo@kdswell{kdslit}{0.06*\flo@kdA}{flo@kdd}{0.9}%
        \ifnum\flo@kdlod=0
          \flo@loop{kdct}\flo@kdq{1}{16}{%
            \flo@calc\flo@kdax{-0.4+0.8*(\the\flo@kdq-0.5)/16}%
            \flo@calc\flo@kday{0.04*\flo@kdA*sin(180*(\flo@kdax+0.46)/0.92)-0.02*\flo@kdA}%
            \flo@kdtooththe{-1}\flo@kdtooththe{1}}%
        \fi
      \else
        \edef\flo@t{\flo@kget{pattern}}\def\flo@tmp{dots}\def\flo@tmpb{bands}\edef\flo@kdct{\flo@kget{contrast}}%
        \ifx\flo@t\flo@tmp
          \flo@range\flo@t{18}{34}\pgfmathtruncatemacro\flo@kdnb{floor(\flo@t)}%
          \flo@loop{kdcd}\flo@kdl{1}{\flo@kdnb}{%
            \flo@range\flo@kdox{-0.4}{0.4}\flo@range\flo@t{-0.38}{0.38}\flo@calc\flo@kdoy{\flo@t*\flo@kdA}%
            \flo@range\flo@t{0.025}{0.06}\flo@calc\flo@kdr{\flo@kdA*\flo@t}%
            \flo@vblob\flo@kdox\flo@kdoy\flo@kdr{0.85*\flo@kdr}{0.25}{7}%
            \flo@kdfill{\flo@kdt-0.28}{0.35+0.45*\flo@kdct}{1}{\flo@smoothpath}}%
        \else\ifx\flo@t\flo@tmpb
          \flo@loop{kdcb}\flo@kdl{1}{3}{%
            \flo@calc\flo@kdax{-0.3+0.3*(\the\flo@kdl-1)}\flo@calc\flo@kday{0.6*\flo@kdA}\flo@calc\flo@kdcx{\flo@kdax+0.02}%
            \flo@kdput{kdstripe}{1}{\flo@kdax}{-\flo@kday}\flo@kdput{kdstripe}{2}{\flo@kdcx}{0}\flo@kdput{kdstripe}{3}{\flo@kdax}{\flo@kday}%
            \flo@kdsetn{kdstripe}{3}%
            \flo@vtone{flo@kdd}{\flo@kdt-0.24}\flo@kdstreak{kdstripe}{0.1}{0.1}{flo@kdd}{0.25+0.35*\flo@kdct}}%
        \fi\fi
        % the mantle line, and the gloss: a long light along the upper left of the dome
        \flo@loop{kdcm}\flo@kdq{0}{6}{%
          \flo@calc\flo@kdax{-0.42+0.84*\the\flo@kdq/6}\flo@calc\flo@kday{0.1*\flo@kdA+0.015*sin(360*\the\flo@kdq/6)}%
          \flo@kdput{kdml}{\the\numexpr\flo@kdq+1\relax}{\flo@kdax}{\flo@kday}}\flo@kdsetn{kdml}{7}%
        \ifnum\flo@kdlod=0 \flo@kdwstroke{0.6*\flo@kdpen}{0.5}{\flo@kdpoly{kdml}0}\fi
        \flo@loop{kdcg}\flo@kdq{0}{4}{%
          \flo@calc\flo@kdax{-0.3+0.45*\the\flo@kdq/4}\flo@calc\flo@kday{0.22*\flo@kdA+0.03*\flo@kdA*sin(180*\the\flo@kdq/4)}%
          \flo@kdput{kdgl}{\the\numexpr\flo@kdq+1\relax}{\flo@kdax}{\flo@kday}}\flo@kdsetn{kdgl}{5}%
        \flo@kdswell{kdgl}{0.12*\flo@kdA}{white}{0.6}%
      \fi
    \end{pgfscope}%
  \fi
  \flo@kdstroke{0.05}{\flo@kdpen}{0.85}{1}{\flo@kdsmooth{kdegg}}%
  % the canals at either end
  \flo@calc\flo@kday{0.03*\flo@kdA}%
  \flo@kdstroke{0.05}{0.7*\flo@kdpen}{0.8}{1}{\pgfpathmoveto{\flo@P{-0.5}\flo@kday}\pgfpathlineto{\flo@P{-0.45}{0}}\pgfpathlineto{\flo@P{-0.5}{-\flo@kday}}}%
  \flo@kdstroke{0.05}{0.7*\flo@kdpen}{0.8}{1}{\pgfpathmoveto{\flo@P{0.5}\flo@kday}\pgfpathlineto{\flo@P{0.45}{0}}\pgfpathlineto{\flo@P{0.5}{-\flo@kday}}}}
% a tooth of the cowrie's slit, on side #1, at \flo@kdax \flo@kday
\def\flo@kdtooththe#1{\flo@calc\flo@kdya{\flo@kday+(#1)*0.035*\flo@kdA}\flo@calc\flo@kdyb{\flo@kday+(#1)*0.11*\flo@kdA}%
  \flo@kdstroke{\flo@kdt-0.25}{0.5*\flo@kdpen}{0.55}{1}{\pgfpathmoveto{\flo@P\flo@kdax\flo@kdya}\pgfpathlineto{\flo@P\flo@kdax\flo@kdyb}}}
