From e06768e6923866dd5cf6f8c9639664f617ccfa6e Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Tue, 30 Aug 2016 19:41:07 +0200 Subject: [PATCH] Issue 4968/2: Replace coord-rotate with coord-rotated Also fixes the look/definition of the high f# saxophone key. --- scm/define-woodwind-diagrams.scm | 35 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/scm/define-woodwind-diagrams.scm b/scm/define-woodwind-diagrams.scm index 48aaf68239..409090b7a5 100644 --- a/scm/define-woodwind-diagrams.scm +++ b/scm/define-woodwind-diagrams.scm @@ -632,7 +632,7 @@ returns @samp{1/3}." (flatten-list (map (lambda (x) (coord-translate - (coord-rotate x (atan (/ y (* 2 0.25)))) + (coord-rotated x (cons y (* 2 0.25))) '(1.0 . 0))) l))) `(((0 . ,y) (,x . ,y) (,x . 0)) @@ -644,7 +644,7 @@ returns @samp{1/3}." (map (lambda (l) (flatten-list (map (lambda (x) - (coord-rotate x (atan (/ y (* 2 0.25))))) + (coord-rotated x (cons y (* 2 0.25)))) l))) `(,(list-tail up-part 1) ,(list-head down-part 1) @@ -938,16 +938,27 @@ returns @samp{1/3}." (define saxophone-rh-high-fis-key-stencil (standard-path-stencil - (append - '((0.0 1.0) (0.0 1.4 0.6 1.4 0.6 1.0) (0.6 0.0)) - (map (lambda (l) - (flatten-list - (map (lambda (x) - (coord-rotate x (atan (* -1 (/ PI 6))))) - l))) - '(((0.6 . -1.0)) - ((0.6 . -1.4) (0.0 . -1.4) (0.0 . -1.0)) - ((0.0 . 0.0))))) + (let* ((angle -30) + (dir2 (ly:directed (* -0.5 angle))) + ;; This comparatively awful expression calculates how far + ;; along the tangents opened by 'angle' with a radius of 0.6 + ;; the control points need to move in order to have the + ;; middle of the bezier curve exactly on radius. + (out (* 0.6 (coord-y dir2) (- 4/3 (* 1/3 (coord-x dir2)))))) + (append + '((0.0 1.0) (0.0 1.4 0.6 1.4 0.6 1.0) (0.6 0.0)) + `((0.6 ,(- out) + ,@(flatten-list (map (lambda (x) (coord-rotated x angle)) + `((0.6 . ,out) + (0.6 . 0.0)))))) + (map (lambda (l) + (flatten-list + (map (lambda (x) + (coord-rotated x angle)) + l))) + '(((0.6 . -1.0)) + ((0.6 . -1.4) (0.0 . -1.4) (0.0 . -1.0)) + ((0.0 . 0.0)))))) 0.75 0.75)) -- 2.39.2