Hi everyone,
I’m trying to recreate an electron diffraction tube diagram with CeTZ in Typst. To get some perspective, I’m using on-yz for projections.
Now I’d like to draw an angle (α) between two lines. But whenever I use angle(…), I get the error that all points must have the same z-coordinate — which seems to happen because some of my points come from the on-yz projection.
Here’s a minimal code snippet:
#canvas(length: 1cm, {
import draw: *
on-yz({
arc((0, 0), radius: 1, start: 45deg, stop: -135deg)
})
line((0, 0), (5.7, 0), name: "lower-line")
on-yz(x: 4, {
circle((0, 0), radius: 2, name: "circle")
})
line((0, 0), "circle.north", name: "upper-line")
// This causes the error:
// angle.angle((0, 0), "upper-line.end", "lower-line.end")
})
How can I correctly draw the angle between these lines in such a mixed 2D/3D setup? Is there a way to “flatten” or project the points so angle accepts them?
Here is a copy of the complete project:
https://typst.app/project/rj4rkyfUxx77BTyfejsQhS
Thanks a lot!