lilypond-devel
[Top][All Lists]
Advanced

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

Re: Some code for polygons


From: Jan Nieuwenhuizen
Subject: Re: Some code for polygons
Date: Wed, 12 Apr 2006 11:24:10 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

David Feuer writes:

> I would greatly appreciate some help changing the code in lookup.cc
> to match my new drawing procedures.  I'm still not sure whether the
> polygon drawer should take a list of vertices or an array of
> vertices.

It seems that you changed the polygon interface from (prefixing type name
to parameter for clarity)

    (define (polygon list-of-points blot-diameter filled?)

to

  (define (polygon vector-of-points blot-radius)

What is the reason to change the interface?  I appreciate that radius
makes more sense than diameter, but blot-diameter is used throughout
lily.  So why not keep the scm interface as it was, ie, change your
polygon code to

  (define (polygon list-of-points blot-diameter)
    (let ((vector-of-points (list->vector))
          (blot-radius (/ blot-diameter 2)))

          ...


Btw, what about the the filled? parameter, is it never used?

Btw2, why the defines

  ...
  (define n (vector-length points))
  (define startpoint (v* 0.5 (v+ (vector-ref points (- n 1)) (vector-ref points 
0))))
  
  (entity 'path ""
  ...

instead of let* ?

    (let* ((n (vector-length vector-of-points))
           (start-point (v* 0.5 (v+ (vector-ref vector-of-points (- n 1))
           (vector-ref vector-of-points 0)))))
    
Could you send a next version as a unified diff please?

Jan.

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org




reply via email to

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