An open API service indexing awesome lists of open source software.

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.

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
![perlin-screenshot](screenshot.PNG)

## 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