CaleTZ
CaleTZ is a Typst package for visualizing Calabi-Yau manifolds using CeTZ 3D drawing primitives.
It generates colorful, smooth 3D surfaces with adjustable parameters, making it easy to explore complex geometries directly in Typst.



Installation
Using just
First, install just if you don’t have it yet:
cargo install just
Then, install the CaleTZ package:
git clone https://github.com/rice8y/caletz.git
cd caletz
just install
This installs the package locally to Typst’s package directory.
Using typkg
First, install typkg if you don’t have it yet:
cargo install --git https://github.com/rice8y/typkg.git
Then, install the CaleTZ package:
typkg install https://github.com/rice8y/caletz.git
This will also install the package locally for Typst usage.
Usage Example
#import "@local/caletz:0.2.0": calabi-yau
#set page(width: auto, height: auto, margin: 1cm)
#calabi-yau(
power: 3,
angle: 0.4,
subdivisions: 20
)
Parameters
power: Degree of the manifold (e.g., 3). Must be a positive integer.angle: Adjusts the combination of z-coordinates; smaller values flatten the surface.subdivisions: Controls mesh density; higher values give smoother surfaces.colormap: Optional, default"jet". Can be"viridis","plasma","cool", or"hot".scale-factor: Optional, default3.0. Scales the entire mesh.rotation: Optional, default(30deg, 45deg, 0deg). Rotates the 3D view.
For best results, use a high
subdivisionsvalue, but note it increases computation.
License
This project is distributed under the MIT License. See LICENSE.