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
922 stars 38 forks source link

Allow dot notation in `intersections` #738

Open rmburg opened 3 weeks ago

rmburg commented 3 weeks ago

Elements in groups can currently not be addressed by intersections.

The following code does not work:

#cetz.canvas({
  group(
    name: "foo",
    {
      rotate(45deg)
      rect(name: "bar", (-1, -1), (1, 1))
    },
  )

  line(name: "baz", (-2, -2), (2, 2))

  intersections("i", "foo.bar", "baz")
})
johannes-wolf commented 3 weeks ago

This could have a big impact on performance, because we would have to store all named objects in the context.