<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font size="4">Hi Jon, <br>
</font></p>
<p>Your gauges look very sweet!</p>
<p>See attached file out of a Morph to give you an idea how to draw
your green arc.</p>
<p><img moz-do-not-send="false"
src="cid:part1.6rI9cDkT.IuRasmT4@free.fr" alt="arc" width="276"
height="222"></p>
<p><br>
</p>
<p>Adjust accordingly to yours needs.<br>
</p>
Hilaire<br>
<p><br>
</p>
<div class="moz-cite-prefix">Le 04/03/2023 à 01:36, Jon Hylands via
Cuis-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CA+=am+WMrB-4w+d=TSuqS37M4D8sQmEDjCZVicmRAiU-qWqYzQ@mail.gmail.com">
<table class="moz-header-part1 moz-main-header" width="100%"
cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<div class="moz-header-display-name"
style="display:inline;">Sujet : </div>
[Cuis-dev] Best way to draw arcs</td>
</tr>
<tr>
<td>
<div class="moz-header-display-name"
style="display:inline;">De : </div>
Jon Hylands via Cuis-dev <a class="moz-txt-link-rfc2396E" href="mailto:cuis-dev@lists.cuis.st"><cuis-dev@lists.cuis.st></a></td>
</tr>
<tr>
<td>
<div class="moz-header-display-name"
style="display:inline;">Date : </div>
04/03/2023 01:36</td>
</tr>
</tbody>
</table>
<table class="moz-header-part2 moz-main-header" width="100%"
cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<div class="moz-header-display-name"
style="display:inline;">Pour : </div>
<a class="moz-txt-link-abbreviated" href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a></td>
</tr>
<tr>
<td>
<div class="moz-header-display-name"
style="display:inline;">Copie à : </div>
Jon Hylands <a class="moz-txt-link-rfc2396E" href="mailto:jhylands@gmail.com"><jhylands@gmail.com></a></td>
</tr>
</tbody>
</table>
<br>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="moz-text-html" lang="x-unicode">
<div dir="ltr"><br>
<div>Hi everyone,</div>
<div><br>
</div>
<div>New to the list, new to Cuis (just downloaded it today).</div>
<div><br>
</div>
<div>I'm designing some gauges for an ultralight plane that
will run on a Raspberry Pi 4 with a 10" LCD panel. Right
now, this is what I have:</div>
<div><br>
</div>
<div><img src="cid:part2.xXniohwM.nMCbIkNM@free.fr"
alt="Cuis-Gauges.png" shrinktofit="true" class=""
width="542" height="326"><br>
</div>
<div><br>
</div>
<div>I love the anti-aliasing, vector-based properly scalable
graphics!</div>
<div><br>
</div>
<div>The part that I'm not happy with is the green, yellow and
red indicator bands on the airspeed gauge. They look nice,
but I'm drawing them by drawing a sequence of filled
polygons.</div>
<div><br>
</div>
<div>The code looks like this:</div>
<div><br>
</div>
<div>drawShadeFrom: startSpeed to: endSpeed color: color on:
aCanvas<br>
| ratio |</div>
<div> ratio := self angleToValueRatio.</div>
<div> aCanvas strokeWidth: 1 color: color fillColor: color
do: [<br>
startSpeed to: endSpeed - 2 do:[:each |<br>
| startAngle endAngle |<br>
startAngle := (90 - (each * ratio)) degreesToRadians.</div>
<div> endAngle := (90 - ((each + 2) * ratio)
degreesToRadians.</div>
<div> aCanvas<br>
moveTo: (Point rho: 85 theta: startAngle);<br>
lineTo: (Point rho: 95 theta: startAngle);<br>
lineTo: (Point rho: 95 theta: endAngle);<br>
lineTo: (Point rho: 85 theta: endAngle);<br>
lineTo: (Point rho: 85 theta: startAngle)]].<br>
</div>
<div><br>
</div>
<div>I tried using the #arcTo: method, but I just couldn't get
it to work at all (not to mention the line ends of the arc
are round, which doesn't work here anyways).</div>
<div><br>
</div>
<div>Is there a more reasonable way to do this?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Jon</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<div class="moz-text-plain" wrap="true" graphical-quote="true"
style="font-size: 16px;" lang="x-western">
<pre class="moz-quote-pre" wrap=""><div class="moz-txt-sig">--
Cuis-dev mailing list
<a class="moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:Cuis-dev@lists.cuis.st" moz-do-not-send="true">Cuis-dev@lists.cuis.st</a>
<a class="moz-txt-link-freetext" href="https://lists.cuis.st/mailman/listinfo/cuis-dev" moz-do-not-send="true">https://lists.cuis.st/mailman/listinfo/cuis-dev</a>
</div></pre>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
GNU Dr. Geo
<a class="moz-txt-link-freetext" href="http://drgeo.eu">http://drgeo.eu</a>
<a class="moz-txt-link-freetext" href="http://blog.drgeo.eu">http://blog.drgeo.eu</a></pre>
</body>
</html>