4
$\begingroup$

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

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.

$\endgroup$
0
3
$\begingroup$

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

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 projectionThe outlines traced

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 projectionThe traced outlines

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

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 Creating the cutout Resulting model

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

Workflow

The actual f3D design file is here.

$\endgroup$
4
  • $\begingroup$ 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. $\endgroup$ Dec 29 '18 at 2:56
  • $\begingroup$ I found a very useful tutorial 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? $\endgroup$ Dec 29 '18 at 4:41
  • $\begingroup$ pretty much - the more photos you take, the more of the imperfections you get. automatic rastering software uses several 100 photos $\endgroup$
    – Trish
    Dec 29 '18 at 9:39
  • $\begingroup$ @Mr.Octopus I added a simple example using Fusion 360, but most programs should allow to follow a similar workflow $\endgroup$
    – Trish
    Dec 29 '18 at 13:48
3
$\begingroup$

Inspired by the answer given by @Trish and the following YouTube video, 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

  2. Draw 6 lines of length 100 along Y axis in the XY plane. enter image description here

  3. Use ALINE command to align the rotation axis in the photos to the added vertical lines. enter image description here

  4. Use SCALE command to rescale all 6 photos into a uniform size. enter image description here

  5. Use POLYLINE command to trace the cross sections from 6 raster images. enter image description here

  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 (view from Z axis) enter image description here

  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 (view from Z axis) enter image description here

  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

  9. Use INTERSECT command to get the intersected part from 6 cylinders, this would be the wanted crystal model. enter image description here

$\endgroup$
2
  • $\begingroup$ the more pictures you use, the better the results will be, but it is a good workflow if it works for you $\endgroup$
    – Trish
    Jan 7 '19 at 1:09
  • $\begingroup$ 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. $\endgroup$ Jan 10 '19 at 18:46
1
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$ Jan 10 '19 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.