www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/08/18/01:12:01

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=XTWFGhdVSKaSjtGRZnRnTsMkIBoxE2/RKwG5AwjFOLA=;
b=SI26GlkMRYDA3SWzllGCJsMkdXwetISrSQQplpDYQT1Cvn9TAP4YjvXmiQBuxCy/ee
/ZLtR5PaRqdxIXINkARImxLQz8isOd0xRZ4fQwj+dJnUN9UKOyVkky4kaahRYx7Mtvj8
TCZJ74rEo07QiqUlrCT0F+mue9TKATOelWLURatxEZZQndCU88roUg3e64rOCJUyC8tE
eB0iCyLybu+8g8xbKnkKDE+J9uNZB+5G8MRfwDz7CRciLYx2OAVu9DuR3kwaE4lVGFUU
DpYgZ3N4tdkQWbrk8dri/rnZCwSVZP6WkqirLsNQ28YEhS5eYKgdtEGPsLiOrcFvcP2/
5D0g==
MIME-Version: 1.0
X-Received: by 10.112.139.133 with SMTP id qy5mr4003991lbb.60.1439874665852;
Mon, 17 Aug 2015 22:11:05 -0700 (PDT)
In-Reply-To: <201508172206.t7HM6ZUI032712@envy.delorie.com>
References: <CAFx0xxgpWa+Ku-B+OBBCiY4gagx3gtcSUCC5Mk1RM5vqK4u94Q AT mail DOT gmail DOT com>
<201508160552 DOT t7G5qBPo025284 AT envy DOT delorie DOT com>
<CAFx0xxj4B2ByhKWhU7BSGjyUhkD_xLA-3wG-u2wB21MLqLbq4g AT mail DOT gmail DOT com>
<201508170550 DOT t7H5oW1T021206 AT envy DOT delorie DOT com>
<CAFx0xxijRCmD6j1XGghhHCQhBL58xcJbHCGe1bJ9y4aN6fX3Kw AT mail DOT gmail DOT com>
<201508171557 DOT t7HFvFka015445 AT envy DOT delorie DOT com>
<CAFx0xxgXV=6LjV=O_=Be9woO_EKahC-AKiYVdyBvvYLtpEH7KA AT mail DOT gmail DOT com>
<201508172206 DOT t7HM6ZUI032712 AT envy DOT delorie DOT com>
Date: Mon, 17 Aug 2015 23:11:05 -0600
Message-ID: <CAFx0xxj-RLUtgpaC+3+TpiV3dVgV_BFDBQ1v-d3SfNng=SEwaQ@mail.gmail.com>
Subject: Re: [geda-user] PCB footprints - what is the best way to change
origin location on existing footprint?
From: "Dave Williams (dave DOT williams DOT lists 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

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

DJ

Thanks for your detailed response.

I did some more tests.

It appears that the absolute position is written to the footprint origin
value in the footprint file.  I wrote one origin to 2870.00mil and
1525.00mil.
I did this by placing the component - setting the cursor to the same
location as the diamond
and coincident with Ctl-M, and saving a new footprint. I was surprised by
the results and I have
no idea why a absolute position would have any value  - especially if your
PCB outline was smaller
then these dimensions.

Based on your latest comments about using absolute coordinates in the past
- could what
I have been seeing with the footprint origin  - is this a legacy 'feature'
that has been made non-functional
with new PCB releases?

If I hand edit the origin back to (0,0) in the footprint file and restart
PCB and place the
same component at the cursor - no problem.  I experience no difference
using this component
in PCB. And as I mentioned previously, I find other library footprints with
non-zero origin values also.
(however, there are differences in the "Elements[ ]" arguments).

I'd like to suggest that before more speculations are made on how it should
work - please test in your version of PCB.
I may have something particular with my environment. Testing origin values
can be done easily/quickly.

Dave

On Mon, Aug 17, 2015 at 4:06 PM, DJ Delorie <dj AT delorie DOT com> wrote:

>
> > A lot of this doesn't make sense. I'm hearing 2 things.
>
> As a bit of background, consider that the original footprint "file"
> allowed more than one footprint, and we use the same information for
> cut buffers and "save buffer to file" stuff.  Each pcb, paste buffer,
> and file has its own local coordinate system, and cutting and pasting
> translates between those coordinate systems.
>
> > 1) If the 0,0 origin coordinates are an absolute position from the
>
> Keep in mind the difference between a footprint and an element.
>
> A footprint is a pattern in a library.
>
> An element is a specified instance of a footprint along with other
> information.
>
> So it makes no sense to talk about the "origin" of a footprint - it's
> in a library, it's just a pattern, the only magic about the origin is
> that it's the mathematical 0,0 point that other things in the
> footprint are measured from.
>
> When you paste a footprint onto a pcb it becomes an element.  At that
> point, the 0,0 of the footprint is mapped to wherever the crosshair
> is, and becomes the "location" of the element.


That has not been seen by my experiments.  The value for the footprint
origin
does not appear to matter.

>
> > But that doesn't happen when you import schematics to the PCB.
>
> Actually it does if you use gsch2pcb.  The File->Import method
> relocates every element so that they're not all up in the corner.
>
> > The diamond shape origin is in the center of this 805 component - no
> > matter where this component is randomly placed onto the PCB grid.
> > The component origin cannot be linked to absolute PCB coordinates.
>
> The element's internal measurements are all relative to the element's
> origin, as if it had its own local coordinate system.  We do this just
> to keep the internal logic easier.  We *used* to keep the internal
> coordinates absolute, and had to recalculate the position of every
> pin, pad, and silk every time you moved the element.
>
> > 2) I thought I heard that the origin written to the footprint file,
> > happens to be the absolute position of the cursor when captured into
> > the buffer.
>
> When you're editing a footprint via pcb, at one point you "cut
> selected objects to buffer".  At that moment, the location of the
> crosshair becomes the 0,0 point for the coordinate system that the cut
> buffer uses.  If you paste the buffer as-is, you'll notice that the
> "ghost" image before you click is relative to the crosshair in the
> same way it was relative to when you cut it.
>
> When you convert a buffer to a footprint, the footprint is created
> relative to the 0,0 of the buffer, of course.  The *net* result is
> that the location of the crosshair when you initially cut it becomes
> the origin of the footprint.
>
>
> > How and why would anyone create parts at 0,0 in the extreme upper
> > left corner of a PCB?
>
> Again, elements vs footprints.  A footprint should have a reasonable
> 0,0 point and should be stored with a 0,0 in the Element[] coordinate
> slot.
>
> Once on a pcb, it's not a footprint, it's an element, and the
> "location" information in the Element[] coordinate slot is used to
> keep track of its location.
>
> > I am guessing that the origin
> > coordinates written to the footprint file, are related to relative
> > coordinates based on a local origin and the cursor position.
>
> If you happen to have something other than 0,0 in the footprint file,
> when you paste that footprint onto the pcb, it will be pasted away
> from the crosshair by that amount.  *After* it's pasted, that
> coordinate will be updated to be the new location of the element.
>

That has not been evident in my tests.  I cannot see/feel any difference.


>
> > BUT - and this is the kicker - it does not seem to matter if you
> > have an non-zero offset in your footprint file.
>
> That would make sense, since the coordinates in the footprint file
> only have a real meaning after you place it on a pcb.
>
> It's possible to have more than one Element[] in a footprint file, but
> we discourage that ;-)
>

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

<div dir=3D"ltr"><div><div><div><div><div><div>DJ<br><br></div>Thanks for y=
our detailed response. <br><br>I did some more tests.=C2=A0 <br><br></div>I=
t appears that the absolute position is written to the footprint origin<br>=
</div><div>value in the footprint file.=C2=A0 I wrote one origin to 2870.00=
mil and 1525.00mil.<br></div><div>I did this by placing the component - set=
ting the cursor to the same location as the diamond<br>and coincident with =
Ctl-M, and saving a new footprint. I was surprised by the results and I hav=
e <br>no idea why a absolute position would have any value=C2=A0 - especial=
ly if your PCB outline was smaller <br>then these dimensions.<br><br></div>=
<div>Based on your latest comments about using absolute coordinates in the =
past=C2=A0 - could what<br>I have been seeing with the footprint origin=C2=
=A0 - is this a legacy &#39;feature&#39; that has been made non-functional =
<br>with new PCB releases?<br></div><div><br></div>If I hand edit the origi=
n back to (0,0) in the footprint file and restart PCB and place the <br>sam=
e component at the cursor - no problem.=C2=A0 I experience no difference us=
ing this component <br>in PCB. And as I mentioned previously, I find other =
library footprints with non-zero origin values also.<br></div><div>(however=
, there are differences in the &quot;Elements[ ]&quot; arguments).<br></div=
></div><br></div><div>I&#39;d like to suggest that before more speculations=
 are made on how it should work - please test in your version of PCB.=C2=A0=
 <br>I may have something particular with my environment. Testing origin va=
lues can be done easily/quickly.<br></div><div><div><div><div><div><div><di=
v><div><div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"=
>Dave<br><br></div><div class=3D"gmail_extra"><div class=3D"gmail_quote">On=
 Mon, Aug 17, 2015 at 4:06 PM, DJ Delorie <span dir=3D"ltr">&lt;<a href=3D"=
mailto:dj AT delorie DOT com" target=3D"_blank">dj AT delorie DOT com</a>&gt;</span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><span class=3D""><br>
&gt; A lot of this doesn&#39;t make sense. I&#39;m hearing 2 things.<br>
<br>
</span>As a bit of background, consider that the original footprint &quot;f=
ile&quot;<br>
allowed more than one footprint, and we use the same information for<br>
cut buffers and &quot;save buffer to file&quot; stuff.=C2=A0 Each pcb, past=
e buffer,<br>
and file has its own local coordinate system, and cutting and pasting<br>
translates between those coordinate systems.<br>
<span class=3D""><br>
&gt; 1) If the 0,0 origin coordinates are an absolute position from the<br>
<br>
</span>Keep in mind the difference between a footprint and an element.<br>
<br>
A footprint is a pattern in a library.<br>
<br>
An element is a specified instance of a footprint along with other<br>
information.<br>
<br>
So it makes no sense to talk about the &quot;origin&quot; of a footprint - =
it&#39;s<br>
in a library, it&#39;s just a pattern, the only magic about the origin is<b=
r>
that it&#39;s the mathematical 0,0 point that other things in the<br>
footprint are measured from.<br>
<br>
When you paste a footprint onto a pcb it becomes an element.=C2=A0 At that<=
br>
point, the 0,0 of the footprint is mapped to wherever the crosshair<br>
is, and becomes the &quot;location&quot; of the element.</blockquote><div>=
=C2=A0<br>That has not been seen by my experiments.=C2=A0 The value for the=
 footprint origin <br>does not appear to matter.=C2=A0 <br></div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">
<span class=3D""><br>
&gt; But that doesn&#39;t happen when you import schematics to the PCB.<br>
<br>
</span>Actually it does if you use gsch2pcb.=C2=A0 The File-&gt;Import meth=
od<br>
relocates every element so that they&#39;re not all up in the corner.<br>
<span class=3D""><br>
&gt; The diamond shape origin is in the center of this 805 component - no<b=
r>
&gt; matter where this component is randomly placed onto the PCB grid.<br>
&gt; The component origin cannot be linked to absolute PCB coordinates.<br>
<br>
</span>The element&#39;s internal measurements are all relative to the elem=
ent&#39;s<br>
origin, as if it had its own local coordinate system.=C2=A0 We do this just=
<br>
to keep the internal logic easier.=C2=A0 We *used* to keep the internal<br>
coordinates absolute, and had to recalculate the position of every<br>
pin, pad, and silk every time you moved the element.<br>
<span class=3D""><br>
&gt; 2) I thought I heard that the origin written to the footprint file,<br=
>
&gt; happens to be the absolute position of the cursor when captured into<b=
r>
&gt; the buffer.<br>
<br>
</span>When you&#39;re editing a footprint via pcb, at one point you &quot;=
cut<br>
selected objects to buffer&quot;.=C2=A0 At that moment, the location of the=
<br>
crosshair becomes the 0,0 point for the coordinate system that the cut<br>
buffer uses.=C2=A0 If you paste the buffer as-is, you&#39;ll notice that th=
e<br>
&quot;ghost&quot; image before you click is relative to the crosshair in th=
e<br>
same way it was relative to when you cut it.<br>
<br>
When you convert a buffer to a footprint, the footprint is created<br>
relative to the 0,0 of the buffer, of course.=C2=A0 The *net* result is<br>
that the location of the crosshair when you initially cut it becomes<br>
the origin of the footprint.<br>
<span class=3D""><br>
<br>
&gt; How and why would anyone create parts at 0,0 in the extreme upper<br>
&gt; left corner of a PCB?<br>
<br>
</span>Again, elements vs footprints.=C2=A0 A footprint should have a reaso=
nable<br>
0,0 point and should be stored with a 0,0 in the Element[] coordinate<br>
slot.<br>
<br>
Once on a pcb, it&#39;s not a footprint, it&#39;s an element, and the<br>
&quot;location&quot; information in the Element[] coordinate slot is used t=
o<br>
keep track of its location.<br>
<span class=3D""><br>
&gt; I am guessing that the origin<br>
&gt; coordinates written to the footprint file, are related to relative<br>
&gt; coordinates based on a local origin and the cursor position.<br>
<br>
</span>If you happen to have something other than 0,0 in the footprint file=
,<br>
when you paste that footprint onto the pcb, it will be pasted away<br>
from the crosshair by that amount.=C2=A0 *After* it&#39;s pasted, that<br>
coordinate will be updated to be the new location of the element.<br></bloc=
kquote><div><br></div><div>That has not been evident in my tests.=C2=A0 I c=
annot see/feel any difference.<br></div><div>=C2=A0<br></div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=
adding-left:1ex">
<span class=3D""><br>
&gt; BUT - and this is the kicker - it does not seem to matter if you<br>
&gt; have an non-zero offset in your footprint file.<br>
<br>
</span>That would make sense, since the coordinates in the footprint file<b=
r>
only have a real meaning after you place it on a pcb.<br>
<br>
It&#39;s possible to have more than one Element[] in a footprint file, but<=
br>
we discourage that ;-)<br>
</blockquote></div><br></div></div></div></div></div></div></div></div></di=
v></div></div>

--001a11c332dafab64f051d8ef174--

- Raw text -


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