Loading

Print Your Run !!!

by snrk, published

Print Your Run !!! by snrk Mar 21, 2014
3 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps

Contents

License

Print Your Run !!! by snrk is licensed under the Creative Commons - Attribution license.

Use This Project

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Makes

Thing Statistics

6576Views 988Downloads Found in Sport & Outdoors

Summary

Who doesn't want a physical representation of the perfect run, the longest run, or that crappy run that even really wasn't something to remember even afterwards?

I know that I did, but I couldn't find any way when searching the net for a solution.

Alas, I set out to make my own program that could turn my .GPX files to .STLs that could be printed out. I found appropriate libraries for Processing, and managed to work out a way to parse the files and translate the data to points in a voxel array.

Instructions

You will need:

Processing -download from www.processing.org
GPS data library for Processing -for parsing .GPX files, download and install
*toxic libraries for Processing -download and install

You will also need:

Some sort of GPS device that can log your activities as GPX files. Usually people use GPS watches, iPhones and such, combined with some sort of service like Garmin Connect, Runkeeper or Strava.

My program comes in two flavors: one for creating meshes that shows the path floating in space (GPS_xy_floating.pde), and one that shows the elevation stretched, originating from a base level (GPS_xy_solid.pde).

  • Get out and run, why not a scenic one?

  • Download your file for local storage on your computer, place it in the same folder as your .pde.

  • Edit the .pde with your .GPX file name.

  • Run the sketch, your run will now be parsed and visualized on your screen. Don't mind that it will look mirrored.

  • Press the 's'-key. This will save the mesh as 'path.stl' in your sketch folder. It will overwrite any 'path.stl' file without asking, so rename your output if you don't want it accidentally destroyed after it's been exported.

  • Load your mesh in favorite slicer and print. If you create a floating track, don't forget to print it with support.

I have only personal .GPX files from the northern hemisphere, so I can't confirm that this will work for everyone. If you want to contribute, please feel free to make a suggestion or your own remix. As for now, these versions suite my current needs.

More from Sport & Outdoors

view more

All Apps

3D Print your file with 3D Hubs, the world’s largest online marketplace for 3D printing services.

App Info Launch App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

3D Print a wide range of designs with Treatstock. Easy to use tools to get the perfect result. The global 3D printing network that connects you with high-quality and fast working print services nea...

App Info Launch App
Mar 22, 2016 - Modified Mar 25, 2016

Hello! I've posted an executable version of my remix of your code. No library d/l or Processing required. Currently, it requires Windows and 64-bit Java or above. http://www.thingiverse.com/thing:985557

Print Your Ride!!! (derived from Print your Run!!!)

Hi, there is no download for the GPX library! it takes you to a wiki page

Hello! I have a probably silly question - I've mapped my run on Strava and have a .gpx file, but I have no idea how to translate that to a .pde file. I've put them in the same folder, created a new sketch with the name of my .gpx file, and have downloaded and installed the appropriate libraries...but I am still not sure how to create this .pde file that I need. Thanks in advance for the help!!

Hello! I remixed your code based on your suggestions for increasing the resolution. I also fixed a bug. Thanks for posting your original!

Hello, when I run the sketch, appears this error:

Framebuffer error (unknown error), rendering will probably not work as expected Read http://wiki.processing.org/w/OpenGL_Issues for help.
OpenGL error 1286 at bot beginDraw(): invalid framebuffer operation
RK_ny.gpx does not exist or could not be read
java.lang.NullPointerException
at processing.data.XML$1.read(XML.java:190)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.arrangeCapacity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipString(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at processing.data.XML.(XML.java:187)
at processing.core.PApplet.loadXML(PApplet.java:6322)
at processing.core.PApplet.loadXML(PApplet.java:6312)
at tomc.gpx.GPX.parse(GPX.java:62)
at Etapa.setup(Etapa.java:55)
at processing.core.PApplet.handleDraw(PApplet.java:2361)
at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:862)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.NullPointerException
at tomc.gpx.GPX.parse(GPX.java:63)
at Etapa.setup(Etapa.java:55)
at processing.core.PApplet.handleDraw(PApplet.java:2361)
at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:862)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:665)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:649)
at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1289)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1119)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:994)
at javax.media.opengl.awt.GLCanvas$11.run(GLCanvas.java:1300)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Klar med minimums, minLat: 100.0 , minLon: 200.0 ,minEle: 50000.0
Klar med maximums, maxLat: 100.0 , maxLon: 200.0 ,maxEle: 50000.0
jul 29, 2014 8:11:32 PM toxi.volume.VolumetricSpace
INFO: new space of 100x100x100 cells: 1000000
Lat: 100.0 to 100.0
Lon: 200.0 to 200.0
Ele: 50000.0 to 50000.0
deltaX: 0.0 deltaY: 0.0
ratioX: 0.0 ratioY: 0.0
minX: 0.0 maxX: 0.0 minY: 0.0 maxY: 0.0
OpenGL error 1286 at top endDraw(): invalid framebuffer operation

Aug 4, 2014 - Modified Aug 4, 2014
snrk - in reply to MMWORKS

If you read the error log, it clearly says that RK_ny.gpx could not be read or does not exist. Do you have it in the same directory?

Is there an easy way to alter the code so that it makes the line that shows your path thinner? I ask this because my run course has a part where two sections of the path come close together and in the stl file the two lines are fused together. Thanks.

Change the BoxBrush size. I think it's set to 2, so you can try 1 or lower.

I dont know what the 'f' at the end is for but if I change it up then it gets thicker. 1.5 must be the lowest. Thanks anyway.

When testing at home, 1 seems to be the lowest possible setting for the BoxBrush size. What you can do is to expand the volume that the brush is painting in ( requires more memory ). As it is now, the gps track is drawn within a cube of 100x100x100 (100 in the z space isn't required really) voxels (a volumetric array). See what happens if you expand it to 200x200x60 or so. Make sure to alter the code in the pixelToGeo()-function so that the mesh fills out the volumetric array.
This would get you a better resolution combined with the smaller brush size.

Thanks for all your help! I am sorry but im not sure how to change the code in the geoToPixel section. I did however manage to expand the volume to 200, 200, 200. So what part would I change and what do I change it with? Thanks again for all your help.

This is the default line of code:
brush = new BoxBrush(volume, 1.5f);
I have tried changing the 1.5 to a lower number but it doesn't change anything. Any ideas?

When I try to run the sketch it says: "The package "tomc" does not exist. You might be missing a library." What should I do?

thats the GPX library. Download and install in your Processing library folder. You may want to rename the fold name to GPX (eg my provided pic) https://dl.dropboxusercontent.com/u/3565394/avbild.tiffhttps://dl.dropboxusercontent....

Thanks!

where you say "Edit the .pde with your .GPX file name" do you mean edit the title or the actual sketch?

change this code:
gpx.parse("gustafsberg.gpx"); // or a URL
inside the .pde so that it matches your provided .gpx

are the inclinations based on terrain or speed?

As of now terrain. I wanted to do the width of the path correspond to the speed, but couldn't get the function Brush.setSize() in the toxic library to work. The X and Y are determined by the ratio between latitude and longitude in the .gpx file, z is mapped in a hard coded span. Look in the pixeltogeo function in the .pde file.

do the routes have to end up where they began? I'm trying to use the script, and get it working with the gustafsberg gpx, but it isn't working on a gpx i found of a gpx of the Boston Marathon i found

You can use the debug section of the Processing IDE to get a sense of the information that's parsed from your gpx. I've only got three personal files from runs I've made in Central Park, otherwise my whole library of Gpx files consists of both positive latitudes an longitudes. I'm not sure if my functions really handles all cases. Do some more testing, and don't be afraid to make changes in the code if u come up w something better!

interesting, thanks! I'm gonna see if theres anyway to export gpx files from google maps

I'm also having trouble with this. I have the GPX installed but cannot get it to display any GPX data. Also don't know what to do with the toxiclibs. No installation instructions for that.

Hi! I can only talk about OSX, as that's what I run. On my machine the libraries is located in \Documents\Processing\libraries

All toxic-libs are subfolders of that libraries folder, as is the gpx one. eg "\Documents\Processing\libraries\volumeutils" and "\Documents\Processing\libraries\gpx"

Don't know the structure for Processing on Windows or Linux, but I'll guess that can be found on the http://Processing.orgProcessing.org website.

Can you tell/show how to do it? Dont know where to put the downloaded files and how to open my gpx file

If you download the .pde, open it in Processing and save it, Processing will create a folder on your drive where it will be stored. On my Mac the path is something like 'Documents\Processing\GPS_xy_solid\GPS_xy_solid.pde'. Place your .gpx file in the same folder as GPS_xy_solid.pde, and change the file name in GPS_xy_solid.pde so that it matches the name of your own .gpx file. Voila!

Top