I don’t know what to think of this. Even the simplest of drawings produce considerable errors and it seems to be a new phenomenon (had no problems before). Have there been any changes to the intersections algorithm of late? This simple drawing gives hoek = 59.84deg, it should be 60deg.
#cetz.canvas({import cetz.draw:*
circle((0,0),radius:4,name:"c")
let v1 = (4,0)
circle(v1,radius:4,stroke:red,name:"c1")
intersections("i","c","c1")
get-ctx(ctx => {let (ctx,v1,v2)=cetz.coordinate.resolve(ctx,v1,"i.0")
let hoek = cetz.vector.angle((0,0,0),v1,v2)})})
Hello! In the last days CeTZ v0.5.3 was released, but I don’t think that version changed anything in the way the calculation for intersections work. Can you share which version you used before?
From what I understand the error is caused by intersections and you can get a better accuracy by increasing the samples used with intersections(..., samples: 60).
Apologies for late respeonse. I have always used version 0.5.2. I once wrote a function for drawing help lines which required get-ctx etc… After that, I always used get-ctx and coordinate.resolve etc.. just for fun, to see if everything checked out OK. I have gotten very good results, apart from one time, which involved a complex drawing and not very efficiently done by me but increasing the number of samples fixed it. Suddenly, I get considerable error margins in even the simplest of drawings, and it even happened more than once that increasing the number of samples had no effect. I find that rather strange. Probably just a coincidence then.. (I now use my own custom functions for getting intersections points, since I only use Cetz for plane Euclidean geometry drawings … not that hard).