<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Jon,<br>
<br>
Long time, no see!<br>
<br>
(Jon was a very active member of the Squeak community many years
ago).<br>
<br>
Welcome to Cuis!<br>
<br>
On 3/3/2023 9:36 PM, Jon Hylands via Cuis-dev wrote:
<blockquote
cite="mid:CA+=am+WMrB-4w+d=TSuqS37M4D8sQmEDjCZVicmRAiU-qWqYzQ@mail.gmail.com"
type="cite">
<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:part1.01090108.00070206@cuis.st"
alt="Cuis-Gauges.png" height="326" width="542"><br>
</div>
<div><br>
</div>
<div>I love the anti-aliasing, vector-based properly scalable
graphics!</div>
<div><br>
</div>
</div>
</blockquote>
<br>
This looks really nice!<br>
<br>
<blockquote
cite="mid:CA+=am+WMrB-4w+d=TSuqS37M4D8sQmEDjCZVicmRAiU-qWqYzQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<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>
</blockquote>
<br>
The #arcTo: method was done following the way to specify arcs in
SVG. Yes, it is a bad api. Pretty hard to use. I guess I'm late to
answer about this, as others (thanks folks!) have already answered.<br>
<br>
WRT the ends being round, yes, Cuis Vector Graphics only support a
round pen nib. The solution is to draw the border of the arc with
small, or zero pen width, and use fill.<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
</body>
</html>