Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

fitzgen/fart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fart — fitzgen's art

A framework to create SVG-based generative art for pen plotters

About

fart is my personal tooling and framework for SVG-based generative art. Originally inspired by Benjamin Kovach's excellent write up on infrastructure and tooling for generative art, but has been evolving in its own direction since then.

I maintain fart just for myself. If it happens to work out for you, okay! But this is not intended to be the framework for creating art with Rust that everyone, everywhere should use. If you file an issue, I might or might not respond, let alone fix it. If you submit a pull request, I might or might not respond, and I might or might not merge it.

If you want to make generative art with Rust, probably check out nannou rather than fart!

Install

cargo install fart-cli

Quick Start

fart quick start

Generate a new fart project:

$ fart new my-cool-project

Run fart watch to automatically build your project and generate an SVG on each change.

$ cd my-cool-project/
$ fart watch

Hack on your project! Keep refreshing my-cool-project/images/latest.svg in your browser or preferred SVG viewer to see what your results look like.

CLI

For a full listing of CLI commands and flags, run fart help [subcommand].

fart new <name>

Create a new fart project named <name>.

fart run

Compile and run a a fart project, producing a new, time-stamped SVG render that is automatically committed for you.

fart watch

Watch a fart project, automatically build and run it on each change. Saves and commits time-stamped SVGs for you, so you can see the evolution of your project.

fart serve

Serve a project and its rendered SVGs on a local HTTP server. Automatically watches the project for changes and re-builds and re-runs it on each change, similar to fart watch. It provides a Web UI with a live-reloading preview, displays build and program logs, and has form widgets for interactively tweaking fart::user_const!s.

Library

Contains utilities for generating SVGs, building scenes, and working with numbers and RNGs.

Read the API docs!

Modules

fart::prelude

Common traits and functions that are used most of the time.

Intended for most projects to glob import the whole thing:

use fart::prelude::*;

fart::canvas

A canvas is a collection of drawn paths, which can be rendered into an SVG.

fart::path

Paths that get drawn in the SVG. Paths are made up of a series of line commands, and have a an associated color.

fart::process

Helpers for making images from processing-style, update->draw->update->draw->... loops.

fart::aabb

2D axis-aligned bounding boxes (AABBs) and AABB trees. Useful for fast-but-imprecise detection of collision/intersection/containment between things.

fart::geom

A hodge-podge assortment of 2D computational geometry algorithms built on top of euclid.

Re-exports

fart has many re-exports of other crates, to let you hit the ground running!

  • fart::euclid: Re-export of the euclid crate.

  • fart::failure: Re-export of the failure crate.

  • fart::noise: Re-export of the noise crate.

  • fart::num_traits: Re-export of the num-traits crate.

  • fart::rand: Re-export of the rand crate.