Skip to content

Commit 2297fb3

Browse files
fix: small fixes
1 parent 4083882 commit 2297fb3

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/dialogs/GenerateSVGDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function SearchShapesDialog(props) {
2222
setResults(null);
2323
try {
2424
const centerTurfPoint = turf.point([project.settings.centerPoint.lng, project.settings.centerPoint.lat]);
25-
const buffer = turf.buffer(centerTurfPoint, project.settings.distance, { units: 'kilometers' });
25+
const buffer = turf.buffer(centerTurfPoint, (project.settings.distance / 2), { units: 'kilometers' });
2626
const bbox = turf.bbox(buffer);
2727
const [west, south, east, north] = bbox;
2828
const coords = [south, west, north, east];

src/lib/export/obj.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ export async function write(filePath, layers, meshData) {
44
const lines = ['# Generated from SVG layers'];
55
let vertexOffset = 0;
66

7+
let index = 0;
78
for (const layer of layers) {
8-
lines.push(`o ${layer.name || 'layer'}`);
9+
lines.push(`o ${layer.surface || 'layer'}_${index}`);
910

1011
// write this layer's vertices
1112
const { points, triangles } = meshData.meshes.get(layer.id)?.mesh;
@@ -24,6 +25,7 @@ export async function write(filePath, layers, meshData) {
2425
}
2526

2627
vertexOffset += points.length / 3;
28+
index++;
2729
}
2830

2931

src/lib/project.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ export async function generateMeshes(layerSettings, terrainSettings) {
347347

348348
if (terrainSettings.smoothing && openProject._heightMap?.data) {
349349
log.info(`Smoothing terrain ${terrainSettings.smoothing}`);
350+
broadcast('mesh.progress', {
351+
progress,
352+
count: (index + 1),
353+
status: `Smoothing terrain with radius of ${terrainSettings.smoothing}`
354+
});
350355
openProject._heightMap.smoothData = await smoothTerrain(openProject._heightMap.data, terrainSettings.smoothing);
351356
} else {
352357
openProject._heightMap.smoothData = null;

src/pages/Map.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export default function Map() {
413413

414414
const turfPointToPolygon = (lng, lat, distance) => {
415415
const centerTurfPoint = turf.point([lng, lat]);
416-
const buffer = turf.buffer(centerTurfPoint, distance, { units: 'kilometers' });
416+
const buffer = turf.buffer(centerTurfPoint, (distance / 2), { units: 'kilometers' });
417417
const bbox = turf.bbox(buffer);
418418
return turf.bboxPolygon(bbox);
419419
}

0 commit comments

Comments
 (0)