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: <201508160552 DOT t7G5qBPo025284 AT envy DOT delorie DOT com> <201508170550 DOT t7H5oW1T021206 AT envy DOT delorie DOT com> <201508171557 DOT t7HFvFka015445 AT envy DOT delorie DOT com> <201508172206 DOT t7HM6ZUI032712 AT envy DOT delorie DOT com> Date: Mon, 17 Aug 2015 23:11:05 -0600 Message-ID: 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]" To: geda-user AT delorie DOT com Content-Type: multipart/alternative; boundary=001a11c332dafab64f051d8ef174 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 --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 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
DJ

Thanks for y= our detailed response.

I did some more tests.=C2=A0

I= t appears that the absolute position is written to the footprint origin
=
value in the footprint file.=C2=A0 I wrote one origin to 2870.00= mil and 1525.00mil.
I did this by placing the component - set= ting 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 hav= e
no idea why a absolute position would have any value=C2=A0 - especial= ly if your PCB outline was smaller
then these dimensions.

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

If I hand edit the origi= n back to (0,0) in the footprint file and restart PCB and place the
sam= e component at the cursor - no problem.=C2=A0 I experience no difference us= ing 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.=C2=A0=
I may have something particular with my environment. Testing origin va= lues can be done easily/quickly.

Dave

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

> A lot of this doesn't make sense. I'm hearing 2 things.

As a bit of background, consider that the original footprint "f= ile"
allowed more than one footprint, and we use the same information for
cut buffers and "save buffer to file" stuff.=C2=A0 Each pcb, past= e 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.=C2=A0 At that<= br> point, the 0,0 of the footprint is mapped to wherever the crosshair
is, and becomes the "location" of the element.
= =C2=A0
That has not been seen by my experiments.=C2=A0 The value for the= footprint origin
does not appear to matter.=C2=A0

> But that doesn't happen when you import schematics to the PCB.

Actually it does if you use gsch2pcb.=C2=A0 The File->Import meth= od
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 elem= ent's
origin, as if it had its own local coordinate system.=C2=A0 We do this just=
to keep the internal logic easier.=C2=A0 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".=C2=A0 At that moment, the location of the=
crosshair becomes the 0,0 point for the coordinate system that the cut
buffer uses.=C2=A0 If you paste the buffer as-is, you'll notice that th= e
"ghost" image before you click is relative to the crosshair in th= e
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.=C2=A0 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.=C2=A0 A footprint should have a reaso= nable
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 t= o
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.=C2=A0 *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.=C2=A0 I c= annot see/feel any difference.
=C2=A0

> 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<= br> we discourage that ;-)

--001a11c332dafab64f051d8ef174--