feat: Implement zone management features including creation, deletion, and updates
- Added zone handling in the Line component for removing and updating zones based on points. - Enhanced Point component to support snapping and updating zone positions. - Introduced zone-related API calls for upserting and deleting zones. - Updated zone store to manage zones more effectively, including methods for removing zones by points and getting zones by point IDs. - Improved zone instance rendering to handle dynamic point connections. - Refactored zone creation logic to allow for better interaction and snapping behavior. - Updated API endpoints for zone operations to use version 1 of the API.
This commit is contained in:
@@ -85,9 +85,12 @@ export function useWallClassification(walls: Walls) {
|
||||
}));
|
||||
}
|
||||
|
||||
const allCoords = mergedLineStrings.flatMap(ls => ls.geometry.coordinates);
|
||||
const uniqueCoords = Array.from(new Set(allCoords.map(coord => coord.join(','))));
|
||||
if (uniqueCoords.length < 4) return [];
|
||||
|
||||
const lineStrings = turf.featureCollection(mergedLineStrings);
|
||||
|
||||
// Now polygonize merged line strings
|
||||
const polygons = turf.polygonize(lineStrings);
|
||||
|
||||
const rooms: Point[][] = [];
|
||||
|
||||
Reference in New Issue
Block a user