[x3d-public] JavaScript tessellation/triangulation open source code wanted.

John Carlson yottzumm at gmail.com
Thu Jun 3 22:22:09 PDT 2021


Anyone care to rewrite this in JavaScript, if not done by X_ITE or X3DOM?

https://github.com/FashGek/chazelle-triangulation

Note: This algorithm is notoriously hard to implement!

Looking for some good tessellation/triangulation scripts in JavaScript!

https://www.npmjs.com/package/earcut

I'm looking for something to use to output STL, so perhaps WebGL is not 
indicated?  Is there WebGL for Node.js?

I'm looking at the gl module: https://github.com/stackgl/headless-gl

Is there a WebGL driver for STL?

Maybe I should go run to help Three.js on Linux?  Their examples aren't 
showing up for some reason on Firefox/Linux.  Confirmation on other 
platforms desired.

Works fine on Chrome:

https://threejs.org/examples/webgl_loader_stl.html

John

On 6/3/21 3:58 PM, John Carlson wrote:
> People may wish to examine my X3D JSON to STL JavaScript script!:
>
> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/convertJsonToStl.js 
>
>
> Also driver script:
>
> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/JsonToStl.js 
>
>
> Usage:
>
> $ node JsonToStl.js X3D_JSON_file.json > STL_file.stl
>
> (changed name of script, but I think it will still work,  let me know 
> of difficulties)
>
> Note that I don't do tessellation of things like Spheres, Cylinders or 
> Cones yet!   Also, I don't breaks surfaces into triangles yet, as is 
> mentioned in the STL "spec", I believe! Contributions for 
> triangularization are welcome!
>
> Enjoy!
>
>
> John
>
> On 6/3/21 2:45 PM, John Carlson wrote:
>> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/stl/UavBeehive.stl 
>> <https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/stl/UavBeehive.stl> 
>>



More information about the x3d-public mailing list