CDL Examples

Ready-to-use CDL expressions for common gemstones, minerals, and crystal habits. Click any example to open it in the Playground.

Basic Crystals

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

Multi-form Combinations

Crystals with multiple forms combined using the + operator.

Modifications

Crystal shapes modified by elongation, flattening, or tapering.

Twin Laws

Crystal twinning using the | twin(law) syntax.

Features v1.2

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

Phenomena v1.2

Optical phenomena like asterism, chatoyancy, and adularescence.

Grouping and Labels v1.3

Parenthesized groups for shared features and labeled forms.

Definitions v1.3

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

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)

Try These Examples

Open the CDL Playground to experiment with these expressions and customize them.

Open Playground