pcb

specctra autoroute patch

Bug #699471 reported by spaceman81 on 2009-08-04
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gEDA project
Wishlist
Unassigned
pcb
Medium
Unassigned

Bug Description

Specctra routing works to export .dsn file and import result .ses file from freeroute.net. Let me know of any trouble. Same as other autorouters, enabled layers are used. Power planes are used when layer name == net name, requires manual addition of rectangle and thermals to connect vias.

spaceman81 (spaceman81) wrote :

A menu item was added for import in lesstif like the one in gtk.
It now exports mounting holes (vias).

It still does not support pre-routed tracks and was only tested on boards with no tracks.

Ineiev (ineiev) wrote :

Probably another git user error. the patch looks like difference against previously patched sources, but the first patch is deleted.

BTW, have you any .dsn files description or just reverse-engineered output of some program? I could find no specification of the format.

Regards,
Ineiev

nobody (nobody-users) wrote :

There is a specctra spec pdf that somebody emailed me, I could email it to you. I never used git before, I thought it compared to the online repository version with git diff.

nobody (nobody-users) wrote :

git diff seems to compare against some intermediate version someplace. How do I make it compare to the repository version?

Ineiev (ineiev) wrote :

> There is a specctra spec pdf that somebody emailed me, I could email it to
> you.

It would be interesting to look at. if there are no strong restrictions, please email it to ${my sourceforge login}@users.sourceforge.net

> I never used git before, I thought it compared to the online
> repository version with git diff

Never mind. git is very convenient, you'll master it in no time.

> git diff seems to compare against some intermediate version someplace. How
> do I make it compare to the repository version?

I think some your changes have been committed and other not. you can check your commits
with 'git log'. to modify the latest commit, I use 'git commit --amend .'; it will remove the latest commit and create new one based on the current state of the files; the attributes (e.g. date) will be the same as of the removed commit unless you edit the log message.

Now you can, for example, 'git format-patch -o $HOME HEAD~1';
this command should put a nice patch file with the log message and other information into your home directory.

Regards,
Ineiev

Peter Clifton (pcjc2) on 2011-01-14
tags: added: 3rd-party-export 3rd-party-import
Bert Timmerman (bert-timmerman) wrote :

The above patch (#7)needs some TLC for rework needed because of the internal nm-resolution introduced recently.

WARNING: please do not patch !

README that went with the above patch (#7):

gEDA-user: help with pcb dsn plugin

To: geda-user@xxxxxxxxxxxxxx
Subject: gEDA-user: help with pcb dsn plugin
From: Josh Jordan <outerspaceman81@xxxxxxxxx>
Date: Sun, 12 Jun 2011 09:14:13 -0700 (PDT)

I made a dsn export/import plugin a few years back that I am trying to
merge into latest git pcb version. It works to export and the dsn can
be routed with freerouting.net, and the import function appears in the
menu, but the import action does not work. The function name is
ActionLoadDsnFrom() but somehow during compilation it lists a
"LoaddsnFrom" in the list of actions. It says "Unknown Action" when I
try to use LoaddsnFrom or ActionLoadDsnFrom, or LoadDsnFrom. Is there
a way to list what actions exist in pcb?
I had to make 2 patches, the first one with "git diff" it only shows
files that were changed. The second patch is from "git add -i
/src/hid/dsn", "git commit" and "git format-patch -1" and it will only
show files that were added. If anyone knows how to make the patch with
1 command that would also help.
Thanks,
Josh Jordan

Peter Clifton (pcjc2) wrote :

The patch is actually mangled - I'm seeing expanded HTML escapes rather than "&<> in various places. I'm not sure how that has happened, but I doubt the patch will even apply in its current state.

Hi all,

I noticed the HTML ugliness from my "copy-and-paste" from the e-mail from geda-user, and I'm working on this patch (the TLC part).

And as said before in #8: "please do not patch !", for the reasons mentioned below.

One other thing I noticed is that a decent copyright notice is missing and that the GPLv2+ notice is not included, so IMHO this code is basically a "no commit" on religious grounds (FSF, Stallman et al) .

@Josh Jordan and Dan McMahill: if you read this, please make a statement regarding the above issue so this importer/exporter actually can be included in the pcb git repository at gpleda.org.

Kind regards,

Bert Timmerman.

Jared Casper (jaredcasper) wrote :

So I wanted try out this freerouting.net thing so went ahead and gave this patch some of that TLC (sorry if I duplicated any work Bert).

Here's what I did:

-- extensive style changes for my own sanity. There was inconsistent style throughout (like all of pcb's code), so I chose the one I like best (linux kernel style with indent of 4 instead of 8). :)

-- Brought all the handling of coordinates up to date with the new Coord type and nm precision. There were a few places where dimensions were being rounded to the nearest mil, etc. which would've been bad for metric based boards. This has all been taken care of and appears to be working in some simple tests. DSN files are now in mm units with nm precision.

-- Removed the somewhat dubious code for finding the rotation of the part copied over from bom.c. We don't have the original part anyway, so the rotation was not being used. The code is still there in bom.c if it is needed in the future.

-- Fixed some minor issues like a small memory leak, etc.

-- Fixed issues registering the action and updated config values to use Coord.

-- New line from the session file weren't clearing polygons.

-- Possibly some other stuff, I forget, I just went through the whole thing top to bottom and fixed anything I saw weird.

Some things still not quite handled:

-- Existing polygons on the pcb don't make it into the dsn.

-- Parts rotated at non-orthogonal angles probably won't work since rectangular pads won't be rotated correctly.

-- Probably some other stuff.

It appears to be working with some early tests, and freerouting.net is pretty awesome.

Jared Casper (jaredcasper) wrote :

Forgot to attribute original authors in commit message, updated patch attached.

Hi Jared,

I tried the expales/LED2.pcb --> dsn --> freerouting.net and got a warning "unable to read .dsn-file".

I tried bare, zipped and gzipped versions, as is discussed on the freerouting forum, to no avail.

What is your mileage on this ?

One other thing that comes with this exporter/importer is documentation.

I have an untested patch attached.

Kind regards,

Bert Timmerman.

s/expales/examples/

Hi,

I tweaked the patc after installing texi2dvi (texinfo-tex).

Updated patch attached.

Kind regards,

Bert Timmerman.

Jared Casper (jaredcasper) wrote :

Hrm, I got the "unable to read .dsn-file" my first try or two when I had some initial bugs with printing some bad values, etc. But with the attached patch I was able to export, open in freerouting.net and route a couple of traces, then import the session file for a couple of different boards.

Maybe browse through the .dsn file and see if anything obvious pops out as weird? One thing I did was comment most of the file out, then added things one by one until I broke it. Obviously you have to be careful to keep the file consistent (i.e. you have to keep the image related to a placement, and any padstacks referenced in the image, etc. If you want to attach/send me the .dsn I could try to take a look and see what the problem is.

Hi,

I think we need quotes, lots of quotes, in our "net scope".

See the thread on the technical support forum on freerouter.net:

<quote>
Re: Problem uploading dsn

Postby alfons » Wed Sep 07, 2011 12:53 pm

If a component name in a pins scope of a net scope contains a "-" character, my router expects, that this name is quoted.
The reason is, that in such a scope the pin name is separated from the component name by such a "-" character.
Normally the DSN-file writer of KiCad does this quoting correctly, but not when the component name begins with such a "-" character.
If you avoid, that a component name starts with a "-" character, my router will read your .dsn-file correctly.
Alternatively you can edit your dsn-file and quote the pin name from -180 to "-180" in the 4 locations inside a pins scope of a net scope, where the problem occurs.

</quote>

The pcb dsn exporter does this:

  (network
    (net AGND
      (pins C8-2 C9-2 C10-2 C11-2 C12-2 C13-2 C20-2 C21-2 R7-2 R9-2 R10-2 U2-6 U2-7 U2-8 U2-9 U2-18 U3-2 U3-5 U7-4)
    )
    (net DGND
      (pins C5-2 C6-2 C7-2 C14-2 C15-2 C16-2 C17-1 J3-1 U2-14 U2-19 U4-2 U4-5 U5-5 U6-4 X1-2)
    )
    (net Minus12V
      (pins C3-1 C4-1 J3-9 U1-6)
    )
    (net Plus12V
      (pins J3-6 R11-1 R12-2 U1-7 U1-11)
    )

others (FreePCB Ver 1.359) do this:

    (network

        (net "N1"

            (pins

                "P1"-"3"

                "MCU"-"131"

            )

        )

        (net "N2"

            (pins

                "P1"-"2"

                "MCU"-"129"

            )

Hope this gives a direction in solving some of the hick-ups I had @ freerouter.net

I try to fidlle with the code to cranck out some more quotes ;-)

Kind regards,

Bert Timmerman.

Jared Casper (jaredcasper) wrote :

Looks like this will just quote the whole pin name in the netlist? From that discussion you linked to, "J1-2" will be parsed as a component id without a pin, whereas "J1"-"2" will be component id "J1" with pin "2". After looking at the pcb code though, I don't think PCB would be okay with a refdes with a "-" in it, since it parses the netlist by looking for the first "-" in the pin description.

Anyway, I'm working with a colleague on getting his board loaded into freerouting.net.

So far we found a typo in generating a padstack for a square pad through hole (which none of my tests had). Still having issues for some other boards though... once we get them all going I'll consolidate all these patches and put a new one up.

Looks like I'll have to change the formatting again as well, according to Peter C.'s message to the list.

Hi,

I just started with the first dozen lines or so, when comment came through (#20).

If you are in a hurry to get your board done on freerouter, then hack away.

I wait until you have something new.

BTW: I have stashed my pcb dev stuff on github: https://github.com/bert/pcb

Look for the LP699471 branch.

Kind regards,

Bert Timmerman.

Jared Casper (jaredcasper) wrote :

Getting closer... fixed a number of bugs and it should be more usable... thought I would put this out there in case people want to use/test it.

-- Re-styled to gnu style

-- Added quoting, most of what Bert has above, plus correct quoting of "refdes"-"pin name" in the netlist.

-- Fixed typo in through holes with square pads

-- Re-worked handling of layers. The top layer needs to come first and the bottom layer needs to come last in DSN files. Also, the code was previously assuming the top layer was called "component", which caused dsn loading failure if it wasn't.

-- Incorporates copyright and documentation patches from Bert above.

Things still to do

-- The handling of routing classes and DRC rules needs some work. Right now the values put into the export dialog end up as both the DRC rules and the default routing style. We should get the DRC rules from the DRC settings in the PCB and export the existing routing styles instead of asking for a new one and only doing that.

-- Right now every segment of a trace is a separate path. For using existing traces in the router, it would be nice to link them together into a path if possible.

-- Polygons and rotated parts, as before

Hi,

FYI, revision 1 with proper quotes in the .dsn output file is to be found in the pcb repository as topic branch "LP699471rev1".

Kind regards,

Bert Timmerman

Pushed topic branch LP699471-rev1 to upstream.

Traumflug (mah-jump-ing) on 2015-09-27
Changed in geda-project:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers