Hi Harm,

On Mon, Aug 17, 2015 at 6:44 PM, Thomas Morley <[email protected]>
wrote:

> Hi all,
>
> I want to "put together" an arbitrary number of stencils,
> pseudo-code:
> (apply
>   some-put-together-procedure
>   stil-list)
>
> While using `ly:stencil-add', it's quite simple:
>
> #(define (stils n)
>   (map
>     (lambda (n)
>       (make-connected-path-stencil
>         `((0 0) (,n 0) (,n ,n) (0 ,n) (0 0))
>         0.1
>         1
>         1
>         #f
>         #f))
>      (iota n 1 1)))
>
> \markup
>   \stencil
>   #(apply ly:stencil-add (stils 3))
>
>
> But now I want to use `ly:stencil-combine-at-edge' with
> axis: X
> direction: RIGHT
> padding: 0
>
> As if I wrote:
>
> \markup
>   \stencil
>   #(ly:stencil-combine-at-edge
>      (car (stils 3))
>      X
>      RIGHT
>      (ly:stencil-combine-at-edge
>        (cadr (stils 3))
>        X
>        RIGHT
>        (caddr (stils 3))
>        0)
>      0)
>
>
> I wasn't able to find the correct syntax how to do:
> (apply ly:stencil-combine-at-edge <what-ever-args>)
>
> Any hints?
>
>
Not sure, but why not something like this?

 \markup
  \stencil
  #(reduce-right
    (lambda (f s)
     (ly:stencil-combine-at-edge f X RIGHT s 0))
    empty-stencil
    (stils 3))

HTH,
David
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to