-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from nhartland/dev
Version 0.4
- Loading branch information
Showing
46 changed files
with
646 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- Environment for `forma` ldoctests | ||
return { | ||
math = math, | ||
assert = assert, | ||
print = function() end, | ||
cell = require('forma.cell'), | ||
pattern = require('forma.pattern'), | ||
automata = require('forma.automata'), | ||
primitives = require('forma.primitives'), | ||
subpattern = require('forma.subpattern'), | ||
neighbourhood = require('forma.neighbourhood'), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
<head> | ||
<title>forma Reference</title> | ||
<link rel="stylesheet" href="../ldoc.css" type="text/css" /> | ||
</head> | ||
<body> | ||
|
||
<div id="container"> | ||
|
||
<div id="product"> | ||
<div id="product_logo"></div> | ||
<div id="product_name"><big><b></b></big></div> | ||
<div id="product_description"></div> | ||
</div> <!-- id="product" --> | ||
|
||
|
||
<div id="main"> | ||
|
||
|
||
<!-- Menu --> | ||
|
||
<div id="navigation"> | ||
<br/> | ||
<h1>forma</h1> | ||
|
||
<ul> | ||
<li><a href="../contents.html">Index</a></li> | ||
</ul> | ||
|
||
|
||
|
||
<h2>Examples</h2> | ||
<ul class="nowrap"> | ||
<li><a href="../examples/async_automata.lua.html">async_automata.lua</a></li> | ||
<li><a href="../examples/binary_space_partition.lua.html">binary_space_partition.lua</a></li> | ||
<li><a href="../examples/bubbles.lua.html">bubbles.lua</a></li> | ||
<li><a href="../examples/cellular_automata.lua.html">cellular_automata.lua</a></li> | ||
<li><a href="../examples/corridors.lua.html">corridors.lua</a></li> | ||
<li><a href="../examples/isolines.lua.html">isolines.lua</a></li> | ||
<li><a href="../examples/maxrectangle.lua.html">maxrectangle.lua</a></li> | ||
<li><strong>perlin.lua</strong></li> | ||
<li><a href="../examples/readme.lua.html">readme.lua</a></li> | ||
<li><a href="../examples/sampling.lua.html">sampling.lua</a></li> | ||
<li><a href="../examples/voronoi.lua.html">voronoi.lua</a></li> | ||
</ul> | ||
<h2>Modules</h2> | ||
<ul class="nowrap"> | ||
<li><a href="../modules/forma.cell.html">forma.cell</a></li> | ||
<li><a href="../modules/forma.pattern.html">forma.pattern</a></li> | ||
<li><a href="../modules/forma.primitives.html">forma.primitives</a></li> | ||
<li><a href="../modules/forma.subpattern.html">forma.subpattern</a></li> | ||
<li><a href="../modules/forma.automata.html">forma.automata</a></li> | ||
<li><a href="../modules/forma.neighbourhood.html">forma.neighbourhood</a></li> | ||
</ul> | ||
<h2>Readme</h2> | ||
<ul class="nowrap"> | ||
<li><a href="../readme/README.md.html">README</a></li> | ||
</ul> | ||
|
||
</div> | ||
|
||
<div id="content"> | ||
|
||
<h2>perlin.lua</h2> | ||
<pre> | ||
<span class="comment">-- Perlin noise sampling | ||
</span><span class="comment">-- Here we sample a square domain pattern according to perlin noise, | ||
</span><span class="comment">-- generating three new patterns consisting of the noise thresholded at | ||
</span><span class="comment">-- values of 0, 0.5 and 0.7. | ||
</span> | ||
<span class="keyword">local</span> subpattern = <span class="global">require</span>(<span class="string">'forma.subpattern'</span>) | ||
<span class="keyword">local</span> primitives = <span class="global">require</span>(<span class="string">'forma.primitives'</span>) | ||
|
||
<span class="keyword">local</span> domain = primitives.square(<span class="number">80</span>,<span class="number">20</span>) | ||
<span class="keyword">local</span> frequency, depth = <span class="number">0.2</span>, <span class="number">1</span> | ||
<span class="keyword">local</span> thresholds = {<span class="number">0</span>, <span class="number">0.5</span>, <span class="number">0.7</span>} | ||
<span class="keyword">local</span> noise = subpattern.perlin(domain, frequency, depth, thresholds) | ||
|
||
<span class="comment">-- Print resulting pattern segments | ||
</span>subpattern.print_patterns(domain, noise, {<span class="string">'.'</span>, <span class="string">'+'</span>, <span class="string">'o'</span>})</pre> | ||
|
||
|
||
</div> <!-- id="content" --> | ||
</div> <!-- id="main" --> | ||
<div id="about"> | ||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> | ||
<i style="float:right;">Last updated 2019-01-07 21:10:29 </i> | ||
</div> <!-- id="about" --> | ||
</div> <!-- id="container" --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.