<p>Inspired by the answer given by @Trish and the following <a href="https://youtube.com/watch?v=GmIkOJmBv_c" rel="nofollow noreferrer">YouTube video</a>, I finally worked out the way to reconstruct the 3D crystal model in AutoCAD. </p>

<ol>
<li><p>Import 6 images into AutoCAD. The photos are taken from 6 different angles with 30 degrees separation.
<a href="https://i.sstatic.net/VuPPQ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VuPPQ.png" alt="enter image description here"></a></p></li>
<li><p>Draw 6 lines of length 100 along Y axis in the XY plane.
<a href="https://i.sstatic.net/MSWjt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MSWjt.png" alt="enter image description here"></a></p></li>
<li><p>Use ALINE command to align the rotation axis in the photos to the added vertical lines.
<a href="https://i.sstatic.net/44Mht.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/44Mht.png" alt="enter image description here"></a></p></li>
<li><p>Use SCALE command to rescale all 6 photos into a uniform size.
<a href="https://i.sstatic.net/cVGeA.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/cVGeA.png" alt="enter image description here"></a></p></li>
<li><p>Use POLYLINE command to trace the cross sections from 6 raster images.
<a href="https://i.sstatic.net/KF6pk.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KF6pk.png" alt="enter image description here"></a></p></li>
<li><p>Use 3DROTATE command to rotate 6 images and the corresponding rotation axes and traced cross sections along Y axis. The first picture was rotated 75 degrees clockwise when viewed along the +Y axis, the second 45 degrees, the third 15 degrees, the fourth -15 degrees... (Tips: The rotation gizmo will only show in a 3D view. If you didn't see the gizmo, drag the view cube on the right-top to change the view point and try again.)
(view from Y axis)
<a href="https://i.sstatic.net/RP6Cj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RP6Cj.png" alt="enter image description here"></a>
(view from Z axis)
<a href="https://i.sstatic.net/A7T3z.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/A7T3z.png" alt="enter image description here"></a></p></li>
<li><p>Use 3DMOVE command to move 6 images so that the rotation axis of each image is aligned in a same circle on the YZ plane. (You would need a little bit calculation to finish this step)
(view from Y axis)
<a href="https://i.sstatic.net/SDFcw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/SDFcw.png" alt="enter image description here"></a>
(view from Z axis)
<a href="https://i.sstatic.net/8zNym.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8zNym.png" alt="enter image description here"></a></p></li>
<li><p>Use EXTRUDE command to extrude 6 cross sections into 6 cylinders, the height of each cylinder should be long enough so that 6 cylinders will intersect.
<a href="https://i.sstatic.net/JuKo3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JuKo3.png" alt="enter image description here"></a></p></li>
<li><p>Use INTERSECT command to get the intersected part from 6 cylinders, this would be the wanted crystal model. 
<a href="https://i.sstatic.net/hg7II.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hg7II.png" alt="enter image description here"></a></p></li>
</ol>

CC BY-SA 4.0
2019-01-07T01:09:53.290Z
the more pictures you use, the better the results will be, but it is a good workflow if it works for you
Trish
CC BY-SA 4.0
2019-01-10T18:46:45.100Z
Yes, but you will also need more time. For me, a model based on 6 photos is a good balance between the quality and the time. I am very grateful to your answer, though I didn't use the Fusion360 in the end. Your answer inspired me to a great extent.
Mr. Octopus
CC BY-SA 4.0
2019-01-07T00:49:43.813Z
2019-01-07T00:49:43.813Z
Mr. Octopus
<p>YES, it is possible to make a model from several shots, if you know the angle of rotation between the pictures.</p>
<p>most CAD programs allow to insert a picture, for example as backdrop or to trace it. We are interested in the later use:</p>
<p>We insert the picture, trace it in the picture's layer, then insert the next picture, rotated around the axis of rotation of the picture, and trace that. This we repeat again and again. The resulting cloud of outlines approximates the photographed body to a good degree.</p>
<p>There is a big caveat though: all photos must be in the same scale and distance, the rotation of the object has to be around one axis of the item itself (no wobble) and the rotation between the pictures has to be known quite exact. This principle is pretty much used by raster scanning by the way.</p>
<p>With a very hard contrast between the crystal and the backdrop, software might be able to automate the tracing process (for example use a white background and a black crystal and make sure no reflection hits the camera).</p>
<h1>Example using Fusion360</h1>
<p>Let's assume I have a perfect crystal like this octahedron with two cut tips
<a href="https://i.sstatic.net/7t0op.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7t0op.png" alt="Octahedron with upper and lower tip cut" /></a></p>
<p>To model this, we need at least a photo of the XZ and YZ shape (that is, 90° rotation to each other), which look like this:</p>
<p><a href="https://i.sstatic.net/pSkDB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pSkDB.png" alt="XZ and YZ plane projection" /></a><a href="https://i.sstatic.net/Xogdh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Xogdh.png" alt="The outlines traced" /></a></p>
<p>But that shape would also match a double-cone! So we'll need some intermediary photos, in this case, the 45° shot that lies on the plane of (XY-diagonal)Z Plane</p>
<p><a href="https://i.sstatic.net/Bncfa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Bncfa.png" alt="Diagonal-Z plane projection" /></a><a href="https://i.sstatic.net/w67LL.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/w67LL.png" alt="The traced outlines" /></a></p>
<p>As you see, the more outlines you have, the more detailed the pseudo-body becomes - it is just a gathering of vertices and lines yet though! But, we can take 3 points and create a construction area on these, then draw the face to merge all points on these faces...</p>
<p><a href="https://i.sstatic.net/6NsGu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6NsGu.png" alt="construction layers" /></a></p>
<p>Now, we turn these construction faces into modeling faces, then create a too large object and cut out the whole thing out...</p>
<p><a href="https://i.sstatic.net/k4XIh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/k4XIh.png" alt="Making the modeling faces" /></a>
<a href="https://i.sstatic.net/wl5Xb.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wl5Xb.png" alt="Creating the cutout" /></a>
<a href="https://i.sstatic.net/3LukB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3LukB.png" alt="Resulting model" /></a></p>
<p>The whole workflow looked like this for 4 pictures (0°, 45°, 90°, 135°)</p>
<p><a href="https://i.sstatic.net/U05Ss.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/U05Ss.png" alt="Workflow" /></a></p>
<p>The actual f3D design file is <a href="https://www.dropbox.com/s/y70bpjnk6d9oyrw/Model%20v0.f3d?dl=0" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2018-12-29T02:56:14.770Z
Hi Trish, thank you for your advice! I have downloaded Auto CAD and 3ds max (3ds max seems to match my goal perfectly when I was browsing Autodesk product page) and I am currently working on it. I will update this page when I have figured it out.
Mr. Octopus
CC BY-SA 4.0
2018-12-29T04:41:45.767Z
I found a very useful tutorial https://www.youtube.com/watch?v=GmIkOJmBv_c. In this tutorial two photos of a fork were imported into AutoCAD. First the cross sections on two orthogonal directions were traced from the raster images. Then, extend the cross section into two columns. Finally intersect two columns so a nice 3D fork is presented (14:30 in the video). My case is similar but more complicated. I probably need like 6 photos. I have to align photos along the rotation axis and create 6 columns with their cross sections traced from the photos. Then I finally intersect them. Am I right?
Mr. Octopus
CC BY-SA 4.0
2018-12-29T09:39:44.673Z
pretty much - the more photos you take, the more of the imperfections you get. automatic rastering software uses several 100 photos
Trish
CC BY-SA 4.0
2018-12-29T13:48:44.187Z
@Mr.Octopus I added a simple example using Fusion 360, but most programs should allow to follow a similar workflow
Trish
CC BY-SA 4.0
2018-12-28T23:44:13.013Z
2018-12-29T13:47:56.897Z
2020-06-18T08:29:41.667Z
Trish
<p>You may want to do a search for "photogrammetry".  This is software that uses many photos to build a 3D model.  Dr. Falkingham did a good review of free software on his blog:</p>

<p><a href="https://peterfalkingham.com/2016/09/14/trying-all-the-free-photogrammetry/" rel="nofollow noreferrer">https://peterfalkingham.com/2016/09/14/trying-all-the-free-photogrammetry/</a>
<a href="https://peterfalkingham.com/2017/12/17/free-photogrammetry-software-review-2017/" rel="nofollow noreferrer">https://peterfalkingham.com/2017/12/17/free-photogrammetry-software-review-2017/</a></p>

<p>His conclusion that works very well for me uses COLMAP to take the photos and build a point cloud, then OpenMVS to build and texture a mesh from the point cloud.</p>

<p><a href="https://colmap.github.io/" rel="nofollow noreferrer">https://colmap.github.io/</a>
<a href="https://github.com/cdcseacave/openMVS/wiki/Usage" rel="nofollow noreferrer">https://github.com/cdcseacave/openMVS/wiki/Usage</a></p>

<p>I have not used many commercial packages, but Pix4D has worked very well for me.</p>

<p><a href="https://www.pix4d.com/" rel="nofollow noreferrer">https://www.pix4d.com/</a></p>

<p>I hope that gets you started.</p>

CC BY-SA 4.0
2019-01-10T19:08:07.437Z
Thank you, UrQuan3! You just offered so many open-source softwares. I will test them and post another learning notes if I find any software being useful.
Mr. Octopus
CC BY-SA 4.0
2019-01-08T21:07:39.797Z
2019-01-08T21:07:39.797Z
UrQuan3
<p>I am a physics graduate student and I want to create some 3D models for my crystal samples. We have an X-ray diffractometer in our lab. It comes with a goniometer inside it, so basically I can take as many photos as needed from any angles. (I have included a gif animation made of 10 photos taken by the machine as an example below) </p>

<p><a href="https://i.sstatic.net/HHvM8.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HHvM8.gif" alt="a gif animation made of ten photos taken by the machine"></a></p>

<p>My problem is, given these 2D photos, am I able to construct 3D models for my crystals in AutoCAD or similar software so that I can determine angles, edge lengths and volume more precisely. </p>

<p>I am new to 3D printing section. I just thought maybe someone here has encountered with a similar problem. It would be very helpful if anyone could tell me any Github codes, MATLAB scripts, Mathematica scripts or software that can finish this kind of job. I can try to figure it out myself.</p>

<3d-models><graphics>
How can I get a 3D model from a bunch of 2D photos?
Mr. Octopus
# How can I get a 3D model from a bunch of 2D photos?

(Asked by: username_0 on 2018-12-28)

I am a physics graduate student and I want to create some 3D models for my crystal samples. We have an X-ray diffractometer in our lab. It comes with a goniometer inside it, so basically I can take as many photos as needed from any angles. (I have included a gif animation made of 10 photos taken by the machine as an example below)

[![a gif animation made of ten photos taken by the machine](https://i.sstatic.net/HHvM8.gif)](https://i.sstatic.net/HHvM8.gif)

My problem is, given these 2D photos, am I able to construct 3D models for my crystals in AutoCAD or similar software so that I can determine angles, edge lengths and volume more precisely.

I am new to 3D printing section. I just thought maybe someone here has encountered with a similar problem. It would be very helpful if anyone could tell me any Github codes, MATLAB scripts, Mathematica scripts or software that can finish this kind of job. I can try to figure it out myself.

**Tags:** 3d-models, graphics

---

## 3 answers

### Answer by username_0 on 2019-01-07. Score: 3

Inspired by the answer given by @Trish and the following [YouTube video](https://youtube.com/watch?v=GmIkOJmBv_c), I finally worked out the way to reconstruct the 3D crystal model in AutoCAD.

1. Import 6 images into AutoCAD. The photos are taken from 6 different angles with 30 degrees separation.
   [![enter image description here](https://i.sstatic.net/VuPPQ.png)](https://i.sstatic.net/VuPPQ.png)
2. Draw 6 lines of length 100 along Y axis in the XY plane.
   [![enter image description here](https://i.sstatic.net/MSWjt.png)](https://i.sstatic.net/MSWjt.png)
3. Use ALINE command to align the rotation axis in the photos to the added vertical lines.
   [![enter image description here](https://i.sstatic.net/44Mht.png)](https://i.sstatic.net/44Mht.png)
4. Use SCALE command to rescale all 6 photos into a uniform size.
   [![enter image description here](https://i.sstatic.net/cVGeA.png)](https://i.sstatic.net/cVGeA.png)
5. Use POLYLINE command to trace the cross sections from 6 raster images.
   [![enter image description here](https://i.sstatic.net/KF6pk.png)](https://i.sstatic.net/KF6pk.png)
6. Use 3DROTATE command to rotate 6 images and the corresponding rotation axes and traced cross sections along Y axis. The first picture was rotated 75 degrees clockwise when viewed along the +Y axis, the second 45 degrees, the third 15 degrees, the fourth -15 degrees... (Tips: The rotation gizmo will only show in a 3D view. If you didn't see the gizmo, drag the view cube on the right-top to change the view point and try again.)
   (view from Y axis)
   [![enter image description here](https://i.sstatic.net/RP6Cj.png)](https://i.sstatic.net/RP6Cj.png)
   (view from Z axis)
   [![enter image description here](https://i.sstatic.net/A7T3z.png)](https://i.sstatic.net/A7T3z.png)
7. Use 3DMOVE command to move 6 images so that the rotation axis of each image is aligned in a same circle on the YZ plane. (You would need a little bit calculation to finish this step)
   (view from Y axis)
   [![enter image description here](https://i.sstatic.net/SDFcw.png)](https://i.sstatic.net/SDFcw.png)
   (view from Z axis)
   [![enter image description here](https://i.sstatic.net/8zNym.png)](https://i.sstatic.net/8zNym.png)
8. Use EXTRUDE command to extrude 6 cross sections into 6 cylinders, the height of each cylinder should be long enough so that 6 cylinders will intersect.
   [![enter image description here](https://i.sstatic.net/JuKo3.png)](https://i.sstatic.net/JuKo3.png)
9. Use INTERSECT command to get the intersected part from 6 cylinders, this would be the wanted crystal model.
   [![enter image description here](https://i.sstatic.net/hg7II.png)](https://i.sstatic.net/hg7II.png)

> **Comments:**
> **username_1**: the more pictures you use, the better the results will be, but it is a good workflow if it works for you  
> **username_0**: Yes, but you will also need more time. For me, a model based on 6 photos is a good balance between the quality and the time. I am very grateful to your answer, though I didn't use the Fusion360 in the end. Your answer inspired me to a great extent.  

---

### Answer by username_1 on 2018-12-28. Score: 3

YES, it is possible to make a model from several shots, if you know the angle of rotation between the pictures.

most CAD programs allow to insert a picture, for example as backdrop or to trace it. We are interested in the later use:

We insert the picture, trace it in the picture's layer, then insert the next picture, rotated around the axis of rotation of the picture, and trace that. This we repeat again and again. The resulting cloud of outlines approximates the photographed body to a good degree.

There is a big caveat though: all photos must be in the same scale and distance, the rotation of the object has to be around one axis of the item itself (no wobble) and the rotation between the pictures has to be known quite exact. This principle is pretty much used by raster scanning by the way.

With a very hard contrast between the crystal and the backdrop, software might be able to automate the tracing process (for example use a white background and a black crystal and make sure no reflection hits the camera).

# Example using Fusion360

Let's assume I have a perfect crystal like this octahedron with two cut tips
[![Octahedron with upper and lower tip cut](https://i.sstatic.net/7t0op.png)](https://i.sstatic.net/7t0op.png)

To model this, we need at least a photo of the XZ and YZ shape (that is, 90° rotation to each other), which look like this:

[![XZ and YZ plane projection](https://i.sstatic.net/pSkDB.png)](https://i.sstatic.net/pSkDB.png)[![The outlines traced](https://i.sstatic.net/Xogdh.png)](https://i.sstatic.net/Xogdh.png)

But that shape would also match a double-cone! So we'll need some intermediary photos, in this case, the 45° shot that lies on the plane of (XY-diagonal)Z Plane

[![Diagonal-Z plane projection](https://i.sstatic.net/Bncfa.png)](https://i.sstatic.net/Bncfa.png)[![The traced outlines](https://i.sstatic.net/w67LL.png)](https://i.sstatic.net/w67LL.png)

As you see, the more outlines you have, the more detailed the pseudo-body becomes - it is just a gathering of vertices and lines yet though! But, we can take 3 points and create a construction area on these, then draw the face to merge all points on these faces...

[![construction layers](https://i.sstatic.net/6NsGu.png)](https://i.sstatic.net/6NsGu.png)

Now, we turn these construction faces into modeling faces, then create a too large object and cut out the whole thing out...

[![Making the modeling faces](https://i.sstatic.net/k4XIh.png)](https://i.sstatic.net/k4XIh.png)
[![Creating the cutout](https://i.sstatic.net/wl5Xb.png)](https://i.sstatic.net/wl5Xb.png)
[![Resulting model](https://i.sstatic.net/3LukB.png)](https://i.sstatic.net/3LukB.png)

The whole workflow looked like this for 4 pictures (0°, 45°, 90°, 135°)

[![Workflow](https://i.sstatic.net/U05Ss.png)](https://i.sstatic.net/U05Ss.png)

The actual f3D design file is [here](https://www.dropbox.com/s/y70bpjnk6d9oyrw/Model%20v0.f3d?dl=0).

> **Comments:**
> **username_0**: Hi Trish, thank you for your advice! I have downloaded Auto CAD and 3ds max (3ds max seems to match my goal perfectly when I was browsing Autodesk product page) and I am currently working on it. I will update this page when I have figured it out.  
> **username_0**: I found a very useful tutorial https://www.youtube.com/watch?v=GmIkOJmBv_c. In this tutorial two photos of a fork were imported into AutoCAD. First the cross sections on two orthogonal directions were traced from the raster images. Then, extend the cross section into two columns. Finally intersect two columns so a nice 3D fork is presented (14:30 in the video). My case is similar but more complicated. I probably need like 6 photos. I have to align photos along the rotation axis and create 6 columns with their cross sections traced from the photos. Then I finally intersect them. Am I right?  
> **username_1**: pretty much - the more photos you take, the more of the imperfections you get. automatic rastering software uses several 100 photos  
> **username_1**: @Mr.Octopus I added a simple example using Fusion 360, but most programs should allow to follow a similar workflow  

---

### Answer by username_2 on 2019-01-08. Score: 1

You may want to do a search for "photogrammetry". This is software that uses many photos to build a 3D model. Dr. Falkingham did a good review of free software on his blog:

<https://peterfalkingham.com/2016/09/14/trying-all-the-free-photogrammetry/>
<https://peterfalkingham.com/2017/12/17/free-photogrammetry-software-review-2017/>

His conclusion that works very well for me uses COLMAP to take the photos and build a point cloud, then OpenMVS to build and texture a mesh from the point cloud.

<https://colmap.github.io/>
<https://github.com/cdcseacave/openMVS/wiki/Usage>

I have not used many commercial packages, but Pix4D has worked very well for me.

<https://www.pix4d.com/>

I hope that gets you started.

> **Comments:**
> **username_0**: Thank you, UrQuan3! You just offered so many open-source softwares. I will test them and post another learning notes if I find any software being useful.  

---

