| / /| | \ | |/|/ \ \| | / | | | \| |/ | | | / - \ | - \ |/- |\|/ / \ / | |\|/| - - | | |/ |/| | / / \| / | | | |/\| \ | - \|/ / \ |\| | | ---| / o @ - | - \ - | |/| / \|/ O \ / /\|/ |/ \|/| |/ @ | / \ / | | -- | \ | | | / | / O ---| / |/ | |--- \ | |\| / \ / / \|/ ---| \|/ - \| | / -- / | --|\| | \|| | - \ |\ - -- |/ | | | \ | \|/ \| -----/ \| /|/ / \|/ | | / | |-- | - . | | |/ / \ \|\ / -.\ | | | --- o - | -- \|\ | / |/ \ \|/ |/\|/ | \ | | | | | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Contours

Quartz composer patch · 11/13/15
A contour map of a 3D function, rendered by the Contours plugin.

A contour map of a 3D function, rendered by the Contours plugin.

Download Contours.plugin.zip — Last updated 11/13/15

This plugin provides a Quartz Composer patch that draws contours of an input function. My implementation is inspired by Paul Bourke's CONREC algorithm, although there are significant differences.

This plugin was built using Weston Hanners' PerlinNoiseKit and Dave DeLong's DDMathParser.

Video

Installation

  1. Download Contours.plugin above.
  2. Drag the plugin file to /Library/Graphics/Quartz Composer Plug-Ins/.
  3. Create a new composition from within Quartz Composer and search for "Contours" in the Library.

Input Port Documentation

Function
The function to contour, as a string. Mathematical functions like sin, cos, sqrt, ln, etc. are recognized. 3 variables are passed to the function: $x, $y and $t (the current time value of the patch). The contour algorithm assumes the output of this function is between -1 and 1.
Size
The width/height of the output contours.
Contours Depth
The depth of the output contours.
Grid Divisions
The size of the sample grid. Higher values yield more accurate contour lines, although can slow down Quartz Composer significantly. The total number of samples taken will be the square of this value.
Number of Lines
The number of contour lines to compute between function values -1 and 1.
Line Thickness
The thickness of contour lines in pixels.
Bottom Color
The color of contour line at the bottom. Color is interpolated between bottom and top.
Top Color
The color of the contour line at the top.
Noise Frequency
Perlin noise frequency to add on top of contoured function. Higher frequency values result in more jittery noise.
Noise Scale
Amount of Perlin noise to add to contoured function.
Noise Speed
Speed of Perlin noise shift. High values result in a chaotic function.