Skip to content

CDL Examples

Ready-to-use CDL expressions for common gemstones, minerals, and crystal habits — copy any snippet below straight into the CDL CLI or your own integration.

Basic Crystals

Syntax reference

Single-form crystal habits using Miller indices or named forms.

Diamond Octahedron

Classic octahedral habit

cubic[m3m]:{111}

Fluorite Cube

Perfect cubic habit

cubic[m3m]:{100}

Garnet Dodecahedron

Rhombic dodecahedron

cubic[m3m]:{110}

Garnet Trapezohedron

Icositetrahedron habit

cubic[m3m]:{211}

Hexagonal Prism

Basic hexagonal prism (beryl, apatite)

hexagonal[6/mmm]:{10-10}

Calcite Rhomb

Rhombohedral cleavage form

trigonal[-3m]:{10-11}

Pyritohedron

Pentagonal dodecahedron (pyrite)

cubic[m-3]:{210}

Ruby Tabular

Tabular habit with dipyramid and pinacoid

trigonal[-3m]:{10-11}@1.0 + {0001}@0.4

Multi-form Combinations

Syntax reference

Crystals with multiple forms combined using the + operator.

Diamond (Octahedron + Dodecahedron)

Octahedron with minor dodecahedron truncation

cubic[m3m]:{111}@1.0 + {110}@0.2

Fluorite Cuboctahedron

Equal cube and octahedron development

cubic[m3m]:{100}@1.0 + {111}@1.0

Garnet Combination

Dodecahedron with trapezohedron

cubic[m3m]:{110}@1.0 + {211}@0.6

Beryl Hexagonal Prism

Prism with basal pinacoid

hexagonal[6/mmm]:{10-10}@1.0 + {0001}@1.0

Beryl Tabular

Tabular habit with dominant pinacoid

hexagonal[6/mmm]:{0001}@1.0 + {10-10}@0.6 + {11-20}@0.2

Quartz (Short Prismatic)

Short prism with rhombohedral terminations

trigonal[32]:{10-10}@0.4 + {10-11}@1.2 + {01-11}@1.0

Tourmaline Prismatic

Hemimorphic prismatic habit

trigonal[3m]:{10-10}@1.0 + {10-11}@0.8

Zircon

Tetragonal bipyramid with prism

tetragonal[4/mmm]:{110}@1.0 + {101}@0.9 + {100}@1.3

Topaz

Orthorhombic prismatic habit

orthorhombic[mmm]:{110}@1.0 + {120}@1.1 + {011}@0.9

Chrysoberyl Tabular

Tabular orthorhombic crystals

orthorhombic[mmm]:{110}@1.0 + {010}@0.8 + {111}@0.5

Moonstone

Monoclinic feldspar habit

monoclinic[2/m]:{010}@1.0 + {110}@0.8 + {001}@0.7 + {100}@0.5

Modifications

Syntax reference

Crystal shapes modified by elongation, flattening, or tapering.

Quartz (Elongated Prism)

Classic elongated quartz crystal

trigonal[32]:{10-10}@0.5 + {10-11}@1.2 + {01-11}@1.0 | elongate(c:2.0)

Sapphire (Barrel-shaped)

Elongated barrel-shaped corundum

trigonal[-3m]:{10-10}@1.0 + {10-11}@0.7 | elongate(c:1.8)

Tourmaline (Elongated)

Strongly elongated prismatic tourmaline

trigonal[32]:{10-10}@1.0 + {10-11}@0.8 | elongate(c:2.5)

Flattened Tabular

Flattened octahedral crystal

cubic[m3m]:{111} | flatten(a:0.5)

Crystal twinning using the | twin(law) syntax.

Diamond Macle

Flattened triangular spinel-law contact twin

cubic[m3m]:{111}@1.0 + {100}@0.3 | twin(spinel_law)

Spinel Macle

Classic spinel law twin

cubic[m3m]:{111}@1.0 + {100}@0.25 | twin(spinel_law)

Fluorite Interpenetrating

Two cubes at 60 degree rotation around [111]

cubic[m3m]:{100}@1.0 | twin(fluorite)

Fluorite Twin (with Octahedron)

Interpenetrating twin with octahedron modification

cubic[m3m]:{100}@1.0 + {111}@0.8 | twin(fluorite)

Quartz Japan Law

Heart-shaped contact twin at ~84.5 degrees

trigonal[32]:{10-10}@0.5 + {10-11}@1.2 + {01-11}@1.0 + {0001}@2.0 | elongate(c:2.0) | twin(japan)

Quartz Dauphine

Penetration twin with 180 degree c-axis rotation

trigonal[32]:{10-10}@0.5 + {10-11}@1.2 + {01-11}@1.0 + {0001}@2.0 | elongate(c:2.0) | twin(dauphine)

Quartz Brazil Law

Optical twin (left/right hand interpenetration)

trigonal[32]:{10-10}@0.5 + {10-11}@1.2 + {01-11}@1.0 + {0001}@2.0 | elongate(c:2.0) | twin(brazil)

Staurolite 90 Degree Cross

Cruciform penetration twin

orthorhombic[mmm]:{110}@1.0 + {010}@0.7 + {001}@0.2 | twin(staurolite_90)

Staurolite 60 Degree Cross

X-shaped "fairy cross" twin

orthorhombic[mmm]:{110}@1.0 + {010}@0.6 + {001}@0.3 | twin(staurolite_60)

Chrysoberyl Trilling

Cyclic pseudohexagonal triplet twin

orthorhombic[mmm]:{1-10}@1.0 + {110}@0.9 + {010}@0.5 + {001}@0.2 | twin(trilling)

Features v1.2

Syntax reference

Surface markings, growth patterns, and inclusions annotated on forms.

Diamond with Trigons

Octahedron with dense triangular etch pits

cubic[m3m]:{111}@1.0[trigon:dense] + {110}@0.2

Diamond Cube with Etch Pits

Cube faces with square dissolution features

cubic[m3m]:{100}[etch_pit:square]

Quartz with Striations

Prism faces with horizontal growth lines

trigonal[32]:{10-10}@0.5[striation:horizontal] + {10-11}@1.2 + {01-11}@1.0 | elongate(c:2.0)

Sapphire with Silk

Barrel-shaped with horizontal striations

trigonal[-3m]:{10-10}@1.0[striation:horizontal] + {10-11}@0.7 | elongate(c:1.8)

Tourmaline with Striations

Parallel vertical striations on prism faces

trigonal[32]:{10-10}@1.0[striation:parallel] + {10-11}@0.8 | elongate(c:2.5)

Garnet with Curved Striations

Dodecahedral faces with characteristic curved lines

cubic[m3m]:{110}[striation:curved]

Watermelon Tourmaline

Colour-zoned pink core with green rim

trigonal[32]:{10-10}@1.0 + {10-11}@0.8 | elongate(c:1.5)

Phenomena v1.2

Syntax reference

Optical phenomena like asterism, chatoyancy, and adularescence.

Star Sapphire (6-Ray)

Six-rayed star from oriented rutile silk

trigonal[-3m]:{10-11}@1.0 | phenomenon[asterism:6]

Star Sapphire (with Silk)

Asterism with silk feature on form

trigonal[-3m]:{10-11}@1.0[silk:dense] | phenomenon[asterism:6]

Cat's Eye Chrysoberyl

Sharp chatoyant band from parallel silk

orthorhombic[mmm]:{110}@1.0 | phenomenon[chatoyancy:sharp]

Star Sapphire (Strong)

Asterism with intensity parameter

trigonal[-3m]:{10-11} | phenomenon[asterism:6, intensity:strong]

Grouping and Labels v1.3

Syntax reference

Parenthesized groups for shared features and labeled forms.

Grouped with Shared Feature

Both forms share phantom feature

cubic[m3m]:({111}@1.0 + {100}@1.3)[phantom:3]

Group + Standalone Form

Group alongside an ungrouped form

cubic[m3m]:({111} + {100})[phantom:3] + {110}@0.8

Merged Features

Own features merge with group features

cubic[m3m]:({111}[trigon:dense] + {100})[phantom:3]

Labeled Forms

Forms labeled as core and rim

cubic[m3m]:core:{111}@1.0 + rim:{100}@1.3

Labeled Group

Named group with shared feature

cubic[m3m]:core:({111} + {100})[phantom:3]

Definitions v1.3

Syntax reference

Named form definitions for reuse with @name and $reference syntax.

Simple Definition

Define octahedron form, reference with $oct

@oct = {111}@1.0 cubic[m3m]:$oct + {100}@1.3

Quartz Definitions

Named prism and rhombohedron

@prism = {10-10}@1.0 @rhomb = {10-11}@0.8 trigonal[-3m]:$prism + $rhomb

Chained Definitions

Definitions referencing other definitions

@a = {111}@1.0 @b = {100}@1.3 @combo = $a + $b cubic[m3m]:$combo

With Doc Comments

Definitions work alongside doc comments

#! Mineral: Diamond @oct = {111}@1.0 cubic[m3m]:$oct

Amorphous Materials v2.0

Syntax reference

Non-crystalline materials using shape descriptors instead of Miller indices.

Precious Opal

Opal with play of colour from silica sphere diffraction

amorphous[opalescent]:{nodular, botryoidal} | phenomenon[play_of_color:spectral]

Turquoise Massive

Massive turquoise habit with characteristic colour

amorphous[waxy]:{massive, nodular}[colour:blue]

Pearl Nacre

Layered nacre with orient iridescence

amorphous[opalescent]:{mammillary}[nacre:layered] | phenomenon[iridescence:orient]

Obsidian

Volcanic glass with conchoidal fracture

amorphous[glassy]:{massive, conchoidal}[colour:black]

Amber

Fossilised tree resin in nodular form

amorphous[resinous]:{nodular}[colour:golden]

Nested Growth v2.0

Syntax reference

Overgrowth relationships using the > operator for scepter and phantom crystals.

Scepter Quartz

Prismatic base with overgrown cap crystal

trigonal[32]:({10-10}@0.5 + {10-11}@1.2) > ({10-10}@0.8 + {10-11}@0.6) | elongate(c:2.0)

Phantom Diamond

Octahedron core with later overgrowth shell

cubic[m3m]:{111}@1.0[phantom:3] > {111}@0.6

Multi-stage Growth

Three successive growth stages (right-associative)

cubic[m3m]:{111}@1.0 > {111}@0.7 > {111}@0.4

Aggregates v2.0

Syntax reference

Multi-crystal arrangements using the ~ operator for clusters, druses, and radiating forms.

Quartz Cluster

Cluster of 12 quartz crystals

trigonal[32]:({10-10}@0.5 + {10-11}@1.2 | elongate(c:2.0)) ~ cluster[12]

Fluorite Cluster

Group of 6 fluorite cubes

cubic[m3m]:{100}@1.0 ~ cluster[6]

Amethyst Geode Lining

Dense druzy coating inside a geode cavity

trigonal[32]:({10-10}@0.3 + {10-11}@1.0) ~ druse[50]@0.2

Radial Tourmaline

Radiating arrangement of 8 tourmaline needles

trigonal[3m]:({10-10}@1.0 + {10-11}@0.8 | elongate(c:3.0)) ~ radial[8]

Group-Level Twins v2.0

Syntax reference

Twin laws applied to individual groups rather than the whole crystal.

Spinel Twin Group

Spinel twin on one group, untwinned dodecahedron alongside

cubic[m3m]:(({111}@1.0 + {100}@0.3) | twin(spinel)) + {110}@0.8

Mixed Twin Groups

Different twin laws on different groups

cubic[m3m]:(({111}) | twin(spinel)) + (({100}) | twin(fluorite))

Building Your Own

Combine these patterns to create custom crystal morphologies:

# Start with a base form
cubic[m3m]:{111}@1.0

# Add a modifying form with +
cubic[m3m]:{111}@1.0 + {100}@1.3

# Adjust relative development
# Smaller @scale = more prominent faces
cubic[m3m]:{111}@0.8 + {100}@1.5  # More octahedron
cubic[m3m]:{111}@1.5 + {100}@0.8  # More cube

# Add features to specific forms
cubic[m3m]:{111}@1.0[trigon:dense] + {100}@1.3

# Apply a modification
trigonal[32]:{10-10}@0.5 + {10-11}@1.2 | elongate(c:2.0)

# Add a twin law
cubic[m3m]:{111}@1.0 | twin(spinel_law)

# Annotate a phenomenon
trigonal[-3m]:{10-11}@1.0[silk:dense] | phenomenon[asterism:6]

# Full example with comments, definitions, features, and twin
#! Mineral: Diamond
#! Habit: Macle twin
@oct = {111}@1.0[trigon:sparse]
cubic[m3m]:$oct + {100}@0.3 | twin(spinel_law)