<WorldInfo title='ArchPrototype.x3d'/>
<ProtoDeclare name='ArchPrototype' appinfo='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.'>
<ProtoInterface>
<!-- COLOR OF ARCH -->
<field name='diffuseColor' type='SFColor' value='0.2 0.8 0.8' accessType='inputOutput'
appinfo='color of arch'/>
<field name='emissiveColor' type='SFColor' value='0.2 0.8 0.8' accessType='inputOutput'
appinfo='color of arch'/>
<!-- INPUT PARAMETERS -->
<!-- General parameters: measures in meters -->
<field name='clearSpanWidth' type='SFFloat' value='4' accessType='initializeOnly'
appinfo='clearSpanWidth: clearSpanWidth must be double of riseHeight to obtain an half circumference'/>
<field name='riseHeight' type='SFFloat' value='2' accessType='initializeOnly'
appinfo='riseHeight: riseHeight must be half of clearSpanWidth to obtain an half circumference'/>
<field name='depth' type='SFFloat' value='3' accessType='initializeOnly'
appinfo='depth'/>
<field name='topAbutmentHeight' type='SFFloat' value='0.5' accessType='initializeOnly'
appinfo='topAbutmentHeight:topAbutmentHeight=0 means no topAbutment'/>
<field name='pierWidth' type='SFFloat' value='0.5' accessType='initializeOnly'
appinfo='pierWidth:pierWidtht=0 means no pierWidth'/>
<field name='pierHeight' type='SFFloat' value='1' accessType='initializeOnly'
appinfo='pierHeight: pierHeight=0 means no pierHeight'/>
<!-- Parameters to create shapes related to arch: put true to apply -->
<field name='archHalf' type='SFBool' value='false' accessType='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'/>
<field name='archHalfExtensionWidth' type='SFFloat' value='0' accessType='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.'/>
<field name='onlyIntrados' type='SFBool' value='false' accessType='initializeOnly'
appinfo='onlyIntrados: note it is a flat curved surface, can modify also clearSpanWidth, riseHeight, depth at purpose, if needed apply archHalf=true.'/>
<field name='archFilled' type='SFBool' value='false' accessType='initializeOnly'
appinfo='archFilled: note it is an half cylinder, can modify also clearSpanWidth, riseHeight, depth at purpose.'/>
<field name='archHalfFilled' type='SFBool' value='false' accessType='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.'/>
<field name='lintel' type='SFBool' value='false' accessType='initializeOnly'
appinfo='lintel: no arc is rendered, but a lintel: topAbutmentHeight on pierHeight, total height is pierHeight + topAbutmentHeight, if needed apply archHalf=true.'/>
</ProtoInterface>
<ProtoBody>
<!-- First node determines node type of this prototype -->
<!-- IndexedFaceset creates arch -->
<!-- ROUTE information for ArchTransform node:
[from ArchPrototypeScript.computedScale to scale
]
-->
<Transform DEF='ArchTransform'>
<Shape DEF='Arch'>
<!-- note that convex='false' (meaning concave geometry) is crucial for this IFS of a geometric chord to render properly -->
<!-- ROUTE information for ArchIndex node:
[from ArchPrototypeScript.indexOut to set_coordIndex
]
-->
<IndexedFaceSet DEF='ArchIndex' convex='false' solid='false'>
</IndexedFaceSet>
<Appearance>
</Appearance>
</Shape>
</Transform>
<!-- Subsequent nodes do not render, but still must be a valid X3D subgraph -->
<!-- This embedded Script provides the X3D author with additional visibility and control over prototype inputs and outputs -->
<!-- ROUTE information for ArchPrototypeScript node:
[from computedScale to ArchTransform.scale
]
[from pointOut to ArchChord.point
]
[from indexOut to ArchIndex.set_coordIndex
]
-->
<Script DEF='ArchPrototypeScript'
url='
"ArchPrototypeScript.js" "https://x3dgraphics.com/examples/X3dForAdvancedModeling/Buildings/ArchPrototypeScript.js" '>
<!-- INPUT PARAMETERS -->
<!-- General parameters -->
<!-- Parameters to create to create shapes related to arch: put true to apply -->
<!-- OUTPUT PARAMETERS -->
<field name='clearSpanWidth' type='SFFloat' accessType='initializeOnly'
appinfo='user or default input for clearSpanWidth parameter'/>
<field name='riseHeight' type='SFFloat' accessType='initializeOnly'
appinfo='user or default input for riseHeight parameter'/>
<field name='depth' type='SFFloat' accessType='initializeOnly'
appinfo='user or default input for depth parameter'/>
<field name='topAbutmentHeight' type='SFFloat' accessType='initializeOnly'
appinfo='user or default input for topAbutmentHeight parameter'/>
<field name='pierWidth' type='SFFloat' accessType='initializeOnly'
appinfo='user or default input for pierWidth parameter'/>
<field name='pierHeight' type='SFFloat' accessType='initializeOnly'
appinfo='user or default input for pierHeight parameter'/>
<field name='archHalf' type='SFBool' accessType='initializeOnly'
appinfo='user or default input for archHalf parameter'/>
<field name='archHalfExtensionWidth' type='SFFloat' accessType='initializeOnly'
appinfo='user or default input for archHalfExtensionWidth parameter'/>
<field name='onlyIntrados' type='SFBool' accessType='initializeOnly'
appinfo='user or default input for onlyIntrados parameter'/>
<field name='archFilled' type='SFBool' accessType='initializeOnly'
appinfo='user or default input for archFilled parameter'/>
<field name='archHalfFilled' type='SFBool' accessType='initializeOnly'
appinfo='user or default input for archHalfFilled parameter'/>
<field name='lintel' type='SFBool' accessType='initializeOnly'
appinfo='user or default input for lintel parameter'/>
<field name='computedScale' type='SFVec3f' accessType='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'/>
<field name='pointOut' type='MFVec3f' accessType='outputOnly'
appinfo='send computed points to the Coordinate node'/>
<field name='indexOut' type='MFInt32' accessType='outputOnly'
appinfo='send computed indices to the IndexedFaceSet node'/>
<IS>
<connect nodeField='clearSpanWidth' protoField='clearSpanWidth'/>
<connect nodeField='riseHeight' protoField='riseHeight'/>
<connect nodeField='depth' protoField='depth'/>
<connect nodeField='pierWidth' protoField='pierWidth'/>
<connect nodeField='topAbutmentHeight' protoField='topAbutmentHeight'/>
<connect nodeField='pierHeight' protoField='pierHeight'/>
<connect nodeField='archHalf' protoField='archHalf'/>
<connect nodeField='archHalfExtensionWidth' protoField='archHalfExtensionWidth'/>
<connect nodeField='onlyIntrados' protoField='onlyIntrados'/>
<connect nodeField='archFilled' protoField='archFilled'/>
<connect nodeField='archHalfFilled' protoField='archHalfFilled'/>
<connect nodeField='lintel' protoField='lintel'/>
</IS>
</Script>
<ROUTE fromNode='ArchPrototypeScript' fromField='computedScale' toNode='ArchTransform' toField='scale'/>
<ROUTE fromNode='ArchPrototypeScript' fromField='pointOut' toNode='ArchChord' toField='point'/>
<ROUTE fromNode='ArchPrototypeScript' fromField='indexOut' toNode='ArchIndex' toField='set_coordIndex'/>
</ProtoBody>
</ProtoDeclare>
<ProtoInstance name='ArchPrototype' DEF='ArchInstance'>
<fieldValue name='diffuseColor' value='0.5 0.3 0.6'/>
<fieldValue name='emissiveColor' value='0.5 0.3 0.6'/>
<fieldValue name='clearSpanWidth' value='5'/>
<fieldValue name='riseHeight' value='2.5'/>
<fieldValue name='depth' value='2'/>
<fieldValue name='topAbutmentHeight' value='0.6'/>
<fieldValue name='pierWidth' value='1'/>
<fieldValue name='pierHeight' value='2'/>
</ProtoInstance>
<Shape>
<Text string='"TODO: internal and external" "prototype tests" "ArchPrototype.x3d"'>
<FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' style='BOLD'/>
</Text>
<Appearance>
<Material diffuseColor='0.9 0.9 0.9'/>
</Appearance>
</Shape>
<!-- Add any ROUTEs here that connect ProtoInstance to/from prior nodes in Scene (and outside of ProtoDeclare) -->
<Inline DEF='CoordinateAxes'
url='
"../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d"
"../../../Savage/Tools/Authoring/CoordinateAxes.x3d"
"https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.x3d" "../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl"
"../../../Savage/Tools/Authoring/CoordinateAxes.wrl"
"https://x3dgraphics.com/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl" "https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.wrl" '/>