bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request: Display bezier control-points


From: James
Subject: Re: Feature request: Display bezier control-points
Date: Fri, 4 May 2012 07:09:44 +0100

Hello,

On 4 May 2012 01:31, Urs Liska <address@hidden> wrote:
> Am 04.05.2012 02:08, schrieb David Nalesnik:
>
>> Hi Urs,
>>
>>    > It would be a really valuable feature if one could let LilyPond
>>    display
>>    > the control-points of a bezier curve.
>>    > I would imagine something like a cross or a point at the middle two
>>    > control-points.
>>
>>
>> I think this would be very helpful, so that you can visualize exactly what
>> these control-points are that you're setting.  (It must be a common
>> misconception that they are points on the actual curve.)
>>
>> I'm not sure what impact this may have on the layout, but you could do
>> something like the following:
>>
>> \version "2.15.37"
>>
>> #(define (make-cross-stencil coords)
>>  (ly:stencil-add
>>    (make-line-stencil 0.1 (- (car coords) 0.2) (- (cdr coords) 0.2)
>>  (+ (car coords) 0.2) (+ (cdr coords) 0.2))
>>    (make-line-stencil 0.1 (- (car coords) 0.2) (+ (cdr coords) 0.2)
>>  (+ (car coords) 0.2) (- (cdr coords) 0.2))))
>>
>> #(define display-control-points
>>  (lambda (grob)
>>    (let ((stencil (ly:slur::print grob))
>>          (cps (ly:grob-property grob 'control-points)))
>>      (ly:stencil-add stencil
>>     (make-cross-stencil (second cps))
>>     (make-cross-stencil (third cps))))))
>> \relative c'' {
>>  \override Slur #'stencil = #display-control-points
>>  c( d e f)
>> }
>>
>> Hope you find this helpful!
>
> Wow, extremely!
> Of course I would prefer to have this built-in.
> And as you I can't really judge if this has side effects.
> But this really _is_ helping to find suitable values for the control-points.
>
>  * Although I know bezier curves from vector graphics software, I also
>   was convinced that the 'control-points' were four points on the
>   curve that define its shape.
>  * In fact the first and last are such points, whereas the middle two
>   'control-points' are the 'handles'.
>   -> Is this explained somewhere?

http://lilypond.org/doc/v2.14/Documentation/notation-big-page.html#modifying-ties-and-slurs

?

James



reply via email to

[Prev in Thread] Current Thread [Next in Thread]