www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/12/16/15:01:39

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=DIr0e+EeTkeqVNOd/gH7Qy/2NGObTstlrJsIFf3Wi/c=;
b=GQ3dzUsD4liWxpwbNRE9kDKll5uvW47VdLx7sIKZjvnFVeEbF0Ed2djJe3qMay27hq
QEQLSiy9p+wU7SFsQ97NnLavimw9OfGAz6mfMuEVa3VTQfhdKaajzItiZirFu4ZUCVMX
3jBkgdtWmXKdyPnFA6D5o0oNIguCXRQjPeekXUVRxtytKmHdpB59iSMFq810pkbs4tgl
NO4ZVnoRiFE1YozSDJmPFZqWO2WQA2OVlR22+PT3qdy9WKx8x7CZRrriEoV6M0qPyHCL
z4JQufpce8DEZUrLOKa0OgldGBXAjMXtHu5JtMq4tSoAkjSLCtnXQgtyEYZTwZ3unbLN
QSzA==
MIME-Version: 1.0
X-Received: by 10.28.65.69 with SMTP id o66mr12793800wma.18.1450296080421;
Wed, 16 Dec 2015 12:01:20 -0800 (PST)
In-Reply-To: <201512152309.tBFN90dS016514@envy.delorie.com>
References: <CAC4O8c_Jc98kmjDp_O2hKbY9BWWAjGk+nb0L5L=jqXfeTAYGGA AT mail DOT gmail DOT com>
<201512152309 DOT tBFN90dS016514 AT envy DOT delorie DOT com>
Date: Wed, 16 Dec 2015 11:01:20 -0900
Message-ID: <CAC4O8c8jaeiyrD4eEcWAR69GC=nd__gBLfPtstNUfQDAstvBcA@mail.gmail.com>
Subject: Re: [geda-user] merge please (or rebase if you must)
From: "Britton Kerin (britton DOT kerin AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
To: geda-user AT delorie DOT com
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--001a1148e62ab160a50527095eb1
Content-Type: text/plain; charset=UTF-8

On Tue, Dec 15, 2015 at 2:09 PM, DJ Delorie <dj AT delorie DOT com> wrote:

> PCB does support width!=height arcs, for example, the gerber HID has
> special code for drawing them.  Why are we removing support for them?

There was no real implementation in find.c or search.c.  There are comments
to
that effect in the original code.  I checked if the renderer handled them,
and it didn't, it just draws an arc of circle (using I don't know which
dimension).  It may have gerber export done as you say, but if so that's
about the only thing that's in place.  They are a lot more work and slower
to test intersections (iterative solution required), and mostly pointless
compared to an arc of circle and a line or three.  Apparently no one is
using them now.  We don't anticipate needing them for anything that I know
of.

> I note you use // for comments.  If we're going this route, we should
> update configure to test for a C99-compliant compiler.

This is probably a pretty safe assumption now.

> arcs with square ends - yeah, we can probably ignore those.  Although
> it's better to keep the arcs (and drop the square end flag) than drop
> the arc completely.

Ok.

> In many cases in the geometry module, you use Vec where you mean
> Point.  Granted, the data is the same, but the meanings should be
> clear to the user, since it's part of the "documentation".

It bugs me too.  The C alternatives I'm aware of are:

  * use casts wherever a conversion happens.  Not sure how ugly it would
    get in this particular case but it usually gets ugly pretty fast this
way
    I've done similar stuff the more pedantic way with Vec as another
    dynamically allocated type and it's so ugly, you end up with more math
bugs
    from trying to keep track of it all

  * Change Vec to Tuple so people can't complain :)


> I think the debug markers should either be removed for now, or
> "completed" - added to all HIDs and documented with some
> programmer-specific documentation.

Would you settle for stubs in the non-gtk HIDs, and programmer
documentation?
It's not obvious to me how to do it in lesstif and I have no real motivation
to figure it out.  What do you mean by programmer documentation besides
comments in hid.h?

> has_flag() shouldn't be needed as the parser converts strings on read.

Yeah it's left-over junk, I'll remove

> The right way to ignore square flags on arcs is to update the flag
> parsing table so that it's not in the supported flags... oh wait, it's
> already ignored there.

I didn't find this table... so I can just take out all the square arc stuff
and it should do the right thing (though a message would be nice really)?

> Rather than check for zero-sized arcs, check for non-positive-sized arcs.

Ok.

> Foo foo foooo, twice.  With an abort, no less.

Well I was making sure I'd found the arc parser.  Seems you have some
old-style arcs around

> "double" type isn't precise enough to hold a pcb coord - "double" is
> 53 bits, but Coord is 64 bits.  Does this matter?

Well, the existing geometry code does this quite a lot.

My system is so old Coord is 32 on it (I guess that's why) and it works
fine,
so I think it's ok.  It bugs me too though.  In pcb_geometry.h I have this:

// I'd like ensure that the floating point type used always be wider than
// the coordinate type, to guarantee that we can go from the latter to the
// former without loss, but pcb doesn't do this and it would be a
significant
// change to the build requirements.  This would do it:
//_Static_assert (
//    (sizeof (GEOM_DEFAULT_FLOAT_TYPE) > sizeof (Coord)),
//    "floating point type for geometry.h not wider than Coord type" );

I'll uncomment that and use long double if you want, though as a subsequent
poster pointed out it's probably ok precision-wise as it is.

> You left debugging enabled in search.c

I'll remove it.

Britton

--001a1148e62ab160a50527095eb1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te"><div class=3D"gmail_quote">On Tue, Dec 15, 2015 at 2:09 PM, DJ Delorie =
&lt;<a href=3D"mailto:dj AT delorie DOT com">dj AT delorie DOT com</a>&gt; wrote:</div><d=
iv class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">&gt; PCB does=
 support width!=3Dheight arcs, for example, the gerber HID has</div><div cl=
ass=3D"gmail_quote">&gt; special code for drawing them.=C2=A0 Why are we re=
moving support for them?</div><div class=3D"gmail_quote"><br></div><div cla=
ss=3D"gmail_quote">There was no real implementation in find.c or search.c.=
=C2=A0 There are comments to</div><div class=3D"gmail_quote">that effect in=
 the original code.=C2=A0 I checked if the renderer handled them,</div><div=
 class=3D"gmail_quote">and it didn&#39;t, it just draws an arc of circle (u=
sing I don&#39;t know which</div><div class=3D"gmail_quote">dimension).=C2=
=A0 It may have gerber export done as you say, but if so that&#39;s</div><d=
iv class=3D"gmail_quote">about the only thing that&#39;s in place.=C2=A0 Th=
ey are a lot more work and slower</div><div class=3D"gmail_quote">to test i=
ntersections (iterative solution required), and mostly pointless</div><div =
class=3D"gmail_quote">compared to an arc of circle and a line or three.=C2=
=A0 Apparently no one is</div><div class=3D"gmail_quote">using them now.=C2=
=A0 We don&#39;t anticipate needing them for anything that I know of.</div>=
<div class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">&gt; I note=
 you use // for comments.=C2=A0 If we&#39;re going this route, we should</d=
iv><div class=3D"gmail_quote">&gt; update configure to test for a C99-compl=
iant compiler.</div><div class=3D"gmail_quote"><br></div><div class=3D"gmai=
l_quote">This is probably a pretty safe assumption now.</div><div class=3D"=
gmail_quote"><br></div><div class=3D"gmail_quote">&gt; arcs with square end=
s - yeah, we can probably ignore those.=C2=A0 Although</div><div class=3D"g=
mail_quote">&gt; it&#39;s better to keep the arcs (and drop the square end =
flag) than drop</div><div class=3D"gmail_quote">&gt; the arc completely.</d=
iv><div class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">Ok.</div=
><div class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">&gt; In ma=
ny cases in the geometry module, you use Vec where you mean</div><div class=
=3D"gmail_quote">&gt; Point.=C2=A0 Granted, the data is the same, but the m=
eanings should be</div><div class=3D"gmail_quote">&gt; clear to the user, s=
ince it&#39;s part of the &quot;documentation&quot;.</div><div class=3D"gma=
il_quote"><br></div><div class=3D"gmail_quote">It bugs me too.=C2=A0 The C =
alternatives I&#39;m aware of are:</div><div class=3D"gmail_quote"><br></di=
v><div class=3D"gmail_quote">=C2=A0 * use casts wherever a conversion happe=
ns.=C2=A0 Not sure how ugly it would</div><div class=3D"gmail_quote">=C2=A0=
 =C2=A0 get in this particular case but it usually gets ugly pretty fast th=
is way</div><div class=3D"gmail_quote">=C2=A0 =C2=A0 I&#39;ve done similar =
stuff the more pedantic way with Vec as another</div><div class=3D"gmail_qu=
ote">=C2=A0 =C2=A0 dynamically allocated type and it&#39;s so ugly, you end=
 up with more math bugs</div><div class=3D"gmail_quote">=C2=A0 =C2=A0 from =
trying to keep track of it all</div><div class=3D"gmail_quote"><br></div><d=
iv class=3D"gmail_quote">=C2=A0 * Change Vec to Tuple so people can&#39;t c=
omplain :)</div><div class=3D"gmail_quote"><br></div><div class=3D"gmail_qu=
ote"><br></div><div class=3D"gmail_quote">&gt; I think the debug markers sh=
ould either be removed for now, or</div><div class=3D"gmail_quote">&gt; &qu=
ot;completed&quot; - added to all HIDs and documented with some</div><div c=
lass=3D"gmail_quote">&gt; programmer-specific documentation.</div><div clas=
s=3D"gmail_quote"><br></div><div class=3D"gmail_quote">Would you settle for=
 stubs in the non-gtk HIDs, and programmer documentation?</div><div class=
=3D"gmail_quote">It&#39;s not obvious to me how to do it in lesstif and I h=
ave no real motivation</div><div class=3D"gmail_quote">to figure it out.=C2=
=A0 What do you mean by programmer documentation besides</div><div class=3D=
"gmail_quote">comments in hid.h?</div><div class=3D"gmail_quote"><br></div>=
<div class=3D"gmail_quote">&gt; has_flag() shouldn&#39;t be needed as the p=
arser converts strings on read.</div><div class=3D"gmail_quote"><br></div><=
div class=3D"gmail_quote">Yeah it&#39;s left-over junk, I&#39;ll remove</di=
v><div class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">&gt; The =
right way to ignore square flags on arcs is to update the flag</div><div cl=
ass=3D"gmail_quote">&gt; parsing table so that it&#39;s not in the supporte=
d flags... oh wait, it&#39;s</div><div class=3D"gmail_quote">&gt; already i=
gnored there.</div><div class=3D"gmail_quote"><br></div><div class=3D"gmail=
_quote">I didn&#39;t find this table... so I can just take out all the squa=
re arc stuff</div><div class=3D"gmail_quote">and it should do the right thi=
ng (though a message would be nice really)?</div><div class=3D"gmail_quote"=
><br></div><div class=3D"gmail_quote">&gt; Rather than check for zero-sized=
 arcs, check for non-positive-sized arcs.</div><div class=3D"gmail_quote"><=
br></div><div class=3D"gmail_quote">Ok.</div><div class=3D"gmail_quote"><br=
></div><div class=3D"gmail_quote">&gt; Foo foo foooo, twice.=C2=A0 With an =
abort, no less.</div><div class=3D"gmail_quote"><br></div><div class=3D"gma=
il_quote">Well I was making sure I&#39;d found the arc parser.=C2=A0 Seems =
you have some</div><div class=3D"gmail_quote">old-style arcs around</div><d=
iv class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">&gt; &quot;do=
uble&quot; type isn&#39;t precise enough to hold a pcb coord - &quot;double=
&quot; is</div><div class=3D"gmail_quote">&gt; 53 bits, but Coord is 64 bit=
s.=C2=A0 Does this matter?</div><div class=3D"gmail_quote"><br></div><div c=
lass=3D"gmail_quote" style=3D"">Well, the existing geometry code does this =
quite a lot.</div><div class=3D"gmail_quote"><br></div><div class=3D"gmail_=
quote">My system is so old Coord is 32 on it (I guess that&#39;s why) and i=
t works fine,</div><div class=3D"gmail_quote">so I think it&#39;s ok.=C2=A0=
 It bugs me too though.=C2=A0 In pcb_geometry.h I have this:</div><div clas=
s=3D"gmail_quote"><br></div><div class=3D"gmail_quote">// I&#39;d like ensu=
re that the floating point type used always be wider than</div><div class=
=3D"gmail_quote">// the coordinate type, to guarantee that we can go from t=
he latter to the</div><div class=3D"gmail_quote">// former without loss, bu=
t pcb doesn&#39;t do this and it would be a significant</div><div class=3D"=
gmail_quote">// change to the build requirements.=C2=A0 This would do it:</=
div><div class=3D"gmail_quote">//_Static_assert (</div><div class=3D"gmail_=
quote">// =C2=A0 =C2=A0(sizeof (GEOM_DEFAULT_FLOAT_TYPE) &gt; sizeof (Coord=
)),</div><div class=3D"gmail_quote">// =C2=A0 =C2=A0&quot;floating point ty=
pe for geometry.h not wider than Coord type&quot; );</div><div class=3D"gma=
il_quote"><br></div><div class=3D"gmail_quote">I&#39;ll uncomment that and =
use long double if you want, though as a subsequent</div><div class=3D"gmai=
l_quote">poster pointed out it&#39;s probably ok precision-wise as it is.</=
div><div class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">&gt; Yo=
u left debugging enabled in search.c</div><div class=3D"gmail_quote"><br></=
div><div class=3D"gmail_quote" style=3D"">I&#39;ll remove it.</div><div cla=
ss=3D"gmail_quote" style=3D""><br></div><div class=3D"gmail_quote" style=3D=
"">Britton</div></div></div></div>

--001a1148e62ab160a50527095eb1--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019