<div class="gmail_quote">---------- Forwarded message ----------<br>From: "John Carlson" <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>><br>Date: Feb 6, 2016 7:14 PM<br>Subject: Re: [x3d-public] Topics for Discussion at JSON meeting:SFNode/MFNode field/fieldValue content, ProtoBody, regexes<br>To: "Joe D Williams" <<a href="mailto:joedwil@earthlink.net">joedwil@earthlink.net</a>><br>Cc: <br><br type="attribution"><p dir="ltr">In the X3D JSON proto expander I had been replacing ProtoDeclare with Group in the instance (I believe i put a group around the contents of the protobody).  This will have to change I suspect.  I will try with the examples in this thread to come up with a good solution.  Since we are not roundtripping the Proto Expander, it will be difficult for me to validate that I have it right.  I will provide expanded JSON and we will have to hand validate the result.  Or someone like me can write test cases that we can hand validate.</p>
<div class="gmail_quote">On Feb 6, 2016 5:42 PM, "Joe D Williams" <<a href="mailto:joedwil@earthlink.net" target="_blank">joedwil@earthlink.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
only be one top level node in the ProtoBody?<br>
</blockquote>
<br>
What is a top-level node? I didn't understand the term.<br>
Isn't there some more X3D established name for this? root or child?<br>
<br>
<br>
The type of the first node defines where the proto can appear in a scene graph. The rest is just whatever it takes to complete the structure and provide the functionality.<br>
<br>
So, isn't is it that any field that has a DEF can be the first node in the proto and likewise any field that can have a DEF can be 'replaced' by an instance of a proto?<br>
<br>
>From HAnim#VRML V2.0 utf8 eMpTyWorlds V3.29.70<br>
<br>
PROTO Humanoid [<br>
exposedField    SFVec3f    center       0 0 0<br>
exposedField    MFNode     humanoidBody          [ ]<br>
exposedField    MFString   info         [ ]<br>
exposedField    MFNode     joints       [ ]<br>
exposedField    SFString   name         ""<br>
exposedField    SFRotation rotation     0 0 1 0<br>
exposedField    SFVec3f    scale        1 1 1<br>
exposedField    SFRotation scaleOrientation      0 0 1 0<br>
exposedField    MFNode     segments     [ ]<br>
exposedField    MFNode     sites        [ ]<br>
exposedField    SFVec3f    translation           0 0 0<br>
exposedField    SFString   version      "200x"<br>
exposedField    MFNode     viewpoints            [ ]<br>
field           SFVec3f    bboxCenter            0 0 0<br>
field           SFVec3f    bboxSize     -1 -1 -1<br>
]<br>
{<br>
Transform {<br>
 center           IS center<br>
 rotation         IS rotation<br>
 scale            IS scale<br>
 scaleOrientation IS scaleOrientation<br>
 translation      IS translation<br>
 children [<br>
  Group {<br>
   children IS humanoidBody<br>
  }<br>
  Group {<br>
   children IS viewpoints<br>
  }<br>
 ]<br>
}<br>
}<br>
Thanks,<br>
Joe<br>
<br>
<br>
<br>
<br>
<br>
----- Original Message ----- From: "Roy Walmsley" <<a href="mailto:roy.walmsley@ntlworld.com" target="_blank">roy.walmsley@ntlworld.com</a>><br>
To: "'Don Brutzman'" <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>><br>
Cc: <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
Sent: Saturday, February 06, 2016 10:27 AM<br>
Subject: Re: [x3d-public] Topics for Discussion at JSON meeting:SFNode/MFNode field/fieldValue content, ProtoBody, regexes<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Don,<br>
<br>
Once again thanks for your further deep considerations and insightful comments.<br>
<br>
When you complete this full set of changes and regenerate all the JSON encodings of the archive examples I will ask John to retest with my schema.<br>
<br>
Until then, I'll just keep adding full node definitions to the Schema. I completed all nodes beginning with 'G' today.<br>
<br>
So, going back to the ProtoBody, and the fact that only the first node is used, do we want to consider specifying that there should only be one top level node in the ProtoBody? Yes, there could be other statements, such as ROUTEs, IMPORT's, etc. and comments. But no point in having, for example, a Script node at the top level and not first node. It will simply be ignored.<br>
<br>
Not sure if I can find a way to validate only the first node. I can't guarantee it will be the first item at the top level. There could be comments or IMPORTs. The easier option is to validate all top level items.  I'll give the matter some thought, though.<br>
<br>
Regards,<br>
<br>
Roy<br>
<br>
-----Original Message-----<br>
From: Don Brutzman [mailto:<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>]<br>
Sent: 06 February 2016 18:04<br>
To: Roy Walmsley<br>
Cc: <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>; 'John Carlson'<br>
Subject: Re: [x3d-public] Topics for Discussion at JSON meeting: SFNode/MFNode field/fieldValue content, ProtoBody, regexes<br>
<br>
On 2/6/2016 2:39 AM, Roy Walmsley wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Don,<br>
<br>
Thanks for your in-depth considerations.<br>
</blockquote>
<br>
Likewise thank you Roy.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The only one I would like to comment further on is that regarding nodes in ProtoBody.  This is my topic 3).<br>
<br>
I can see your argument, and, in some ways, agree. However, how would that be validated? I have a ProtoBody element, to which I need to assign properties. What properties should I assign. Using your method I would have to assign every possible containerField name, and assign the nodes that can go there. Another disadvantage is that comments would be confined to the -children property, losing some of the ability to be located with most of the nodes they refer to.<br>
<br>
Using a single -children field means it is the only property I have to assign. Yes, I have to add every concrete node as a possible child. It also has the advantage that comments can be interspersed.<br>
</blockquote>
<br>
Regarding comments: yes agreed, and as with other X3D encodings, a prototype engine needs to skip over any comments that appear before the first ProtoBody node.<br>
<br>
Creating a prototype that acts solely as a comment is not an allowed design option.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
At the moment there is no easy way to validate that a ProtoInstance is being used in the correct place. Validation would need to be able to find the first child of the relevant ProtoBody and check that it could be used in the field that calls up the ProtoInstance.<br>
<br>
Let's take a small example excerpt. It's not meant to be meaningful, only illustrative of principles.<br>
<br>
<ProtoDeclare><br>
   <ProtoInterface/><br>
   <ProtoBody><br>
     <MetadataBoolean/><br>
   </ProtoBody><br>
</ProtoDeclare><br>
....<br>
<MetadataSet><br>
     <ProtoInstance name="myProto" containerField="value"/><br>
</MetadataSet> ....<br>
<MetadataSet><br>
     <ProtoInstance name="myProto" containerField="metadata"/><br>
</MetadataSet><br>
<br>
How would the JSON encoding handle the ProtoBody? Will you assign it to a  -metadata or a -value field?<br>
</blockquote>
<br>
For a terse element like <MetadataBoolean/> the default containerField value (provided during parsing by the X3D Schema or X3D DTD) is what would be assigned.  In this case, default containerField="metadata" for the Metadata* nodes.<br>
<br>
So, in the current JSON encoding that is deployed, the JSON version of your ProtoDeclare above would use "-metadata" as the key.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The JSON encoding of the MetadataSet and the ProtoInstance would correctly assign the ProtoInstance to the appropriate field in each case. So there is no loss of information if the ProtoBody assigns the MetadataBoolean to a generic -children field.<br>
</blockquote>
<br>
Aha.  Really critical point, indeed the crux of the matter.  What specifically needs to not get lost is the node type of the first node.  Hmmm.<br>
<br>
I've been thinking that if we indeed want to move that initial node in the current JSON encoding, by putting the initial node at the top of the "-children" field, then (instead of containerField) a different way to identify the node-type information may be needed.<br>
<br>
That now seems overcautious though... the node type isn't indicated by containerField, the node type is actually indicated by the node name.<br>
<br>
Hmmm.... let's press on a bit further as you suggest.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Now, consider a variation.<br>
<br>
<ProtoDeclare><br>
   <ProtoInterface/><br>
   <ProtoBody><br>
     <MetadataBoolean/><br>
     <MetadataBoolean/><br>
   </ProtoBody><br>
</ProtoDeclare><br>
<br>
Now, how would you encode the ProtoBody? According to the strict wording of the specification is It illegal to use this prototype in a -metadata field? The first node is still legal! So the wording of the specification is probably insufficient.<br>
<br>
Has that muddied the waters?<br>
</blockquote>
<br>
Well, for sake of discussion, let's call the second MetadataBoolean a MetadataDouble instead.  Slightly less muddy:<br>
<br>
<ProtoDeclare><br>
  <ProtoInterface/><br>
  <ProtoBody><br>
    <MetadataBoolean/><br>
    <MetadataDouble/><br>
  </ProtoBody><br>
</ProtoDeclare><br>
<br>
Using this prototype as an instance would put the MetadataBoolean as an active node in the scene graph, while the MetadataDouble would be just hanging "alongside" it in the scene graph, rather than within the scene graph per se...  Indeed any other nodes could also appear alongside, these are not rendered or traversed, and simply sit over on the side unless activated somehow by the first node.<br>
<br>
Elaborating this notion of "straphanger" nodes along for the ride... From spec, as before:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
7.2.5.8 PROTO statement<br>
<a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/comp" rel="noreferrer" target="_blank">http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/comp</a><br>
onents/core.html#PROTOStatement<br>
(last paragraph)<br>
"The <protoDefinition> consists of a list of nodes the first of which is used to specify the node type for the prototype. This list may instantiate other prototypes provided that the definitions of the referenced prototypes precede this PROTO statement. See 4.4.4.3 PROTO definition semantics for details."<br>
</blockquote>
<br>
That first specification sentence above puts no restrictions on what the other nodes in the list might be.<br>
<br>
btw putting a comma somewhere in that sentence couldn't hurt... Dick do you need a full feedback report + Mantis issue + teleconference agenda item to add that comma?  :0<br>
<br>
Anyway, if we continue as spec suggests, we see that the lack of restrictions on those nodes is indeed intentional:<br>
<br>
==================================<br>
4.4.4.3 PROTO definition semantics<br>
<br>
A prototype definition consists of one or more nodes, nested PROTO statements, and ROUTE statements. The first node type determines how instantiations of the prototype can be used in an X3D file. An instantiation is created by filling in the parameters of the prototype declaration and inserting copies of the first node (and its scene graph) wherever the prototype instantiation occurs.<br>
<br>
EXAMPLE  If the first node in the prototype definition is a Material node, instantiations of the prototype can be used wherever a Material node can be used. Any other nodes and accompanying scene graphs are not part of the transformation hierarchy, but may be referenced by ROUTE statements or Script nodes in the prototype definition.<br>
==================================<br>
<br>
So this allows a prototype author to carry around as many invisible baggage nodes as they want, stashed at the top of the ProtoBody after the first node.  It also means that we do not validate the nodes appearing at the top level within a ProtoBody, since any nodes can appear in that list of nodes without constraint.<br>
<br>
If that first node has contained content, it must be a valid scene subgraph.  Otherwise it can't be validly plugged in elsewhere in the scene as a ProtoInstance.<br>
<br>
In practice, that validation-free-zone (at the top level of the ProtoBody) is a very good place to put Scripts, ROUTEs, and nodes with IS/connect that can hold ProtoInterface field initialization values.<br>
<br>
Illustrative examples:<br>
<br>
<ProtoDeclare name="invalid"><br>
  <ProtoInterface/><br>
  <ProtoBody><br>
    <MetadataBoolean><br>
      <-- contained nodes are strictly validated, so the following nodes fail inside a MetadataBoolean --><br>
      <Script/><br>
      <ROUTE/><br>
      <ROUTE/><br>
    </MetadataBoolean><br>
  </ProtoBody><br>
</ProtoDeclare><br>
<br>
<ProtoDeclare name="valid"><br>
  <ProtoInterface/><br>
  <ProtoBody><br>
    <MetadataBoolean/><br>
    <-- follow-on sibling nodes are not strictly validated at top level, though their children will be --><br>
    <Script/><br>
    <ROUTE/><br>
    <ROUTE/><br>
    <WorldInfo><br>
      <IS><br>
        <connect/><br>
      </IS><br>
    </WorldInfo><br>
  </ProtoBody><br>
</ProtoDeclare><br>
<br>
Hope that is all sensible. The abstract spec does seem pretty well specified on this point.<br>
<br>
At first the looseness of the ProtoBody top-level node list does appear unfamiliar to many authors, since we are stridently strict about scene-graph structure just about everywhere else.  We further remain strict within any of the individual nodes appearing in this list.<br>
<br>
... OK back to the point at hand for the JSON encoding.  Can we put the first ProtoBody node at the top of the "-children" field, without loss of necessary information?<br>
<br>
I'm now convinced that you are indeed correct.  It is the node name for the first ProtoBody node (e.g. "MetadataBoolean"), and not the containerField, that determines the node type of the ProtoDeclare being created (and corresponding ProtoInstance being instantiated in the scene graph).<br>
<br>
So yes let's move that first node into the "-children" array in the JSON encoding.<br>
<br>
Absent other considerations on this issue, I will work to implement and deploy this change in X3dToJson.xslt and the X3D Examples Archives.<br>
<br>
Again thanks for sustained scrutiny... these certainly can get deep at times!  This is the kind of diligence that makes X3D scenes and X3D players reliable.<br>
<br>
p.s. status update: yesterday's change fixing the "-value" key for JSON encoding of contained SFNode/MFNode content in field/fieldValue tags is complete, fully deployed, and ready for testing.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-----Original Message-----<br>
From: Don Brutzman [mailto:<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>]<br>
Sent: 06 February 2016 03:04<br>
To: Roy Walmsley; John Carlson<br>
Cc: <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
Subject: Re: [x3d-public] Topics for Discussion at JSON meeting:<br>
SFNode/MFNode field/fieldValue content, ProtoBody, regexes<br>
<br>
Summary: Once again the X3D JSON design is looking pretty solid, and our tool suites are pretty powerful at detecting edge-case issues.<br>
<br>
On 2/5/2016 10:37 AM, Don Brutzman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[correction: shifted to x3d-public]<br>
[...]<br>
On 2/4/2016 10:56 AM, Roy Walmsley wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Topics for Discussion for JSON encoding meeting February 5^th 2016 at 1000 PST, 1800 GMT.<br>
<br>
1) *Review of progress on JSON Schema development and validation<br>
testing on example archive.*<br>
</blockquote></blockquote>
<br>
As the screen shot only began to indicate, this is really rocking! as<br>
discussed it will be great to<br>
- autogenerate the X3D JSON Schema from the X3D Object Model<br>
- include it as informative annex in future spec<br>
- Document the various validation features possible/supported<br>
- Generate X3D JSON Schema documentation using XML Spy (feature<br>
request submitted to Altova) or another tool<br>
<br>
It was also totally impressive to see that John is applying X3D JSON with other JavaScript libraries to good effect.<br>
<br>
Tweet:<br>
"d3 layout orbit x3d" by John Carlson visualizes multiple example scenes using new #X3D JSON encoding<br>
<a href="https://twitter.com/Web3DConsortium/status/695687691308896256" rel="noreferrer" target="_blank">https://twitter.com/Web3DConsortium/status/695687691308896256</a><br>
<a href="https://www.youtube.com/watch?v=p0fMd92mu5s" rel="noreferrer" target="_blank">https://www.youtube.com/watch?v=p0fMd92mu5s</a><br>
Data-Driven Documents  @d3js_org  <a href="https://d3js.org" rel="noreferrer" target="_blank">https://d3js.org</a><br>
<br>
Great visualization!<br>
<br>
Presumably the availability of an X3D JSON Schema will not only improve scene quality but further simplify the reliable integration of X3D into a variety of JavaScript frameworks.<br>
<br>
uh... "X3D Anywhere" anybody?!<br>
<br>
Further deep-dive issues follow.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) *Encoding of node fields in ‘field’ and ‘fieldValue’ elements<br>
within Script and Prototypes.*<br>
</blockquote></blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[...snip/shuffle...]<br>
Illustration of 2) above is in X3D Example Archives: Basic, CAD, Cad<br>
Geometry Extern Prototypes (see<br>
<a href="http://www.web3d.org/x3d/content/examples/Basic/CAD/_pages/page02.ht" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/content/examples/Basic/CAD/_pages/page02.ht</a><br>
m<br>
l)<br>
<br>
Find the ProtoInstance named ‘IndexedQuadSet’. It has two fieldValue children. The second has the name ‘coord’, and a child Coordinate node. When converted into JSON this Coordinate node is allocated to a field /-coord/, which is the default containerField name for this node. This is incorrect. It should be allocated to the /-value/ field. This is because the element fieldValue has attributes of ‘name’ and ‘value’.<br>
<br>
A similar issue arises with default values for node fields within the field element.<br>
</blockquote></blockquote>
<br>
OK this change is worth close scrutiny to avoid confusion later.<br>
<br>
For <field> and <fieldValue>, when the "@value" attribute is used for simple types, everything works OK.<br>
<br>
For <field> and <fieldValue>, with contained SFNode/MFNode content or contained comments or contained ROUTEs, the key is now "-value" (hyphen instead of ampersand).<br>
<br>
I have applied this correction to field/fieldValue SFNode/MFNode handling in X3dToJson.xslt conversion stylesheet and will deploy updates to the example archives.<br>
<br>
Example excerpts follow, check out the differences for ("index","@value") and ("coord","-value") below:<br>
<br>
<a href="http://www.web3d.org/x3d/content/examples/Basic/CAD/CadGeometryExternP" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/content/examples/Basic/CAD/CadGeometryExternP</a><br>
rototypes.x3d<br>
<a href="http://www.web3d.org/x3d/content/examples/Basic/CAD/CadGeometryExternP" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/content/examples/Basic/CAD/CadGeometryExternP</a><br>
rototypes.json (copy attached)<br>
=========================================<br>
<ProtoInstance containerField='geometry' name='IndexedQuadSet'><br>
    <fieldValue name='index' value='0 3 2 1 4 5 6 7 2 7 9 8 2 3 4 7'/><br>
    <fieldValue name='coord'><br>
      <Coordinate point='-1.5 0 0 -1.5 1 -1 -.5 1 -1 -.5 0 0 0.5 0 0 1.5 0 0 1.5 1 -1 0.5 1 -1 -0.5 2 -1 0.5 2 -1'/><br>
    </fieldValue><br>
</ProtoInstance><br>
=========================================<br>
{ "ProtoInstance":<br>
    {<br>
"@name":"IndexedQuadSet",<br>
"fieldValue": [<br>
  {<br>
"@name":"index",<br>
"@value":[0,3,2,1,4,5,6,7,2,7,9,8,2,3,4,7]<br>
  },<br>
  {<br>
"@name":"coord",<br>
"-value":[<br>
  { "Coordinate":<br>
{<br>
<br>
"@point":[-1.5,0,0,-1.5,1,-1,-0.5,1,-1,-0.5,0,0,0.5,0,0,1.5,0,0,1.5,1,-1,0.5,1,-1,-0.5,2,-1,0.5,2,-1]<br>
}<br>
  }<br>
]<br>
  }<br>
]<br>
    }<br>
}<br>
=========================================<br>
<br>
Next issue:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3) *Encoding of node children in ProtoBody*<br>
</blockquote></blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[...snip/shuffle...]<br>
Taking 3) above: ProtoBody can take any nodes as children. The current converter assigns them to a field named as per the default containerField. I propose that all nodes, irrespective of type, be added to a /-children/ field.<br>
</blockquote></blockquote>
<br>
Let's think this one through a bit more, please.<br>
<br>
The first node in a ProtoBody has special significance, it indicates the node type of the prototype being declared.  This language feature lets X3D authors define a prototype alternative for any node in X3D - a huge extensibility feature.  From the spec:<br>
<br>
7.2.5.8 PROTO statement<br>
<a href="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/comp" rel="noreferrer" target="_blank">http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/comp</a><br>
onents/core.html#PROTOStatement<br>
(last paragraph)<br>
"The <protoDefinition> consists of a list of nodes the first of which is used to specify the node type for the prototype. This list may instantiate other prototypes provided that the definitions of the referenced prototypes precede this PROTO statement. See 4.4.4.3 PROTO definition semantics for details."<br>
<br>
Of note is that this is the only place in the scene graph where nodes with dissimilar node types can be side by side as peers.<br>
<br>
In the XML encoding, the node type for the first ProtoBody child is defined by it's default (or overridden) containerField value.<br>
<br>
In the current JSON encoding, the first node is similarly exposed, and the type is the key.  For example ProtoBody "-geometry" in JSON encoding example below.  Subsequent nodes/ROUTEs/comments all fall under the "-children" key.<br>
<br>
I've provided abridged (but otherwise unmodified) source excerpts for the examples we discussed during today's teleconference.<br>
<br>
[Emotional warning: this pair of examples are wonderfully or horribly<br>
detailed, depending on your linguistic rheostat.  Our 3D imaginations<br>
are even bigger than the current Web, so here we go...]<br>
<br>
Excerpts follow.<br>
<a href="http://www.web3d.org/x3d/content/examples/Basic/CAD/CadGeometryPrototy" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/content/examples/Basic/CAD/CadGeometryPrototy</a><br>
pes.x3d<br>
<a href="http://www.web3d.org/x3d/content/examples/Basic/CAD/CadGeometryPrototy" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/content/examples/Basic/CAD/CadGeometryPrototy</a><br>
pes.json (copy attached) =========================================<br>
<ProtoDeclare appinfo='The IndexedQuadSet node represents a 3D shape composed of a collection of individual quadrilaterals (quads). IndexedQuadSet uses the indices in its index field to specify the vertices of each quad from the coord field. Each quad is formed from a set of four vertices of the Coordinate node identified by four consecutive indices from the index field If the index field does not contain a multiple of four coordinate values the remaining vertices shall be ignored.' documentation='<a href="http://www.web3d.org/x3d/specifications/ISO-IEC-19775-Amendment1-PDAM-X3DAbstractSpecification/Part01/components/CADGeometry.html#IndexedQuadSet" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/specifications/ISO-IEC-19775-Amendment1-PDAM-X3DAbstractSpecification/Part01/components/CADGeometry.html#IndexedQuadSet</a>' name='IndexedQuadSet'><br>
    <ProtoInterface><br>
<field accessType='inputOnly' appinfo='range [0..∞) or -1' name='set_index' type='MFInt32'><br>
  <!-- No specific initialization value --><br>
</field><br>
<field accessType='inputOutput' appinfo='[X3DVertexAttributeNode]' name='attrib' type='MFNode'><br>
  <!-- Specification initialization: NULL node --><br>
</field><br>
<field accessType='inputOutput' appinfo='[X3DColorNode]' name='color' type='SFNode'><br>
  <!-- Specification initialization: NULL node --><br>
</field><br>
<field accessType='inputOutput' appinfo='[X3DCoordinateNode]' name='coord' type='SFNode'><br>
  <!-- Specification initialization: NULL node --><br>
</field><br>
<field accessType='inputOutput' appinfo='[FogCoordinate]' name='fogCoord' type='SFNode'><br>
  <!-- Specification initialization: NULL node --><br>
</field><br>
<field accessType='inputOutput' appinfo='[X3DNormalNode]' name='normal' type='SFNode'><br>
  <!-- Specification initialization: NULL node --><br>
</field><br>
<field accessType='inputOutput' appinfo='[X3DTextureCoordinateNode]' name='texCoord' type='SFNode'><br>
  <!-- Specification initialization: NULL node --><br>
</field><br>
<field accessType='initializeOnly' name='ccw' type='SFBool' value='true'/><br>
<field accessType='initializeOnly' appinfo='colorPerVertex ignored in IndexedQuadSet, and always treated as true' name='colorPerVertex' type='SFBool' value='true'/><br>
<field accessType='initializeOnly' name='normalPerVertex' type='SFBool' value='true'/><br>
<field accessType='initializeOnly' name='solid' type='SFBool' value='true'/><br>
<field accessType='initializeOnly' appinfo='range [0..∞) or -1' name='index' type='MFInt32'><br>
  <!-- No specific initialization value --><br>
</field><br>
<field accessType='inputOutput' appinfo='[X3DMetadataObject]' name='metadata' type='SFNode'><br>
  <!-- Specification initialization: NULL node --><br>
</field><br>
    </ProtoInterface><br>
    <ProtoBody><br>
<IndexedFaceSet DEF='RenderedIQS'><br>
  <IS><br>
<connect nodeField='attrib' protoField='attrib'/><br>
<connect nodeField='color' protoField='color'/><br>
<connect nodeField='colorPerVertex' protoField='colorPerVertex'/><br>
<connect nodeField='coord' protoField='coord'/><br>
<connect nodeField='fogCoord' protoField='fogCoord'/><br>
<connect nodeField='normal' protoField='normal'/><br>
<connect nodeField='texCoord' protoField='texCoord'/><br>
<connect nodeField='ccw' protoField='ccw'/><br>
<connect nodeField='normalPerVertex' protoField='normalPerVertex'/><br>
<connect nodeField='solid' protoField='solid'/><br>
  </IS><br>
</IndexedFaceSet><br>
<!-- Initial node in the PROTO body is actual node type, and the only node rendered. Remaining ProtoBody nodes not rendered --><br>
<Group DEF='UnrenderedIQS'><br>
  <Script DEF='IndexedQuadSetToIndexedFaceSet' directOutput='true'><br>
<field accessType='initializeOnly' name='index' type='MFInt32'/><br>
<field accessType='inputOnly' name='set_index' type='MFInt32'/><br>
<field accessType='initializeOnly' name='renderedIQS' type='SFNode'><br>
  <IndexedFaceSet USE='RenderedIQS'/><br>
</field><br>
<field accessType='initializeOnly' name='localTraceEnabled' type='SFBool' value='true'/><br>
<field accessType='initializeOnly' name='coordIndexNew' type='MFInt32'><br>
  <!-- constructed during initialization --><br>
</field><br>
<IS><br>
  <connect nodeField='index' protoField='index'/><br>
  <connect nodeField='set_index' protoField='set_index'/><br>
</IS><br>
<![CDATA[<br>
ecmascript:<br>
// [...abridged...]<br>
]]><br>
  </Script><br>
  <Group><br>
<MetadataString name='metadataHolder'><br>
  <IS><br>
<connect nodeField='metadata' protoField='metadata'/><br>
  </IS><br>
</MetadataString><br>
  </Group><br>
</Group><br>
    </ProtoBody><br>
</ProtoDeclare><br>
=========================================<br>
{ "ProtoDeclare":<br>
    {<br>
"@name":"IndexedQuadSet",<br>
"@appinfo":"The IndexedQuadSet node represents a 3D shape composed of a collection of individual quadrilaterals (quads). IndexedQuadSet uses the indices in its index field to specify the vertices of each quad from the coord field. Each quad is formed from a set of four vertices of the Coordinate node identified by four consecutive indices from the index field If the index field does not contain a multiple of four coordinate values the remaining vertices shall be ignored.",<br>
"@documentation":"<a href="http://www.web3d.org/x3d/specifications/ISO-IEC-19775-Amendment1-PDAM-X3DAbstractSpecification/Part01/components/CADGeometry.html#IndexedQuadSet" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/specifications/ISO-IEC-19775-Amendment1-PDAM-X3DAbstractSpecification/Part01/components/CADGeometry.html#IndexedQuadSet</a>",<br>
"ProtoInterface": {<br>
"field": [<br>
  {<br>
"@name":"set_index",<br>
"@accessType":"inputOnly",<br>
"@appinfo":"range [0..∞) or -1",<br>
"@type":"MFInt32",<br>
"-children":[<br>
  { "#comment":"No specific initialization value"<br>
  }<br>
]<br>
  },<br>
  {<br>
"@name":"attrib",<br>
"@accessType":"inputOutput",<br>
"@appinfo":"[X3DVertexAttributeNode]",<br>
"@type":"MFNode",<br>
"-children":[<br>
  { "#comment":"Specification initialization: NULL node"<br>
  }<br>
]<br>
  },<br>
  {<br>
"@name":"color",<br>
"@accessType":"inputOutput",<br>
"@appinfo":"[X3DColorNode]",<br>
"@type":"SFNode",<br>
"-children":[<br>
  { "#comment":"Specification initialization: NULL node"<br>
  }<br>
]<br>
  },<br>
  {<br>
"@name":"coord",<br>
"@accessType":"inputOutput",<br>
"@appinfo":"[X3DCoordinateNode]",<br>
"@type":"SFNode",<br>
"-children":[<br>
  { "#comment":"Specification initialization: NULL node"<br>
  }<br>
]<br>
  },<br>
  {<br>
"@name":"fogCoord",<br>
"@accessType":"inputOutput",<br>
"@appinfo":"[FogCoordinate]",<br>
"@type":"SFNode",<br>
"-children":[<br>
  { "#comment":"Specification initialization: NULL node"<br>
  }<br>
]<br>
  },<br>
  {<br>
"@name":"normal",<br>
"@accessType":"inputOutput",<br>
"@appinfo":"[X3DNormalNode]",<br>
"@type":"SFNode",<br>
"-children":[<br>
  { "#comment":"Specification initialization: NULL node"<br>
  }<br>
]<br>
  },<br>
  {<br>
"@name":"texCoord",<br>
"@accessType":"inputOutput",<br>
"@appinfo":"[X3DTextureCoordinateNode]",<br>
"@type":"SFNode",<br>
"-children":[<br>
  { "#comment":"Specification initialization: NULL node"<br>
  }<br>
]<br>
  },<br>
  {<br>
"@name":"ccw",<br>
"@accessType":"initializeOnly",<br>
"@type":"SFBool",<br>
"@value":true<br>
  },<br>
  {<br>
"@name":"colorPerVertex",<br>
"@accessType":"initializeOnly",<br>
"@appinfo":"colorPerVertex ignored in IndexedQuadSet, and always treated as true",<br>
"@type":"SFBool",<br>
"@value":true<br>
  },<br>
  {<br>
"@name":"normalPerVertex",<br>
"@accessType":"initializeOnly",<br>
"@type":"SFBool",<br>
"@value":true<br>
  },<br>
  {<br>
"@name":"solid",<br>
"@accessType":"initializeOnly",<br>
"@type":"SFBool",<br>
"@value":true<br>
  },<br>
  {<br>
"@name":"index",<br>
"@accessType":"initializeOnly",<br>
"@appinfo":"range [0..∞) or -1",<br>
"@type":"MFInt32",<br>
"-children":[<br>
  { "#comment":"No specific initialization value"<br>
  }<br>
]<br>
  },<br>
  {<br>
"@name":"metadata",<br>
"@accessType":"inputOutput",<br>
"@appinfo":"[X3DMetadataObject]",<br>
"@type":"SFNode",<br>
"-children":[<br>
  { "#comment":"Specification initialization: NULL node"<br>
  }<br>
]<br>
  }<br>
]<br>
},<br>
"ProtoBody": {<br>
"-geometry":[<br>
  { "IndexedFaceSet":<br>
{<br>
  "@DEF":"RenderedIQS",<br>
  "IS": {<br>
  "connect": [<br>
{<br>
  "@nodeField":"attrib",<br>
  "@protoField":"attrib"<br>
},<br>
{<br>
  "@nodeField":"color",<br>
  "@protoField":"color"<br>
},<br>
{<br>
  "@nodeField":"colorPerVertex",<br>
  "@protoField":"colorPerVertex"<br>
},<br>
{<br>
  "@nodeField":"coord",<br>
  "@protoField":"coord"<br>
},<br>
{<br>
  "@nodeField":"fogCoord",<br>
  "@protoField":"fogCoord"<br>
},<br>
{<br>
  "@nodeField":"normal",<br>
  "@protoField":"normal"<br>
},<br>
{<br>
  "@nodeField":"texCoord",<br>
  "@protoField":"texCoord"<br>
},<br>
{<br>
  "@nodeField":"ccw",<br>
  "@protoField":"ccw"<br>
},<br>
{<br>
  "@nodeField":"normalPerVertex",<br>
  "@protoField":"normalPerVertex"<br>
},<br>
{<br>
  "@nodeField":"solid",<br>
  "@protoField":"solid"<br>
}<br>
  ]<br>
  }<br>
}<br>
  }<br>
],<br>
"-children":[<br>
  { "#comment":"Initial node in the PROTO body is actual node type, and the only node rendered. Remaining ProtoBody nodes not rendered"<br>
  },<br>
  { "Group":<br>
{<br>
  "@DEF":"UnrenderedIQS",<br>
  "-children":[<br>
{ "Script":<br>
  {<br>
"@DEF":"IndexedQuadSetToIndexedFaceSet",<br>
"@directOutput":true,<br>
"field": [<br>
  {<br>
"@name":"index",<br>
"@accessType":"initializeOnly",<br>
"@type":"MFInt32"<br>
  },<br>
  {<br>
"@name":"set_index",<br>
"@accessType":"inputOnly",<br>
"@type":"MFInt32"<br>
  },<br>
  {<br>
"@name":"renderedIQS",<br>
"@accessType":"initializeOnly",<br>
"@type":"SFNode",<br>
"-value":[<br>
  { "IndexedFaceSet":<br>
{<br>
  "@USE":"RenderedIQS"<br>
}<br>
  }<br>
]<br>
  },<br>
  {<br>
"@name":"localTraceEnabled",<br>
"@accessType":"initializeOnly",<br>
"@type":"SFBool",<br>
"@value":true<br>
  },<br>
  {<br>
"@name":"coordIndexNew",<br>
"@accessType":"initializeOnly",<br>
"@type":"MFInt32",<br>
"-children":[<br>
  { "#comment":"constructed during initialization"<br>
  }<br>
]<br>
  }<br>
],<br>
"IS": {<br>
"connect": [<br>
  {<br>
"@nodeField":"index",<br>
"@protoField":"index"<br>
  },<br>
  {<br>
"@nodeField":"set_index",<br>
"@protoField":"set_index"<br>
  }<br>
]<br>
},<br>
"#sourceText":[ "ecmascript:","[...abridged...]" ]<br>
  }<br>
},<br>
{ "Group":<br>
  {<br>
"-metadata":[<br>
  { "MetadataString":<br>
{<br>
  "@name":"metadataHolder",<br>
  "IS": {<br>
  "connect": [<br>
{<br>
  "@nodeField":"metadata",<br>
  "@protoField":"metadata"<br>
}<br>
  ]<br>
  }<br>
}<br>
  }<br>
]<br>
  }<br>
}<br>
  ]<br>
}<br>
  }<br>
]<br>
}<br>
    }<br>
},<br>
=========================================<br>
<br>
Assessment: syntax for these ProtoDeclare encodings are already closely aligned with each other, and express the semantics of the specification accurately.<br>
<br>
Recommendation: no change, enjoy!  8)<br>
<br>
YMMV, further insights and improvements welcome.  Please advise.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
4) *Encoding of single value for an MFxxxxx field (non-node) - array<br>
or single value*<br>
</blockquote></blockquote>
<br>
As discussed, in previous emails and on today's call:<br>
- strict typing of arrays has expressive power and matches the object-oriented nature of JSON.<br>
- creation of an X3D JSON Schema has the expressive power to isolate problems and enforce correct typing.<br>
- The appropriate rules exist already within X3dToJson.xslt conversion stylesheet.<br>
<br>
So at this point, I simply have to go through the invalid JSON scenes identified by John's JSON validation suite and fix either offending .x3d content or incorrect translation details inside the stylesheet.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
5) *Validation of /url/ fields.*<br>
</blockquote></blockquote>
<br>
We discussed how JSON/javascript diagnostics (probably regex i.e. regular expression based) are hiccuping on the multiple url entries in X3D url MFString arrays, especially when # character is included in each ProtoDeclare url.<br>
<br>
These are legal constructs for X3D.<br>
<br>
Future work: when we finish current X3D XML Schema, X3D Object Model and X3D JSON work, we will return to the X3D Regular Expressions effort and document correctly working regexes for X3D urls.<br>
<br>
Skeleton page is at<br>
<a href="http://www.web3d.org/specifications/X3dRegularExpressions.html" rel="noreferrer" target="_blank">http://www.web3d.org/specifications/X3dRegularExpressions.html</a><br>
<br>
Meanwhile: continuing bugfix attention to any invalid url content detected in the X3D Examples Archives.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
6)The numeric value -0.<br>
</blockquote></blockquote>
<br>
Further investigation in next message.  This topic might seem pedantic (ok ok it is very pedantic) but it is important to get right from a specification perspective.<br>
<br>
Summary.  Once again the X3D JSON design is looking pretty solid, and our tool suites are pretty powerful at detecting edge-case issues.<br>
<br>
Thanks again for steady sustained progress. Have fun with X3D JSON!<br>
</blockquote>
<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 <a href="tel:%2B1.831.656.2149" value="+18316562149" target="_blank">+1.831.656.2149</a><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>
<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>
</blockquote>
<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>
</blockquote></div>
</div>