feat: Implement HeightmapGenerator and Voronoi module

- Added HeightmapGenerator class for generating heightmaps with various tools (Hill, Pit, Range, Trough, Strait, etc.).
- Introduced Voronoi class for creating Voronoi diagrams using Delaunator.
- Updated index.html to include new modules.
- Created index.ts to manage module imports.
- Enhanced arrayUtils and graphUtils with type definitions and improved functionality.
- Added utility functions for generating grids and calculating Voronoi cells.
This commit is contained in:
Marc Emmanuel 2026-01-16 13:12:56 +01:00
parent fa493989b6
commit 4b5e9bfeea
8 changed files with 748 additions and 601 deletions

View file

@ -143,4 +143,94 @@ window.drawCellsValue = (data:any[]) => drawCellsValue(data, (window as any).pac
window.drawPolygons = (data: any[]) => drawPolygons(data, (window as any).terrs, (window as any).grid);
window.drawRouteConnections = () => drawRouteConnections((window as any).packedGraph);
window.drawPoint = drawPoint;
window.drawPath = drawPath;
window.drawPath = drawPath;
export {
rn,
lim,
minmax,
normalize,
lerp,
isVowel,
trimVowels,
getAdjective,
nth,
abbreviate,
list,
last,
unique,
deepCopy,
getTypedArray,
createTypedArray,
TYPED_ARRAY_MAX_VALUES,
rand,
P,
each,
gauss,
Pint,
biased,
generateSeed,
getNumberInRange,
ra,
rw,
convertTemperature,
si,
getIntegerFromSI,
toHEX,
getColors,
getRandomColor,
getMixedColor,
C_12,
getComposedPath,
getNextId,
rollups,
distanceSquared,
getIsolines,
getPolesOfInaccessibility,
connectVertices,
findPath,
getVertexPath,
round,
capitalize,
splitInTwo,
parseTransform,
isValidJSON,
safeParseJSON,
sanitizeId,
byId,
shouldRegenerateGrid,
generateGrid,
findGridAll,
findGridCell,
findClosestCell,
calculateVoronoi,
findAllCellsInRadius,
getPackPolygon,
getGridPolygon,
poissonDiscSampler,
isLand,
isWater,
findAllInQuadtree,
drawHeights,
clipPoly,
getSegmentId,
debounce,
throttle,
parseError,
getBase64,
openURL,
wiki,
link,
isCtrlClick,
generateDate,
getLongitude,
getLatitude,
getCoordinates,
initializePrompt,
drawCellsValue,
drawPolygons,
drawRouteConnections,
drawPoint,
drawPath
}