<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.stack.imgur.com/HHvM8.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/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>

[{'answer_id': 7806, 'author': 'Trish', 'author_id': 8884, 'author_profile': 'https://3dprinting.stackexchange.com/users/8884', 'pm_score': 2, 'selected': False, 'text': '<p>YES, it is possible to make a model from several shots, if you know the angle of rotation between the pictures.</p>\n<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>\n<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>\n<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>\n<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>\n<h1>Example using Fusion360</h1>\n<p>Let\'s assume I have a perfect crystal like this octahedron with two cut tips\n<a href="https://i.stack.imgur.com/7t0op.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7t0op.png" alt="Octahedron with upper and lower tip cut" /></a></p>\n<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>\n<p><a href="https://i.stack.imgur.com/pSkDB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pSkDB.png" alt="XZ and YZ plane projection" /></a><a href="https://i.stack.imgur.com/Xogdh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xogdh.png" alt="The outlines traced" /></a></p>\n<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>\n<p><a href="https://i.stack.imgur.com/Bncfa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bncfa.png" alt="Diagonal-Z plane projection" /></a><a href="https://i.stack.imgur.com/w67LL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w67LL.png" alt="The traced outlines" /></a></p>\n<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>\n<p><a href="https://i.stack.imgur.com/6NsGu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6NsGu.png" alt="construction layers" /></a></p>\n<p>Now, we turn these construction faces into modeling faces, then create a too large object and cut out the whole thing out...</p>\n<p><a href="https://i.stack.imgur.com/k4XIh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k4XIh.png" alt="Making the modeling faces" /></a>\n<a href="https://i.stack.imgur.com/wl5Xb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wl5Xb.png" alt="Creating the cutout" /></a>\n<a href="https://i.stack.imgur.com/3LukB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3LukB.png" alt="Resulting model" /></a></p>\n<p>The whole workflow looked like this for 4 pictures (0°, 45°, 90°, 135°)</p>\n<p><a href="https://i.stack.imgur.com/U05Ss.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U05Ss.png" alt="Workflow" /></a></p>\n<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>\n'}, {'answer_id': 7889, 'author': 'Mr. Octopus', 'author_id': 13996, 'author_profile': 'https://3dprinting.stackexchange.com/users/13996', 'pm_score': 2, 'selected': False, 'text': '<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>\n\n<ol>\n<li><p>Import 6 images into AutoCAD. The photos are taken from 6 different angles with 30 degrees separation.\n<a href="https://i.stack.imgur.com/VuPPQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VuPPQ.png" alt="enter image description here"></a></p></li>\n<li><p>Draw 6 lines of length 100 along Y axis in the XY plane.\n<a href="https://i.stack.imgur.com/MSWjt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MSWjt.png" alt="enter image description here"></a></p></li>\n<li><p>Use ALINE command to align the rotation axis in the photos to the added vertical lines.\n<a href="https://i.stack.imgur.com/44Mht.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/44Mht.png" alt="enter image description here"></a></p></li>\n<li><p>Use SCALE command to rescale all 6 photos into a uniform size.\n<a href="https://i.stack.imgur.com/cVGeA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cVGeA.png" alt="enter image description here"></a></p></li>\n<li><p>Use POLYLINE command to trace the cross sections from 6 raster images.\n<a href="https://i.stack.imgur.com/KF6pk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KF6pk.png" alt="enter image description here"></a></p></li>\n<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.)\n(view from Y axis)\n<a href="https://i.stack.imgur.com/RP6Cj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RP6Cj.png" alt="enter image description here"></a>\n(view from Z axis)\n<a href="https://i.stack.imgur.com/A7T3z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A7T3z.png" alt="enter image description here"></a></p></li>\n<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)\n(view from Y axis)\n<a href="https://i.stack.imgur.com/SDFcw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SDFcw.png" alt="enter image description here"></a>\n(view from Z axis)\n<a href="https://i.stack.imgur.com/8zNym.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8zNym.png" alt="enter image description here"></a></p></li>\n<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.\n<a href="https://i.stack.imgur.com/JuKo3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JuKo3.png" alt="enter image description here"></a></p></li>\n<li><p>Use INTERSECT command to get the intersected part from 6 cylinders, this would be the wanted crystal model. \n<a href="https://i.stack.imgur.com/hg7II.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hg7II.png" alt="enter image description here"></a></p></li>\n</ol>\n'}, {'answer_id': 7928, 'author': 'UrQuan3', 'author_id': 12673, 'author_profile': 'https://3dprinting.stackexchange.com/users/12673', 'pm_score': 1, 'selected': False, 'text': '<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>\n\n<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>\n<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>\n\n<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>\n\n<p><a href="https://colmap.github.io/" rel="nofollow noreferrer">https://colmap.github.io/</a>\n<a href="https://github.com/cdcseacave/openMVS/wiki/Usage" rel="nofollow noreferrer">https://github.com/cdcseacave/openMVS/wiki/Usage</a></p>\n\n<p>I have not used many commercial packages, but Pix4D has worked very well for me.</p>\n\n<p><a href="https://www.pix4d.com/" rel="nofollow noreferrer">https://www.pix4d.com/</a></p>\n\n<p>I hope that gets you started.</p>\n'}]
['https://3dprinting.stackexchange.com/questions/7805', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/13996/']