[x3d-public] JSON to STL. Function bounties.

Joseph D Williams joedwil at earthlink.net
Tue Dec 20 14:59:24 PST 2022


➢ My approach i am considering taking is:  first, choosing a set of flat meshes to cover sphere, cone, cylinder, generically. After that, we can cover more complicated meshes like extrusions, 2D geometry and NURBS geometry

John, 
Right, in thinking of flat meshes relating to other geometry, I was just thinking about texture mapping, where we somehow tell how to map a 2D planar to a 3D object. 
Texture coordinates are a field of the geometry that tell which coordinate of the 2D will be applied to which coordinate of the 3D. 

When generating mesh think of the animation where the author may need to know the index of  a point to animate. This animation may depend upon a certain level of point resolution, and that certain features are consistently located within the mesh. 

Thanks,
Joe 




From: John Carlson
Sent: Tuesday, December 20, 2022 1:37 PM
To: Christoph Valentin; X3D Graphics public mailing list
Subject: Re: [x3d-public] JSON to STL. Function bounties.

Current code is here:

https://github.com/coderextreme/JsonToStl

It’s a pretty clean project, no real build script (make.sh), needs more test cases.

If you want to be a contributor, send me your email and specify your license of choice.  Code you work on should include your license in each source file you modify and the main LICENSE file.  If you want to create a python blender scripts to go from X3D to STL, that will be cool too.  I don’t want a lot of confusion about which IDE to use.   I use vim.  Use what you like, but don’t create a lot of dependencies, instead use some you didn’t install like easy to read make.bat file to pair with make.sh.

Remember there’s Git Bash, so you can assume bash will be on the system that git uses.

My approach i am considering taking is:  first, choosing a set of flat meshes to cover sphere, cone, cylinder, generically. After that, we can cover more complicated meshes like extrusions, 2D geometry and NURBS geometry

So i think that sphere might be a grid mesh, cylinder would be 3 meshes, and cone is 3 meshes.

My plan is to do sphere first, since that will cover my use case.

John

On Tue, Dec 20, 2022 at 2:58 PM John Carlson <yottzumm at gmail.com> wrote:
Wondering, is an X3dToStl.xslt code development  planned soon?

The other thing i can work on is continuing JSON to Python conversion.

Is there something i can write that i will use on a regular basis?

Christoph Valentin, what’s the  preferred multiuser web software for X3D?

Would syntax highlighting for vim and/or neovim be useful?

John

On Tue, Dec 20, 2022 at 6:17 AM John Carlson <yottzumm at gmail.com> wrote:
Here are the functions that are planned or implemented in JsonToStl.  Please express which ones you'd like to see implemented next.

Thanks!

Also, please discuss what type of LICENSE would be required. If at all possible, I'd like to make some money off this, perhaps by setting up a conversion website or patreon.

Yes, I'm aware of the STL output in Blender! I'm working on this to enhance X3DJSONLD.  Is conversion to STL still desired?

Thanks,

John

function convertJsonToStl(json) {
function initializeLDNode(json, obj) {
function findLDNodeInList(use, LDNodeList) {
function toNormals(json, LDNodeList, ParentNode) {
                IndexedFaceSet : function(obj, LDNode) {
                Group : function(obj, LDNode) {
                Shape : function(obj, LDNode) {
                Box : function(obj, LDNode) {
                IndexedTriangleSet : function(obj, LDNode) {
                IndexedTriangleStripSet : function(obj, LDNode) {
                IndexedTriangleFanSet : function(obj, LDNode) {
                IndexedLineSet : function(obj, LDNode) {
                Normal : function(obj, LDNode) {
                Coordinate : function(obj, LDNode) {
                Transform : function(obj, LDNode) {
                "@scale" : function(obj, LDNode) {
                "@rotation" : function(obj, LDNode) {
                "@translation" : function(obj, LDNode) {
                "@normalPerVertex" : function(obj, LDNode) {
                "@size" : function(obj, LDNode) {
                "@vector" : function(obj, LDNode) {
                "@point" : function(obj, LDNode) {
                "@normalIndex" : function(obj, LDNode) {
                "@coordIndex" : function(obj, LDNode) {
                "@index" : function(obj, LDNode) {
function vector_product(u, v) {
function normalize(v) {
function triangle_normal(a, b, c) {
function printNormal(prefix, x, y, z, output, transform) {
function printSFVec3f(prefix, x, y, z, output, transform) {
function IndexedTriangle(LDNode, output, transform) {
function transformLDNodesToTriangles(LDNode, output, parentTransform) {
                IndexedFaceSet: function(LDNode, output, transform) {
                Box: function(LDNode, output, transform) {
                SixSided: function(LDNode, output, transform, x, y, z) {
                Square: function(LDNode, output, transform, square) {
                Triangle: function(LDNode, output, transform, coords) {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20221220/d74653a9/attachment.html>


More information about the x3d-public mailing list