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)
Estimation of whether or not the persons given information will have diabetes.

Diabetes Business Problem : It is desired to develop a machine learning model that can predict whether people have diabetes when their characteristics

Barış TOKATLIOĞLU 0 Jan 20, 2022
Vvim - Keyboardless Vim interactions

This is done via a hardware glove that the user wears. The glove detects the finger's positions and translates them into key presses. It's currently a work in progress.

Boyd Kane 8 Nov 17, 2022
Micro Displays for Raspberry Pi

micro-displays Micro Displays for Raspberry Pi Why? I'm super bored in lockdown. Add a Raspberry Pi 400 and a few tiny displays... The top half of the

ig 291 Jul 06, 2022
A Python script to monitor the latest block on an LCD.

PiHole-Monitoring A Python script to monitor the latest block on a lcd display. The first number represents the dns queries from the last 24h, the sec

Maxi 4 Dec 05, 2022
Cow Feeder is a bot automatically execute trade on cowswap

Cow Feeder is a bot automatically execute trade on cowswap, includes functions: Monitoring Ethereum network gas price and execute trade whe

6 Apr 20, 2022
Quasi-static control of the centroid of quadruped robot

Quasi-static control of quadruped robot γ€€γ€€This is a demo of the quasi-static controller for the centroid of the quadruped robot. The Quadratic Program

Junwen Cui 21 Dec 12, 2022
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
A ch341dll Wrap is for using in Python 32bits windows to access I2C SPI and MDIO (by GPIO), and Demo with display PC sreen on OLED by i2c or SPI .

ch341dll_wrap_typcal_app A ch341dll Wrap is for using in Python 32bits windows to access I2C SPI and MDIO (by GPIO). In addition, I provided 3 Demo. I

13 Jan 02, 2023
Easyeda2kicad.py - Convert any LCSC components (including EasyEDA) to KiCad library

easyeda2kicad.py A Python script that convert any electronic components from LCSC or EasyEDA to a Kicad library Installation git clone https://github.

uPesy Electronics 150 Jan 06, 2023
Small Robot, with LIDAR and DepthCamera. Using ROS for Maping and Navigation

πŸ€– RoboCop πŸ€– Small Robot, with LIDAR and DepthCamera. Using ROS for Maping and Navigation Made by Clemente Donoso, πŸ“ Chile πŸ‡¨πŸ‡± RoboCop Lateral Fron

Clemente Donoso Krauss 2 Jan 04, 2022
a weather application for the raspberry pi and the Pimorioni Inky pHAT.

raspi-weather a weather application for the raspberry pi and the Inky pHAT

Derek Caelin 59 Oct 24, 2022
Intel Realsense t265 into Unreal Engine

t265_UE Intel Realsense t265 into Unreal Engine. Windows only, and Livelink plugin is 4.26.2 only at the moment. Might recompile it for different vers

Bjarke Aagaard 30 Jan 02, 2023
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 03, 2023
A simple program to make MSI Modern 15 speaker and microphone mute led work.

MSI Modern 15 sound led fixup for linux A simple program to fix the MSI Modern 15 speaker and microphone mute LEDs. Installation Requirements pulsectl

Seyed Danial Movahed 4 Oct 18, 2022
Robot Framework keyword library wrapper for atlassian-python-api

Robot Framework keyword library wrapper for atlassian-python-api

Marcin Koperski 3 Jul 29, 2022
Andreas Frisch 1 Jan 10, 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
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
Brogrammer-keyboard - FIrmware for the Brogrammer Keyboard v1.0

Brogrammer Keyboard Firmware The package contains the firmware that runs on the Brogrammer Keyboard v1.0 See https://imgur.com/a/oY5QZ14 This keyboard

Devin Hartleben 1 Apr 21, 2022
CO2Ampel - This RaspberryPi project uses weather data to estimate the share of renewable energy in the power grid

CO2Ampel This RaspberryPi project uses weather data to estimate the share of ren

Felix 4 Jan 19, 2022