|
|
| Line 31: |
Line 31: |
| {{Main|Shapefiles}} | | {{Main|Shapefiles}} |
|
| |
|
| I downloaded contour elevation data for the Seattle area, which was contained in a zip file called <code>Elev_322166_Seattle_E_1X1.zip</code>.
| | To convert Shapefiles (GIS-friendly format) to STL files (CAD-friendly format), see [[Shapefiles]] |
| | |
| Unzipping results in a pile of files of various formats:
| |
| | |
| [[Image:NationalMapViewerFiles.png|200px]]
| |
| | |
| The one I'll use there is the shapefile.
| |
| | |
| We'll use the shp2stl utility to convert the shapefile (GIS format) into an STL file (3D printing format).
| |
| | |
| Nice writeup/utility here: http://dougmccune.com/blog/2014/12/30/using-shp2stl-to-convert-maps-to-3d-models/
| |
| | |
| Download Node, and get npm. Use npm to install shp2stl utility:
| |
| | |
| <pre>
| |
| $ npm update
| |
| $ npm install shp2stl
| |
| </pre>
| |
| | |
| Here is the javascript file that I used to convert this shapefile to a stl file:
| |
| | |
| <pre>
| |
| $ cat stlify.js
| |
| var fs = require('fs');
| |
| var shp2stl = require('shp2stl');
| |
| var file = 'Elev_Contour.shp';
| |
| shp2stl.shp2stl(file,
| |
| {
| |
| width: 100, //in STL arbitrary units, but typically 3D printers use mm
| |
| height: 10,
| |
| extraBaseHeight: 0,
| |
| extrudeBy: "Pop_psmi",
| |
| simplification: .8,
| |
| binary: true,
| |
| cutoutHoles: false,
| |
| verbose: true,
| |
| extrusionMode: 'straight'
| |
| },
| |
| function(err, stl) {
| |
| fs.writeFileSync('SeattleContours.stl', stl);
| |
| }
| |
| );
| |
| </pre>
| |
| | |
| To run this, just pass it to node:
| |
| | |
| <pre>
| |
| $ node stlify.js
| |
| bounds: Infinity Infinity -Infinity -Infinity (spherical)
| |
| pre-quantization: 111.195km (1.00°) 111.195km (1.00°)
| |
| topology: 0 arcs, 0 points
| |
| topojson done
| |
| simplification: effective minimum area 0.00
| |
| simplification: retained 0 / 0 points (NaN%)
| |
| making top planes
| |
| making side planes
| |
| making bottom planes
| |
| done making 3D planes
| |
| </pre>
| |
|
| |
|
| =Flags= | | =Flags= |
Latest revision as of 01:16, 17 April 2017
STL (Stereo Litography) files are intended to represent three-dimensional shapes using information about the surface of a shape. STL files do not store any volumetric information. Surfaces are triangulated, and the triangles that compose a shape are described using Cartesian points.
Note that STL files do not know anything about scale - all measurements and distances are relative and may be scaled.
Viewing STL Files
ParaView
ParaView: http://www.paraview.org/download/
FreeCAD
FreeCAD binary files: https://github.com/FreeCAD/FreeCAD/releases
When you first open FreeCAD, you'll see this:
If you do a File > Open, you'll see lots of available file formats:
Note: shapefiles are not on the list, because shapefiles are a geographic information system (GIS) format for mapping. But with the shp2stl utility, you can turn your shapefiles into stl files and open them in FreeCAD.
Converting
Converting Shapefiles to STL Files
To convert Shapefiles (GIS-friendly format) to STL files (CAD-friendly format), see Shapefiles
Flags