<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Monaco;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Here’s my current code for clearing the ECMAScript out of a X3D file so that it doesn’t show on the screen:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                       $(selector+" Script").contents().filter(function () {</p><p class=MsoNormal>                            return this.nodeType === 3 || this.nodeType === 4;</p><p class=MsoNormal>                       }).remove();</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This retains the fields.  I may change my code to work with fields instead of parsing out the fields into properties (but directOutput is nice).  This would mean that X3DOM has to route to and from the script fields (is this possible?).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Saturday, August 4, 2018 4:56 AM<br><b>To: </b><a href="mailto:vmarchetti@kshell.com">vmarchetti@kshell.com</a>; <a href="mailto:x3d-public@web3d.org">X3D-Public</a>; <a href="mailto:x3dom-users@lists.sourceforge.net">x3dom mlist</a>; <a href="mailto:andreasplesch@gmail.com">Andreas Plesch</a><br><b>Subject: </b>RE: [x3d-public] good example for ECMAScripting and Protos?</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have a problem with this file in X3DOM, because as far as I can tell, the SFNode fields (the node, not the field) do not have getFieldValue for point etc. as a function, for example (but one can double check me).  In other words, I don’t think this node is an X3DOM node.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thus I cannot take a reasonable length in the script.  One would have to parse the string.<o:p></o:p></p><p class=MsoNormal><br>That’s as clear as I can get.  I think this might be because x3dom does not process scripts correctly. We would need a script tag handler, and a field handler inside that.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Can you help Andreas?  I’ve created a script tag before, but that code is lost. It might be in my GitHub repository somewhere, not sure.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>We just need a script tag that has fields, but doesn’t execute its CDATA section.  I am pretty sure<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>How is V4.0 handling this?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Alternatively, I can change my nodeUtil code to look at the type and do the right thing converting a string to the correct type.   Suggestions are welcome.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for the great example, Vince,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Should I adapt my code to deal with this failing in X3DOM, or should we change X3DOM?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From: </b><a href="mailto:vmarchetti@kshell.com">vmarchetti@kshell.com</a><br><b>Sent: </b>Wednesday, August 1, 2018 9:04 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a>; <a href="mailto:x3d-public@web3d.org">X3D-Public</a><br><b>Subject: </b>Re: [x3d-public] good example for ECMAScripting and Protos?<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>See <o:p></o:p></p><p class=MsoNormal><a href="http://www.kshell.com/pages/pointcloudvisualization/SphereDirectedPointSet.x3d">http://www.kshell.com/pages/pointcloudvisualization/SphereDirectedPointSet.x3d</a><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>It is a X3D file with with a Prototype + ecmascript definition of a point cloud, with a vector attached to each point of the cloud.<o:p></o:p></p></div><div><p class=MsoNormal>Example used is just points randomly distributed on sphere with directs pointed radially outward.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Potential uses would be to implement the scanning design pattern at http://x3dgraphics.com/examples/X3dForAdvancedModeling/Scanning/X3dMeshDesignPatternIndex.html , or<o:p></o:p></p></div><div><p class=MsoNormal>visualizing fluid flow or  electromagnetic field<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>On Jul 31, 2018, at 10:30 PM, John Carlson <yottzumm@gmail.com> wrote:<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Is there a good example of ECMAScripting in X3D that I can use to test my X3D JSON ECMAScript preprocessor?  Preferably with Protos<span class=apple-converted-space> </span><o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal>Thanks!<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal>John<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Monaco",serif'>_______________________________________________<br>x3d-public mailing list<br></span><a href="mailto:x3d-public@web3d.org"><span style='font-size:9.0pt;font-family:"Monaco",serif;color:#954F72'>x3d-public@web3d.org</span></a><span style='font-size:9.0pt;font-family:"Monaco",serif'><br></span><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org"><span style='font-size:9.0pt;font-family:"Monaco",serif;color:#954F72'>http://web3d.org/mailman/listinfo/x3d-public_web3d.org</span></a><o:p></o:p></p></div></blockquote></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>