23

I have a schematic of a raspberry pi that is completely flat, no solid faces, just connected vertices.

Is it possible to render these lines somehow, so that it looks like a 2D drawing?

Maybe with freestyle?

gandalf3
  • 157,169
  • 58
  • 601
  • 1,133
marchello
  • 457
  • 1
  • 3
  • 7
  • Related: http://blender.stackexchange.com/questions/2784/rendering-with-wireframe, http://blender.stackexchange.com/questions/2838/create-a-rounded-wireframe, http://blender.stackexchange.com/questions/2372/how-to-render-a-pixelated-occluded-wireframe-with-freestyle, http://blender.stackexchange.com/questions/605/can-cycles-wireframe-material-be-coerced-into-displaying-tris-quads-and-ngons (Yes, lots of related stuff :P) – gandalf3 Oct 02 '13 at 19:25
  • For what it's worth, there are a lot of YouTube tutorials on using Blender/Freestyle to create blueprint-style schematics of objects. https://m.youtube.com/results?q=blender%20blueprint%20freestyle Since you just have a 2D object, it might be more than you need, but they're helpful in general. – TIA May 20 '16 at 17:26

7 Answers7

14

Note: This answer is for 2.79 only. For 2.8+ you will have to look at some of the other answers.


The simplest way to render an object that has no faces is to change the material type in the internal renderer to a 'Wire' material:

enter image description here

The mesh on the left, when rendered, looks like the image on the right:

enter image description here

I also changed it to be 'Shadeless' in the shading panel of the material so that it wouldn't be affected by shadows and would be lit equally.

Ray Mairlot
  • 29,192
  • 11
  • 103
  • 125
12

It seems as if freestyle doesn't care for wireframe meshes. Even faces aren't recognized if they have 0 surface area (edge extruded and escaped).

If you want to achieve that effect with freestyle then assign a material to your mesh (with faces) that has Z Transparency enabled. Alpha and Specularity should be set to 0.0.

To make the flat edgelines visible for freestyle, just extrude them all away from the camera. Then select the edges that you want to keep seeing with a Border Select and hit CtrlE - Mark Freestyle Edge. Set freestyle to render nothing but Edge Mark. The transparent material will hide the surplus geometry.

enter image description here

Alternatively you can set the material to Cast Only in the Shadow panel. It works if your scene doesn't have shadows.

Or you can disable Solid in the Layer panel of the Render Layers. Then nothing gets rendered except the freestyle pass. I get the best results if I disable Chaining and set the Caps to Round in the Freestyle Line Style panel.

The advantages: You don't have to display every edge. You can control line thickness and line style very creatively. Dashed lines are possible, to name just one option.

blender wireframe freestyle comparison

Haunt_House
  • 16,049
  • 5
  • 48
  • 78
11

For the sake of completeness, there is also the possibility to use the skin modifier. It removes faces (if present) from your mesh and builds tubes intersecting at all vertices.

Below a screenshow showing original mesh (manually deleted faces), with skin modifier and last with skin modifier and subdivision modifier.

You can scale the tubing thickness at each vertices (use ctrl+A in edit mode).

Skin modifier screenshot

Gunslinger
  • 6,392
  • 2
  • 28
  • 40
  • 2
    You can reduce the polycount adding a decimate modifier set to Planar. In you exemple, I used 5°, from 15k vertices to 1700 without important quality loss. – Bithur Mar 19 '15 at 13:06
5

You can also convert a faceless collection of vertices and edges into a curve:

alt-c convert mesh to curve

Then create, say, a simple circle curve then after reselecting your original curve object, set the bevel object to the circle curve.

Chris Hanning
  • 176
  • 1
  • 5
3

Blender 2.9

(presumably also valid for 2.8 versions)

Two-part anwser:

  • Use Cuves
  • Use Skin Modifier

Curves:

A simple way is to convert the mesh into curves, then bevel it, what gives the resulting "wire" a solid appearance. In Object mode:

  1. select object and in top menu go to Object > Convert to > Curve
  2. in the Properties Tab under Curve select Geometry > Bevel > Depth. Set a meaningful radius here.

The resulting object can be rendered in any way using the material of your choice.

Pretty easy and fast way.

enter image description here

Skin Modifier

If you really need flat lines to be rendered, I suggest to rather not using curves. Instead, in Object mode apply the Skin Modifier as suggested above by Gunslinger. This way is a bit more complicated in order to achive "flat" lines similar to a 2D drawing. Because the resulting skin first appears like a bold tube. But this can be changed in Edit mode:

  1. Select all
  2. go to Sidebar > Item > Transform. Here change either Mean Radius X or Mean Radius Y so that it gives the desired flat look.

However, this method seems to be computationally demanding for big meshes with lots of edges (compared to the other method) so that it may be slow when it comes to rendering.

1

In blender 2.8+ :

If you have an edge only mesh like for instance :

enter image description here

Disable all the overlays but the edges :

enter image description here

Setup your animation keyframes :

enter image description here

Resize and frame your viewport as it was a camera :

enter image description here

Set your output as if it was a regular render :

enter image description here

Render the animation with View > Viewport Render Animation :

enter image description here

Result :

enter image description here

Gorgious
  • 30,723
  • 2
  • 44
  • 101
0

Freestyle is unable to output edges, only faced mesh objects are supported. Here is a simple workaround, tested in Blender 3.5:

  • Convert your object (whether consisting only of edges) to Grease Pencil in Object Mode
  • Set your view as you like, no camera needed
  • Optionally set thickness of lines in GPencil Object Data Properties > Layers > Adjustments > Stroke Thickness
  • File > Export > Grease Pencil as SVG.
Duarte Farrajota Ramos
  • 59,425
  • 39
  • 130
  • 187
emeff
  • 23
  • 3