Gallery › Geometry and fractals

Recursive Peaks

A night mountain range built entirely from artkit's fractals: nested-triangle peaks, a carpet-pattern starfield and snowflake curves.

Recursive Peaks, three mountains made of nested triangles shaded from white tips to grey, under a night sky of cyan and pink stars and three fractal snowflake outlines
Click the picture for the full-size render.

How it is made

The peaks are triangles subdivided with gasket and shaded by altitude, the sparse starfield comes from carpet, and the snowflakes overhead are edgepoly Koch and quadratic Koch curves. Everything is a fractal from artkit's fractals section.

Details

Category
Geometry and fractals
Tags
landscape
Libraries
artkit
Added
2026-08-03
Page size
640 × 640 points

Source

View source the whole program in a scrolling window, or read gallery/recursive_peaks.ps on GitHub. To draw it yourself, from a checkout of the repository:

pscat --page 640x640 gallery/recursive_peaks.ps
The first 40 of 111 lines of the source
%!PS-Adobe-3.0
%%Title: Recursive Peaks
%%BoundingBox: 0 0 640 640
%%Creator: Claude & a nostalgic LaserWriter fan
%%EndComments

% A night-time mountain range built entirely from artkit's fractals
% section: each peak is one large triangle recursively subdivided by
% `gasket`, with every facet shaded by its own altitude (dark rock at
% the base, snow-white near the summit) -- a "low-poly" mountain look
% that falls directly out of the Sierpinski subdivision itself, not a
% separate rendering trick. The sky is a `carpet`-driven starfield: most
% cells are skipped, the rest stamp a small dot, so the recursive square
% subdivision reads as a scattered field of stars rather than a solid
% tiling. Two `edgepoly` snowflakes (the /koch and /quadkoch generators)
% float above the peaks. Run from the repo root:
%
%   pscat --page 640x640 gallery/recursive_peaks.ps

(lib/artkit.ps) run
11 srand

% --- sky: banded gradient, nocturne dark-to-navy -------------------------
0 1 31 {
    /band exch def
    /bt band 31 div def
    /nocturne pal 0 get /nocturne pal 1 get bt mix3 setrgbcolor
    newpath 0 band 640 mul 31 div 640 640 31 div 1 add rectfill
} for

% --- starfield: carpet subdivision, most cells skipped -------------------
0 0 640 640 3 {
    4 dict begin
        /ch exch def /cw exch def /cy exch def /cx exch def
        5 chance 0 eq {
            /sx cx cw 2 div add 2 jit add def
            /sy cy ch 2 div add 2 jit add def
            4 chance 0 eq { /nocturne pal 4 get } { /nocturne pal 3 get } ifelse
            aload pop setrgbcolor
            newpath sx sy 1 frnd 1.6 mul add 0 360 arc fill