l

larnt

@preview

3D line art engine using rust rewrite of fogleman/ln.

v0.1.0
MIT

Package Information

Last Updated
Categories
visualizationintegrationfun

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/larnt:0.1.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/larnt:0.1.0": *

Version History

0.1.0
577411fc39df...

larnt

Typst Universe
crates.io
Repo

3D line art engine using rust rewrite of fogleman/ln.

Examples

basics beads csg
basics beads (about 1min) csg
example1 func func2
example1 func (about 2s) func2 (about 1s)
func3 graph skyscrapers
func3 (about 1s) graph skyscrapers (about 3s)
suzanne test test0
suzanne test (about 20s) test0

Click on the example image to jump to the code.

Features

  • Primitives
    • Sphere
    • Cube
    • Triangle
    • Cylinder
    • Cone
    • 3D Functions
  • Triangle Meshes
  • Vector-based "Texturing"
  • CSG (Constructive Solid Geometry) Operations
    • Intersection
    • Difference
  • Output SVG

Usage

For information, see the manual.pdf.

Add the following code to your document:

#import "@preview/larnt:0.1.0" as la;

#image(la.render(
  // Some shapes to render
))

Build

# build the plugin
cargo build --release --target wasm32-unknown-unknown

# copy the wasm file to the current directory
cp ./target/wasm32-unknown-unknown/release/larnt_typst_plugin.wasm ./