https://github.com/mhhollomon/mandel
My take on the fractal coloring genre
https://github.com/mhhollomon/mandel
angelscript c-plus-plus-17 cereal fractals
Last synced: 12 months ago
JSON representation
My take on the fractal coloring genre
- Host: GitHub
- URL: https://github.com/mhhollomon/mandel
- Owner: mhhollomon
- License: mit
- Created: 2020-04-30T22:38:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-11T12:48:41.000Z (almost 6 years ago)
- Last Synced: 2025-02-10T02:49:29.924Z (about 1 year ago)
- Topics: angelscript, c-plus-plus-17, cereal, fractals
- Language: C++
- Size: 1.01 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mandel
My take on the fractal coloring genre
A set of tools to evaluate and color fractal sets.
# Building
~~~
cmake -S . -B build
cmake --build build
~~~
The executables will be in the new build directory.
# Programs
## fractalator
A CLI for evaulating point on the complex number plane for fractal set
inclusion. Currently, the only fractal supported is the Mandelbrot set.
fractalator writes an output file with the results of the evaulation. This file
can then be used with the `colorator` utiltiy (see below).
### command line
`fractalator `
#### general arguments
- -h, --help
- Print out short command line help text
- -o, --output-file <filename>
- path to file into which the output will be written. If the file exists, it
will be truncated. - -j, --jobs <jobcount>
- Number of parallel threads use for computing. If
0is given or
if the the options is not on the command line, the engine will use a strict
sequential code path. If <jobcount> is1, the parallel
path will be used, but only one calculating thread will be used. This can
actually be slower than0. If <jobcount> is greater
than1, then that many threads will be used. - -l --limit <limit>
- Integer number of iterations of the fractal formula to use to decide if the
results will diverge or not. - -e, --escape <radius>
- Value to use to test if the point has diverged. Default is 256.0
#### bounding box arguments
There are multiple ways to define the part of the complex plane that will be
used.
- Direct - specify the bounding box's top left and bottom right points using
`--ltr,--lti,--rbr,--rbi`. This is the base case. Internally, all other ways
to define the bounding box are reduced to this.
- Center - use `--cr,--ci` to specify the center of the box and `--box` to
specify the length of the sides. Note that the box specified this way will
necessarily be a square.
- Aspect - Use `--ltr,--lti` to specify the top right of the box, `--box` to
specify the length of the real axis and `--aspect` to give sampling. In
this case, the real axis will be the length given by `--box`. The imaginary
axis will be a scaled length of the ratio of given by aspect.
`--ltr 1.0 --lti 1.0 --box 0.5 --aspect 1920x1080` is equivalent to `--ltr
1.0 --lti 1.0 --rbr 1.5 --rbi 0.71875 --width 1920 --height 1080`
- --ltr <number>
- real coordinate for the left top point of the
bounding box - --lti <number>
- imaginary coordinate for the left top point of
the bounding box - --rbr <number>
- real coordinate for the right bottom point of
the bounding box - --lti <number>
- imaginary coordinate for the right bottom point
of the bounding box - --cr <number>
- real coordinate for the center of the bounding box
- --ci <number>
- imaginary coordinate for the center of the
bounding box - --box <number>
- When used with
--cr,--ci, this is the length of
the side for bounding box. When used with--aspect, this is the length of the
real axis for the bounding box.
#### sampling arguments
These arguments control the number of points along each axis that will be
sampled by the algorithm.
- -s, --samples <n>
- Number of samples to use on both axis, equivalent to
--width n --height n - --width <n>
- Number of samples to use on the real axis
- --height <n>
- Number of samples to use on the imaginary axis
- --aspect <WxH>
- Number of samples to use. Equivalent to
--width W --height Hbut also
controls the actual height of the bounding box (See above).
## colorator
Applies a user supplied coloring algorithm to the input fractal data to create a
.bmp image file.
The coloring algorithm is written in
[angelscript](http://www.angelcode.com/angelscript/sdk/docs/manual/doc_script.html).
See the [scripting documentation](docs/scripting.md) for further details on the interface. See the
[samples directory](samples/) for examples.
### command line
`colorator [-h] -o -i -s -a <argstring>`
<dl>
<dt>-h, --help </dt>
<dd>Print out short command line help text<dd>
<dt>-o, --output-file <filename></dt>
<dd>path to file into which the output will be written. If the file exists, it
will be truncated.</dd>
<dt>-i, --input-file <filename></dt>
<dd>Path to .fract file on to which to apply coloring. It assumes the file
format is that put out by fractalator.</dd>
<dt>-s, --script-file <filename></dt>
<dd>Path to the angelscript file containing coloring algorithm.</dd>
<dt>-a, --args <argstring></dt>
<dd>semi-colon separated list of key/value pairs that will be passed to the
script. see [scripting documentation](docs/scripting.md) of further
details</dd>
</dl>
## mandel
`mandel` combines `fractalator` and `colorator`, but with a small bit of
smarts. `mandel` checks the parameters encoded in the `fractalator` output. If
they are the same, then only the coloring pass is run. If they are different,
then both will be run. This allows you to fine tune the coloring while still
having the felixbility to slightly tweak the fractal while only doing what is
required.
### command line
The options to `mandel` are mostly a straight combination of the `fractalator`
and `colorator` parameters. Differences are noted below.
<dl>
<dt>-o, --output-file <filename></dt>
<dd>This is the path prefix for both the .fract file and the image file. If
<filename> is `/somedir/foo` ,then the .fract file will be
`/somedir/foo.fract` and the image file will be `/somedir/foo.bmp`</dd>
<dt>-s, --samples</dt>
<dd>Like the fractalator option</dt>
<dt>--script <filename></dt>
<dd>Same as the (-s, -script-file) options to colorator</dd>
</dl>
## gmandel
Hypothetical future version of mandel but with a gui interface.
## Technologies
- [Cmake](https://cmake.org/) for build configuration.
- [cxxopts](https://github.com/jarro2783/cxxopts) for command line handling.
- [cereal](https://uscilab.github.io/cereal/index.html) for serialization.
- [angelscript](http://www.angelcode.com/angelscript/sdk/docs/manual/doc_script.html) for the user scripting support.
## License
MIT © 2020 Mark Hollomon