<div dir="ltr">The fieldDispatchTable has JSON property names (attributes/fields of nodes) which are converted in convertJsonToStl.<div><br></div><div>The nodeDispatchTable has JSON property names (tags of nodes) which are converted in convertJsonToStl.</div><div><br>There's no parsing or proto expander as this are handled by other modules. In other words, convertJsonToStl can be thought of as handling different JSON languages, even though it does not. (I'm thinking HTML5 JSON or SVG JSON--If such a thing existed). I try to write generically as possible, but use shims to fold in X3DV4.</div><div><br></div><div>Note that this approach may get me into trouble!</div><div><br></div><div>John</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 19, 2020 at 5:50 PM Don Brutzman <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">aha, belay my last request for code with thanks for these.<br>
<br>
for clarity am noting that "Json" in following is X3dJdon, as in convertX3dJsonToStl<br>
<br>
Looks like your importers for Ply and STL are about 200-300 lines each, including lotsa brackets.<br>
<br>
Perhaps we can meet to adapt to Java and Python using existing data structures in X3DJSAIL and X3DPSAIL? those utility methods could then be part of library autogeneration. If you can sketch out the respective Java and Python code first that would be great.<br>
<br>
Looks like your X3dJsonToStl goes through a transformLDNodesToTriangles() method which supports IndexedFaceSet, IndexedTriangleSet, IndexedTriangle, or IndexedTriangleFanSet?<br>
<br>
<br>
On 4/18/2020 4:20 PM, John Carlson wrote:<br>
> Here's the matrix of relevant code:<br>
> <br>
> <a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/convertJsonToStl.js" rel="noreferrer" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/convertJsonToStl.js</a><br>
> <a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/convertPlyToJson.js" rel="noreferrer" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/convertPlyToJson.js</a><br>
> <a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/convertStlToJson.js" rel="noreferrer" target="_blank">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/convertStlToJson.js</a><br>
> <br>
> Note that these run in browser, so no need for a docker image, jupyter, or complex setups.<br>
> <br>
> John<br>
> <br>
> On Sat, Apr 18, 2020 at 6:11 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a> <mailto:<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>>> wrote:<br>
> <br>
> Note that X3DJSONLD has a PLY-> X3D converter and would appreciate contributions of an X3D to PLY converter. Also advancement of the X3D -> STL converter would also be appreciated, in particular, the converter could use tessellation of faces plus additional X3D geometries.<br>
> <br>
> I have a web page @ <a href="http://coderextreme.net/X3DJSONLD" rel="noreferrer" target="_blank">coderextreme.net/X3DJSONLD</a> <<a href="http://coderextreme.net/X3DJSONLD" rel="noreferrer" target="_blank">http://coderextreme.net/X3DJSONLD</a>> which shows off capabilities.<br>
> <br>
> It’s not python.<br>
> <br>
> John<br>
> <br>
> On Fri, Apr 17, 2020 at 7:16 PM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a> <mailto:<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>>> wrote:<br>
> <br>
> Did somebody put together an x3d converter based on pythonocc ?<br>
> <br>
> Here is an example:<br>
> <br>
> <a href="https://senties-martinelli.com/software/cad-viewer" rel="noreferrer" target="_blank">https://senties-martinelli.com/software/cad-viewer</a><br>
> <br>
> It could convert step, stp, igs, iges, obj and stl formats. Format<br>
> import and export is only a small subset of pythonocc<br>
> (<a href="https://github.com/tpaviot/pythonocc-core" rel="noreferrer" target="_blank">https://github.com/tpaviot/pythonocc-core</a>) but I think just making<br>
> this functionality easy to use with a dedicated converter could be<br>
> really valuable.<br>
> <br>
> In the end, I think a web service just for conversion would be most useful.<br>
> <br>
> I played with the Jupyter notebook and could generate with only a few lines x3d.<br>
> <br>
> And there are ways to generate a standalone webapp from a notebook:<br>
> <a href="https://discourse.jupyter.org/t/how-to-transform-a-jupyter-notebook-into-a-webapp/758/6" rel="noreferrer" target="_blank">https://discourse.jupyter.org/t/how-to-transform-a-jupyter-notebook-into-a-webapp/758/6</a><br>
> <br>
> That could be quick way to offer a web service.<br>
> <br>
> Have there been attempts of this kind ? Would there be interest in a<br>
> open source github hosted project ?<br>
> <br>
> -Andreas<br>
> <br>
> -- <br>
> Andreas Plesch<br>
> Waltham, MA 02453<br>
> <br>
> _______________________________________________<br>
> x3d-public mailing list<br>
> <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a> <mailto:<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
> <br>
> <br>
> _______________________________________________<br>
> x3d-public mailing list<br>
> <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
> <br>
<br>
all the best, Don<br>
-- <br>
Don Brutzman Naval Postgraduate School, Code USW/Br <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149<br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" rel="noreferrer" target="_blank">http://faculty.nps.edu/brutzman</a><br>
</blockquote></div>