Sorry - I should have replied to this earlier, but I was away from my
computer.
In woodwinds, I believe that the "make-connected-shape-stencil" does exactly
this - I use it to draw paths and automate finding extents.  Rather than
adding two things w/ similar functionalities to Lilypond, I think it would
be intelligent to roll both of them into one.  Patrick: can you look at the
patch and let me know what you think?  I have no objection to changing my
work if you feel that there is a better way to implement it along the lines
of the patch that you've uploaded.

~Mike


On 6/26/10 2:06 AM, "pnor...@gmail.com" <pnor...@gmail.com> wrote:

> On 2010/06/22 03:50:24, Carl wrote:
>> On 2010/06/21 22:39:53, Patrick McCarty wrote:
>>> On 2010/06/20 11:07:37, Carl wrote:
>>>> Is it possible to have the path command estimate reasonable
>>>> extents, rather than using (0 . 0) and (0 . 0)?  Since we
>>>> know the thickness of the line, and we have a list of
>>>> points, it seems we should be able to keep track of the
>>>> maximum and minimum X and Y coordinates during the path
>>>> creation.
>>> 
>>> This should be possible, but I'm not sure how to implement it,
>>> especially when relative coordinates are involved.
> 
>> My first thought would be to start with currentx=currenty=
>> xmax=xmin=ymax=ymin = 0.
> 
>> For an absolute move, set currentx = move x, currenty = move y.
> 
>> For a relative move, set currentx += movex, currenty += movey.
> 
>> If currentx > xmax, xmax=currentx.  If currenty > ymax,
>> ymax=currenty.  If currentx < xmin, xmin = currentx.  If
>> currenty < ymin, ymin = currenty.
> 
>> For curves, go one point at a time.  The control points bound
>> the curve, so you can use the control points as if they were
>> curve points.
> 
>> When you're done with all the points, add half the thickness to
>> xmax and ymax, and subtract half the thickness from xmin and
>> ymin.
> 
>> I haven't tried it, but it seems to me it should work.
> 
> Hi Carl,
> 
> Thanks for your help.
> 
> I've uploaded a new patch set that (more or less) follows your
> algorithm above, and also changes the interface again (according
> to Han-Wen's and Jan's comments).
> 
> Let me know what you think.
> 
> Thanks,
> Patrick
> 
> 
> http://codereview.appspot.com/1730044/show
> 
> _______________________________________________
> lilypond-devel mailing list
> lilypond-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/lilypond-devel
> 



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to