Sunday, April 16, 2006

 

3D Progress Previewer

While sitting in front of bad TV tonight, I had a bit of a toy with Java 3D. It's not too awful, and I ended up building a 3D progress preview window.

This doesn't do anything that the component Adrian is working on does, it just shows you what is printing as it prints. You can rotate, zoom and pan around the object to see it is all going as expected. More usefully, if you edit the reprap.properties file and set the geometry to "nullcartesian" it creates a dummy reprap object. This means you can fully test things without a real reprap plugged in, and it's much faster. This should be really useful for debugging. Adrian, this might be quite useful for testing the stuff you're working on too.

It's very simple to use. Here's a complete application that produced the screenshot here. This is the same 7mm square as before, rotated 45 degrees.


package org.reprap;

import org.reprap.gui.PreviewWindow;
import org.reprap.machines.MachineFactory;

public class SquareTest {

public static void main(String[] args) throws Exception {

Printer reprap = MachineFactory.create();

// Comment out the following three
// lines if you don't have java3d or don't want to preview
PreviewWindow preview = new PreviewWindow();
preview.setVisible(true);
reprap.setPreviewer(preview);

reprap.calibrate();
reprap.selectMaterial(0);
reprap.setSpeed(248);
reprap.setExtruderSpeed(180);

// Print a square, rotated 45 degrees
reprap.moveTo(20, 5, 0);
reprap.printTo(15, 10, 0);
reprap.printTo(20, 15, 0);
reprap.printTo(25, 10, 0);
reprap.printTo(20, 5, 0);

reprap.terminate();
}
}

Comments:
Wow! :-)
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]

View mobile version