landxml 0.4.0 → 0.4.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 +7 -4
- package/dist/index.mjs +7 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -280,12 +280,15 @@ var linesToPolyLines = (lineSegments) => {
|
|
|
280
280
|
}
|
|
281
281
|
return polylines;
|
|
282
282
|
};
|
|
283
|
-
var contourElevations = (minElevation, maxElevation,
|
|
283
|
+
var contourElevations = (minElevation, maxElevation, interval) => {
|
|
284
|
+
if (maxElevation >= Infinity) {
|
|
285
|
+
throw new Error("Contour elevations have to be finite numbers");
|
|
286
|
+
}
|
|
284
287
|
const elevations = [];
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
for (let elevation = start; elevation <= end; elevation += increment) {
|
|
288
|
+
let elevation = Math.ceil(minElevation * interval) / interval;
|
|
289
|
+
while (elevation < maxElevation) {
|
|
288
290
|
elevations.push(elevation);
|
|
291
|
+
elevation += interval;
|
|
289
292
|
}
|
|
290
293
|
return elevations;
|
|
291
294
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -245,12 +245,15 @@ var linesToPolyLines = (lineSegments) => {
|
|
|
245
245
|
}
|
|
246
246
|
return polylines;
|
|
247
247
|
};
|
|
248
|
-
var contourElevations = (minElevation, maxElevation,
|
|
248
|
+
var contourElevations = (minElevation, maxElevation, interval) => {
|
|
249
|
+
if (maxElevation >= Infinity) {
|
|
250
|
+
throw new Error("Contour elevations have to be finite numbers");
|
|
251
|
+
}
|
|
249
252
|
const elevations = [];
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
for (let elevation = start; elevation <= end; elevation += increment) {
|
|
253
|
+
let elevation = Math.ceil(minElevation * interval) / interval;
|
|
254
|
+
while (elevation < maxElevation) {
|
|
253
255
|
elevations.push(elevation);
|
|
256
|
+
elevation += interval;
|
|
254
257
|
}
|
|
255
258
|
return elevations;
|
|
256
259
|
};
|