X3D Model Documentation: ArchPrototype.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
  3  <X3D profile='Immersive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <meta name='titlecontent='ArchPrototype.x3d'/>
  6            <meta name='descriptioncontent='Create an arch. Can modify general parameters: clearSpanWidth, riseHeight, depth, topAbutmentHeight, pierWidth, pierHeight. See the reference file ArchModelingDiagrams.pdf to find further information. See also ArchPrototypeScript_more_readable.js. Possibility to create shapes related to arch: ArchHalf; IntradosOnly; ArchFilled; ArchHalfFilled; Lintel. See the reference file ArchModelingDiagrams.pdf to find further information.'/>
  7            <meta name='creatorcontent='Michele Foti, Don Brutzman'/>
  8            <meta name='createdcontent='15 December 2014'/>
  9            <meta name='modifiedcontent='16 June 2020'/>
 10            <meta name=' TODO content=' debug local ProtoInstance '/>
 11            <meta name=' TODO content=' add test ArchPrototypeExample '/>
 12            <meta name=' TODO content=' Xj3D Player Issue, bogus error on line 243 of script regarding assignment to MFInt32 value '/>
 13            <meta name='referencecontent='ArchModelingDiagrams.pdf'/>
 14            <meta name='referencecontent='https://en.wikipedia.org/wiki/Arch'/>
 15            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/Buildings/ArchPrototype.x3d'/>
 16            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 17            <meta name='licensecontent='../license.html'/>
 18       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Arch, ArchChord, ArchIndex, ArchInstance, ArchPrototypeScript, ArchTransform, CoordinateAxes, MaterialNode

Index for ProtoDeclare definition: ArchPrototype
-->
 19       <Scene>
 20            <WorldInfo title='ArchPrototype.x3d'/>
 21            <ProtoDeclare name='ArchPrototypeappinfo='Create an arch. Can modify general parameters: clearSpanWidth, riseHeight, depth, topAbutmentHeight, pierWidth, pierHeight. - Possibility to create shapes related to an arch: ArchHalf; IntradosOnly; ArchFilled; ArchHalfFilled; Lintel. See the reference file ArchModelingDiagrams.pdf to find further information. See also ArchPrototypeScript_more_readable.js.js.'>
 22                 <ProtoInterface>
 23                      <!-- COLOR OF ARCH -->
 24                      <field name='diffuseColortype='SFColorvalue='0.2 0.8 0.8accessType='inputOutput'
                     appinfo='color of arch'/>
 25                      <field name='emissiveColortype='SFColorvalue='0.2 0.8 0.8accessType='inputOutput'
                     appinfo='color of arch'/>
 26                      <!-- INPUT PARAMETERS -->
 27                      <!-- General parameters: measures in meters -->
 28                      <field name='clearSpanWidthtype='SFFloatvalue='4accessType='initializeOnly'
                     appinfo='clearSpanWidth: clearSpanWidth must be double of riseHeight to obtain an half circumference'/>
 29                      <field name='riseHeighttype='SFFloatvalue='2accessType='initializeOnly'
                     appinfo='riseHeight: riseHeight must be half of clearSpanWidth to obtain an half circumference'/>
 30                      <field name='depthtype='SFFloatvalue='3accessType='initializeOnly'
                     appinfo='depth'/>
 31                      <field name='topAbutmentHeighttype='SFFloatvalue='0.5accessType='initializeOnly'
                     appinfo='topAbutmentHeight:topAbutmentHeight=0 means no topAbutment'/>
 32                      <field name='pierWidthtype='SFFloatvalue='0.5accessType='initializeOnly'
                     appinfo='pierWidth:pierWidtht=0 means no pierWidth'/>
 33                      <field name='pierHeighttype='SFFloatvalue='1accessType='initializeOnly'
                     appinfo='pierHeight: pierHeight=0 means no pierHeight'/>
 34                      <!-- Parameters to create shapes related to arch: put true to apply -->
 35                      <field name='archHalftype='SFBoolvalue='falseaccessType='initializeOnly'
                     appinfo='archHalf: can modify also clearSpanWidth, riseHeight, depth, pierWidth, pierHeight, topAbutmentHeight, archHalfExtensionWidth at purpose, clearSpanWidth measure refers to a full arc, consider clearSpanWidth/2 for the archHalf width'/>
 36                      <field name='archHalfExtensionWidthtype='SFFloatvalue='0accessType='initializeOnly'
                     appinfo='archHalfExtensionWidth: measure in meters, use only if archHalf=true, it is the width of the etension of the abutment of the archHalf. See the reference file ArchModelingDiagrams.pdf to find further information.'/>
 37                      <field name='onlyIntradostype='SFBoolvalue='falseaccessType='initializeOnly'
                     appinfo='onlyIntrados: note it is a flat curved surface, can modify also clearSpanWidth, riseHeight, depth at purpose, if needed apply archHalf=true.'/>
 38                      <field name='archFilledtype='SFBoolvalue='falseaccessType='initializeOnly'
                     appinfo='archFilled: note it is an half cylinder, can modify also clearSpanWidth, riseHeight, depth at purpose.'/>
 39                      <field name='archHalfFilledtype='SFBoolvalue='falseaccessType='initializeOnly'
                     appinfo='archHalfFilled: note it is a quarter cylinder, can modify also clearSpanWidth, riseHeight, depth at purpose, clearSpanWidth measure refers to a full arc, consider clearSpanWidth/2 for the archHalfFilled width.'/>
 40                      <field name='linteltype='SFBoolvalue='falseaccessType='initializeOnly'
                     appinfo='lintel: no arc is rendered, but a lintel: topAbutmentHeight on pierHeight, total height is pierHeight + topAbutmentHeight, if needed apply archHalf=true.'/>
 41                 </ProtoInterface>
 42                 <ProtoBody>
 43                      <!-- First node determines node type of this prototype -->
 44                      <!-- IndexedFaceset creates arch -->
 45 
                    <!-- ROUTE information for ArchTransform node:  [from ArchPrototypeScript.computedScale to scale ] -->
                    <Transform DEF='ArchTransform'>
 46                           <Shape DEF='Arch'>
 47                                <!-- note that convex='false' (meaning concave geometry) is crucial for this IFS of a geometric chord to render properly -->
 48 
                              <!-- ROUTE information for ArchIndex node:  [from ArchPrototypeScript.indexOut to set_coordIndex ] -->
                              <IndexedFaceSet DEF='ArchIndexconvex='falsesolid='false'>
 49 
                                   <!-- ROUTE information for ArchChord node:  [from ArchPrototypeScript.pointOut to point ] -->
                                   <Coordinate DEF='ArchChord'/>
 50                                </IndexedFaceSet>
 51                                <Appearance>
 52                                     <Material DEF='MaterialNode'>
 53                                          <IS>
 54                                               <connect nodeField='emissiveColorprotoField='emissiveColor'/>
 55                                               <connect nodeField='diffuseColorprotoField='diffuseColor'/>
 56                                          </IS>
 57                                     </Material>
 58                                </Appearance>
 59                           </Shape>
 60                      </Transform>
 61                      <!-- Subsequent nodes do not render, but still must be a valid X3D subgraph -->
 62                      <!-- This embedded Script provides the X3D author with additional visibility and control over prototype inputs and outputs -->
 63 
 64                           <!-- INPUT PARAMETERS -->
 65                           <!-- General parameters -->
 66                           <!-- Parameters to create to create shapes related to arch: put true to apply -->
 67                           <!-- OUTPUT PARAMETERS -->
 68                           <field name='clearSpanWidthtype='SFFloataccessType='initializeOnly'
                          appinfo='user or default input for clearSpanWidth parameter'/>
 69                           <field name='riseHeighttype='SFFloataccessType='initializeOnly'
                          appinfo='user or default input for riseHeight parameter'/>
 70                           <field name='depthtype='SFFloataccessType='initializeOnly'
                          appinfo='user or default input for depth parameter'/>
 71                           <field name='topAbutmentHeighttype='SFFloataccessType='initializeOnly'
                          appinfo='user or default input for topAbutmentHeight parameter'/>
 72                           <field name='pierWidthtype='SFFloataccessType='initializeOnly'
                          appinfo='user or default input for pierWidth parameter'/>
 73                           <field name='pierHeighttype='SFFloataccessType='initializeOnly'
                          appinfo='user or default input for pierHeight parameter'/>
 74                           <field name='archHalftype='SFBoolaccessType='initializeOnly'
                          appinfo='user or default input for archHalf parameter'/>
 75                           <field name='archHalfExtensionWidthtype='SFFloataccessType='initializeOnly'
                          appinfo='user or default input for archHalfExtensionWidth parameter'/>
 76                           <field name='onlyIntradostype='SFBoolaccessType='initializeOnly'
                          appinfo='user or default input for onlyIntrados parameter'/>
 77                           <field name='archFilledtype='SFBoolaccessType='initializeOnly'
                          appinfo='user or default input for archFilled parameter'/>
 78                           <field name='archHalfFilledtype='SFBoolaccessType='initializeOnly'
                          appinfo='user or default input for archHalfFilled parameter'/>
 79                           <field name='linteltype='SFBoolaccessType='initializeOnly'
                          appinfo='user or default input for lintel parameter'/>
 80                           <field name='computedScaletype='SFVec3faccessType='outputOnly'
                          appinfo='computedScale: modify scale field - NOTE it is not used to modify the whole arch, but to modify clearSpanWidth, riseHeight, depth. It does not affect topAbutmentHeight, pierWidth, pierHeight, archHalfExtensionWidth'/>
 81                           <field name='pointOuttype='MFVec3faccessType='outputOnly'
                          appinfo='send computed points to the Coordinate node'/>
 82                           <field name='indexOuttype='MFInt32accessType='outputOnly'
                          appinfo='send computed indices to the IndexedFaceSet node'/>
 83                           <IS>
 84                                <connect nodeField='clearSpanWidthprotoField='clearSpanWidth'/>
 85                                <connect nodeField='riseHeightprotoField='riseHeight'/>
 86                                <connect nodeField='depthprotoField='depth'/>
 87                                <connect nodeField='pierWidthprotoField='pierWidth'/>
 88                                <connect nodeField='topAbutmentHeightprotoField='topAbutmentHeight'/>
 89                                <connect nodeField='pierHeightprotoField='pierHeight'/>
 90                                <connect nodeField='archHalfprotoField='archHalf'/>
 91                                <connect nodeField='archHalfExtensionWidthprotoField='archHalfExtensionWidth'/>
 92                                <connect nodeField='onlyIntradosprotoField='onlyIntrados'/>
 93                                <connect nodeField='archFilledprotoField='archFilled'/>
 94                                <connect nodeField='archHalfFilledprotoField='archHalfFilled'/>
 95                                <connect nodeField='lintelprotoField='lintel'/>
 96                           </IS>
 97                      </Script>
 98                      < ROUTE  fromNode='ArchPrototypeScript' fromField='computedScale' toNode='ArchTransform' toField='scale'/>
 99                      < ROUTE  fromNode='ArchPrototypeScript' fromField='pointOut' toNode='ArchChord' toField='point'/>
100                      < ROUTE  fromNode='ArchPrototypeScript' fromField='indexOut' toNode='ArchIndex' toField='set_coordIndex'/>
101                 </ProtoBody>
102            </ProtoDeclare>
103            <ProtoInstance name='ArchPrototypeDEF='ArchInstance'>
104                 <fieldValue name='diffuseColorvalue='0.5 0.3 0.6'/>
105                 <fieldValue name='emissiveColorvalue='0.5 0.3 0.6'/>
106                 <fieldValue name='clearSpanWidthvalue='5'/>
107                 <fieldValue name='riseHeightvalue='2.5'/>
108                 <fieldValue name='depthvalue='2'/>
109                 <fieldValue name='topAbutmentHeightvalue='0.6'/>
110                 <fieldValue name='pierWidthvalue='1'/>
111                 <fieldValue name='pierHeightvalue='2'/>
112            </ProtoInstance>
113            <Shape>
114                 <Text string='"TODO: internal and external" "prototype tests" "ArchPrototype.x3d"'>
115                      <FontStyle family='"SANS"justify='"MIDDLE" "MIDDLE"style='BOLD'/>
116                 </Text>
117                 <Appearance>
118                      <Material diffuseColor='0.9 0.9 0.9'/>
119                 </Appearance>
120            </Shape>
121            <!-- Add any ROUTEs here that connect ProtoInstance to/from prior nodes in Scene (and outside of ProtoDeclare) -->
122            <Inline DEF='CoordinateAxes'   url=' "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "../../../Savage/Tools/Authoring/CoordinateAxes.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.x3d" "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "../../../Savage/Tools/Authoring/CoordinateAxes.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.wrl" '/>
123       </Scene>
124  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Arch, ArchChord, ArchIndex, ArchInstance, ArchPrototypeScript, ArchTransform, CoordinateAxes, MaterialNode

Index for ProtoDeclare definition: ArchPrototype
-->
X3D Tooltips element index: Appearance, connect, Coordinate, field, fieldValue, FontStyle, head, IndexedFaceSet, Inline, IS, Material, meta, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, ROUTE, Scene, Script, Shape, Text, Transform, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table entries with 3 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

ArchPrototypeScript
Script
computedScale
SFVec3f

ROUTE
event to
(1)
ArchTransform
Transform
scale
SFVec3f
ArchPrototypeScript
Script
pointOut
MFVec3f

ROUTE
event to
(1)
ArchChord
Coordinate
point
MFVec3f
ArchPrototypeScript
Script
indexOut
MFInt32

ROUTE
event to
(1)
ArchIndex
IndexedFaceSet
set_coordIndex
MFInt32

ArchInstance
ProtoInstance
ArchPrototype
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 
Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/Buildings/ArchPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/Buildings/ArchPrototype.x3d -->

<!-- Color legend: X3D terminology <X3dNode DEF='idName' field='value'/> matches XML terminology <XmlElement DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> </ProtoInstance> -->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->