cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
928 stars 38 forks source link

Coil decoration only works with a specific order #757

Open lcnbr opened 4 days ago

lcnbr commented 4 days ago
#import "@preview/cetz:0.3.0"
#{
let a = (1,0)
let b = (0.12,0.3)
cetz.canvas(length:30%,{
  cetz.decorations.coil(cetz.draw.hobby(a,b),amplitude:0.051,segment-length:0.05112,align:"MID")
})
cetz.canvas(length:30%,{
  cetz.decorations.coil(cetz.draw.hobby(b,a),amplitude:0.051,segment-length:0.05112,align:"MID")
})
}

This code should produce identical images but the bottom one seems to be problematic. Additionally some combinations make the compiler crash. I have a document where this is the case but cannot make a MWE.

johannes-wolf commented 4 days ago

Setting b=(0.12, 0.4) panics because of rounding issues.

johannes-wolf commented 4 days ago

(Has nothing to do with this bug: Please use cetz 0.3.1, as 0.3.0 has some nasty bugs).