geojson2obj
Advanced tools
+10
-7
@@ -41,7 +41,8 @@ var extend = require('extend'), | ||
| var flatPolyCoords = [].concat.apply([], vs), | ||
| holeIndices = coordinates.slice(2).reduce(function(holeIndices, ring, i, arr) { | ||
| holeIndices.push(arr[i - 1].length); | ||
| holeIndices = coordinates.slice(2).reduce(function(holeIndices, ring, i) { | ||
| var prevHoleIndex = holeIndices[holeIndices.length - 1]; | ||
| holeIndices.push(prevHoleIndex + coordinates[i + 1].length * 2); | ||
| return holeIndices; | ||
| }, [coordinates[0].length]), | ||
| triIndices = earcut(flatPolyCoords, holeIndices); | ||
| }, [coordinates[0].length * 2]); | ||
| var triIndices = earcut(flatPolyCoords, holeIndices); | ||
| [].concat.apply(faces, triIndices); | ||
@@ -60,3 +61,2 @@ } | ||
| geom = transform ? transform(f, options).geometry : f.geometry; | ||
| if (transform) console.log(geom); | ||
@@ -67,5 +67,8 @@ var baseZ = options.featureBase(f), | ||
| vertices = verticesFunc[geom.type](geom.coordinates).map(options.coordToPoint), | ||
| surfaces = surfacesFunc[geom.type](geom.coordinates, vertices, nIndices); | ||
| surfaces = surfacesFunc[geom.type](geom.coordinates, vertices, nIndices), | ||
| name = options.featureName(f); | ||
| stream.write('g ' + options.featureName(f) + '\n'); | ||
| if (name) { | ||
| stream.write('g ' + name + '\n'); | ||
| } | ||
@@ -72,0 +75,0 @@ if (materialName) { |
+1
-1
| { | ||
| "name": "geojson2obj", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "Convert GeoJSON into Wavefront OBJ format", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
37528581
016000
0.02%