Name | Last modified | Size | Description | |
---|---|---|---|---|
Parent Directory | - | |||
3d/ | 2023-07-23 12:21 | - | ||
COLOURS/ | 2023-07-23 12:21 | - | ||
EFFECTS/ | 2023-04-20 08:25 | - | ||
Messages/ | 2023-07-23 07:39 | - | ||
art.zip | 2023-07-23 12:22 | 27M | ||
art/ | 2023-07-23 12:21 | - | ||
art_no_data.zip | 2023-07-23 12:22 | 3.7M | ||
colourspace/ | 2023-07-23 12:21 | - | ||
components/ | 2023-07-23 12:21 | - | ||
config/ | 2023-07-23 07:39 | - | ||
core/ | 2023-07-23 12:21 | - | ||
data.zip | 2023-07-23 12:22 | 21M | ||
data/ | 2023-07-23 12:21 | - | ||
dependencies | 2023-07-23 08:47 | 72K | ||
documentation.zip | 2023-07-23 12:22 | 2.1M | ||
documentation/ | 2023-07-23 08:57 | - | ||
examples/ | 2023-07-23 12:21 | - | ||
geo/ | 2023-07-23 12:21 | - | ||
image/ | 2023-07-23 12:21 | - | ||
makefile | 2023-07-23 07:39 | 19K | ||
music/ | 2023-07-23 12:21 | - | ||
noise/ | 2023-07-23 12:21 | - | ||
sdf/ | 2023-07-23 12:21 | - | ||
shapes/ | 2023-07-23 12:21 | - | ||
string/ | 2023-07-23 12:21 | - | ||
svg/ | 2023-07-23 12:21 | - | ||
tests/ | 2023-07-23 12:21 | - | ||
tiling/ | 2023-07-23 12:21 | - | ||
types/ | 2023-07-23 12:21 | - | ||
wfc/ | 2023-07-23 12:21 | - | ||
API documentation is in the various subdirectories, e.g. string/api.html
as well as in the documentation
directory.
The code here is generally licensed as CC-BY (https://creativecommons.org/licenses/by/4.0/).
Attribution should be to Mary Holstege and include a link to the code base at http://mathling.com/code/
Some of the same data is based on WordNet 3.0® and is made available under that license (see data
directory).
The noise code is a port of noise-rs which is used under an MIT License (see noise
directory).
Much of the colour space conversion code is a port of hsluv-c which is used under an MIT License (see colourspace
directory).
Much of the SDF code is based in part on code from Inigo Quilez which is used under an MIT License with some operators from Karsten Schmidt which is used under an Apache license, and a few details from Electric Square Ltd., also under and MIT License (see sdf
directory).
The gradients are based on gradient definitions from a variety of sources used under MIT, BSD, and CC Licenses (see COLOURS
directory).
The Wave Function Collapse algorithm is a port of the WFC code, which is used under an MIT license. See wfc
directory.
The Saxon 12 and Saxon-JS issues mentioned in 20230424 still apply. The Saxon-JS issues are further exacerbated by heap errors during export and "too large" errors at run time. Saxon-JS is really not usable yet except for very small and constrained examples that do not use many packages.
geom:is-straight()
, geom:is-straight-edge()
to edge (geometric/euclidean.xqy, geometric/edge.xqysim:simplify()
, sim:streamline()
, sim:chaikin()
geom:convex-hull()
to simplifygeom:bounding-sphere()
, geom:stereographic()
, geom:stereographic3D()
, geom:apply-matrix3()
, geom:projection()
, geom:process-polygons()
, geom:process-areas()
, geom:process-solids()
, geom:process-paths()
, geom:delegate()
(geometric/euclidean.xqy)affine:apply-matrix3()
, affine:projection3()
, affine:projection()
(geometric/affine.xqy)point:sum()
, point:counterclockwise()
(geometric/point.xqy)edge:osculating-circle()
, edge:signed-curvature()
, edge:curvature()
(geometric/edge.xqy)path:quadrangle()
, path:ngon()
, path:osculating-circle()
, path:simplify()
, path:simplify-points()
, path:streamline()
, path:chaikin()
, path:chaikin-points()
, path:normalize()
, path:consolidate-points-by-colour()
, path:consolidate-points-by-colour-and-opacity()
(geometric/path.xqy)ellipse:ellipse-contains-ellipse()
(geometric/ellipse.xqy)solid:to-polyhedron()
, solid:simple-polyhedron()
, solid:extrude()
, solid:glue()
, solid:merge()
(geometric/slot.xqy)coord:stereographic()
, coord:stereographic3D()
(geo/coordinates.xqy)v:distance()
, v:valid()
(core/vector.xqy)geom:region-center()
supports slot/wrapper edge:inclination()
with just edge argumentedge:tangent()
supports arc and ellipsesolid:insphere()
supports blockgeom:edges()
takes region sequence not just singletonpath:path()
handles sequence of pointsspline:spline()
excludes points with infinite coordinatesgeom:length()
add support for polygonssolid:properties()
missing case for generic polyhedronsolid:with-properties()
missing case for generic polyhedronsolid:circumsphere()
missing case for generic polyhedronpoint:distinct()
should return () for empty sequence of pointssolid:same()
generic polyhedron should be less sensitive to vertex reorderingsolid:points()
, solid:vertices()
, solid:face-indexes()
should give error for ellipsoidsgeom:length()
mishandling box/spaceedge:line-intersection()
fails in some cases because test of -0=0 fails (?!)box:vertices()
to be consistent with counterclockwise polygonpoly:as-real()
, poly:is-constant()
, zpoly:is-real()
, zpoly:as-real-polynomial()
, zpoly:as-polynomial()
, poly:times()
, zpoly:times()
, zpoly:ztimes()
, poly:zvaluev()
, zpoly:zvaluez()
complex:asin()
, complex:acos()
, vcomplex:asin()
, vcomplex:acos()
, complex:asinh()
, complex:acosh()
, vcomplex:asin()
, vcomplex:acosh()
, complex:modsq()
, vcomplex:modsq()
, complex:vector()
, complex:as-vector()
(core/complex.xqy, (core/vcomplex.xqy)q:quaternion()
(from angles), q:from-vector()
, q:rotation-between()
, q:rotation3()
, q:to-angles()
(core/complex.xqy, (core/vquaternion.xqy)seq:continued-fraction()
, seq:convergents()
, seq:numerators()
, seq:denominators()
, seq:modp()
, seq:modz()
, seq:unmodp()
, seq:unmodz()
seq:sequence()
supports "counter" + other new functionsseq:sequence()
incorrect handling of "prime-sequence"util:some()
, util:every()
, util:none()
, util:extreme()
util:linspace()
n=1, inclusivedist:weighted-distribution-of()
to dist:weighted-index-of()
(types/distributions.xqy)$rand:STD-UNIT
(core/random.xqy)tone:shade()
, tone:shadev()
(colourspace/tonemap.xqy)effect:colour()
take sequence of colours, rotates through them (svg/effect.xqy)patterns:center()
and patterns:scale-and-center()
to shapes (shapes/patterns.xqy, shapes/shapes.xqy)paths:stroke-path()
, paths:looping-meander()
, paths:bend()
, paths:bend-path()
(shapes/paths.xqy)grids:hexagon()
(shapes/grids.xqy)patterns:scale-and-center()
support width != height better (shapes/patterns.xqy)paths:meander()
should use just sin() not derivative; paths:looping-meander()
uses derivative (shapes/paths.xqy)grids:hex-point()
maybe returns empty (not error) (shapes/grids.xqy)music:parse()
and associated objects (music/music.xqy)music:note()
, music:rest()
additional parameter for note index (music/music.xqy)mnoise:noise-pitch()
, mnoise:noise-pitch-vector()
, mnoise:noise-density()
, mnoise:noise-density-vector()
, mnoise:noise-extreme()
, mnoise:noise-extreme-vector()
) (music/noise.xqy)ppm:p6-array()
reading P6 into array (image/ppm.xqy)imagematrix:sample()
(image/matrix.xqy)draw:project
to default drawing mapstats:mean()
, stats:median()
, stats:mode()
, stats:std()
(core/statistics.xqy)density:chloropleth()
, density:dots()
, density:dot-diagram()
(shapes/density.xqy)Saxon 12 issues
Saxon-JS issues
saxon:xquery()
) which is not available in that context.Major changes
Major incompatibilities: Mutation functions, modifier functions, and noise functions
callable:function()
to get an actual function item to call.mutation:as-vector()
, mutation:as-point()
, noise:as-point()
, noise:as-vector()
to switch modalities. (components/mutations.xqy, components/modifiers.xqy, noise/)Other incompatibilities:
mutation:random-mutation()
and mutation:random-mutations()
changed order of arguments to make compatible with general usage (components/mutations.xqy)components/systems.xqy
is now shapes/systems.xqy
with namespace changed from "http://mathling.com/art/systems" to "http://mathling.com/shape/systems"point:orientation()
arguments order interpreted so that first two points are edge and orientation is of third point relative to that edge (geo/point.xqy); calls should flipped 2nd and 3rd parametersgeom:point()
, geom:x()
, geom:y()
, geom:px()
, geom:py()
, geom:midpoint()
Use point functions instead. Not present in XSL package. (geo/euclidean.xqy)Major new capabilities:
seq:sequence()
(core/sequences.xqy)seq:mirror()
, seq:alternate()
, seq:shift()
, seq:modix()
grid:hex-triads()
, grid:hex-subgrid()
, grid:hex-points()
, grid:hexagons()
, grid:excluded()
(shapes/grids.xqy)Other new things:
edge:skip()
(geo/edge.xqy)vector:destination()
, vector:mutate()
(core/vector.xqy)path:consolidate()
, path:consolidate-by-colour()
, path:consolidate-by-width()
, path:consolidate-points()
(geo/path.xqy)point:sorientation()
orientation of point triplets as a numerical sign (geo/point.xqy)geom:convex-hull()
(geo/euclidean.xqy)patterns:scale-and-center()
, patterns:center()
(shapes/patterns.xqy)paths:meander()
, paths:circle-spiral()
(shapes/paths.xqy)complex:sum()
, complex:eq()
, vcomplex:sum()
, vcomplex:eq()
effect:distant-light()
noise:trace-bounds()
, noise:cache()
(noise/modifiers.xqy)noise-map:flat-static()
, noise-map:sphere-static()
(noise/noise-map.xqy)tests/test-noise.xqy
testing noise functions and modifierssdf:opRepeat2()
, sdf:opMirrorRepeat2()
, sdf:opGridRepeat2()
, sdf:opPolarRepeat2()
util:zsign()
see bugs (core/utilities.xqy)mask:ref()
(types/mask.xqy)poly:multiply()
(types/polynomial.xqy)arr:blur()
, arr:horizontal-blur()
, arr:vertical-blur()
(core/array.xqy)examples/contours.xqy
, examples/tree.xqy
(examples/)Bug fixes, clean-ups, and tweaks
seq:primes()
, seq:prime-factors()
, seq:foreach-combination()
, seq:lazy-caterer()
, seq:thue-morse()
, seq:binomial()
tests/test-sequences.xqy
seq:foreach-permutation()local:testThueMorse()
in tests/test-sequences.xqy
$config:tolerance
instead of $config:ε
solid:ry()
, solid:rz()
using wrong accessor for spheressolid:ordered-edges()
and solid:edges() reporting inverted edgestransform:translate()
and transform:rotate()
check for no-opsdelaunay:base-triangle()
check for empty point listmarching:contours-by-function()
wrong cardinality on parametergeo/translate.xsl
leading to improper formattingsd3:sdPyramid()
misbehaves because util:sign(-0)
should be 0 but ends up negative as $v=0 fails (?!); however, some of the complex functions fail if util:sign(-0) is not negative (?!) so add util:zsign()
for sd3:sdPyramid()
simplex:noise4()
raising type errorbox:min-point()
offsets to grid:hex-grid()
calculationscore:randomize()
wrt keysMajor incompatibility: SDF functions
callable:function()
to get at the actual function now. Other functions-that-produce-annotated functions (noise, modifiers) will get this treatment going forward. However, callable:function()
will work on bare functions too, so it is advisable to just use it with these modules to future-proof code.Other incompatibilities
components/paths.xqy
to shapes/paths.xqy
; namespace changed from http://mathling.com/art/paths to http://mathling.com/shape/pathscomponents/paths.xqy
into shapes/grids.xqy
with namespace http://mathling.com/gridDocumentation
XSL APIs
Examples
Complete reworking of drawing functions
Major new objects and capabilities
geo/box.xqy
)geo/coordinates.xqy
)shapes/patterns.xqy
)types/reach.xqy
)shapes/grids.xqy
)Sequences (see core/sequences.xqy
)
SDF changes (see sdf/
)
New art components and capabilities
components/people.xqy
)components/squishy.xqy
)components/barnsley.xqy
)Miscellaneous new functions
core/utilities.xqy
)types/distributions.xqy
)geo/curves.xqy
)geo/splitree.xqy
)svg/effects.xqy
)svg/gradients.xqy
)components/english.xqy
)geo/path.xqy
)geo/edge.xqy
)Bug fixes
Tests
Major new components and capabilities
core/quaternion.xqy
, core/vquaternion.xqy
)music/music.xqy
)types/text.xqy
, string/string.xqy
)components/paths.xqy
)components/polyspiral.xqy
)components/arrangements.xqy
)components/modifiers.xqy
)components/refraction.xqy
)components/pixelsort.xqy
)components/crosshatch.xqy
)components/english.xqy
)components/oldkey.xqy
)Effects and filters
Colours and gradients
Images
image/image.xqy
)image/convolution.xqy
)image/pixelsort.xqy
)Randomizers
Geometry
Complex numbers
Tweaks
Misc
Major new algorithm: Wave Function Collapse (wfc/
)
Mutations:
Other new:
Refactoring of geometry code
geo/affine.xqy
geo/edge.xqy
; some renaming, e.g. geom:slice-edge()
=> edge:slice()
geo/box.xqy
to avoid twisted imports; external interface unchangedGeometry additional:
edge:as-point-arc()
Colours
Other bugs:
Major new components and features
3d/
)images/png.xqy
)geo/conrec.xqy
)types/distibutions.xqy
)geo/curves.xqy
)types/polynomial.xqy
)svg/effects.xqy
)Randomized components:
components/backgrounds.xqy
)components/cellular.xqy
)components/contours.xqy
)components/egg.xqy
)components/divisions.xqy
)components/fflame.xqy
)components/waves.xqy
)components/xtrs.xqy
)components/harmonograph.xqy
)Various spirals and curves (components/paths.xqy
)
Colours and gradients:
svg/gradients.xqy
)gradient:average-luminance()
to compute relative brightness of a set of coloursRandom distributions:
dist:post-shift()
to add a value to the output of the core algorithmdist:simple-sums()
method for constructing a cumulative weight table from an ordered set of raw weightskeys
hook for automating getting values from random indexes (art/core.xqy
)double
cast to override the implicit integer
cast of some of the distributions (e.g. Zipf)Types:
Isohedral tiling:
tiling:create-tiles
to control the extent of the bounds and override the defaultGeometry:
geom:area()
, geom:length()
, geom:n-faces()
, geom:region-point()
functionsgeom:tangent()
and geom:normal()
for 2D linear, quad, or cubic edge, plus associated geom:tangent-angle()
and geom:normal-angle()
(angle of the tangent or normal vector)point:valid()
to check for point coordinates that are infinite or NaNsolid:normal()
, solid:face-area()
, solid:face-centroid()
Framework
core:randomize()
core:random-parameter-map()
, core:random-parameters()
Signed distance functions
sdf:toSDF()
sdf:opUnion()
, sdf:opIntersect()
Components
mut:drift()
, handle missing parametersIncompatibilities
util:min-key()
and util:max-key()
geom:region-center()
honours a center
propertysolid:edges()
to return distinct edges; add solid:ordered-edges()
to get the full set of edges (including shared), in face ordertransform:describe()
to better match SVG transform propertyVarious fixes:
geom:region-center()
, fix bug in center of 4-sided polygongeom:ellipse-point()
core:dump-randomizer()
and $core:EVAL11
systems:pentaplexity()
to use parameters for scaling and generationsPossible future mayhem:
components/paths.xqy
[1] Requires functions from the http://expath.org/ns/file
and http://expath.org/ns/binary
namespaces.
[2] Depends on Saxon Java API extensions; metadata saved in a secondary file due to lacunae in Java PNG implementation.
[3] See Paul Bourke "CONREC: A Contouring Subroutine" (http://paulbourke.net/papers/conrec/
) for more information.
[4] See https://en.wikipedia.org/wiki/Elementary_cellular_automaton
for more information.
[5] See Valeriy G. Narushin, Michael N. Romanov, and Darren K. Griffin " A universal formula for avian egg shape" (https://www.biorxiv.org/content/10.1101/2020.08.15.252148v1
) for more information.
[6] See Scott Draves & Erik Reckase "The Fractal Flame Algorithm" (https://flam3.com/flame_draves.pdf) for more information.
Geometry:
box:max-y
for spacesgeom:project
return typemutate()
Sequences:
Utilities:
util:logK()
and util:log2()
(log base K and log base 2)rand:mutual-prime-pair()
(pair of mutually prime integers)util:modix
handle negative numbers to preserve sequentialitypaths:array()
calculationsDrawing/Colour/Effects:
gradient:random-gradient()
select a random well-known gradient or its reverseComponents:
Additions, extensions, and bug fixes to geometry code:
geo:region-intersects
between most region typesgeo:region-contains
between some region typesgeo:shortest-distance
from point to regiongeo:intersection
between edgesgeo:bounding-circle
of region (Weltz' algorithm)geo:bounding-box
of regiongeo:region-center
geo:regions
edge following to construct polygons from edge graphgraph.xqy
)treemap.xqy
)delaunay.xqy
)Drawing code
draw.xqy
)effect.xqy
)Miscellaneous
tonemap.xqy
)$EDGE-START
and $EDGE-END
in tiling coderoots.xqy
)complex.xqy
)Major refactoring of geospatial code, with some additional operations for splinning and reversing edges, among others. As a consequence of this a number of edge and path functions have shifted from euclidean.xqy
to edge.xqy
or path.xqy
in some cases with a slight renaming. Example: geom:linear-edge-point
is not edge:linear-point
. In addition a few functions have moved to utilities.xqy
(remap-degrees
, remap-radians
).
Handle error cases in edge:quad-length
better.
Change geom:inclination
to define it as 90° not 0° when the points are the same.
Change geom:destination
to avoid small round-off errors in Z values from inclination imprecision.
Add split tree and well-separated pair decomposition and spanning edges on WSPDs. (Depends on bug-fix in Saxon 10.6 to work.)
Add support for dithering of raw images.
Add support for complex numbers.
Add modules for signed distance function calculation, with various rendering and lighting calculations, with tests.
Add SVG gradient collection and module for manipulating SVG gradients.
Add permutation and combination calculations to utilities.xqy
.
Slight refactoring of random distributions code to avoid tangled imports.
ε is now defined globally in config.xqy
util:twixt
will reorder out-of-order arguments.
Bug fix to rand:skewed()
: incorrect calculation of standard deviation.
Bug fix to rand:flip()
: scaling error.
Reimplementation and API change to rand:random-selection()
to give more precise probability mapping.
Additional/cleaned-up randomizer tests: advice on optimizer flags for Saxon EE
util:rangeindex()
+ tests