p

pull-eh

@preview

Visualize pulleys with Typst and CeTZ

v0.1.1
MIT

Package Information

Last Updated
Minimum Typst Version
0.13.1
Categories
visualization
Disciplines
engineering

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/pull-eh:0.1.1

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/pull-eh:0.1.1": *

Version History

0.1.10.13.1
39bcbe756553...
0.1.00.13.0
750c7aefb571...

Pull-eh

Visualize pulleys with Typst and CeTZ. This package provides a function wind() that makes it easy
to draw a taut rope/cable winding around a number of pulleys or pivot points.

Getting Started

To add this package to your project, use this:

#import "@preview/cetz:0.4.0"
#import "@preview/pull-eh:0.1.1"

#cetz.canvas(length: 2cm, {
  import cetz.draw: *
  import pull-eh: *

  rotate(-65deg)

  let point = (0, 9)
  circle(name: "a", (5, 15), radius: 1)
  circle(name: "b", (5, 12), radius: 0.8)
  circle(name: "c", (5, 9), radius: 1)

  wind(
    stroke: 2pt,
    point,
    (coord: "a", radius: 1) + cw,
    (coord: "c", radius: 1) + cw,
    (coord: "b", radius: 0.8) + cw,
    "c.north",
  )
})

Usage

See the manual for details.