3 ms·
Heron Language 3D Geometry Demo
- jitl 9y agoI wish the syntax was more discoverable from this page. I see a sphere approximation, but no idea if it’s easy to produce from first principles or if it’s a primitive
- yorwba 9y agoThere's a link to https://github.com/cdiggins/heron-language/blob/master/input/geometry-mesh.heron https://github.com/cdiggins/heron-language/blob/master/input... on the demo page, where you can see that the sphere is implemented like this: // Given UV coordinates on the surface of a sphere u=[0,1), v=[0,1) computes the 3D location. function spherePoint(u, v) = vector(-cos(u*2.0*pi) * sin(v*2.0*pi), cos(v*2.0*pi), sin(u*2.0*pi) * sin(v*2.0*pi)); function sphere(segments) = meshFromUV(spherePoint, segments); function sphere() = sphere(32);
- codetrotter 9y agoAgreed. All languages ought to show a snippet of what they look like syntax-wise. Especially when page is showing the result like this. For example, look at https://www.rust-lang.org/en-US/ https://www.rust-lang.org/en-US/ or https://golang.org/ https://golang.org/. They both immediately give you a small taste of what the language looks like.
- cdiggins 9y agoGood advice, thanks! I thought the link was enough, but I think showing the syntax right away will be very important.
- cdiggins 9y agoSorry it wasn't discoverable. The mesh, vector, and array library are built up from first principles. Take a look at: https://github.com/cdiggins/heron-language/tree/master/input https://github.com/cdiggins/heron-language/tree/master/input
- brudgers 9y agoProbably the simplest thing is to link to the github repository "home page" with something like "Source on Github"...or even "source".
- nielsbot 9y agoThis came up just yesterday, but I wonder if Ohm (https://github.com/harc/ohm https://github.com/harc/ohm) would help with the implementation...
- cdiggins 9y agoIn case you are interested I actually used my own general purpose parsing library in TypeScript: https://github.com/cdiggins/myna-parser https://github.com/cdiggins/myna-parser