GithubHelp home page GithubHelp logo

traumflug / visolate Goto Github PK

View Code? Open in Web Editor NEW
85.0 11.0 26.0 5.89 MB

Visolate is an application for calculating machining toolpaths (G-code) for manufacturing printed circuit boards (PCBs) by isolation milling. As an outstanding feature, this calculation is done on the computer's screen, using the features of 3D graphics drivers.

License: GNU General Public License v3.0

Java 100.00%

visolate's Introduction

Archiving hint: In late summer 2023, Github started to enforce 2FA (Two Factor
                Authentication), so I had to archive it before losing control
                over it.  See also #12

                Traumflug, August 2023


Visolate is an application for calculating machining toolpaths (G-code) for
manufacturing printed circuit boards (PCBs) by isolation milling. As an
outstanding feature, this calculation is done on the computer's screen,
using the features of 3D graphics drivers.

Please note that branch 'master' isn't the single best branch. There are
multiple branches from various contributors, all on a similar development level.
One of these branches might work better for your operating system or your use
case than another.

USAGE

To use Visolate, run it in a terminal with the Java engine:

  java -jar visolate-3.1.1.jar

If this results in tons of error gibberish, see installation instructions below.

The most simple use case is to load a Gerber file at the top of the window,
then clicking "Fix Topology" and "Make Toolpaths", then saving the G-code
file. For all the options in between, move your mouse over all the buttons
and fields. Tooltips appear which shall be helpful.

Accuracy of the G-code is adjusted by adjusting the DPI value of the display.


NEW in 3.1.1:

- Make command line options more consistent.

- Avoid misbehaviour when a requested file can't be load (load the demo
  instead).

- Make sure freshly loaded files respect X and Y flipping.

NEW in 3.1:

- Use a slightly modified Douglas-Peucker algorithm for path optimisation.
  This reduces the number of G-code lines by some 20% while increasing
  accuracy and prettyness.

- Make path optimisation more coarse, as in some cases stair-steps weren't
  optimised away. To re-gain the same granularity, you have to increase the
  resolution of the drawn image (dpi value slider). Together, this results
  in even better accuracy at the same granularity.

NEW in 3.0.1:

- Make it work on Ubuntu 12.04.

NEW in 3.0:

- Toolspaths now respect the thickness of elements. Earlier, only the centers
  of tracks/pads were taken for calculation, now the entire perimeters are.

- Path junctions are now kept accurately.

- Much faster path optimisation. So fast one of the progress bars went useless.


INSTALLATION - Debian/Ubuntu Linux

Visolate it's self needs no installation, but it requires some dependencies:

  sudo apt-get install --no-install-recommends openjdk-6-jre
  sudo apt-get install --no-install-recommends libjava3d-java
  sudo apt-get install --no-install-recommends libjava3d-jni
  sudo apt-get install --no-install-recommends libvecmath-java

Getting this to work on Ubuntu 11.10 and earlier requires a few additional tweaks:

  sudo update-java-alternatives -s java-6-openjdk
  sudo ln -s /usr/share/java/j3dcore.jar /usr/lib/jvm/java-6-openjdk/jre/lib/ext
  sudo ln -s /usr/share/java/j3dutils.jar /usr/lib/jvm/java-6-openjdk/jre/lib/ext
  sudo ln -s /usr/share/java/vecmath.jar /usr/lib/jvm/java-6-openjdk/jre/lib/ext


DEVELOPMENT

Unfortunately, there are no makefiles available. Development is currently done
in the totally overfeatured, but well working Eclipse IDE:

1. Make sure you have all dependencies. Easiest way to find out is to
   run the JAR executable, see section USAGE.

2. Install Eclipse:

     sudo apt-get install eclipse

3. Grab sources:

     git clone https://github.com/Traumflug/Visolate.git

4. Launch Eclipse, select Menu -> File -> Import... ->
                          Existing Projects into Workspace.

   Find the just grabbed sources; avoid copying them (see checkbox there).

5. Create a Run Configuration:

   (essential, as applet and/or application, to be defined)

6. Turn off useless warnings:

   By default, a large number of warnings about missing privileges in system
   libraries appear. This is counterproductive, as it hides real warnings.

   (non-essential, to be defined)

7. Tell Eclipse to always update externally modified files:

   This is essential when using Git.

   (non-essential, to be defined)

8. Tell Eclipse to show the TODO list:

   All known flaws and a wishlist are marked as TODO in the sources. This is
   really helpful when developing and better than Eclipse's "bookmark" feature.

   (non-essential, to be defined)

9. Compile and run the executable

   Select Menu -> Run -> Run.


SOURCE CODE OVERVIEW

Please take this with a grain of salt. All the code is well crafted and easy
to understand, even for C programmers. However, I (Traumflug, early 2012)
learned about the workings of Visolate only when enhancing from version 2.1.6
to version 3.0, so I very likely missed the parts not needed for these new
features.

Whatever, it's big fun to learn about the workings as you hack away. Clear
design, excellent base for further enhancements. Starting points can be
found by searching for the texts displayed in the GUI.

What I found out so far:

Main.java is the launcher and does the command line stuff. Display.java does
all the handling of the 3D display while Visolate.java handles the remaining
GUI. All this is in the visolate package. Model.java in the visolate.model
package has some GUI code as well(?!?).

When a Gerber is loaded, it's parsed and it's geometry is stored as a simulator
object. The simulator is in the visolate.simulator package, one class for
each type of element.

All the track and pin drawing stuff is done in the package visolate.model,
namedly in Net.java. There are different types of drawings, like flat geometry,
cone geometry or line geometry. For each GUI checkbox you'll find an almost 1:1
corresponding method there. Hack this if you want to change the appearance
of your elements.

Path creation stuff is done in the visolate.processor package. Basically, the
elements are drawn as needed (ToolpathsProcessor: processStarted()), then
the "real" work is done in ProcessCompleted(). Pixel-sized toolpath nodes are
found by searching color differences between adjectant pixels. After assembling
them to larger paths they're optimized, to be written out as G-code later.
Very straightforward.


MAKING A RELEASE

1. Find the APPNAME variable in Main.java and adjust the string to the new
   version.

2. Update the NEW section above in this file.

3. Update the name of the JAR file in the USAGE section above.

4. Create a JAR:

   - Eclipse-> Menu -> File -> Export... -> Java -> Runnable JAR file

   - Click "Next".

   - Locate the destination into the "releases" folder.

   - Check "Extract required libraries into generated JAR".

   - Click "Finish".

   - Accept repackaging the libraries.

5. Commit the JAR file with the message "Make release x.x." and a short
   description of the new features, starting in subsequent lines.

6. Create a signed tag of the release:

     RELEASE=x.x  # e.g. RELEASE=3.0
     git tag -u 806F3A3E -m "Release ${RELEASE}." "release-${RELEASE}"

   Note: This "806F3A3E" is my own (Traumflug's) GPG key. On how to set up
         your own key, consult Google.

7. Done. Push the stuff out to Github:

     git push && git push --tags

visolate's People

Contributors

blokkendoos avatar traumflug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visolate's Issues

wishlist

If possible, i would suggest that having a start.gcode and end.gcode implementation would be quite useful. For example i have a procedure to put milling bit on top of the pcb for height adjustment and i normally use that as start.gcode.

Also one part which could be better is to have the moves made at elevated height as a travel speed, faster than the milling speed (at milling depth). Basically to have a travel speed for moving from one polygon to the other (at high Z). This would be neat for non-voronoi paths which generates more travel moves than otherwise.

Does not support ground polygon

Hello,

It appears that Visolate fails with the below exception when there are any polygons in the pcb.

java -jar /tmp/Visolate/releases/visolate-3.1.1.jar
graphics device: :0.0
libGL error: failed to load driver: r600
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
pixel format 8:8:8 24-bit depth
WARNING: ignoring offset OFA0.0B0.0
WARNING: ignoring image polarity IPPOS
WARNING: ignoring layer polarity LPD
computing inch coords...
making nets...
102 nets
making half edge loops...
66 loops
computing inch coords...
making nets...
102 nets
making half edge loops...
70 loops
Comment at line 1: start of page 2 for group 0 idx 0
Comment at line 2: Title: (unknown), top
Comment at line 3: Creator: pcb 1.99z
Comment at line 4: CreationDate: Sun 23 Dec 2012 07:41:20 PM GMT UTC
Comment at line 5: For: joe
Comment at line 6: Format: Gerber/RS-274X
Comment at line 7: PCB-Dimensions (mm): 152.40 127.00
Comment at line 8: PCB-Coordinate-Origin: lower left
layer name: TOP
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: TBD polygon mode
at visolate.simulator.Simulator.setPosition(Simulator.java:232)
at visolate.parser.Parser.CoordinateDCode(Parser.java:351)
at visolate.parser.Parser.DCode(Parser.java:316)
at visolate.parser.Parser.Code(Parser.java:219)
at visolate.parser.Parser.Input(Parser.java:98)
at visolate.Visolate.load(Visolate.java:722)
at visolate.Visolate.loadFile(Visolate.java:698)
at visolate.Visolate$2.actionPerformed(Visolate.java:144)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

test files used:

test.sch: schematic file: http://codepad.org/7EfApPjh
test.pcb: pcb file: http://codepad.org/5JusexrR
gerber file, output of the command: pcb -x gerber --verbose --metric --gerberfile test_board test.pcb: test_board.top.gbr: http://codepad.org/XVquxoKx

btw, it works without the polygon in the pcb.

Joe

Huge elements on load of gbr file

So trying to use visolate for the first time - Have a board I designed in kicad, reworked so it does not use a ground plane (to work around that issue for now), and loaded it into visolate 3.1.1

But when I load the file, all the elements are huge and overlapping each other. The file appears fine in GerbView 4.0.6 and loads fine in some other tools I've tried also.

Hopefully I'm just doing something silly...

GRB file: https://drive.google.com/file/d/0B_tI4K3x6U3_ZGJaZmF3cnU4T0E/view?usp=sharing

Screen shots of visolate and GRBView: https://docs.google.com/document/d/18rx4XHdTZHVQnV2tDGZXEY3t52iMsSDvY6d8GqSaxg0/edit?usp=sharing

Unable to launch on Windows

When i try to launch Visolate on my Win10 PC, i get the following error:

C:\Users\Thomas>java -jar "C:\Users\Thomas\Downloads\visolate-3.1.1.jar"
Aug 17, 2018 12:24:40 PM javax.media.j3d.NativePipeline getSupportedOglVendor
SEVERE: java.lang.UnsatisfiedLinkError: no j3dcore-ogl-chk in java.library.path
Exception in thread "main" java.lang.ExceptionInInitializerError
        at visolate.Display.<init>(Display.java:97)
        at visolate.Visolate.<init>(Visolate.java:66)
        at visolate.Visolate.<init>(Visolate.java:60)
        at visolate.Main.main(Main.java:118)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: javax.media.j3d.Win32NativeConfigTemplate3D
        at javax.media.j3d.NativeConfigTemplate3D$1.run(NativeConfigTemplate3D.java:82)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.media.j3d.NativeConfigTemplate3D.createNativeConfigTemplate3D(NativeConfigTemplate3D.java:74)
        at javax.media.j3d.NativePipeline.initialize(NativePipeline.java:127)
        at javax.media.j3d.Pipeline.createPipeline(Pipeline.java:170)
        at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:965)
        at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:299)
        ... 4 more
Caused by: java.lang.ClassNotFoundException: javax.media.j3d.Win32NativeConfigTemplate3D
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at javax.media.j3d.NativeConfigTemplate3D$1.run(NativeConfigTemplate3D.java:79)
        ... 10 more

Looks like i'm missing some libraries, but i'm not sure how/where to get them?

Crashes on Xubuntu16.04 with AMD Radeon

I think this is the operative word:

SIGSEGV (0xb) at pc=0x00007f90948d5823, pid=13282, tid=140258956797696

JRE version: OpenJDK Runtime Environment (8.0_91-b14) (build 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14)
Java VM: OpenJDK 64-Bit Server VM (25.91-b14 mixed mode linux-amd64 compressed oops)
Problematic frame:
C  [radeonsi_dri.so+0x256823]

pointing to the Radeon driver. (HP Z600 with Radeon 7950, dual monitor)
This crash does not happen on a Thinkpad T420 with Intel graphics.

hase

zig-zag voronoi separation

Running visolate 3.1.1 in win7, with gerber files from Kicad (*.pho), from RDB_ts board.
On summary, the voronoi paths separation has a zig-zag instead of a quasi-straight median between the polygons.

visolate_zigzag1
visolate_zigzag2
visolate_zigzag3

Havent noticed differences when playing with parameters except voronoi lim, and only if that is less than unity. I dont think that is related though, its probably just how the parameter works, but i also get an error about it there. From playing with this, zig-zag shape changes when voronoi lim is very low, like 0.05, but that seems like a corner case which starts to spill errors about "nnuID", as seen from terminal in 3rd picture. And for example at settings like voronoi lim like 0.01 and lower it seems voronoi paths become like "outline" shapes, again probably how it would work, but it is still stacking up that error.

This is the gerber file (just needs an extension change from jpg to *.gbr). Header says its exported from gerbv because i changed the origin with gerbv, but otherwise the file is exported by kicad.

rdb_ts_001_g-b_cu pho gbr

My awesome journey ends here

Folks, Github is about to enforce 2FA (Two Factor Authentification). That's IMHO a pretty pointless burden. Quality control in Open Source isn't established by some door lock, but by eyeballs looking at the code. Git commit IDs are enough of a verification, same ID gives always the exactly same code (and even the very same commit message). And yes, Git has also a mechanism to sign tags and commits with a GPG signature. That's as safe as public code can be.

I'm not going to mess with my phone (only way to give a second factor) when doing development, so I'll lose control over this repository in a couple of days. For this reason, this repository will be archived in a minute. All my Github activities requiring 2FA will chease for the same reason.

Should I happen to pick up development on this project again, it'll appear on GitLab, or some other appropriate public Git server. Archived repositories stay readable, and I also have my local copy.

Traumflug

Support outlines

Possible strategies:

  • Regognize the outline layer.
  • Calculate the outline from all available elements like it's currently done, but ignore the width of the outer tracks for this calculation. Also, put the origin to the lower left corner instead of the lower left corner of the whole Gerber.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.