Meshlab

The educational technology and digital learning wiki
Jump to navigation Jump to search

Draft

<pageby nominor="false" comments="false"/>

Introduction

This is a little tutorial that covers first steps of using Meshlab for creating printable RapMan .STL files.

Read also: RapMan (some tips about printing) and Skeinforge for RapMan (detailed tips for g-code generation with skeinforge)

Importing .dae and exporting to .stl

Some 3D modeling tools like google sketchup only can export to .DAE, the collada format. In order to import to skeinforge, you need an .STL.

To import .dae:

  • File -> Open

You then could fix meshes and do other manipulations like changing size and position, but for beginners it's easier to use NetFabb for this. Therefore just save

To export as .stl:

  • File -> Save As

Merging layers

Now l'est assume that you have two or more objects that you would like to merge.

In the most simple case, they already are in the right position, e.g. you did this in Netfabb or sketchup.

According to the Layer Management Meshlab wiki page:

  • You can add an external mesh to a new layer by going in File > Open As New

Layer.

  • The open the layers tool. Click on the 5th icon from the left and that looks a like a pile of paper (or layers).
  • Either right-click on the layer box that will popup, or go in Filters > Layers Management. Then flatten your layers, click on Flatten visible Layers The options are explicit.
  • Then File->Save as
  • Again, you could import to Netfabb again for repair or directly import to skeinforge, depends how much you trust your STL files. When you export from sketchup to .DAE, repair is mandatory I believe.

Example - paper clip with a name

(1) Get the paper clip from Thingyverse

(2) Create a 3D Text Then, for creating the text we played with two options (pick either one):

(2a) Create a 3D text with Google Sketchup and save as .DAE (collada), then transform to .STL with Meshlab

(2b) Create a 3D text with netfabb (click on the second icon from the left)

For both options, size doesn't really matter, but it's easier to create something in the 1 to 10 cm range and about 2mm high.

However, the kind of chosen font does matter. Pick a regular bold font. In addition (if you have the patience, you should explode the text group and space out the letters. The RapMan has trouble printing narrow fonts or letters that are too close !

(3) Align and resize with netfab

Procedure:

  • Load both models in netfab
  • Make the Paperclip size correct, e.g. use Menu: Part->Scale (or click on the icon). I made the paper clip a bit bigger and about 2mm high (Z-axis).
  • Then rotate the letters, resize and approximatly position, etc.
  • Then (important) position the paperclip at origin (Menu: Part->Move to origin). Verify by clicking the "information" icon
  • Then position the letters on top. E.g. if height of the paperclip is 2.2mm, position it at z=2.2mm
  • Then look at the object from top and move the text into final position
  • Finally, export both files as STL, e.g. clip.stl and name.stl
Two parts in Netfabb

Disclaimer: I didn't see any merge function in the free version of netfabb... but maybe I was to stupid to find it.

(4) Merge with Meshlab as explained above

  • Import the paperclip
  • Import the text as layer
  • Flatten the layers
  • Export as new STL (file: nameclip.stl)
Merge with Meshlab

(5) Repair the final STL with netfab

  • Import nameclip.stl to netfabb
  • Repair by clicking on the red + sign (I just used default repair). Apply the repairs.
  • Export part as .STL

(6) Print

  • Import to skeinforge
  • Print ...

Here is a first result. No so good, since I used an inappropriate font (the default in netfabb)

Paperclip for Sandra - Font to be improved

Sorry for the bad picture quality. My cellphone can't handle close-up pictures of plastic and that's the only camera at hand at work.

Here is a result for another girl:

Paperclip for Laurence

The next picture shows a version that was way to fat (2 to 3 mm for clip is enough). The fat one can go to a keyring ...

Too fat (almost 1cm)

The best results come from paperclips that are about 10cm long and about 3mm thick (without counting the letters). Make sure to print a hot and large lines raft !

Almost perfect clip for Sandra

Moving and aligning meshes

In order create a single model from several imported misplaced and mis-sized models, you need to dig into Meshlab commands first.

  • By default, e.g. when MeshLab starts, you are in the so-called camera mode where the mouse actions are used to change the way in which you look at the model.
  • When you use Interactive editing tools, the mouse actions are interpreted in a different way (e.g. for painting the mesh), but you can always switch back to the camera mode by pressing ESC; in this case the edinting tool is just suspended and you can go back to editing by pressing again ESC.
  • To exit from an editing tool, you have to press again the toolbar button that started it.

Obviously for mac users, you should substitute the ctrl with the command key.

Standard camera mode
left drag Rotate the object. Click far from the center to rotate around the line of view.
ctrl+left drag Pan (move right/left)
wheel Zoom in or out
shift+left drag Zoom (if you do not have a mouse wheel or if you want smooth zoom)
ctrl+shift+left drag Light rotate, to interactively change the default light setting.
left double click center and zoom on clicked point; subsequent rotations and zooms will be centered on the chosen point. E.g. if you want to rotate an mesh arount its center, double click in the center.
alt+left drag Z translate; moves the camera along the viewing direction, (the effect can be similar to zoom, but it allows to more precisely navigate in the space around the object)
shift+wheel change field of view and move the camera to keep the model of approximately the same dimension (in practice increase/decrease the perspective deformation, much alike the Hitchcock zoom depicted in the Vertigo movie).
ctrl+wheel move near plane back and forth to section the object and reveal its interior.
alt+wheel change point size when rendering mode is Points. Use Points rendering to display interactively huge meshes.

Other useful key combinations for mesh inspecting are:

  • ctrl+d toggle double sided lighting
  • ctrl+k toggle backface culling
  • ctrl+f toggle blue-red back=front lighting

With align tool enabled and one mesh selected, the selected mesh will change position, rotate, change size etc. using different commands

The Align tool:

  • Click on the A - align tool
  • In the Align tool popup window, select one of the Meshes
  • Click on "Manual Rough Glue"
  • Then use the key+mouse combinations below to change position, size and orientation
  • Click on "Store transform".

In the align tool mode there are both camera mode and object move/resize commands. Note: You also could hit ESC to go to camera mode, and hit ESC again to come back.

In the align tool
left drag Rotate orbit around the current center of the object. Click far from the center to rotate around the line of view.
ctrl+left drag Pan (move the object right/left with respect to the others
wheel Zoom in/out the whole scene (camera mode)
middle drag Pan the whole scene (camera mode)
ALT-middle drag Rotate the whole scene (camera mode)
shift+left drag Make the objects bigger/smaller in or out

With one of the two selection tool enabled on can edit meshes. Click = click left button of the mouse

With a selection tool
click Select all the faces in the direction (including the hidden ones behind)
ctrl+click Add faces to selection
shift+click Remove faces to selection
alt+click Select only the front faces (without the hidden ones behind)
ctrl+alt+click Add only the front faces (without the hidden ones behind) to selection
shift+alt+click Remove only the front faces (without the hidden ones behind) to selection
wheel Zoom
middle mouse button Translate mesh
alt+ middle mouse button Rotate mesh

Example - create a Lego-compatible duck

Warning: This will take many hours to print. Also overhangs are too strong at the bottom. Some filing needed...

We use two ingredients:

Two .STL meshes before aligning

Procedure:

  • Open the Lego brick
  • Open the duck as new layer
  • Click on the align tool
  • Click on Manual Rough Glue
  • Make the duck bigger and align it with the commands explained above.
  • Click on "store transformation"
  • Then use the layer tool to merge the two layers as explained above
  • In principle, one then could use Meshlab to improve the mesh, but I used netfabb for this (easier to understand)
  • So just "save as" some *.STL
An .STL duck mesh being resized and put in position
Two .STL meshes in position

In netfabb:

  • Align the duck to Z=0 !
  • (keep its size or else it will not be DUPLO compatible)
  • Repair it with the + tool
  • Export part as .STL

Then import to skeinforge and print :)

Of course, an expert would simply the mesh, i.e. there is not need to have Lego structures be printed inside the duck, but then nobody will ever see what's inside ;)

  • Anyhow I know that I should "gut" the insides of the duck (i.e. the head of the duplo brick) with a 3D rubber ... sometimes soon if I find time. Right now it will print like this:
A duck with an interior life

At some later stages of the print you would see:

Giant duplo-compatible duck in progress

Links

Software needed
  • MeshLab is the open source, portable, and extensible system for the processing and editing of unstructured 3D triangular meshes. Can import/export STL (for 3D printers like the RapMan))
    • Meshlab documentation wiki
    • MeshLab is sponsored by the EU 3d-coform project.
    • Imports: PLY, STL, OFF, OBJ, 3DS, COLLADA, PTX, V3D, PTS, APTS, XYZ, GTS, TRI, ASC, X3D, X3DV, VRML, ALN
    • Exports: PLY, STL, OFF, OBJ, 3DS, COLLADA, VRML, DXF, GTS, U3D, IDTF, X3D
  • Netfabb “is a software tailored for additive fabrication, rapid prototyping and 3D printing. It includes the ability of viewing, editing, repairing and analyzing stl-files or slice-based files in various formats.” Base version is free.

Credits and copyright modification