<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<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 '>
<head>
<meta name='titlecontent='ArchPrototype.x3d'/>
<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.'/>
<meta name='creatorcontent='Michele Foti, Don Brutzman'/>
<meta name='createdcontent='15 December 2014'/>
<meta name='modifiedcontent='16 June 2020'/>
<meta name=' TODO content=' debug local ProtoInstance '/>
<meta name=' TODO content=' add test ArchPrototypeExample '/>
<meta name=' TODO content=' Xj3D Player Issue, bogus error on line 243 of script regarding assignment to MFInt32 value '/>
<meta name='referencecontent='ArchModelingDiagrams.pdf'/>
<meta name='referencecontent=' https://en.wikipedia.org/wiki/Arch '/>
<meta name='identifiercontent=' https://x3dgraphics.com/examples/X3dForAdvancedModeling/Buildings/ArchPrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

Index for ProtoDeclare definition : ArchPrototype

Index for DEF nodes : Arch, ArchChord, ArchIndex, ArchInstance, ArchPrototypeScript, ArchTransform, CoordinateAxes, MaterialNode
-->
<Scene>
<WorldInfo title='ArchPrototype.x3d'/>
<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.'>
<ProtoInterface>
<!-- COLOR OF ARCH -->
<field name='diffuseColortype='SFColorvalue='0.2 0.8 0.8accessType='inputOutput'
 appinfo='color of arch'/>

<field name='emissiveColortype='SFColorvalue='0.2 0.8 0.8accessType='inputOutput'
 appinfo='color of arch'/>

<!-- INPUT PARAMETERS -->
<!-- General parameters: measures in meters -->
<field name='clearSpanWidthtype='SFFloatvalue='4accessType='initializeOnly'
 appinfo='clearSpanWidth: clearSpanWidth must be double of riseHeight to obtain an half circumference'/>

<field name='riseHeighttype='SFFloatvalue='2accessType='initializeOnly'
 appinfo='riseHeight: riseHeight must be half of clearSpanWidth to obtain an half circumference'/>

<field name='depthtype='SFFloatvalue='3accessType='initializeOnly'
 appinfo='depth'/>

<field name='topAbutmentHeighttype='SFFloatvalue='0.5accessType='initializeOnly'
 appinfo='topAbutmentHeight:topAbutmentHeight=0 means no topAbutment'/>

<field name='pierWidthtype='SFFloatvalue='0.5accessType='initializeOnly'
 appinfo='pierWidth:pierWidtht=0 means no pierWidth'/>

<field name='pierHeighttype='SFFloatvalue='1accessType='initializeOnly'
 appinfo='pierHeight: pierHeight=0 means no pierHeight'/>

<!-- Parameters to create shapes related to arch: put true to apply -->
<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'/>

<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.'/>

<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.'/>

<field name='archFilledtype='SFBoolvalue='falseaccessType='initializeOnly'
 appinfo='archFilled: note it is an half cylinder, can modify also clearSpanWidth, riseHeight, depth at purpose.'/>

<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.'/>

<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.'/>
</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='ArchIndexconvex='falsesolid='false'>
<!-- ROUTE information for ArchChord node:  [from ArchPrototypeScript.pointOut to point ] -->
<Coordinate DEF='ArchChord'/>
</IndexedFaceSet>
<Appearance>
<Material DEF='MaterialNode'>
<IS>
<connect nodeField='emissiveColorprotoField='emissiveColor'/>
<connect nodeField='diffuseColorprotoField='diffuseColor'/>
</IS>
</Material>
</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='clearSpanWidthtype='SFFloataccessType='initializeOnly'
 appinfo='user or default input for clearSpanWidth parameter'/>

<field name='riseHeighttype='SFFloataccessType='initializeOnly'
 appinfo='user or default input for riseHeight parameter'/>

<field name='depthtype='SFFloataccessType='initializeOnly'
 appinfo='user or default input for depth parameter'/>

<field name='topAbutmentHeighttype='SFFloataccessType='initializeOnly'
 appinfo='user or default input for topAbutmentHeight parameter'/>

<field name='pierWidthtype='SFFloataccessType='initializeOnly'
 appinfo='user or default input for pierWidth parameter'/>

<field name='pierHeighttype='SFFloataccessType='initializeOnly'
 appinfo='user or default input for pierHeight parameter'/>

<field name='archHalftype='SFBoolaccessType='initializeOnly'
 appinfo='user or default input for archHalf parameter'/>

<field name='archHalfExtensionWidthtype='SFFloataccessType='initializeOnly'
 appinfo='user or default input for archHalfExtensionWidth parameter'/>

<field name='onlyIntradostype='SFBoolaccessType='initializeOnly'
 appinfo='user or default input for onlyIntrados parameter'/>

<field name='archFilledtype='SFBoolaccessType='initializeOnly'
 appinfo='user or default input for archFilled parameter'/>

<field name='archHalfFilledtype='SFBoolaccessType='initializeOnly'
 appinfo='user or default input for archHalfFilled parameter'/>

<field name='linteltype='SFBoolaccessType='initializeOnly'
 appinfo='user or default input for lintel parameter'/>

<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'/>

<field name='pointOuttype='MFVec3faccessType='outputOnly'
 appinfo='send computed points to the Coordinate node'/>

<field name='indexOuttype='MFInt32accessType='outputOnly'
 appinfo='send computed indices to the IndexedFaceSet node'/>

<IS>
<connect nodeField='clearSpanWidthprotoField='clearSpanWidth'/>
<connect nodeField='riseHeightprotoField='riseHeight'/>
<connect nodeField='depthprotoField='depth'/>
<connect nodeField='pierWidthprotoField='pierWidth'/>
<connect nodeField='topAbutmentHeightprotoField='topAbutmentHeight'/>
<connect nodeField='pierHeightprotoField='pierHeight'/>
<connect nodeField='archHalfprotoField='archHalf'/>
<connect nodeField='archHalfExtensionWidthprotoField='archHalfExtensionWidth'/>
<connect nodeField='onlyIntradosprotoField='onlyIntrados'/>
<connect nodeField='archFilledprotoField='archFilled'/>
<connect nodeField='archHalfFilledprotoField='archHalfFilled'/>
<connect nodeField='lintelprotoField='lintel'/>
</IS>
</Script>
<ROUTE fromNode='ArchPrototypeScriptfromField='computedScaletoNode='ArchTransformtoField='scale'/>
<ROUTE fromNode='ArchPrototypeScriptfromField='pointOuttoNode='ArchChordtoField='point'/>
<ROUTE fromNode='ArchPrototypeScriptfromField='indexOuttoNode='ArchIndextoField='set_coordIndex'/>
</ProtoBody>
</ProtoDeclare>
<ProtoInstance name='ArchPrototypeDEF='ArchInstance'>
<fieldValue name='diffuseColorvalue='0.5 0.3 0.6'/>
<fieldValue name='emissiveColorvalue='0.5 0.3 0.6'/>
<fieldValue name='clearSpanWidthvalue='5'/>
<fieldValue name='riseHeightvalue='2.5'/>
<fieldValue name='depthvalue='2'/>
<fieldValue name='topAbutmentHeightvalue='0.6'/>
<fieldValue name='pierWidthvalue='1'/>
<fieldValue name='pierHeightvalue='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" '/>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition : ArchPrototype

Index for DEF nodes : Arch, ArchChord, ArchIndex, ArchInstance, ArchPrototypeScript, ArchTransform, CoordinateAxes, MaterialNode
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

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