CaleTZ is a Typst package for visualizing Calabi-Yau manifolds using CeTZ 3D drawing primitives.
It generates high-quality, parameterizable 3D surfaces representing slices of Calabi-Yau spaces. This package is ideal for physics and mathematics visualizations, allowing you to explore these complex geometries directly within your Typst documents.
Calabi-Yau Projection n=5 Cross-section View Topological Structure
CaleTZ visualizes a 3D projection of a complex 1-dimensional sub-manifold (an algebraic curve) related to the Fermat Quintic Calabi-Yau threefold.
The surface is defined by the locus of points satisfying the Fermat equation in
To visualize this 4-dimensional object (
Let
where:
-
$n$ is the degree of the manifold (typically$n=5$ for the quintic). -
$k_1, k_2 \in {0, 1, \dots, n-1}$ determine the Riemann sheet branches. -
$a \in [0, \pi/2]$ and$b \in [-\pi/2, \pi/2]$ are the domain parameters.
Since we cannot view 4 dimensions directly, we project the coordinates into
Here,
#import "@preview/caletz:0.1.0": calabi-yau #set page(width: auto, height: auto, margin: 1cm) // Render a Calabi-Yau projection with degree 3 #calabi-yau( power: 3, angle: 0.4, subdivisions: 20, scale-factor: 4.0 )
| Parameter | Type | Default | Description |
|---|---|---|---|
power |
int |
3 |
The degree |
angle |
float |
0.0 |
The projection angle |
subdivisions |
int |
15 |
The mesh density. Higher values produce smoother surfaces but increase compilation time. |
colormap |
string |
"jet" |
Color scheme. Options: "jet", "viridis", "plasma", "cool", "hot". |
scale-factor |
float |
3.0 |
Scaling multiplier for the final mesh size inside the canvas. |
rotation |
angle array |
(0deg, 0deg, 0deg) |
Initial camera rotation |
width |
length |
400pt |
The width of the drawing canvas. |
height |
length |
400pt |
The height of the drawing canvas. |
Tip
Performance Note: Generating these meshes involves complex number arithmetic for every vertex. For subdivisions > 30, compilation might take a few seconds.
This project is distributed under the MIT License. See LICENSE for details.