landxml 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.js +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -448,7 +448,8 @@ var contourElevations = (minElevation, maxElevation, interval) => {
|
|
|
448
448
|
throw new Error("Contour elevations have to be finite numbers");
|
|
449
449
|
}
|
|
450
450
|
if (minElevation + interval > maxElevation) {
|
|
451
|
-
|
|
451
|
+
console.warn(`No contour lines at interval: ${interval} between elevation ${minElevation} and ${maxElevation}`);
|
|
452
|
+
return [];
|
|
452
453
|
}
|
|
453
454
|
const elevations = [];
|
|
454
455
|
const firstStep = Math.ceil(minElevation / interval);
|
|
@@ -501,6 +502,7 @@ var bucketTrianglesByElevation = (triangles, elevations, interval) => {
|
|
|
501
502
|
var getContours = (data, interval = 2, precomputed) => __async(null, null, function* () {
|
|
502
503
|
const { triangles, minElevation, maxElevation } = precomputed != null ? precomputed : precomputeSurfaceData(data);
|
|
503
504
|
const elevations = contourElevations(minElevation, maxElevation, interval);
|
|
505
|
+
if (elevations.length === 0) return constructGeojson([]);
|
|
504
506
|
const trianglesByElevation = bucketTrianglesByElevation(triangles, elevations, interval);
|
|
505
507
|
const elevationPolylines = yield Promise.all(
|
|
506
508
|
elevations.map(
|
package/dist/index.mjs
CHANGED
|
@@ -411,7 +411,8 @@ var contourElevations = (minElevation, maxElevation, interval) => {
|
|
|
411
411
|
throw new Error("Contour elevations have to be finite numbers");
|
|
412
412
|
}
|
|
413
413
|
if (minElevation + interval > maxElevation) {
|
|
414
|
-
|
|
414
|
+
console.warn(`No contour lines at interval: ${interval} between elevation ${minElevation} and ${maxElevation}`);
|
|
415
|
+
return [];
|
|
415
416
|
}
|
|
416
417
|
const elevations = [];
|
|
417
418
|
const firstStep = Math.ceil(minElevation / interval);
|
|
@@ -464,6 +465,7 @@ var bucketTrianglesByElevation = (triangles, elevations, interval) => {
|
|
|
464
465
|
var getContours = (data, interval = 2, precomputed) => __async(null, null, function* () {
|
|
465
466
|
const { triangles, minElevation, maxElevation } = precomputed != null ? precomputed : precomputeSurfaceData(data);
|
|
466
467
|
const elevations = contourElevations(minElevation, maxElevation, interval);
|
|
468
|
+
if (elevations.length === 0) return constructGeojson([]);
|
|
467
469
|
const trianglesByElevation = bucketTrianglesByElevation(triangles, elevations, interval);
|
|
468
470
|
const elevationPolylines = yield Promise.all(
|
|
469
471
|
elevations.map(
|