# How to go from GPS Data to Full Colour 3D Model

Got a large dataset you want to visualize in 3D? Let's take a look at the steps involved from going from just a spreadsheet to full colour 3D.

1. ### Step 1: Intro

Father's day has been and gone, and I've had to do this project once already for another customer so why not combine a belated Father's day gift and a work project I was supposed to be doing anyway?

The premise: most aircraft have some form of data logger that records their position during flight. What if air traffic control wanted to better visualize that complex 3D data? Maybe for an accident investigation or perhaps to train pilots on the convoluted airspace and approach patterns of their airfield?

Maybe you missed Father's day and you have almost unfettered access to the best in class when it comes to full colour additive?

2. ### Step 2: The Data

Most aircraft have some form of 'black' box flight record.

This data-logger stores the plane's position every second or so during flight. Latitude, Longitude and meters above sea level.

Latitude, Longitude and meters above sea level?

That sounds a lot like X Y Z coordinates to me...

...that sounds a lot like 3D mesh data!

You'll need to do some jiggery pokery to get the data into something we can use. Essentially what I did was convert everything into meters and have a bit of a tidy up until I got a clean CSV that looked like the one below.

Depending on how accurate you want your model to be and where you are in the world you might also need to take account for the differences between spherical and planar projections.

https://msi.nga.mil/msisitecontent/staticfiles/calculators/degree.html

Remember, latitude becomes your Y and longitude your X. Height above sea level obviously becomes your Z.

At this point you might want to think about using a sensible scale to convert your meters into millimeters. If your flight path is 50km x 50km you could choose a scale of say 1mm = 0.5km to bring everything down to something printable. Or if you are more visual you can do this in Blender in the next step.

3. ### Step 3: CSV to 3D Model using Blender™

Blender is a free open source computer graphics tool set. Mesh Modeling, Rendering, Animation, Fluid Simulation; it does it all.

It's amazing... and it's really hard! Honestly I feel like I understand about 2% of this program, yet we can still do some awesome things with it.

Setup:

If like me you like to work in real world units like millimeters, not Blender ‘imaginary’ units, you’ll need to do setup a bit of setup work before you import your data. Otherwise the huge extent of this GPS file now in CSV-XYZ-KM-From-Take-Off-Point format will get clipped by the viewport.

A) First, we set the Blender units to millimeters and the unit scale to 0.001

B) Set the scale to 0.001 in the display menu (press N in the viewport to bring up this menu)

C) Set the clipping to be between 1mm & 10 meters so you can see your whole model when you zoom out

Now we are ready to import our data into Blender. I’m using the CSV Mesh Importer Plugin. You can add this by going into File -> Preferences -> Search for Import-Export: CSV Mesh Importer. If you don’t have that script already you’ll need to download and put it into Blender's script library yourself:

Detailed tutorial here:

https://blenderartists.org/t/a-script-to-import-a-csv-file-and-create-meshes-for-blender-2-5x-or-later/501410

After this, in your scene tab you should see a little module called "CSV Mesh Importer". Open your CSV file here using the little file icon and set the settings as below.

Press the Add button and select create vertices and edges (single line) from the menu then press the import button!

And hey presto you should now have it, your XYZ CSV data in 3D 'worm' form:

We'll want to make that into a real 3D object though, not just a 1D line in 3D space. So we're going to loft a circle along this curve.

For all you smarty pants saying "This could easily be done in a more parametric CAD package like SolidWorks" ...Good luck! That was the first thing I tried. This is where we need the flexibility of mesh based modeling to cope with extremely organic and complex shapes.

In Blender different objects have different types, our worm is currently a series of discrete edges jointed together point to point to make a 1D ‘mesh’. In order to extrude a circle along this we’ll need to convert it into a ‘curve’

Press Alt-C and select Curve from Mesh/Text

Now draw yourself a NURBS Circle somewhere in the world, I chose a diameter of 2mm to give us a nice visible tube to represent the flight path.

Next select your flight path curve and navigate to the curve menu and under 'bevel object' select the NURBS Circle you just drew.

Well I'm glad that's over, lets get the hell out of Blender and into some other software packages I'm more comfortable using!

Export your now 3D flight path as an STL file and move onto the next step.

4. ### Step 4: Some Land

I use this great website Terrain2STL which lets me export anywhere in the world into a topographical STL

http://jthatch.com/Terrain2STL/

It is worth thinking about how you are going to line up all of these parts. Is there a geographical feature such as a mountain top, steep valley or a lake you can see in the model later to line up your flight path?

I decided to center my land around the coordinate of the airport runway as this gave me a clear takeoff point to start everything from.

Unfortunately depending on where you get your map data from you might have to do a bit of scaling work if you want a 100% accurate model. Your flight path is in meters, but your land might not be. It might not even be "flat"

Be aware of the difference between spherical and flat projections. Again I used some geographical features such as valleys and mountain tops to help me scale everything correctly in X&Y compared to the flight path data.

Finally I measured a couple of mountains in the STL and compared them to the heights they should be on the map, this enabled me to scale the Z correctly.

I actually chose to double my Z scale compared to X&Y for a better contrast.

5. ### Step 5: "The Rest" - Clear Casing, Scale Bars & A Title Block

Back to the safety of SolidWorks to make scale bars, a title block, a base and clear casing to go over the whole thing.

Thanks to the beauty of GrabCAD prints' new advanced slicer we don't need to worry about the fact that the models will self intersect and overlap as the slicer will automatically make space for the smaller pieces. Say goodbye to painful boolean operations!

6. ### Step 6: Assembling all the Pieces

Right, time to put everything together. You can use any software package you feel comfortable with for this. Because our flight path & land objects are already STLs we might as well stay in the 'mesh modeling realm'

I ended up using Magics to 'assemble' all the pieces, because I'm more comfortable with this than Blender or Rhino. Essentially the goal is to assemble all the files and save them each separately with a common origin so that when we take them onto the texturing stage everything lines up. If you're a rhino genius you could skip this and do it in Rhino on the next step.

Save everything as an STL using the same origin but do not combine the STLs into one file.

7. ### Step 7: Texturing in Rhino

Last step I promise!

Our model doesn't really have any "colour" yet, they're just dumb STLs that represent geometry. After we import each of the STLs into Rhino we can see they're beautifully lined up just like we left them in Magics but there's no texture or colour data.

So to fix that! First thing is to make sure all your parts have their own layer.

Not only will it make your life a lot easier to select things individually but it means you can assign each part a different colour or texture map.

Then you can go through and assign a custom colored materials to each layer as needed.

• Black for the base & scale bars & text
• Orange for the take off point
• Red for the flight path
• Fully transparent 100% alpha for the clear casing

Shuvom has nice tutorial on how to do this here:

Finally, we need to assign a custom texture image to add map data to the land. Go to your favorite online mapping software and take a large screenshot of the area you wish to cover. Then load it as a custom material as shown below.

Now we have the material assigned, we just need to tell Rhino how to wrap the texture image over the part. Select the texture mapping icon in the properties tab then in this case I chose planar mapping.

By adjusting the XYZ position and scale of the texture image we can make it fit correctly over the 3D land geometry below.

Again I used geographical features to line everything up. I could see the runway on the image so that could be lined up with my little orange take off cylinder, then it was possible to line up various mountain peaks or roads with different valleys.

Turn the other layers back on, and there we go our finished model! You just need to save it as a VRML and you can load that into GrabCAD print.

Don't forget to keep your texture images in the same folder as your VRML, otherwise you'll get missing texture errors. The reference paths are static not dynamic.

It's worth noting that before you print with these complex VRMLs GrabCAD print is generally a fairly good WYSIWYG check. If it doesn't look right on the screen, check your files and with big models it probably doesn't hurt to do a scaled down test print first either.

Now I couldn't finish without showing you the final part could I? Here it is, unpolished and without any photo-bleaching just fresh off the printer with our new material Vero Ultra Clear!

I'd really recommend printing these types of parts in the newer *ultra clear* material (above) compared to the old *clear* material (below). Both are good but for thicker parts like this you can see that the ultra clear gives a much better view of the internals: