- (format
- "gsave ~a ~a translate
-0 0 moveto
-~a
-grestore\n"
-
- (ly:number->string x)
- (ly:number->string y)
- s))
-
-(define (polygon points blotdiameter filled?)
- (string-append
- (ly:numbers->string points) " "
- (ly:number->string (/ (length points) 2)) " "
- (ly:number->string blotdiameter)
- (if filled? " true " " false ")
- " draw_polygon"))
+ (ly:format
+"~4f ~4f moveto
+~a\n" x y s))
+
+(define (polygon points blot-diameter filled?)
+ (ly:format "~a ~4l ~a ~4f draw_polygon"
+ (if filled? "true" "false")
+ points
+ (- (/ (length points) 2) 1)
+ blot-diameter))
+
+(define (repeat-slash width slope beam-thickness)
+ (define (euclidean-length x y)
+ (sqrt (+ (* x x) (* y y))))
+
+ (let ((x-width (euclidean-length beam-thickness (/ beam-thickness slope)))
+ (height (* width slope)))
+ (ly:format "~4l draw_repeat_slash"
+ (list x-width width height))))
+
+
+(define (round-filled-box left right bottom top blotdiam)
+ (let* ((halfblot (/ blotdiam 2))
+ (x (- halfblot left))
+ (width (- right (+ halfblot x)))
+ (y (- halfblot bottom))
+ (height (- top (+ halfblot y))))
+ (ly:format "~4l draw_round_box"
+ (list width height x y blotdiam))))