From: Lars H. <Lar...@re...> - 2012-10-17 10:40:15
|
Simon Geard skrev 2012-10-17 10.11: > > TIP #415: ENABLE EASY CREATION OF CIRCULAR ARC SEGMENTS > ========================================================= > Version: $Revision: 1.1 $ > Author: Simon Geard<simon_at_whiteowl.co.uk> > State: Draft > Type: Project > Tcl-Version: 8.7 > Vote: Pending > Created: Tuesday, 16 October 2012 > URL: http://purl.org/tcl/tip/415.html > WebEdit: http://purl.org/tcl/tip/edit/415 > Post-History: > > ------------------------------------------------------------------------- > > ABSTRACT > ========== > > Creating a segment of a circular arc is unnecessarily difficult using > the *canvas* arc. This TIP proposes a simple extension of the syntax to > support the creation of circular arc segments in a natural way. A > similar extension to support the more general elliptical arc segments > is outside the scope of this TIP. > > RATIONALE > =========== > > There is scope to enhance arc creation to make it much more useful as > was shown by a recent discussion on<URL:news:comp.lang.tcl.> The Do you have a more specific (and permanent) URL for this? In a few weeks it will be very much work to find the discussion you reference. > proposal here is the simplest enhancement to enable creation of > circular arc segments from a single parameter. > > PROPOSAL > ========== > > Enhance arc creation to support a new -height option > > /canvas/ *create arc* /x1 y1 x2 y2/ *-height* /h/ ?/options/? > > This will create an arc from (/x1/,/y1/) to (/x2/,/y2/) with a > mid-point a distance /h/ from the chord. For /h/>0 the arc will be > clockwise, and for /h/<0 the arc will be anti-clockwise. A value of 0 Just checking that I understand this correctly: The midpoint you speak about is the centre of the circle. Then as h approaches 0, the arc will approach a semicircle. There is no way to make arcs with an extent exceeding 180 degrees with this option. > is not valid and is currently ignored so that the command reverts to > it's previous behaviour. > > If *-height* is present the style is automatically set to *arc*; the > *pieslice* style option is not permitted. And the (absolute value of the) -height value is the height of the triangle part of the pieslice (taking the chord as base of the triangle). > If *-height* is present the *-start* and *-extent* options are ignored. > > Note that in this version of the command (/x1/,/y1/) and (/x2/,/y2/) no > longer form the corners of the bounding box but instead the start and > end points of the arc's chord. That feels more like what one would do using line or polygon items (with some kind of smoothing). Any thoughts on whether support for circular arc segments there would suffice for what you're aiming at? Lars Hellström |