Skip to content

Name points during the construction of line. #1135

Description

@ElaysonAbreu

Imagine situations like this:

#import "@preview/cetz:0.5.2"
#import cetz.draw: *

#cetz.canvas({
  hide(circle((2,0), name: "circle", radius: 1))
  line((1,0), (3,0), "circle.120deg", close: true)
  
  content((a: (1,0), number: 50%, b: (3,0)), [$a$], anchor: "north")
  content((a: (3,0), number: 50%, b: "circle.120deg"), [$b$], anchor: "south-west")
  content((a: "circle.120deg", number: 50%, b: (1,0)), [$c$], anchor: "south-east")
})

If I could name the points while creating line, I wouldn't have to repeat them in content. This could perhaps be achieved with a syntax like:

line((1,0).A, (3,0).B, "circle.120deg".C, close: true)

It is true that #let A = (1,0) #let B = (3,0) can solve this problem, but isn't the syntax I suggested feasible? Thanks in advance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions