<?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='ExtrusionCrossSectionITSSPrototype.x3d'/>
<meta name='creatorcontent='Don Brutzman and Sungmin Kwon'/>
<meta name='createdcontent='23 October 2017'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='descriptioncontent='Shape prototype for Enclosing IndexedTriangleStripSet that also draws spine line plus oriented, scaled cross sections at each spine point.'/>
<meta name='hintcontent='Utilize ExtrusionCrossSectionITSS ProtoInstance as if it is a Shape node (with containerField="children") rather than an Extrusion node (with containerField="geometry") under a Shape.'/>
<meta name='referencecontent='VRML 97 Specification, 6.18 Extrusion'/>
<meta name='referencecontent=' https://www.web3d.org/technicalinfo/specifications/vrml97/part1/nodesRef.html#Extrusion '/>
<meta name='Imagecontent='VRML 97 Specification, Figure 6.6'/>
<meta name='Imagecontent=' https://www.web3d.org/technicalinfo/specifications/vrml97/Images/Extrusion.gif '/>
<meta name='referencecontent=' http://realism.com/x3d/examples/Extrusion/_frame.html '/>
<meta name='referencecontent=' http://www.cs.brown.edu/~gss/vrml/drawpoly.html '/>
<meta name='referencecontent='ExtrusionXj3dGoldberg1999.java'/>
<meta name='referencecontent=' http://web3d.metrolink.com/cgi-bin/cvsweb.cgi/x3d/src/com/sun/j3d/loaders/vrml97/impl/Attic/Extrusion.java '/>
<meta name='identifiercontent=' https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionCrossSectionPrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!-- -->
<Scene>
<WorldInfo title='ExtrusionCrossSectionITSSPrototype.x3d'/>
<ProtoDeclare name='ExtrusionCrossSectionITSSappinfo='Shape prototype for Extrusion node that also draws spine line plus oriented scaled cross sections at each spine point' documentation=' https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionCrossSectionPrototype.x3d '>
<ProtoInterface>
<field name='nametype='SFStringaccessType='initializeOnly'
 appinfo='Extrusion name'/>

<field name='crossSectiontype='MFVec2fvalue='1 1 1 -1 -1 -1 -1 1 1 1accessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='spinetype='MFVec3fvalue='0 0 0 0 1 0accessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='scaletype='MFVec2fvalue='1 1accessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='orientationtype='MFRotationvalue='0 0 1 0accessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='beginCaptype='SFBoolvalue='falseaccessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='endCaptype='SFBoolvalue='falseaccessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='ccwtype='SFBoolvalue='trueaccessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='convextype='SFBoolvalue='trueaccessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='creaseAngletype='SFFloatvalue='0accessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='solidtype='SFBoolvalue='trueaccessType='initializeOnly'
 appinfo='Extrusion field'/>

<field name='spineColortype='SFColorvalue='0 0.9 0.8accessType='inputOutput'
 appinfo='emissiveColor of spine'/>

<field name='crossSectionColortype='SFColorvalue='0.2 0.8 0.3accessType='inputOutput'
 appinfo='diffuseColor of crossSection'/>

<field name='crossSectionTransparencytype='SFFloatvalue='0.2accessType='inputOutput'
 appinfo='transparency of crossSection'/>

<field name='extrusionColortype='SFColorvalue='0.3 0.3 0.3accessType='inputOutput'
 appinfo='diffuseColor of extrusion hull'/>

<field name='extrusionTransparencytype='SFFloatvalue='0.7accessType='inputOutput'
 appinfo='transparency of extrusion hull'/>

<field name='extrusionImageTexturetype='SFNodeaccessType='initializeOnly'
 appinfo='Image to apply to Extrusion'>
<!-- initialization node (if any) goes here -->
</field>
<field name='extrusionTextureTransformtype='SFNodeaccessType='initializeOnly'
 appinfo='TextureTransform coordinates of image applied to Extrusion'>
<!-- initialization node (if any) goes here -->
</field>
<field name='set_crossSectiontype='MFVec2faccessType='inputOnly'
 appinfo='Extrusion field'/>

<field name='set_spinetype='MFVec3faccessType='inputOnly'
 appinfo='Extrusion field'/>

<field name='set_scaletype='MFVec2faccessType='inputOnly'
 appinfo='Extrusion field'/>

<field name='set_orientationtype='MFRotationaccessType='inputOnly'
 appinfo='Extrusion field'/>

<field name='traceEnabledtype='SFBoolvalue='falseaccessType='initializeOnly'
 appinfo='Whether to provide initialization trace statements showing node construction'/>
</ProtoInterface>
<ProtoBody>
<Group>
<Shape DEF='Spine'>
<!-- ROUTE information for SpineLine node:  [from CrossSectionScript.spineIndex to set_coordIndex ] -->
<IndexedLineSet DEF='SpineLinecolorPerVertex='false'>
<Coordinate DEF='SpineCoordinates'>
<IS>
<connect nodeField='pointprotoField='spine'/>
<connect nodeField='pointprotoField='set_spine'/>
</IS>
</Coordinate>
</IndexedLineSet>
<Appearance>
<Material DEF='SpineMaterial'>
<IS>
<connect nodeField='emissiveColorprotoField='spineColor'/>
</IS>
</Material>
</Appearance>
</Shape>
<Shape DEF='InternalCrossSections'>
<!-- ROUTE information for CrossSectionFaces node:  [from CrossSectionScript.facesIndex to set_index ] -->
<IndexedTriangleFanSet DEF='CrossSectionFacesccw='truecolorPerVertex='truenormalPerVertex='truesolid='false'>
<!-- ROUTE information for CrossSectionFacesCoordinates node:  [from CrossSectionScript.facePoints to point ] -->
<Coordinate DEF='CrossSectionFacesCoordinates'/>
</IndexedTriangleFanSet>
<Appearance>
<Material DEF='CrossSectionMaterial'>
<IS>
<connect nodeField='diffuseColorprotoField='crossSectionColor'/>
<connect nodeField='transparencyprotoField='crossSectionTransparency'/>
</IS>
</Material>
</Appearance>
</Shape>
<Shape DEF='ExternalExtrusion2'>
<Appearance DEF='ExtrusionAppearance2'>
<IS>
<connect nodeField='textureprotoField='extrusionImageTexture'/>
<connect nodeField='textureTransformprotoField='extrusionTextureTransform'/>
</IS>
<Material DEF='ExtrusionMaterial2'>
<IS>
<connect nodeField='diffuseColorprotoField='extrusionColor'/>
<connect nodeField='transparencyprotoField='extrusionTransparency'/>
</IS>
</Material>
</Appearance>
<!-- ROUTE information for EnclosingExtrusion2 node:  [from CrossSectionScript.triStripIndex to set_index ] -->
<IndexedTriangleStripSet DEF='EnclosingExtrusion2ccw='truecolorPerVertex='trueindex='0 1 2normalPerVertex='truesolid='true'>
<!-- ROUTE information for ExtrusionCoordinates2 node:  [from CrossSectionScript.facePoints to point ] -->
<Coordinate DEF='ExtrusionCoordinates2'/>
</IndexedTriangleStripSet>
</Shape>
<!-- <Shape DEF='ExternalExtrusion'> <Extrusion DEF='EnclosingExtrusion' convex='false' solid='false'> <IS> <connect nodeField='crossSection' protoField='crossSection'/> <connect nodeField='spine' protoField='spine'/> <connect nodeField='scale' protoField='scale'/> <connect nodeField='orientation' protoField='orientation'/> <connect nodeField='set_crossSection' protoField='set_crossSection'/> <connect nodeField='set_spine' protoField='set_spine'/> <connect nodeField='set_scale' protoField='set_scale'/> <connect nodeField='set_orientation' protoField='set_orientation'/> <connect nodeField='beginCap' protoField='beginCap'/> <connect nodeField='endCap' protoField='endCap'/> <connect nodeField='ccw' protoField='ccw'/> <connect nodeField='convex' protoField='convex'/> <connect nodeField='creaseAngle' protoField='creaseAngle'/> <connect nodeField='solid' protoField='solid'/> </IS> </Extrusion> <Appearance DEF='ExtrusionAppearance'> <IS> <connect nodeField='texture' protoField='extrusionImageTexture'/> <connect nodeField='textureTransform' protoField='extrusionTextureTransform'/> </IS> <Material DEF='ExtrusionMaterial'> <IS> <connect nodeField='diffuseColor' protoField='extrusionColor'/> <connect nodeField='transparency' protoField='extrusionTransparency'/> </IS> </Material> </Appearance> </Shape> -->
</Group>
<!-- TODO hardwired local Script path to workaround BS Contact bug -->
<!-- ROUTE information for CrossSectionScript node:  [from spineIndex to SpineLine.set_coordIndex ] [from facesIndex to CrossSectionFaces.set_index ] [from facePoints to CrossSectionFacesCoordinates.point ] [from triStripIndex to EnclosingExtrusion2.set_index ] [from triStripIndex to Trace_ROUTE_CrossSectionScript.triStripIndex_TO_EnclosingExtrusion2.set_index.traceValue ] [from facePoints to ExtrusionCoordinates2.point ] -->
<Script DEF='CrossSectionScript'
  url=' "ExtrusionCrossSectionITSSPrototype.js" "https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionCrossSectionITSSPrototype.js" '>
<field name='nametype='SFStringaccessType='initializeOnly'/>
<field name='crossSectiontype='MFVec2faccessType='initializeOnly'/>
<field name='spinetype='MFVec3faccessType='initializeOnly'/>
<field name='scaletype='MFVec2faccessType='initializeOnly'/>
<field name='orientationtype='MFRotationaccessType='initializeOnly'/>
<field name='spineColortype='SFColoraccessType='inputOutput'/>
<field name='crossSectionColortype='SFColoraccessType='inputOutput'/>
<field name='crossSectionTransparencytype='SFFloataccessType='inputOutput'/>
<field name='extrusionColortype='SFColoraccessType='inputOutput'/>
<field name='extrusionTransparencytype='SFFloataccessType='inputOutput'/>
<field name='set_crossSectiontype='MFVec2faccessType='inputOnly'/>
<field name='set_spinetype='MFVec3faccessType='inputOnly'/>
<field name='set_scaletype='MFVec2faccessType='inputOnly'/>
<field name='set_orientationtype='MFRotationaccessType='inputOnly'/>
<field name='spineIndextype='MFInt32accessType='outputOnly'/>
<field name='facesIndextype='MFInt32accessType='outputOnly'/>
<field name='facePointstype='MFVec3faccessType='outputOnly'/>
<field name='triStripIndextype='MFInt32accessType='outputOnly'/>
<field name='traceEnabledtype='SFBoolaccessType='initializeOnly'/>
<!-- local variables -->
<field name='computedFacesIndextype='MFInt32accessType='initializeOnly'/>
<field name='computedFacePointstype='MFVec3faccessType='initializeOnly'/>
<field name='computedTriStripIndextype='MFInt32accessType='initializeOnly'/>
<IS>
<connect nodeField='nameprotoField='name'/>
<connect nodeField='crossSectionprotoField='crossSection'/>
<connect nodeField='spineprotoField='spine'/>
<connect nodeField='scaleprotoField='scale'/>
<connect nodeField='spineColorprotoField='spineColor'/>
<connect nodeField='crossSectionColorprotoField='crossSectionColor'/>
<connect nodeField='crossSectionTransparencyprotoField='crossSectionTransparency'/>
<connect nodeField='extrusionColorprotoField='extrusionColor'/>
<connect nodeField='extrusionTransparencyprotoField='extrusionTransparency'/>
<connect nodeField='orientationprotoField='orientation'/>
<connect nodeField='set_crossSectionprotoField='set_crossSection'/>
<connect nodeField='set_spineprotoField='set_spine'/>
<connect nodeField='set_scaleprotoField='set_scale'/>
<connect nodeField='set_orientationprotoField='set_orientation'/>
<connect nodeField='traceEnabledprotoField='traceEnabled'/>
</IS>
</Script>
<ROUTE fromNode='CrossSectionScriptfromField='spineIndextoNode='SpineLinetoField='set_coordIndex'/>
<ROUTE fromNode='CrossSectionScriptfromField='facesIndextoNode='CrossSectionFacestoField='set_index'/>
<ROUTE fromNode='CrossSectionScriptfromField='facePointstoNode='CrossSectionFacesCoordinatestoField='point'/>
<ROUTE fromNode='CrossSectionScriptfromField='triStripIndextoNode='EnclosingExtrusion2toField='set_index'/>
<Group>
<!-- ======= ROUTE Trace ============================================== -->
<!-- ROUTE information for Trace_ROUTE_CrossSectionScript.triStripIndex_TO_EnclosingExtrusion2.set_index node:  [from CrossSectionScript.triStripIndex to traceValue ] -->
<Script DEF='Trace_ROUTE_CrossSectionScript.triStripIndex_TO_EnclosingExtrusion2.set_indexmustEvaluate='true'>
<!-- Trace ROUTEd event values on X3D browser console -->
<field name='reportIntervaltype='SFTimevalue='1.0accessType='initializeOnly'
 appinfo='Sampling frequency in seconds (0 means all values)'/>

<field name='traceValuetype='MFInt32accessType='inputOnly'/>
<field name='timeStampPreviousReporttype='SFTimevalue='-1accessType='initializeOnly'/>
<![CDATA[
            
ecmascript:
    function traceValue (eventValue, timeStamp) {
      // input eventValue received for trace field
      if (timeStamp - timeStampPreviousReport >= reportInterval) {
        Browser.print ('Trace_ROUTE_CrossSectionScript.triStripIndex_TO_EnclosingExtrusion2.set_index type=MFInt32 value=' + eventValue.toString() + '\n');
        timeStampPreviousReport = timeStamp;
      }
    }
    function timeOfDay (someTime) {
      hh = Math.floor (someTime /(60*60)) % 24;
      mm = Math.floor (someTime / 60)     % 60;
      ss = Math.floor (someTime)          % 60;
      if (hh < 9) hour   = '0' + hh;
      else        hour   =       hh;
      if (mm < 9) minute = '0' + mm;
      else        minute =       mm;
      if (ss < 9) second = '0' + ss;
      else        second =       ss;
      return '(' + hour + ':' + minute + ':' + second + ' GMT)';
    }

          
]]>
</Script>
<ROUTE fromNode='CrossSectionScriptfromField='triStripIndextoNode='Trace_ROUTE_CrossSectionScript.triStripIndex_TO_EnclosingExtrusion2.set_indextoField='traceValue'/>
<!-- ======= ROUTE Trace block complete ===================================================== -->
</Group>
<ROUTE fromNode='CrossSectionScriptfromField='facePointstoNode='ExtrusionCoordinates2toField='point'/>
<!-- -->
</ProtoBody>
</ProtoDeclare>
<!-- ==================== -->
<!-- Example instance adapted from Figure15.12Torus.x3d -->
<!-- https://www.web3d.org/x3d/content/examples/Basic/Vrml2Sourcebook/Chapter15-Extrusion/Figure15.12Torus.x3d -->
<!-- Redirection text in case a user examines this PROTO file via a 3D browser: -->
<Group>
<Transform translation='0 0.5 0'>
<Shape>
<Appearance>
<Material diffuseColor='0 1 1emissiveColor='0 1 1'/>
</Appearance>
<Text string='"ExtrusionCrossSectionITSS" "is a Prototype definition scene"'>
<FontStyle justify='"MIDDLE" "MIDDLE"size='0.7'/>
</Text>
</Shape>
</Transform>
</Group>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition : ExtrusionCrossSectionITSS

Index for DEF nodes : CrossSectionFaces, CrossSectionFacesCoordinates, CrossSectionMaterial, CrossSectionScript, EnclosingExtrusion2, ExternalExtrusion2, ExtrusionAppearance2, ExtrusionCoordinates2, ExtrusionMaterial2, InternalCrossSections, Spine, SpineCoordinates, SpineLine, SpineMaterial, Trace_ROUTE_CrossSectionScript.triStripIndex_TO_EnclosingExtrusion2.set_index
-->

<!-- 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. -->