June 13, 2019 at 8:21 pm #103334
I made a little Python script that takes a gcode file from Estlcam (or maybe other sources — but currently not that many gcode features are supported, so YMMV) and generates an OpenSCAD file which simulates the cut with an adjustable bit shape (you can adjust the bit tip angle, the diameter and the length). The cut gets subtracted from a solid representing the workpiece (by default a 1000x1000x6mm “cube”, but can be adjusted).
This should work better for some purposes than Repetier Host or Estlcam preview.
python gcode2scad.py filename.gcode > filename.scad
OpenSCAD rendering is slow because of the subtraction, and Render may work better than Preview. (You can also not subtract by setting workWidth=0, which will increase speed.)
Attachments:June 13, 2019 at 10:51 pm #103346
Very nice. I can’t wait to try it.June 14, 2019 at 7:57 am #103362
WHat!!?!?! If this works That would be awesome!June 14, 2019 at 9:50 am #103375
Very cool!June 15, 2019 at 12:59 am #103440June 15, 2019 at 6:58 am #103457
ImplicitCAD lacks the convex hull operation, so it won’t work. I also tried OpenJSCAD, but it only supports 2D convex hulls. I could write the code to generate a polyhedron representing a cutting bit path between two points directly rather than by just doing a convex hull of two cutting bit shapes, but I am not sure how well it’ll work.
IceSL is worth trying, but it will be complicated.
I agree that OpenSCAD is slow. But it’s still probably a bit faster than wasting a piece of wood on a cut that doesn’t do what one wants. The mekleth render in my screenshot takes just under 8 minutes (using Render mode; Preview mode doesn’t work well with giant subtractions). That’s because subtracting the cutting path from the solid is an enormously expensive operation.
If one wants to see just the solid cutting path (by setting workWidth to 0), one can use Preview mode and it takes 4 seconds. Here’s the cutting path render.
Attachments:June 15, 2019 at 7:36 am #103460
I tried OpenJSCAD and ImplicitCAD again with a pre-rendered cutting path, just testing the subtraction speed, and it was way slower than OpenSCAD (in fact, I let them run for about 20 minutes and gave up).June 15, 2019 at 8:07 am #103464
Icesl somehow tries to use opengl for accelerations, so may be it can be faster. Honestly, i guess it could even parse gcode file by itself, because it’s pure Lua.
By the way, best solution imho, if Cristian will implement it as a feature of estlcam.
I’m use fusion 360 and cam simulation subsystem of it is great.
Freecad cam also has internal feature to produce cutted shape.June 15, 2019 at 8:27 am #103466
Regardless of the speed, functionality comes first. Building this on such a freely available tool as openscad is a huge feature.June 16, 2019 at 9:34 am #103540
You must be logged in to reply to this topic.