Hi, i need to make a hole in an object (e.g. slab) according to 2D image.
I tried using OpenScad surface command and it works fine but very slow for large image
This is may be because surface uses image intensity as Z, while I do not need it at all ...
This job will be repeated multiple time and I need speed
Any suggestions ?
software to make a hole in an object using 2d image
Re: software to make a hole in an object using 2d image
Option 1) Crisp up the image, extract its borders, extrude the shapeboep777 wrote:Any suggestions ?
Preprocess the image to convert the grayscale to monochrome: black + white, nothing in between. That will eliminate most of the irrelevant detail, but you'll still have polygons along the edge. This image prep checklist for my cookie press script should get you from gray to monochrome.
http://softsolder.com/2012/11/29/automa ... checklist/
Align that shape across the Z=0 plane, project a slice onto Z=0 as a 2D object, then linear_extrude as far as you need. The polygons will be gone, you'll have a clean shape, and it ought to come pretty close to what you need. The Projection doc explains how to slice an object:
https://en.wikibooks.org/wiki/OpenSCAD_ ... Projection
Given a bunch of original images, you can automate that entire process. I used a grayscale height map image to produce both a cookie cutter (which is basically what you want) and a cookie press (which takes forever to process, as you discovered).
Option 2) Convert an image to DXF, import, extrude
If you have only a few images, you can convert them to DXF manually using Inkscape. I did that for a special-purpose cookie cutter, then fed the resulting shape into the cutter script:
http://softsolder.com/2013/08/28/creati ... ie-cutter/
----
Either of those processes should give you a clean linear_extrude shape that exports into an STL file like this:
You can then punch that shape out of a slab without any hassle:
Re: software to make a hole in an object using 2d image
I just checked out your cookie cutter link, Ed. It appears things have improved since you wrote that. I used Inkscape autotrace (https://inkscape.org/en/doc/tracing/tut ... acing.html) and the Inkscape to OpenSCAD dxf tutorial you disparaged (http://repraprip.blogspot.com/2011/05/i ... orial.html) and ended up with this:
In Step 6 of the tutorial, I opted for the Extensions - Modify Path - Flatten Beziers option, which worked great.
If you want a through hole shape through your entire slab, you can even export an inverse path by differencing in Inkscape and extruding that instead of differencing within OpenSCAD.
In Step 6 of the tutorial, I opted for the Extensions - Modify Path - Flatten Beziers option, which worked great.
If you want a through hole shape through your entire slab, you can even export an inverse path by differencing in Inkscape and extruding that instead of differencing within OpenSCAD.
Re: software to make a hole in an object using 2d image
I tried to follow what that tutorial is doing, and (however much it may have been improved since Ed was ragging on it) it seems to be more complicated than necessary. I have been using the Export-to-OpenSCAD-DXF plug-in described in http://www.thingiverse.com/thing:14221, in which you just do "Save As..." and select "OpenSCAD DXF" and it's done. I have a more complicated procedure in which I use xcircuit (because, hey, I wrote it) to draw an outline to match some photographic image that I put in the background, export SVG, then load that into inkscape and export the OpenSCAD-compatible DXF. Obviously, if you're familiar with drawing in inkscape, that's much more direct.jsc wrote:the Inkscape to OpenSCAD dxf tutorial you disparaged (http://repraprip.blogspot.com/2011/05/i ... orial.html)
Re: software to make a hole in an object using 2d image
The wizards have been improving OpenSCAD's DXF import (and export!) capabilities, making it much more robust these days. It's still not a general-purpose CAD program, but smart folks have performed amazing feats with the 2D features.Tim wrote:select "OpenSCAD DXF" and it's done
Not only that: nearly everything I know is obsolete... [grin]jsc wrote: It appears things have improved since you wrote that.
Re: software to make a hole in an object using 2d image
Yeah, well me too now.....move on over guys......is there room on the shelf for one more?ednisley wrote:Not only that: nearly everything I know is obsolete... [grin]
Re: software to make a hole in an object using 2d image
Thanks! got the idea. BTW there is a trace to openscad export plugin - convenient.
since my image was in MATLAB,i made in ML similar tracer and exporter like in inkscape + called openscad as command line to make STL - works fast and nice.
since my image was in MATLAB,i made in ML similar tracer and exporter like in inkscape + called openscad as command line to make STL - works fast and nice.
Re: software to make a hole in an object using 2d image
This web site will take a 5000x5000 raster image and convert it to several different vector formats including DXF.
I used it recently to create a file for a vinyl cutter and it worked well.
http://www.autotracer.org/
I used it recently to create a file for a vinyl cutter and it worked well.
http://www.autotracer.org/