Tag Archives: inkscape

Making an SVG File 3D In Blender

Despite some earlier blog posts on the matter, I have become fond of using Inkscape to make SVG files for my 3D Models.  (My breakthrough came when I started saving as a “Plain SVG” format instead of an “Inkscape SVG” format).

I figured I should document my process at pulling and prepping those files in Blender.

  1. Import the SVG file.  File->Import->Scalable Vector Graphics (.svg)IMport SVG
  2. It looks like nothing happened, but your SVG is there.  It’s just really really really small.  If you look to the right in your Objects listing, you can see a new “Curve” that was not there before.
    SVG Tiny
  3. Resize the object so you can see it better.
    Resize
  4. Sometimes resizing it takes it off the screen and the Object’s Origin is not very intuitive  For that, I change the Object’s Origin to the Center of the Mass.  I do that by going to Object->Transform->Center of Mass
    Object Transform Origin to 3D Cursor
  5. Then I can change all the Transform coordinates to 0,0,0 to center my new SVG
    PUt ot 0 0 0
  6. SVGs pull in as Curves.  You’ll want to convert it to a Mesh before doing anything with it.  You can do that by going to Object->Convert to->Mesh from Curve/Meta/Serf/Text
    Convert To Mesh
  7. OPTIONAL – Get Rid of Black Color
    When I was new to Blender and Inkscape, I could not figure out why my Inkscape SVGs were all black… and I just did not know enough to find the right keywords to Google.  Later when I learned about Materials, it will started to click.  The SVGs import in with a Default Material.  If you want to get rid of that, click on the Materials icon for your object, click on the black material and hit to get rid of it.
    Getting Rid of Black
  8. With your newly converted Mesh selected, switch to Edit mode.Switch to Edit Mode
  9. Click A to select all vertices.
  10. Go to Extrude->Region to give your 2D Object some Depth.  If you can you the mouse to size or type in a measurement– for example 0.5 for 0.5mm.Extrude Region
  11. And then you have a 3D Object in Blender from an SVG file.3D Object

Using Inkscape and Tinkercad to Customize Halloween Pendants

HAPPY HALLOWEEN!

My very first Thingiverse upload was glowing pumpkin pendants/pins for kids.  This video hits briefly on how I print these via Multi-processes in Simplify3D (Spoiler alert – they are three separate prints).  It will also show you how you can import in the pendant template into TinkerCAD and quickly make your own customizations.  Finally, have a drawing you want to use?  I’ll go over using Inkscape to make a SVG file from a black and white image/photo/scan that you can also pull into TinkerCAD to “carve” your pumpkin.
All the pumpkin models, including the template are up on Thingiverse at:
http://www.thingiverse.com/thing:1074202
Need help with Simplify3D Multiple Processes?  I learned from THIS Joel Telling video:
https://youtu.be/ZHe2_h1nQG4
TinkerCAD is free with nothing to install– http://www.tinkercad.com
Finally, Inkscape is also free and can be downloaded at http://www.inkscape.org.
The Starting and Stopping Points of My Processes
0 – 1.5mm – Black or Green
1.5 – 2mm – GlowFill
2mm – rest – Orange

Print Diary – Experiments in Pumpkin Carvings

Occoquan Arts and Craft Show – September 26th and 27th!
First off, I’m in! My application to the Fall Occoquan Arts and Crafts Show has been accepted (with multiple explanation marks from the show director). It’s official– TGAW 3D is the show’s very first 3D Printing Booth! Hopefully, we’ll be setting a trend for future shows.

Even better news– our booth is going to be adjacent to my brother’s shop, which means we’ll have access to power. Weather permitting, Ryan and I will be bringing the MakerGear M2 down and have it running. We’ll also have our Kinect on hand in case anyone wants to get themselves scanned. :)

If you are in the area, stop by and see us!

Acceptance-Highlighted

Automating Pumpkins
My ultimate game plan with the Glowing Pumpkin Pendants is to take advantage of one of the great perks of 3D printing– customization. I want people to draw/design their own pumpkin faces. I have my base pumpkin model. I would just need to make their face into a model and subtract it from my pumpkin. Thinking ahead, I did some experiments. I grabbed a Sharpie, drew a face and scanned it as a black and white image.

3D Printing

Now what?

OpenSCAD?
Looking over the OpenSCAD documentation, it looked like I might be able to use the Surface feature to achieve my goal. It uses the greyscale values of an image to determine the various heights of a surface. Since my image was Black and White, it should give me a template to carve out of my pumpkin.

It did make my face surface as planned… but it had a bottom plane underneath it. No worries, I rotated it 180 degrees. At this point, all I would need to do is position it, size it, and subtract it from my pre-existing pumpkin template.

OpenSCAD-Surface

I got it carved out, albeit a lot smaller than I wanted. At this point, I had to abort. I do truly believe OpenSCAD could be a viable option. But the rendering times were sooooo long. And then anytime I wanted to scroll or examine my object, I would have to wait again.

Disclaimer- It very well could be my old laptop from 2010 that has dwindling harddrive space…courtesy of all my 3D modeling.

If you’d like to explore this option further, my OpenSCAD code is below for reference and you may also want to refer to CubeHero’s Emboss and Impress Images onto a Surface in OpenSCAD article.

module pumpkin_template()
{
    //This is me importing in my base pumpkin template
    //what I want to carve the face out of.
   import("C:\Users\Vicky\Google Drive\Personal\Blender\Pumpkin Pendants\template-glowing-pumpkin.stl", convexity=10);
}

//This difference command is me subtracting my
//face surface from my base pumpkin .STL
difference()
{
translate([0,0,-2.5])
    resize([37.275,0,0],auto=true)
    pumpkin_template();

//This is me making my surface file based on my PNG
//of my face.  I rotate it 180 degrees so the solid
//plane base is on top (and out of the scope of my carving
rotate([0,180,0])
    resize([30, 0, 5],auto=true)
        surface(file = "C:\Users\Vicky\Google Drive\Personal\Blender\Pumpkin Pendants\evilVampire2.png", center = true, invert=true);
}          

InkScape?
Inkscape seems to be a very powerful way of turning images, logos, and patterns into scalable vector graphic images that you can import into Blender or other modeling software. I’ve seen many people having success with it on the Internet.

One of those people just isn’t me. : (

Inkscape - TraceBitmap in Action

I’ve tried using it for three different projects over the last 18 months. Each time, I’ve ended up with a model that is cumbersome to edit and full of mismatched face normals. It just seems like I have an awful lot of cleanup to do. And not fun, “I’m learning more about 3D modeling” cleanup– tedious, demoralizing cleanup (“What– now I have even MORE non-manifold edges? #@(*&$I*!”)

Disclaimer- This could end up being user error– something like I should export to a different SVG format instead of the Inkscape SVG.

ShapeJS
Interestingly enough, the tool I found I liked the most is Shapeway’s JavaScript-based library, ShapeJS. Just like OpenSCAD’s surface, you can upload an image and the colors in that image is used to make your model.

I stole code from their Absinthe Spoon example, uploaded my Black and White image and very quickly I had a model.

ShapeJS- Pumpkin Face

They have a Download 3D Model button, but I couldn’t seem to get that to work in Internet Explorer or Chrome.

My workaround was:

  1. Click on Upload & Print button.
  2. When the new Model details came up, I clicked on the Download button near the top and saved the file to my desktop.
    Shapeways - Export to x3db
  3. This downloaded a zip file, so I extracted the inside
  4. D’oh. This file was in x3db format. I wanted .STL. I had the free version of NetFabb Basic on my machine. I opened that up, added my x3db part and then went to Part->Export Part->as STL. (Hat Tip, StackOverflow!) NetFabb Basic - Export Part - as STL
  5. Yay! I had my .STL

Yes– that is indeed a lot of steps. But guess what– I found it still better than Inkscape cleanup. : )

If you wish to follow in my footsteps, here’s my ShapeJS code. To compliment the code, you’ll want to click on Add File Input at the top of the code editor and then upload the file you wish to use.

ShapeJS - Adding a File Argument

var voxelSize = 0.1*MM;

function makePart(path, width, height, thickness){

  var img = new ImageBitmap(path, width, height, thickness);
  img.setBaseThickness(0.0);
  img.setVoxelSize(voxelSize);

  return img;
}

function main(args) {
	//This argument (arg[0]) is our PNG file.
	//I add by clicking on the "Add File Input"
	//and then I upload the file I want to use
	var image = args[0];
	var a = 32*MM;

	dest = createGrid(-a,a,-a,a,-a,a,voxelSize);
	var th = 5*MM;
	var width = 20*MM;
	var height = 22*MM;

	var img = makePart(image, width, height, th);
        var maker = new GridMaker();
	maker.setSource(img);

	maker.makeGrid(dest);
	return dest;

}

3D Printing

Other Options
There are most definitely other options out there. I’m sure my learning and experimenting will continue. Last night, for example, I was just reading an article by Chris Gerty about using Online-Convert to do the same thing. H.G. Dietz’s Trace2SCAD looks interesting as well.

But for now, the ShapeJS method has served me well. My husband drew me two new faces that we were able to model and print quickly this past weekend.

3D Printing