Welcome! Log In Create A New Profile

Advanced

how to calculate path for motor given a series of 2D shapes

Posted by bozmonster 
how to calculate path for motor given a series of 2D shapes
November 14, 2013 12:18AM
Hi everyone,

A friend from uni and I want to do a minimalist SLS printer, at the moment we are doing planning and design. I was trying to find algorithms for filling an arbitrary 2D shape and I was wondering what other people have used.

I'll describe the problem in more detail, given an arbitrary set of shapes on a 2D plane, a shape being defined by a set of vertices.. how do find a path that "fills" the insides of the shape.
Say if you have a square with the bottom left corner at (-1000, -1000) and top right corner (1000, 1000) you could start at the botleft and increment Y, then when you reach the maximum you increment X once or twice, then decrement Y until you get to the bottom.. then go back up etc.

But that's a trivial case and what about curved edges, or do people generally only use closely placed large sets of vertices... What about disconnected shapes.. my friend said that turning the laser on and off frequently isn't good for it's health so ideally we want to cover as much path as possible with one continuous movement of the laser, but this seems to vastly complicate the filling algorithm.

I've looked around on the internet for solutions, here and for analogies of the same problem and found this
floodfill algorithm which is what ms paint uses to fill shapes, but it looks like something that's horribly inefficient for this purpose and I was wondering if that's as good as it gets... I'd love to hear suggestions and thoughts, how did you deal with this issue.
Re: how to calculate path for motor given a series of 2D shapes
November 14, 2013 03:23AM
Hi Bozmonster,

I'm not a laser expert, although from what I understand turning on and off lasers rapidly isn't going to be bad for them... I think that's what they're actually good at.

For the infill algorithm the easiest option would be to sweep the laser in rows along the shape(s). As you travel along a row you would toggle the laser on/off at each shape boundary. This algorithm is also used to find if a point is inside a polygon. Here's a link that explains things better, including corner cases: [alienryderflex.com]
Re: how to calculate path for motor given a series of 2D shapes
November 14, 2013 04:21AM
On the turning-on-and-off thing that depends on the type of laser in use. Solid-state lasers are absolutely fine with it so long as the control electronics can handle the start-up transients which isn't difficult. Gas-lasers like CO2 arn't so good at rapid and repeated changes of power, because of the life-time of the plasma in the tube they're not happy being rapidly modulated.


Prussa i2 Comissioned 4-Nov-2013
Bitcoin : 1Jcrg5czBtNfKyS4sCjFAamJTcSYdTGk9h
Re: how to calculate path for motor given a series of 2D shapes
November 14, 2013 11:58AM
On industrial lasers, the laser system itself is not turned on and of, but is only blocked when needed.

For the algorithm, I'd recomend you take a look to the Slic3r software source code. I does just what you need.
Re: how to calculate path for motor given a series of 2D shapes
November 14, 2013 01:46PM
All the cheap laser cutters use CO2 lasers, I've never heard that cutting paths need to be specially optimised to avoid turning laser on/off. Perhaps if it is an issue, the trick is like Guizmo says, interrupt the beam instead of turning off.

Therefore as far as the algorithm goes any floodfill would do, though it would be nice to reduce unnecessary travel of the head just to reduce overall time.


What is Open Source?
What is Open Source Hardware?
Open Source in a nutshell: the Four Freedoms
CC BY-NC is not an Open Source license
Re: how to calculate path for motor given a series of 2D shapes
November 14, 2013 02:50PM
If you haven't already seen this, you may want to check out OpenSLS. In particular the section on Software.
VDX
Re: how to calculate path for motor given a series of 2D shapes
November 14, 2013 04:31PM
... my first CO2-laser was a sealed RF-controlled type with 100kHz modulation frequency - was then (around 1995) something like 3000 DM for 5 Watts of power.

Actually I'm using either digitally/analog modulated diodes (IR up to 25W, 445nm up to 2W - modulation up to some MHz) or a pulsing fiberlaser ... or a cheap chinese 40W-CO2-tube with modulation too (unknown rates) ... or a CW-fiberlaser with an AOM (Acousto Optical Modulator) with 40MHz modulation frequency.

For comparing CW against modulated CO2-lasers - in our company we actually got negotioations for some high quality CO2-lasers with higher powers (from 250W upwards) and either CW for around 20000 Euros or Q-switched for 150000 Euros!

So modulation could be something really tricky or expensive with higher powers confused smiley


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Sorry, only registered users may post in this forum.

Click here to login