Skip to content

Commit

Permalink
Add label-angle
Browse files Browse the repository at this point in the history
  • Loading branch information
soegaard committed Feb 12, 2024
1 parent 61ffbb0 commit f9cca48
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions metapict/markings.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
slanted-mark
arc-outline
mark-angle
label-angle
mark-curve-angle
mark-curve
mark-right-angle
Expand Down Expand Up @@ -191,6 +192,23 @@
(def r (pt+ b (vec* rad (normalize (pt- c b)))))
; draw
(draw-angle-curve p q r #:marks m #:marker marker))
; draw label
(label-angle a b c label
#:arcs n
#:spacing spacing
#:radius radius)))


; Put the label a little further out than the last arc that mark-angle draws.
(define (label-angle a b c label
#:arcs [n 1] ; number of arcs
#:spacing [spacing (angle-spacing)]
#:radius [radius (angle-radius)])
(convert-points a b c)
; Center of arc
(def p b)
; Draw n arcs
(draw
(if label
(let ()
(set! n (min n 5))
Expand Down

0 comments on commit f9cca48

Please sign in to comment.