Skip to main content

Coordinate

Functions to aid in resolving coordinates.

resolve-system

resolve-system() -> str 

Figures out what system a coordinate belongs to and returns the corresponding string.

The coordinate to find the system of.

resolve

resolve() -> array 

Resolve a list of coordinates to absolute vectors. Returns an array of the new context then the resolved coordinate vectors.

line((0,0), (1,1), name: "l")
get-ctx(ctx => {
// Get the vector of coordinate "l.start" and "l.end"
let (ctx, a, b) = cetz.coordinate.resolve(ctx, "l.start", "l.end")
content("l.start", [#a], frame: "rect", stroke: none, fill: white)
content("l.end", [#b], frame: "rect", stroke: none, fill: white)
})

Canvas context object

..coordinates:

List of coordinates

update:

Default: true

Update the context's last position