https://github.com/barrettotte/xslt-perlin2d
An ugly and slow 2D perlin noise SVG generator using XSLT 2.0 and self loathing.
https://github.com/barrettotte/xslt-perlin2d
perlin-noise stupid svg xml xslt xslt2
Last synced: 6 months ago
JSON representation
An ugly and slow 2D perlin noise SVG generator using XSLT 2.0 and self loathing.
- Host: GitHub
- URL: https://github.com/barrettotte/xslt-perlin2d
- Owner: barrettotte
- License: mit
- Created: 2019-07-23T11:58:44.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-25T18:35:42.000Z (almost 7 years ago)
- Last Synced: 2025-02-03T13:13:14.819Z (over 1 year ago)
- Topics: perlin-noise, stupid, svg, xml, xslt, xslt2
- Language: XSLT
- Homepage:
- Size: 1.22 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XSLT-Perlin2D
A 2D perlin noise SVG generator using XSLT 2.0 and self loathing.
Its ugly, slow, and I'm sorry for bringing it into existence.
## Build
* This was actually a huge pain to figure out which XSLT processor to use (xalan, saxon, xsltproc, etc)
* I ended up doing something gross. I used Apache Ant and Saxon9.
* To build with Saxon9 (XSLT 2.0) use ```ant``` **Recommended**
* Can also be built with XALAN (XSLT 1.0) use ```groovy build-xalan.groovy``` but its runs terribly at greater than 128x128 size
## Generated SVG

## Input XML (```perlin-svg.xml```)
```xml
256
256
1234
6
4
```
## Generated Perlin noise XML ```example-perlin.xml```
Sample of perlin noise data that is generated before transforming to SVG.
## Output SVG ```perlin.svg```
```xml
```
## XSLT Descriptions
| File Name | Description |
| --------- | ----------- |
| hash.xslt | Pre-computed hashes for generating perlin noise |
| map.xslt | Create map data structure of pixels |
| noise.xslt | Generate 2D Perlin noise |
| perlin-svg.xslt | Driver |
| svg-utils.xslt | Utils for SVG generation and color value conversion |
| utils.xslt | General utils |
## Sources
* Ken Perlin's implementation http://mrl.nyu.edu/~perlin/noise/
* https://en.wikipedia.org/wiki/Perlin_noise
* https://codepen.io/shshaw/post/vector-pixels-svg-optimization-animation-and-understanding-path-data