|
From: | Urs Liska |
Subject: | Re: What to do wanting a 4th order Bézier? |
Date: | Mon, 19 Sep 2016 11:00:17 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
Am 19.09.2016 um 00:32 schrieb David
Kastrup:
Urs Liska <address@hidden> writes:Am 18.09.2016 um 20:54 schrieb David Kastrup:Do you know how to split a bezier at a given ratio into equivalent beziers? It's a comparatively simple operation and I think it's already somewhere in the C++ code though without access from Scheme.No, but I should be able to figure it out (if noone sends a pointer before I manage to do so).Well, METAFONT uses the notation a[z1, z2] for z1 + a*[z2-z1], mapping a range of 0..1 for a linearly between z1 and z2. If we have points z1, z2, z3, z4 defining a Bezier, then the two split beziers are defined with the points z1, a[z1, z2], a[a[z1, z2], a[z2, z3]], a[a[a[z1, z2], a[z2, z3]], a[a[z2, z3], a[z3, z4]] and a[a[a[z1, z2], a[z2, z3]], a[a[z2, z3], a[z3, z4]]], a[a[z2, z3], a[z3, z4]], a[z3, z4], z4 Basically, calculation of a point a on an n-grade Bezier is done using a recursive formula to depth n, and keeping the intermediate results will give you the control points for the Bezier curves split at that point. I think before diving into that I share what I currently have, so we may discuss which approach should actually be continued. The attached solution does the following:
BTW I've spiced up the control points display a bit. I hope it's self-explanatory. I would like to integrate this with Janek's \shapeII functions (https://github.com/openlilylib/snippets/tree/master/notation-snippets/shaping-bezier-curves) as I think there'll be quite some code (and interface?) that can be shared. Opinions? Urs |
compound-slur-relative.ly
Description: Text Data
compound-slur-relative.preview.pdf
Description: Adobe PDF document
[Prev in Thread] | Current Thread | [Next in Thread] |