Model Parts for 3D Printing Using Context From Pix4D Reconstruction

9 Jan

The 3D model I used as context for designing my part

While constructing a new fixed wing drone I needed to design and 3d print a small mount for a GoPro action camera.  Typically I would do this by taking a large number of measurements using a ruler or calipers, and then designing the part based on those measurements.  This time I decided to try a completely different workflow involving photogrammetric 3d reconstruction, which worked wonderfully, and will be my new method for these scenarios going forward.

Here I’ll show you how I used my camera, and a great bit of software called Pix4D, to quickly and easily reconstruct a 3D model I could import into OpenSCAD and use as a template for designing my new part quickly and easily.

Here you can see the area in the wing of my plane where the GoPro will sit.  It points down through a hole in the wing.  This picture is one of about 20 that I quickly snapped with my camera (another GoPro).  I took pictures while moving the camera laterally to catch various angles.

Wing bay with gopro

Here are thumbnails from the rest of the photos.


I then loaded these images into Pix4D Mapper, an application that performs photogrammetric reconstruction.  I configured Pix4D to generate a textured mesh and output it as an OBJ file.  I chose a reasonably small triangle and texture size for faster processing.


A mesh was generated for me that contained good detail for the area I was interested in.  Here is the raw output.


Next I fired up MeshLab, a wonderful free and open source mesh processing tool.  In MeshLab I performed three tasks.

  1. Crop the mesh to the area I am interested in
  2. Run a smoothing filter to remove some of the artifacts from the mesh
  3. Run a quadratic decimation filter to reduce the size of the mesh


I then exported the mesh as STL format and brought it into my preferred modelling tool, OpenSCAD.  OpenSCAD can import any STL file and it can be used in operations against your model.


From here you are ready to model.  Keep in mind the scale of the model is probably incorrect, so make a single measurement of something in the model and apply an appropriate scaler.  In my case I just adjusted the scale of the imported model until the width of the GoPro was correct.

I built out my model using the imported data as context, so it was easy to know what shape would fit and get it right the first time.


My design was very simple, but it did have several beveled corners to fit in the cavity, and fit perfectly the first time.  It’s designed to hold a rubber band over the GoPro for easy removal.

End to end this process took under an hour, so I look forward to using it in the future for more complex projects.

To be clear, this is really a proof of concept.  Of course this technology is not required for such a simple design, but for more complex scenarios this could be used as a great time saver.  More resolution in the generated model is easily achieved with more pictures, or increased quality settings in your photogrammetry application.


8 Replies to “Model Parts for 3D Printing Using Context From Pix4D Reconstruction

  1. Thanks for the great tutorials! I found this post after reading your great tutorial for geo-tagging solo images. I’m using Solo to map invasive weeds in one of the remotest community in Australia – Tjuntjuntjara.

  2. Pingback: Using Photogrammetry To Design 3D Printed Parts | Hackaday

    • They did release a discounted version over the holidays, I think I paid $200/year. Pix4D Mapper Mesh. But of course I agree you should not purchase the product for doing this type of work exclusively.

  3. Pingback: Using Photogrammetry To Design 3D Printed Parts – Daily Hackers News

  4. Hi Stefano,

    I am pretty sure that could be done only with open source techniques, can I download the pictures somewhere to test something ? I will let you know if it works.



Leave a Reply

Your email address will not be published. Required fields are marked *