<div dir="ltr">I should add, the coordinate system of the morph is set to origin at the center of the gauge, and yAxisPointsUp is enabled.<div><br></div><div>Also, #angleToValueRatio returns 3.15, since the gauge sweeps 315 degrees over 100 mph.</div><div><br></div><div>- Jon</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 4 Mar 2023 at 07:36, Jon Hylands <<a href="mailto:jhylands@gmail.com">jhylands@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hilaire,<div><br></div><div>Thanks for the input.</div><div><br></div><div>I've attached that method, with the #arcTo: sends.</div><div><br></div><div>This is what I get:</div><div><br></div><div><img src="cid:ii_lety4zwv4" alt="usingArcTo.png" width="364" height="562"><br></div><div><br></div><div>If I replace the #arcTo: sends with the commented out #lineTo: sends (from the attached code), this is what I get:</div><div><br></div><div><img src="cid:ii_lety5pfm5" alt="usingLineTo.png" width="440" height="431"><br></div><div><br></div><div>So I know that I am specifying all the end points correctly.</div><div><br></div><div>Any ideas?</div><div><br></div><div>- Jon</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 4 Mar 2023 at 03:33, Hilaire Fernandes via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div 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 src="cid:186ac99ec0d48f240fa1" alt="arc" width="276" height="222"></p>
<p><br>
</p>
<p>Adjust accordingly to yours needs.<br>
</p>
Hilaire<br>
<p><br>
</p>
<div>Le 04/03/2023 à 01:36, Jon Hylands via
Cuis-dev a écrit :<br>
</div>
<blockquote type="cite">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<div style="display:inline">Sujet : </div>
[Cuis-dev] Best way to draw arcs</td>
</tr>
<tr>
<td>
<div style="display:inline">De : </div>
Jon Hylands via Cuis-dev <a href="mailto:cuis-dev@lists.cuis.st" target="_blank"><cuis-dev@lists.cuis.st></a></td>
</tr>
<tr>
<td>
<div style="display:inline">Date : </div>
04/03/2023 01:36</td>
</tr>
</tbody>
</table>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<div style="display:inline">Pour : </div>
<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a></td>
</tr>
<tr>
<td>
<div style="display:inline">Copie à : </div>
Jon Hylands <a href="mailto:jhylands@gmail.com" target="_blank"><jhylands@gmail.com></a></td>
</tr>
</tbody>
</table>
<br>
<div 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:186ac99ec0d9724be262" alt="Cuis-Gauges.png" 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></fieldset>
<div style="font-size:16px" lang="x-western">
<pre><div>--
Cuis-dev mailing list
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a>
</div></pre>
</div>
</blockquote>
<pre cols="72">--
GNU Dr. Geo
<a href="http://drgeo.eu" target="_blank">http://drgeo.eu</a>
<a href="http://blog.drgeo.eu" target="_blank">http://blog.drgeo.eu</a></pre>
</div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>
</blockquote></div>