'Number -1' invisible pad in pattern

Report bugs here
Post Reply
Message
Author
dtu2
Expert
Posts: 197
Joined: 20 Jan 2012, 03:50

'Number -1' invisible pad in pattern

#1 Post by dtu2 » 15 Jul 2018, 05:20

I ran across an interesting 'anomaly' with the Pattern Editor... (sorry, I know this is long but I guess it needs to be)

I was building three similar patterns used to represent pcb mounting spacers. Neither pattern is intended to have any pads... only a drawing on the assembly layer strictly for location purposes and a 3D model showing the pcb mounting spacer under the pcb. (BTW, no mounting hole yet at this stage when I discovered the problem).

One of these patterns, 'SPCR1', will position correctly on the grid when it is initially placed using the PCB editor. The problem is that the other one, SPCR2, will be skewed off center by a fractional amount. However, if you select the skewed SPCR2 pattern after it has been placed and select 'Snap to Grid' > 'By Origin', the pattern will then align to the grid properly based on the assembly layer drawing. It just won't center to the grid when it's initially placed... you always must correct it's position.

So, I exported these two patterns using Diptrace ASCII and compared them.

What I found was an invisible 'phantom' pad in SPCR2, the pattern with the problem. It's a 1mm x 1mm pad with a 0.1mm hole which is offset from the drawing origin at coordinates -1.5,-1.05 (which is not on any grid point). This phantom pad is not visible in the Diptrace Pattern Editor and cannot be selected or deleted within the Pattern Editor. It's as if it doesn't even exist to the user but never the less there it is in the ASCII export.

If you look at the contents of the ASCII export of the malformed SPCR2 pattern you will see a 'Pads' section that has information about this invisible pad. Moreover, in that section, you will notice that the pad 'Number' is shown as a '-1'. So it's there, but with a value of -1 Diptrace does not display it or allow you to select it and/or delete it. It's as though it doesn't exist in the Editor but it is actually there in the ASCII export and it's effects are displayed when placing the pattern on the pcb.

So, I renumbered the pad from 'Number -1' to 'Number 1' and imported it back into Diptrace. At that point you can see this pad.

Now, when you place the pattern on the pcb it centers on that mysterious pad since that's Diptraces' default behavior. So when the pad is hiding and when you place it on the pcb, it causes the pattern to be centered on the invisible phantom pad's position but when you snap to the grid 'By Origin' it centers on the visible assembly layer drawings as it should and not on the invisible pad.

Here's the thing... I can't account for this invisible pad or any pads at all for that matter in these patterns. These patterns didn't contain any pads... only assembly layer drawings and a 3D model (again, no mounting hole yet at this stage).

For me to have caused this I would have had to place a pad off center from the drawing origin at coordinates -1.5,-1.05 (not on the grid) and, I suppose, renumber it manually to -1. All of which I can assure you didn't happen. Also, I created one pattern and duplicated it twice more so all three patterns 'should' show the same behavior but they don't.

So, three questions to anyone that is still reading:

1) Any idea how it got there (it isn't in a location that has anything to do with the pattern's assembly drawings i.e. not at the origin and not on the grid)?
2) Why would it be numbered 'Number -1'?
3) What is going on with Diptrace and an invisible, negative value pad ('Number -1')?

Anybody?

Serg?

.
Spcr_Comb.png
Spcr_Comb.png (43.28 KiB) Viewed 306 times
spcr2_pads_section.png
spcr2_pads_section.png (18.9 KiB) Viewed 306 times
spcr1.txt
(2.67 KiB) Downloaded 53 times
spcr2.txt
(3.54 KiB) Downloaded 53 times
Jeff

Alex
Technical Support
Posts: 3897
Joined: 13 Jun 2010, 23:43

Re: 'Number -1' invisible pad in pattern

#2 Post by Alex » 16 Jul 2018, 01:29

1. You could duplicate an existing pattern, delete its pads and put some graphics objects. Since new pattern doesn't have pads Pattern editor can't center the pattern because this function works by pads.
2. (Number -1) means deleted pad. It's often faster to set negative number than refresh all related arrays.
3. Software ignores pads with negative number.

dtu2
Expert
Posts: 197
Joined: 20 Jan 2012, 03:50

Re: 'Number -1' invisible pad in pattern

#3 Post by dtu2 » 16 Jul 2018, 11:05

Alex wrote: 16 Jul 2018, 01:29 1. You could duplicate an existing pattern, delete its pads and put some graphics objects.
Yes you *could*. However, even if that were the case, I created all three patterns at the same time. Does this explain why only one of them would have this problem if they were all a copy of a copy? That pad was not the default pad. It's size and hole diameter would have had to be changed and it's not on any normal grid. In fact it's on a custom X,Y grid setting. And it's in a separate library that does not contain any other patterns that contain this pad size and location.

None of this really makes any sense to me now... but I suppose 'it is what it is'.

Since new pattern doesn't have pads Pattern editor can't center the pattern because this function works by pads.
Well, we can see that obviously this isn't always true. If you look at the picture of the SPCRs you can see the Pattern Editor seems to have no problems centering other instances of these spacer patterns based on the Origin that contain only assembly layer drawings such as SPCR1 (and SPCR3 which I didn't include here) and no pads either visible or invisible. When I place them with the PCB Editor they center correctly based solely on the Origin having only assembly layer drawings and no pads either positive or negatively numbered.

2. (Number -1) means deleted pad. It's often faster to set negative number than refresh all related arrays.


Yes, speed is good but:

Does that mean if a person were to delete a high pin count BGA that all of those pads remain in the pattern as negative numbered pads indefinitely?

Is there ever any 'automatic housekeeping' that cleans things up?

If not, is there anything a person can do to manually clean up the patterns in the UI (other than manually export > edit > import)?

Maybe the 'Library' > 'Check "your_lib_here" Library...' should clean this stuff up?

I realize it's all a special case but it seems to be an unfortunate side effect of the decision to leave those negatively numbered pads hanging around in a pattern. If this is the way you want it to work then apparently the software needs to check to see if there are any positively numbered pads and if not then ignore the negatively numbered ones as well. Or just take out the trash...

3. Software ignores pads with negative number.
Well, this shows that's clearly not always the case. In this instance, you can see that SPCR2 centers on the invisible, negatively numbered pad exactly the same as when the pad is positively numbered and visible.

***********

This all relates back to requests to create the option to be able to set the Default 'snap-to' function to the Origin instead of just limited to the Pads as it is currently. With all the different pin pitches and packages these days, this makes more sense now than ever before.

Tomg defined this perfectly here:
viewtopic.php?f=8&t=10742&p=19114&hilit=origin#p19114

And, of course, you may remember others as well.

It's been a long wait and many have asked for some time now...

Would you please include that option in the next update whether you all fix this or not? If that option was there chances are that I'd never even run across this. That's way more important that swatting this bug that most will never encounter.

Thanks.
Jeff

Post Reply