STL Files: Difference between revisions
From charlesreid1
| Line 9: | Line 9: | ||
FreeCAD binary files: https://github.com/FreeCAD/FreeCAD/releases | FreeCAD binary files: https://github.com/FreeCAD/FreeCAD/releases | ||
=== | When you first open FreeCAD, you'll see this: | ||
[[Image:FreeCAD1.png|500px]] | |||
If you do a File > Open, you'll see lots of available file formats: | |||
[[Image:FreeCAD2.png|200px]] | |||
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== | |||
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>. | 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>. | ||
| Line 17: | Line 29: | ||
[[Image:NationalMapViewerFiles.png|200px]] | [[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> | |||
Quick example of how to use this utility: | |||
<pre> | |||
var fs = require('fs'); | |||
var shp2stl = require('shp2stl'); | |||
var file = 'SanFranciscoPopulation.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('SanFranciscoPopulation.stl', stl); | |||
} | |||
); | |||
</pre> | |||
=Flags= | =Flags= | ||
Revision as of 05:40, 13 June 2016
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:
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
I downloaded contour elevation data for the Seattle area, which was contained in a zip file called Elev_322166_Seattle_E_1X1.zip.
Unzipping results in a pile of files of various formats:
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:
$ npm update $ npm install shp2stl
Quick example of how to use this utility:
var fs = require('fs');
var shp2stl = require('shp2stl');
var file = 'SanFranciscoPopulation.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('SanFranciscoPopulation.stl', stl);
}
);