Tool to create 3D printable terrain with integrated path/road part files (Single material 3d printer)

Overview

BACKGROUND

This has been an ongoing project of mine for a few months now. I run trails a lot and original the goal was to create a function to combine trail data from Openstreetmap and geospatial data to create a 3D printable terrain model with the path features as seperate integrated prints. The terrain data is downloaded from USGS (10 or 30m 3DEP data), overpass (overpy) is used for the OSM queries, and OpensSCAD is used for all the boolean operations with a collection of Python functions to do all the processing. The hardest part was creating a function to inflate (widen) the trail lines to a polygon that could be extruded and meshed. There are several python libraries that do line/plolygon inflation, but none that really worked for an arbitray network of intersecting and deadend lines so I had start from scratch. Going into this I knew almost no Python so this has been a learning experience.

The "inflator" function can take almost any complex set of multiple intersecting and/or seperate polylines and inflate to a specified width, handling any resulting overlap, and removing interior polygons that get too small or thin. This is then 2D meshed using a Delaunay triangulation (Triangle library) and extruded to a 3D watertight mesh using pymesh. The intersection of this mesh and the terrain mesh is used so the top surface mataches the terrain exactly once inserted. OpenSCAD seems very slow (several hours with 10m DEM) for boolean operations, but it does finish eventually and it does exactly what I want.

Once I had this I realized adding in roads and streams would be easy so the final product takes an input deck and produces a set of ready to print models (not multi-material) for the terrain, with cutouts for trails, roads, streams and lakes and the individual models for the trails, roads, streams and lakes. The clearance has to be tweaked for your setup, but once you get it right everything just clicks together with very few visible gaps. The paths are all created with a short thicker section at the top so it is easier to get them in with a tight fit.

An input script is needed for a given area to define your printer size, bounding polygon coordinates and the roads, streams and lakes to incude. The focus was on trails for me so all OSM footpaths are included by default with a list of exluded trails as an input. I was able to get good results using a 0.25m nozzle for the paths and a path width of around 0.8 mm (3 passes), the terrain is printed with a 0.4mm nozzle. The terrain is a long print if you maximize the size and use .10 layers, 2-3 days on a Mk3, but the other parts all print very quickly. I found that if I print with a .10 mm layer height the layer lines are barely noticable, no post processing required.

It's not quite plug and play but you should be able to get working for any area you want with a little work. The great thing about OSM is that it is user maintained so you can add the trails you need and do any required clean-up on what is there.

This is currently only able to pull from downloaded elevation data. I have found that 10m data can be easily downloaded from: https://apps.nationalmap.gov/tnmaccess/products.html The current script is set up to read the geotiff files using that search.

Future options I would like to include are:

  • Automatic sectioning and dovetailing for terrain prints larger than printbed
  • Seprate groups of trails for different colored trails. (can be done with slicer...)
  • Additional printed path from GPX file.
  • Integrated compass for terrain model.
  • Guidance for material changes at specific layers heights to generate contour lines on terrain model.
  • Adjust base height each path section based on minimum elevation. This would reduce priting time and reduce the number of tall skinny path prints that are prone to failing.

The following libraries are used:

  • overpy
  • numpy trimesh as tm
  • import pyclipper
  • triangle
  • gpxpy
  • rasterio

OpenSCAD is also required, exe loacation is assumed to be: "C:"Program Files\OpenSCAD\openscad.com"

USAGE:

In general to make a print you need to define a polygon using coordinates for the print area. you can also use a gpx file to input the area, I use caltopo to create these: caltopo.com > +Add > polygon > [draw polygon] > export.

I made this with a focus on trails so it will import all footpaths within the selected area, so you will need to exlude paths by name or OSM id. Use the openstreetmap.org "query features" tool to get the ids for the paths to exclude. Roads, waterways and waterbodies have to be explicitly included. It's up to you how many roads you want to inlcde.

This is currently only able to pull from downloaded elevation data. I have found that 10m data can be easily downloaded from: https://apps.nationalmap.gov/tnmaccess/products.html.

The 30m data is easier to find but I have found the quality of the 10m (1/3 arcsecond) data to be much better and not just because of the resolution, it is just more accurate and less noisy.

See the included example for North Park (pittsburgh area): NP_STL.py, NP.gpx, tiff files downloaded by searching bounding box="-80.034,40.577,-79.974,40.6222", NED 1/3 arc-second, GeoTIFF.

Final assembly can be a little tricky. You do want to clean off any fuzzies, and maybe cut really big path sections into several pieces. Don't force them in too hard or they will get stuck partially inserted. A little sanding in the cutouts and on the side of the paths really helps the process.

INPUTS:

  • CoordPoly - polygon to define shape of terrain, input as longitude/lattitude array, or gpx file of points
  • rd_include - roads names / ids to inlcude, no roads included by default.
  • trail_exclude - footpath names / ids to inlcude, all included by default.
  • waterway_include - water paths to inlcude, not inlcuding polygon water bodies
  • waterbody - waterbody polygons (lakes, ponds) rivers will work in threory but the code is not set up to allow for any slope on waterbodies.
  • path_width - path (road, footpaths and waterway) print top width, 3 total passes works best.
  • support_width - width of base (shoot for one pass less than path_width)
  • path_clearance - clearance between path prints (tops) and cutouts.
  • height_factor - exaggeration factor for elevation. 1.0 makes on same scale as horizontal dimensions. 2-3 is reasonable factor.
  • base_height - minium print thickness
  • edge_width - width of terrian border with no path cutouts
  • max_print_size - maximum print dimension. will scale and rotate print to fit this.
  • water_drop - water ways printed slightly lower than other paths and terrain
  • load_area - overide automatic area selection
  • resolution - 10 or 30, for 10/30 meter resolution DEM.
  • dem_offset - offset DEM relative to OSM data to account for shifts in data
  • downsample_factor - integer factor to reduce resolution of terrain surface, needed for larger models. 1mm resolution is reasonable minimum.
  • map_only - stop after generating map to review (no boolean ops), recomend to do this first until all desired features look correct so it doesn't get hung up on the boolean operations for hours.
You might also like...
Create a low powered, renewable generation forecast  display with a Raspberry Pi Zero & Inky wHAT.
Create a low powered, renewable generation forecast display with a Raspberry Pi Zero & Inky wHAT.

GB Renewable Forecast Display This Raspberry Pi powered eInk display aims to give you a quick way to time your home energy usage to help balance the g

Create (templateable) cameras that display qr codes in homeassistant
Create (templateable) cameras that display qr codes in homeassistant

QRCam This custom component creates cameras displaying qrcodes. The QRCodes can be static or generated from templates. If you use a template as conten

This repository contains all the code and files needed to simulate the notspot quadrupedal robot using Gazebo and ROS.
This repository contains all the code and files needed to simulate the notspot quadrupedal robot using Gazebo and ROS.

Notspot robot simulation - Python version This repository contains all the files and code needed to simulate the notspot quadrupedal robot using Gazeb

A battery pack simulation tool that uses the PyBaMM framework

Overview of liionpack liionpack takes a 1D PyBaMM model and makes it into a pack. You can either specify the configuration e.g. 16 cells in parallel a

This tool emulates an EMV-CAP device, to illustrate the article
This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC

About This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC, issue #56 and f

🐱🖨Cat printer is a portable thermal printer sold on AliExpress for around $20.
🐱🖨Cat printer is a portable thermal printer sold on AliExpress for around $20.

Cat printer is a portable thermal printer sold on AliExpress for around $20. This repository contains Python code for talking to the cat printer over

Code repository for Semantic Terrain Classification for Off-Road Autonomous Driving

BEVNet Datasets Datasets should be put inside data/. For example, data/semantic_kitti_4class_100x100. Training BEVNet-S Example: cd experiments bash t

Fully Automated YouTube Channel ▶️with Added Extra Features.

Fully Automated Youtube Channel ▒█▀▀█ █▀▀█ ▀▀█▀▀ ▀▀█▀▀ █░░█ █▀▀▄ █▀▀ █▀▀█ ▒█▀▀▄ █░░█ ░░█░░ ░▒█░░ █░░█ █▀▀▄ █▀▀ █▄▄▀ ▒█▄▄█ ▀▀▀▀ ░░▀░░ ░▒█░░ ░▀▀▀ ▀▀▀░

A django compressor tool that bundles css, js files to a single css, js file with webpack and updates your html files with respective css, js file path.

django-webpacker's documentation: Introduction: django-webpacker is a django compressor tool which bundles css, js files to a single css, js file with

Multi-path load balancing is a method used by most of the real-time network to split the packets into different paths rather than transferring it through a single path
Multi-path load balancing is a method used by most of the real-time network to split the packets into different paths rather than transferring it through a single path

Multipath-Load-Balancing Method of managing incoming traffic by distributing and sharing load fairly among multiple routes from source to destination

Path tracing obj - (taichi course final project) a path tracing renderer that can import and render obj files
Path tracing obj - (taichi course final project) a path tracing renderer that can import and render obj files

Path tracing obj - (taichi course final project) a path tracing renderer that can import and render obj files

These scripts look for non-printable unicode characters in all text files in a source tree

find-unicode-control These scripts look for non-printable unicode characters in all text files in a source tree. find_unicode_control.py should work w

Quadruped-command-tracking-controller - Quadruped command tracking controller (flat terrain)
Quadruped-command-tracking-controller - Quadruped command tracking controller (flat terrain)

Quadruped command tracking controller (flat terrain) Prepare Install RAISIM link

Approaches to modeling terrain and maps in python
Approaches to modeling terrain and maps in python

topography 🌎 Contains different approaches to modeling terrain and topographic-style maps in python Features Inverse Distance Weighting (IDW) A given

A tool for automatically generating 3D printable STLs from freely available lidar scan data.
A tool for automatically generating 3D printable STLs from freely available lidar scan data.

mini-map-maker A tool for automatically generating 3D printable STLs from freely available lidar scan data. Screenshots Tutorial To use this script, g

Mysterium the first tool which permits you to retrieve the most part of a Python code even the .py or .pyc was extracted from an executable file, even it is encrypted with every existing encryptage. Mysterium don't make any difference between encrypted and non encrypted files, it can retrieve code from Pyarmor or .pyc files.
Mysterium the first tool which permits you to retrieve the most part of a Python code even the .py or .pyc was extracted from an executable file, even it is encrypted with every existing encryptage. Mysterium don't make any difference between encrypted and non encrypted files, it can retrieve code from Pyarmor or .pyc files.

Mysterium the first tool which permits you to retrieve the most part of a Python code even the .py or .pyc was extracted from an executable file, even it is encrypted with every existing encryptage. Mysterium don't make any difference between encrypted and non encrypted files, it can retrieve code from Pyarmor or .pyc files.

Prime Path Generator is a prime path generator used to generate prime paths.

Prime Path Generator is a prime path generator used to generate prime paths.

Python implementation of an automatic parallel parking system in a virtual environment, including path planning, path tracking, and parallel parking
Python implementation of an automatic parallel parking system in a virtual environment, including path planning, path tracking, and parallel parking

Automatic Parallel Parking: Path Planning, Path Tracking & Control This repository contains a python implementation of an automatic parallel parking s

3D-printable hand-strapped keyboard
3D-printable hand-strapped keyboard

Note: This repo has not been cleaned up and prepared for general consumption at all. This is just a dump of the project files. If there is any interes

Releases(v0.3)
  • v0.3(Apr 26, 2022)

  • v0.2(Feb 18, 2022)

    Some bug fixes, added some different boundary modes since it can be difficult to input coordinates that make an exact rectangle. This version is back to only requiring blender, no OpenSCAD operations.

    Source code(tar.gz)
    Source code(zip)
  • v0.1(Feb 9, 2022)

    Most of the features I wanted are up and running, and the mesh quality coming out is acceptable. See readme for usage and limitations. See NP_STL for example input deck.

    Source code(tar.gz)
    Source code(zip)
MPY tool - manage files on devices running MicroPython

mpytool MPY tool - manage files on devices running MicroPython It is an alternative to ampy Target of this project is to make more clean code, faster,

Pavel Revak 5 Aug 17, 2022
Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;)

TMorse Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;) Compatible with python3.9+. No third-party library is required

Mahyar 2 Jul 11, 2022
Segger Embedded Studio project for building & debugging Flipper Zero firmware.

Segger Embedded Studio project for Flipper Zero firmware Установка Добавить данный репозиторий в качестве сабмодуля в корень локальной копии репозитор

25 Dec 28, 2022
🐱 Petkit feeder components for HomeAssistant

Petkit for HomeAssistant Installing Download and copy custom_components/xiaomi_miot folder to custom_components folder in your HomeAssistant config fo

62 Dec 29, 2022
Watson-Assistant with integration capabilities

Watson-Assistant-Integration Watson-Assistant with integration capabilities "main.py" should be deployed as Cloud Function (Action) on IBM Cloud. For

Sergey Usachev 1 Dec 20, 2021
raspberry pi servo control using pca9685

RPi_servo-control_pca9685 raspberry pi 180° servo control using pca9685 Requirements Requires you to have the adafruit servokit library installed You

1 Jan 10, 2022
The software that powers the sPot: a 4th generation

This code is meant to accompany this project in which a Spotify client is built into an iPod "Classic" from 2004. Everything is meant to run on a Raspberry Pi Zero W.

Guy Dupont 683 Dec 28, 2022
A set of postprocessing scripts and macro to accelerate the gyroid infill print speed with Klipper

A set of postprocessing scripts and macro to accelerate the gyroid infill print speed with Klipper

Jérôme W. 75 Jan 07, 2023
Baseline model for Augmented Home Assistant

Dataset Preparation Step 1. Rename the Virtual-Home output directory to 'vh.[name]', for example: 'vh.door' Make sure the directory contains 100+ fram

Stanford HCI 1 Aug 24, 2022
SALUS THERMOSTAT Custom component for Home-Assistant

Home-Assistant Custom Components Custom Components for Home-Assistant (http://www.home-assistant.io) Salus Thermostat Climate Component My device is R

21 Dec 18, 2022
A modular sequencer based on Pi Pico & EuroPi

PicoSequencer A modular sequencer based on Pi Pico & EuroPi by Zeno Van Moerkerke / Keurslager Kurt For now it is 'only' a trigger sequencer, but I si

5 Oct 27, 2022
Kwcpu - An unobtrusive CPU meter that fits in the default Windows 11 taskbar. Supports up to 32 cores.

kwcpu An unobtrusive CPU meter that fits in the default Windows 11 taskbar. Supports up to 32 cores. kwcpu is provided as a Rainmeter skin. By default

Jay Oster 2 Nov 07, 2022
A python library written for the raspberry pi.

A python package for using certain components on the raspberry pi.

Builder212 1 Nov 09, 2021
Electrolux Pure i9 robot vacuum integration for Home Assistant.

Home Assistant Pure i9 This repository integrates your Electrolux Pure i9 robot vacuum with the smart home platform Home Assistant. The integration co

Niklas Ekman 15 Dec 22, 2022
View your medication from Medisafe Cloud in Home Assistant

Medisafe View your medication from Medisafe Cloud in Home Assistant. This integration adds sensors for today's upcoming, taken, skipped, and missed do

Sam Steele 12 Dec 27, 2022
A python module for interacting with rolimon's, a roblox value site.

rpi - rolimon's python interaction rpi is an open source python-based rolimon's api wrapper. It provides an end-to-end pipeline in which each componen

Acier 11 Nov 08, 2022
Pihole-eink-display - A simple Python script to display PiHole statistics on an eInk Display

Pihole-eink-display - A simple Python script to display PiHole statistics on an eInk Display

Mark McIntyre 64 Oct 11, 2022
My 500 LED xmas tree

xmastree2020 This repository contains the code used for Matt's Christmas tree, as featured in "I wired my tree with 500 LED lights and calculated thei

Stand-up Maths 581 Jan 07, 2023
A raspberrypi tools for python

raspberrypi-tools how to install: first clone this project: git clone https://github.com/Ardumine/rpi-tools.git then go to the folder cd rpi-tools and

1 Jan 04, 2022
Python library to interact with the GCE Electronics IPX800 device

A python library to control a GCE-Electronics IPX800 V4 device through its API.

Marc-Aurèle Brothier 2 Oct 20, 2021