Route Plaque From GPX File

by Gammawave in Design > 3D Design

284 Views, 3 Favorites, 0 Comments

Route Plaque From GPX File

DSCF6558.JPG

Some time ago I create a VBA application (Scaling the Heights in 3D), that takes a GPX file and converts it into a GCODE file for 3D printing. The resulting output simply comprised the route and the profile.

Time passed and I moved onto other projects but the current maps contest gave me a reason to revisit it.

As a result some changes were made; Assigned names to the sheets, positioning the output central to the workspace, colour the data on the strata sheet to highlight the profile, output a trail without contours.

I still wanted a physical representation of my activity but this time presented in a different manner using the trail without contours output.

For this particular project I decided to use a cycle route on a trip to Alcudia in Spain.

Supplies

GPX file from your GPS device or from your fitness application repository.

MS Excel including VBA

Voxelizer (Version 3 used to convert the Gcode to STL)

FreeCAD (Version 1.1 used to Decimate (introduced from V0.19), the STL)

Tinkercad

Cura slicing engine

3D Printer

No affiliation to any of the applications listed, other applications may be available which support the requirements.

Links valid at the time of publication.

Importing the Data

main.png
contour_map.png
route_map.png

The first step in this process was to run the application and select the GPX* file to be processed.

When the file is loaded the data is displayed and columnated on Sheet 1 named rawdata.

In addition to this is are displayed two charts:

1: A 3D contour map of the data.

2: A 2D trail map of the data.

At this stage the Gcode for the map has not been created and the Sheets named strata and gc_map are blank.

However, the Sheets gc_init and gc_reset are both pre populated with initialization and reset Gcode.

The fields on the form for latitude and longitude relate to the size and position on the bed.

The fields on the right hand side of the form relate to printer specific options.

*GPX (Global Positioning System Exchange Format), an XML^ data format which contains longitude and latitude location data that may include waypoints, geocaches, routes, and tracks.

^XML (Extensible Markup Language), a text-based markup language in a format that is both human-readable and machine-readable.

Convert to Gcode

gcode_rst.png

Selecting Generate on the form populates the Sheets strata and gc_map.

Strata shows the profile and associated layers in the map.

gc_map shows the Gcode* conversion data for the specific file selected.

Additionally, two files are output.

gpx_conv14.txt - which is the full profile and trail Gcode.

gpx_conv141l.txt - which is the trail without the profile Gcode. (attached to this Instructable).

For this particular project I will be using gpx_conv141l.txt the extension will be changed to gcode for further processes.

*Gcode are instructions related to cartesian coordinates (X, Y, Z) and other machine operations (flow rate, speed of travel etc.)..

Downloads

Gcode to STL

GC2STL.png

Having converted the GPX file to a GCODE file I could directly load the file on the printer.

Note: On my printer an Elegoo 4 Pro were normally the estimated print time is shown with these particular files, no time estimate is shown although elapsed time and percentage complete is shown.

Although, based on the percentage complete and the elapsed time an estimation of total print time can be calculated if needed.

However, if I wanted to apply further manipulation or incorporate this model within another model it needed to be in a more user friendly format.

As I wanted to use Tinkercad for this particular project a format that could be imported was required and not having a multi coloured printer or requiring high quality or surface texture data passed over the other two supported formats OBJ & SVG for a universal format such as STL*.

The conversion from Gcode to STL was accomplished using Voxelizer.

*STL an abbreviation for Stereolithography developed by 3D Systems in 1987, is a file format used to represent 3D surface geometry as a triangular mesh.

Voxelizer Import

vox_import.png
loaded.png

On the Voxelizer menu select File > Import > G-code (.gcode)

This will import the gcode file and display the object on the workspace.

Select Voxelize

voxelized.png
voxelized_model.png
voxel_size.png

On the sidebar (list of columnated icons on the left); Select the last icon in the list.

Next select Voxelize Precise.

A Voxel size entry will be presented with the default set to 0.1mm.

[Smaller Voxels can be entered for more detail but in this case more detail is un-necessary]

Select OK for the default.

Voxelizer Filter

vox_filters.png
vox_thicken_done.png

On the sidebar select the filter icon (third icon from the end of the list).

Select Basic Filters

Select Thickening > Apply

Voxelizer Export

vox_export_mesh.png

Right click the model to select it.

On the menu select File > Export > Mesh (.stl)

Enter an appropriate name for the file and select Save.

Tinkercad Load Error

tinkercad_import_err.png

This stage of processes is included due to Tinkercad indicating that the Voxelized STL was too complex to be imported.

On loading the Voxelized STL into Tinkercad it reported meshes are limited to 300,000 triangles.

As a result I had to find a way to reduce the complexity of the mesh.

FreeCAD would be used reduce the complexity of the mesh by a process of Decimating.

FreeCAD

freecad_emptyfile.png
freecad_blank.png
freecad_import.png
freecad_imported.png

Run FreeCAD and select Empty File.

On the new blank file select File > Import and select the previously saved Voxelized STL.

Select Open

The trail of the selected file should now be visible in the work area.

Open Mesh Workbench

freecad_mesh.png
freecad_mesh_select.png

Open the Mesh Workbench by selecting View > Workbench > Mesh

Right click on the object to select it.

The Mesh Info Box will display the mesh parameters but of particular interest is the number of facets.

For the specific file in question this is 377,952 facets greater than Tinkercad's maximum limit.

FreeCAD Decimating

freecad_decimate.png
freecad_decimate_options.png
freecad_decimate_abs.png
freecad_decimated_mesh.png

On the Mesh menu select the Diamond icon.

This will display the Decimating options.

1: Reduction by percentage plus tolerance.

2: Absolute value with tolerance disabled.

As there is only one mesh object to be processed select the Absolute option.

The final number of facets can be adjusted by changing the numeric value in the right hand field.

Select OK on the Decimating menu.

Right click on the object.

The Mesh Info Box will be updated with the mesh parameters in this case 188,976 facets

FreeCAD Export

freecad_export_mesh.png

Select File > Export

Assign a suitable name for the file.

Select Save.

Tinkercad Import

tinkercad_import.png
tinkercad_import_options.png
tnkercad_imported.png

Open a new 3D design.

Select Import

Select Choose a File

Select the appropriate file and select Open.

The Import 3D Shape form will be shown where the measurement units or size can be modified.

Select Import

This will import the object and after a few minutes place it on the Workplane.


Create the Plaque

tinkercad_add_shape.png

I wanted to add a plaque on which the map trail would sit.

This was accomplished by adding a shape.

The shape in this case was a hexagon with the dimensions adjusted to fit the trail and allow the addition of text.

However, any shape that suits your requirements could be selected.

Add Text

tinkercad_add_text.png

Text is added to identify the trail.

In this case I identified the trail as with regard to the location and the activity (Alcudia, Spain).

However, other details can be added as suits your requirements.

Tinkercad Export

tinkercad_export.png

Select Export

This will display the download options.

I selected .STL to download the file although other formats are available.

Cura Slicer

cura_fileopen.png
cura_loaded.PNG

Open Cura

Select File > Open

Select the required file and select Open to load the file and display it on the work area.

Cura Settings

cura_sliced_prepare.PNG
cura_sliced_preview2.PNG

In order to create some contrast between the plaque and the map trail I decided to print the model in two colours.

Using a single head printer this would require a filament change.

The plaque would be in black and the map trail and text would be in orange.


The main print detail are as follows:

Filament: PLA

Layer Height: 0.15mm

Print Speed: 250mm/s

Infill: 50%

Infill Pattern: Cubic Subdivision

Wall Count: 2

Plate Adhesion: Skirt

These print details can be changed to suit user requirements, printer or filament differences.


Once the settings have been assigned select Slice.

Once the slicing process has completed.

Select Preview mode.

Cura Filament Change

cura_modgcode2.png
cura_ppscript.PNG
cura_filchange.png
cura_script21.PNG

Using the layer slider at the extreme right hand side, adjust the slider to the point were the map trail and text appear. Make a note of the layer number. (21)

Select Extensions > Post Processing > Modify G-Code

On the Post Processing Plugin form select Add a script

On the displayed list select Filament Change

Under Filament Change > Layer enter the layer number previously noted. (21)

Select Close

A red circle should be visible beside the Slice button.

Select Save to Disk

Use the default file name or enter a suitable name and select Save.

3D Printing

3dicon.png

Start the printer as normal.

At the specified layer, the print will pause, retract the filament, and move the nozzle to the change position. After changing the filament, press Continue.

The head will purge the previous filament by running through a length of the current filament and continue printing.

Once complete you will have a permanent record of your activity.

Display

DSCF6559.JPG

All that is left to do is decide how to display your plaque.

1: Simply place it flat on your desk.

2: Mount a magnet on the back and attach it to the refrigerator/fridge.

3: Fix a bracket on the back and hang on the wall.

4: Fix a support on the back to enable it to stand upright on a shelf.

5: Create a stand on which the plaque can sit. (an STL for a stand is included.)

Downloads

Finally

That's all for now.

Hope you found this project of interest.