Welcome! Log In Create A New Profile

Advanced

Trouble with 2D file import confused smiley

Posted by danroonie 
Trouble with 2D file import confused smiley
October 16, 2016 06:13AM
I am trying to turn a 2D scalable vector image from inkscape into an OpenSCAD file. Unfortunately, bringing the file into OpenSCAD as a DXF file looked terrible and using the inkscape extension didn't work either. Any ideas on getting this to work?

I attached the files I tried using
Attachments:
open | download - emblemPt1.dxf (12 KB)
open | download - emblemPt1.png (5.2 KB)
open | download - emblemPt1.svg (4.2 KB)
Re: Trouble with 2D file import confused smiley
October 16, 2016 07:53AM
Figured out how to bring it in... see below - but how do I add another 2D imported image ontop of the first one?? When i bring a 2nd object in - it just puts it inside the 1st object.

1 - Draw object in Inkscape
2 - Move object to lower left corner of page, align left/right center marker to left page border, align top/bottom center marker with the bottom page border (it may help to turn off the page shadow in Document Properties)
3 - Select Objects you want to export
4 - Convert to Path: Path --> Object to Path (Ctrl+Shift+C)
5 - Flatten Beziers: Extensions --> Modify Path --> Flatten Beziers (adjust the value based on granularity you need; I use 0.3 or 0.1 for most things)
6 - Save as Desktop Cutting Plotter (Autocad DXF R14) .DXF file
7 - Make sure the ROBO-Master spline option is unchecked, LWPOLYLINE option is checked. I keep the base units in mm to be consistent with OpenSCAD.
8 - import the file in OpenSCAD (e.g. import ("drawing.dxf"); ) dragging and dropping the file will insert the command - then say preview
Re: Trouble with 2D file import confused smiley
October 17, 2016 07:59AM
Just prior to the "import" line for the second DXF object, add the line

translate ([x,y,0])

Note do not add a ";" character.
Experiment with different values for x and y to position the object where you want it.

If you need them at different heights you can change the "0" value.

Dave

Edited 1 time(s). Last edit at 10/17/2016 08:00AM by dmould.
Sorry, only registered users may post in this forum.

Click here to login