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: <201512152309 DOT tBFN90dS016514 AT envy DOT delorie DOT com> Date: Wed, 16 Dec 2015 11:01:20 -0900 Message-ID: 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]" To: geda-user AT delorie DOT com Content-Type: multipart/alternative; boundary=001a1148e62ab160a50527095eb1 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 Precedence: bulk --001a1148e62ab160a50527095eb1 Content-Type: text/plain; charset=UTF-8 On Tue, Dec 15, 2015 at 2:09 PM, DJ Delorie 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


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

> PCB does= support width!=3Dheight arcs, for example, the gerber HID has
> special code for drawing them.=C2=A0 Why are we re= moving support for them?

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

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

This is probably a pretty safe assumption now.

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

Ok.

> In ma= ny cases in the geometry module, you use Vec where you mean
> Point.=C2=A0 Granted, the data is the same, but the m= eanings should be
> clear to the user, s= ince it's part of the "documentation".

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

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

=C2=A0 * Change Vec to Tuple so people can't c= omplain :)


> I think the debug markers sh= ould either be removed for now, or
> &qu= ot;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 h= ave no real motivation
to figure it out.=C2= =A0 What do you mean by programmer documentation besides
comments in hid.h?

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

<= div class=3D"gmail_quote">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 supporte= d flags... oh wait, it's
> already i= gnored there.

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

> Rather than check for zero-sized= arcs, check for non-positive-sized arcs.
<= br>
Ok.
> Foo foo foooo, twice.=C2=A0 With an = abort, no less.

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

> "do= uble" type isn't precise enough to hold a pcb coord - "double= " is
> 53 bits, but Coord is 64 bit= s.=C2=A0 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 i= t works fine,
so I think it's ok.=C2=A0= It bugs me too though.=C2=A0 In pcb_geometry.h I have this:

// I'd like ensu= re that the floating point type used always be wider than
// the coordinate type, to guarantee that we can go from t= he latter to the
// former without loss, bu= t pcb doesn't do this and it would be a significant
// change to the build requirements.=C2=A0 This would do it:
//_Static_assert (
// =C2=A0 =C2=A0(sizeof (GEOM_DEFAULT_FLOAT_TYPE) > sizeof (Coord= )),
// =C2=A0 =C2=A0"floating point ty= pe 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.

> Yo= u left debugging enabled in search.c

I'll remove it.

Britton
--001a1148e62ab160a50527095eb1--