-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I initially explained it here OpenCPN/OpenCPN#2714
Since then I've made better progress on this idea.
The idea is to render S57 ENC vector charts in browser natively using WebGL.
It actually looks quite promising. I took S57 parser and render in Java from JOSM.
https://www.javatips.net/api/josm-plugins-master/seachart/src/s57/S57dec.java
I've converted it into Kotlin. (Both parser and renderer which uses AWT canvas).
Rnderer is coded to render all objects specified in chart. (Not by icons, but by actual code writing on canvas)
See here: https://github.com/mgrouch/kotlin-sandbox/tree/main/kotlin-s57
Parser is very very close to be running in browser using Kotlin JS.
I've tested it a little on JVM already.
Renderer should be possible to port from AWT canvas to WebGL in Kotlin).
Might be using https://github.com/revaultch/gwt-awt (converted to Kotlin)
Caching for performance in browser can be handled using IndexedDB of browser.
Might use: https://github.com/JuulLabs/indexeddb
or something else
Conversion of depth contour lines into 3D mesh using triangulation libraries in Kotlin can be done with:
https://github.com/slaviboy/DelaunatorKotlin
https://github.com/ricardomatias/delaunator
3D rendering or 2D with WebGL:
https://github.com/Pozo/threejs-kotlin
https://github.com/markaren/three-kt-wrapper
https://github.com/openrndr/openrndr
I've played with WebGL and 3D rendering of reliefs with it too in Kotlin
https://github.com/mgrouch/kotlin-sandbox/tree/main/kotlin-webgl
Rest of UI can be done using kvision https://github.com/rjaros/kvision
What do you think? I'll code more but, more people helping would be better.
Kotlin and IntelliJ really make it way easier than anything I could think of.
Thanks