<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.1//EN" "https://www.web3d.org/specifications/x3d-3.1.dtd">
<X3D profile='Immersive' version='3.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.1.xsd'>
  <head>
    <meta content='CadGeometryPrototypes.x3d' name='title'/>
    <meta content='This scene provides tool developers with X3D Amendment 1 CAD Component node prototypes, providing backwards compatibility with VRML97 and X3D v3.0.' name='description'/>
    <meta content='Travis Rauch, Alan Shaffer, Mounir Sidhom, Patrick Sullivan and Don Brutzman' name='creator'/>
    <meta content='28 April 2005' name='created'/>
    <meta content='2 December 2024' name='modified'/>
    <meta content='Do not use these prototypes in an up-to-date X3D browser that already provides CAD support.' name='warning'/>
    <meta content='Recommended practice: avoid using these prototypes, instead use native definitions for CAD nodes using an up-to-date X3D browser.' name='info'/>
    <meta content='These scenes are not intended for regular authoring - use X3D v3.2+ CAD component instead. Example scenes using these prototypes do not get support for making embdedded metadata values visible at run time, though metadata can certainly be saved in the scene file OK.' name='info'/>
    <meta content='CadGeometryExternPrototypes.x3d' name='reference'/>
    <meta content='https://www.web3d.org/files/specifications/19775-1/V3.3/Part01/components/CADGeometry.html' name='reference'/>
    <meta content='https://www.web3d.org/files/specifications/19775-1/V3.3/Part01/CADInterchange.html' name='reference'/>
    <meta content='CADAssembly CADFace CADLayer CADPart IndexedQuadSet QuadSet' name='subject'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Basic/CAD/CadGeometryPrototypes.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../license.html' name='license'/>
  </head>
  <Scene>
    <!-- =========================================== -->
    <WorldInfo title='CadGeometryPrototypes.x3d'/>
    <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='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/CADGeometry.html#IndexedQuadSet' name='IndexedQuadSet'>
      <ProtoInterface>
        <field accessType='inputOnly' appinfo='range [0..∞) or -1' name='set_index' type='MFInt32'>
          <!-- No specific initialization value -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DVertexAttributeNode]' name='attrib' type='MFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DColorNode]' name='color' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DCoordinateNode]' name='coord' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[FogCoordinate]' name='fogCoord' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DNormalNode]' name='normal' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DTextureCoordinateNode]' name='texCoord' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='initializeOnly' name='ccw' type='SFBool' value='true'/>
        <field accessType='initializeOnly' appinfo='colorPerVertex ignored in IndexedQuadSet, and always treated as true' name='colorPerVertex' type='SFBool' value='true'/>
        <field accessType='initializeOnly' name='normalPerVertex' type='SFBool' value='true'/>
        <field accessType='initializeOnly' name='solid' type='SFBool' value='true'/>
        <field accessType='initializeOnly' appinfo='range [0..∞) or -1' name='index' type='MFInt32'>
          <!-- No specific initialization value -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DMetadataObject]' name='metadata' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
      </ProtoInterface>
      <ProtoBody>
        <IndexedFaceSet DEF='RenderedIQS'>
          <IS>
            <connect nodeField='attrib' protoField='attrib'/>
            <connect nodeField='color' protoField='color'/>
            <connect nodeField='colorPerVertex' protoField='colorPerVertex'/>
            <connect nodeField='coord' protoField='coord'/>
            <connect nodeField='fogCoord' protoField='fogCoord'/>
            <connect nodeField='normal' protoField='normal'/>
            <connect nodeField='texCoord' protoField='texCoord'/>
            <connect nodeField='ccw' protoField='ccw'/>
            <connect nodeField='normalPerVertex' protoField='normalPerVertex'/>
            <connect nodeField='solid' protoField='solid'/>
          </IS>
        </IndexedFaceSet>
        <!-- Initial node in the PROTO body is actual node type, and the only node rendered. Remaining ProtoBody nodes not rendered -->
        <Group DEF='UnrenderedIQS'>
          <Script DEF='IndexedQuadSetToIndexedFaceSet' directOutput='true'>
            <field accessType='initializeOnly' name='index' type='MFInt32'/>
            <field accessType='inputOnly' name='set_index' type='MFInt32'/>
            <field accessType='initializeOnly' name='renderedIQS' type='SFNode'>
              <IndexedFaceSet USE='RenderedIQS'/>
            </field>
            <field accessType='initializeOnly' name='localTraceEnabled' type='SFBool' value='true'/>
            <field accessType='initializeOnly' name='coordIndexNew' type='MFInt32'>
              <!-- constructed during initialization -->
            </field>
            <IS>
              <connect nodeField='index' protoField='index'/>
              <connect nodeField='set_index' protoField='set_index'/>
            </IS>
            <![CDATA[
ecmascript:

function initialize()
{
	//colorPerVertex ignored in IndexedQuadSet, and always treated as "true"
	RenderedIQS.colorPerVertex = true;

	// index is an array of quad indices. The ordering of
	// the vertices is ccw (counter-clockwise).

	// ensure legal index values
	for (ii=0; ii <= index.length-1; ii++)
	{
	  if (index[ii] < -1)
	  {
		alwaysPrint ('error, index[' + ii + ']=' + index[ii] + ' is illegal value');
		return;
	  }
	}
	tracePrint ('index.length=' + index.length);
	tracePrint ('index=' + index);

	if (index.length < 4)
	{
		alwaysPrint ('warning, index.length=' + index.length + ' insufficient to construct a quad, IQS ignored');
		return;
	}

	coordIndexNew = new MFInt32 ();

	// ii walks through index array,
	// goal is to initialize coordIndexNew list to match quads
	for (ii=0; ii <= index.length-1; ii+=4)
	{
		if ((index[ii]   == index[ii+1]) || (index[ii]   == index[ii+2]) || (index[ii] == index[ii+3]) ||
		    (index[ii+1] == index[ii+2]) || (index[ii+1] == index[ii+3]) ||
		    (index[ii+2] == index[ii+3]))
		{
			alwaysPrint ('index=' + index);
			alwaysPrint ('error, pair of equal indices in quad');
			return;
		}

		if (index[ii] >= 0)
		{
			// add another quad from latest 4 points of fan set to IQS
			// order is ccw, i.e. in correct halfplane direction
			// note: there is an implicit "malloc" here for the'length' element of the array
			coordIndexNew [coordIndexNew.length] = index[ii];
			coordIndexNew [coordIndexNew.length] = index[ii+1];
			coordIndexNew [coordIndexNew.length] = index[ii+2];
			coordIndexNew [coordIndexNew.length] = index[ii+3];
			coordIndexNew [coordIndexNew.length] = -1;
		}

		if (index.length % 4 != 0) {
			alwaysPrint ('error, index field does not contain a multiple of four coordinate values.');
			alwaysPrint ('The remaining vertices shall be ignored');
			return;
		}

	  // incremental trace of array being built
	  tracePrint ('coordIndexNew=' + coordIndexNew);
	}
	renderedIQS.set_coordIndex = coordIndexNew;
	tracePrint ('renderedIQS.coordIndex=' + renderedIQS.coordIndex);
	// match colorIndex if any Color node exists
//	if (nodesHolder.color)
//	{
//	  if (nodesHolder.color.color.length > 0)
//	  {
		//  Could implement color count check here
//	  }
//	}

	// no need to set colorIndex since indexedFaceSet semantics handles this
}
function set_index (value, timestamp)
{
	index = value;
	initialize ();
}
function tracePrint(outputString)
{
    if (localTraceEnabled)
	  Browser.println ('[IndexedQuadSet]' + outputString);
}
function alwaysPrint(outputString)
{
	Browser.println ('[IndexedQuadSet]' + outputString);
}
]]>
          </Script>
          <Group>
            <MetadataString name='metadataHolder'>
              <IS>
                <connect nodeField='metadata' protoField='metadata'/>
              </IS>
            </MetadataString>
          </Group>
        </Group>
      </ProtoBody>
    </ProtoDeclare>
    <!-- =========================================== -->
    <ProtoDeclare appinfo='The QuadSet node represents a 3D shape that represents a collection of individual planar quadrilaterals. The coord field contains a Coordinate node that defines the 3D vertices that define the quad. Each quad is formed from a consecutive set of four vertices of the coordinate node. If the coordinate node does not contain a multiple of four coordinate values the remaining vertices shall be ignored.' documentation='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/CadGeometry.html#QuadSet' name='QuadSet'>
      <ProtoInterface>
        <field accessType='inputOutput' appinfo='[X3DVertexAttributeNode]' name='attrib' type='MFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DColorNode]' name='color' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DCoordinateNode]' name='coord' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[FogCoordinate]' name='fogCoord' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DNormalNode]' name='normal' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='[X3DTextureCoordinateNode]' name='texCoord' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='initializeOnly' name='ccw' type='SFBool' value='true'/>
        <field accessType='initializeOnly' appinfo='colorPerVertex ignored in QuadSet, and always treated as true' name='colorPerVertex' type='SFBool' value='true'/>
        <field accessType='initializeOnly' name='normalPerVertex' type='SFBool' value='true'/>
        <field accessType='initializeOnly' name='solid' type='SFBool' value='true'/>
        <field accessType='inputOutput' appinfo='[X3DMetadataObject]' name='metadata' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
      </ProtoInterface>
      <ProtoBody>
        <IndexedFaceSet DEF='RenderedQS'>
          <IS>
            <connect nodeField='attrib' protoField='attrib'/>
            <connect nodeField='color' protoField='color'/>
            <connect nodeField='colorPerVertex' protoField='colorPerVertex'/>
            <connect nodeField='coord' protoField='coord'/>
            <connect nodeField='fogCoord' protoField='fogCoord'/>
            <connect nodeField='normal' protoField='normal'/>
            <connect nodeField='texCoord' protoField='texCoord'/>
            <connect nodeField='ccw' protoField='ccw'/>
            <connect nodeField='normalPerVertex' protoField='normalPerVertex'/>
            <connect nodeField='solid' protoField='solid'/>
          </IS>
        </IndexedFaceSet>
        <!-- Initial node in the PROTO body is actual node type, and the only node rendered. Remaining ProtoBody nodes not rendered -->
        <Group DEF='UnrenderedQS'>
          <Script DEF='QuadSetToIndexedFaceSet' directOutput='true'>
            <field accessType='initializeOnly' name='index' type='MFInt32'>
              <!-- initialized in ecmascript -->
            </field>
            <field accessType='inputOnly' name='set_index' type='MFInt32'/>
            <field accessType='initializeOnly' name='renderedQS' type='SFNode'>
              <IndexedFaceSet USE='RenderedQS'/>
            </field>
            <field accessType='initializeOnly' name='localTraceEnabled' type='SFBool' value='true'/>
            <field accessType='initializeOnly' name='coordIndexNew' type='MFInt32'>
              <!-- constructed during initialization -->
            </field>
            <![CDATA[
ecmascript:

function initialize()
{
	//colorPerVertex ignored in QuadSet, and always treated as "true"
	RenderedQS.colorPerVertex = true;

	// calculate index value from QuadSet coord values
	if (renderedQS.coord)
	{
		numberOfCoordinatePoints = renderedQS.coord.point.length;
	}
	else
	{
		tracePrint ('no Coordinate node found');
		return;
	}
	if (numberOfCoordinatePoints < 4)
	{
		alwaysPrint ('warning, numberOfCoordinatePoints=' + numberOfCoordinatePoints + ' insufficient to construct a quad, QuadSet ignored');
		return;
	}

	coordIndexNew = new MFInt32 ();

	// ii walks through index array,
	// goal is to initialize coordIndexNew list to match quads
	for (ii=0; ii <= numberOfCoordinatePoints-1; ii+=4)
	{
		// check if at least 4 vertices remaining to build a quad
		if ((numberOfCoordinatePoints - ii) < 4)
		{
			alwaysPrint ('error, index field does not contain a multiple' +
' of four coordinate values.');
			alwaysPrint ('The remaining vertices shall be ignored');
			return;
		}

		if ((index[ii]   == index[ii+1]) || (index[ii]   == index[ii+2]) || (index[ii] == index[ii+3]) ||
		    (index[ii+1] == index[ii+2]) || (index[ii+1] == index[ii+3]) ||
		    (index[ii+2] == index[ii+3]))
		{
			alwaysPrint ('index=' + index);
			alwaysPrint ('error, pair of equal indices in quad');
			return;
		}

		if (index[ii] >= 0)
		{
			// add another quad from latest 4 points of fan set to QS
			// order is ccw, i.e. in correct halfplane direction
			// note: there is an implicit "malloc" here for the'length' element of the array
			coordIndexNew [coordIndexNew.length] = index[ii];
			coordIndexNew [coordIndexNew.length] = index[ii+1];
			coordIndexNew [coordIndexNew.length] = index[ii+2];
			coordIndexNew [coordIndexNew.length] = index[ii+3];
			coordIndexNew [coordIndexNew.length] = -1;
		}

	  // incremental trace of array being built
	  tracePrint ('coordIndexNew=' + coordIndexNew);
	}
	renderedQS.set_coordIndex = coordIndexNew;
	tracePrint ('renderedQS.coordIndex=' + renderedQS.coordIndex);
	// match colorIndex if any Color node exists
//	if (nodesHolder.color)
//	{
//	  if (nodesHolder.color.color.length > 0)
//	  {
		//  Could implement color count check here
//	  }
//	}

	// no need to set colorIndex since indexedFaceSet semantics handles this
}
function set_index (value, timestamp)
{
	index = value;
	initialize ();
}
function tracePrint(outputString)
{
    if (localTraceEnabled)
	  Browser.println ('[IndexedQuadSet]' + outputString);
}
function alwaysPrint(outputString)
{
	Browser.println ('[IndexedQuadSet]' + outputString);
}
]]>
          </Script>
          <Group>
            <MetadataString name='metadataHolder'>
              <IS>
                <connect nodeField='metadata' protoField='metadata'/>
              </IS>
            </MetadataString>
          </Group>
        </Group>
      </ProtoBody>
    </ProtoDeclare>
    <!-- ======================================== -->
    <ProtoDeclare appinfo='The CADAssembly node holds a set of assemblies or parts grouped together.' name='CADAssembly'>
      <ProtoInterface>
        <field accessType='inputOnly' name='addChildren' type='MFNode'/>
        <field accessType='inputOnly' name='removeChildren' type='MFNode'/>
        <field accessType='inputOutput' appinfo='The children field can contain X3DProductStructureChildNode types. Each child will be either a sub-assembly or a part.' name='children' type='MFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='The name field documents the name of this CADAssembly.' name='name' type='SFString'/>
        <field accessType='initializeOnly' appinfo='Bounding box center: position offset from origin of local coordinate system.' name='bboxCenter' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' appinfo='Bounding box size: automatically calculated can be specified as an optimization or constraint.' name='bboxSize' type='SFVec3f' value='-1 -1 -1'/>
        <field accessType='inputOutput' appinfo='[X3DMetadataObject]' name='metadata' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
      </ProtoInterface>
      <ProtoBody>
        <Group>
          <IS>
            <connect nodeField='addChildren' protoField='addChildren'/>
            <connect nodeField='removeChildren' protoField='removeChildren'/>
            <connect nodeField='children' protoField='children'/>
            <connect nodeField='bboxCenter' protoField='bboxCenter'/>
            <connect nodeField='bboxSize' protoField='bboxSize'/>
          </IS>
        </Group>
        <Group>
          <MetadataString name='metadataHolder'>
            <IS>
              <connect nodeField='metadata' protoField='metadata'/>
            </IS>
          </MetadataString>
          <!-- name holder -->
          <Anchor url='"#hideWarning1"'>
            <IS>
              <connect nodeField='description' protoField='name'/>
            </IS>
          </Anchor>
        </Group>
      </ProtoBody>
    </ProtoDeclare>
    <!-- ======================================== -->
    <ProtoDeclare appinfo='local dummy node to hold value for CADFace' name='ShapeHolder'>
      <ProtoInterface>
        <field accessType='inputOutput' name='shape' type='SFNode'>
          <!-- no initialization value -->
        </field>
      </ProtoInterface>
      <ProtoBody>
        <Script DEF='HoldShapeNodeScript' directOutput='true'>
          <field accessType='inputOutput' appinfo='holder for IS field' name='shape' type='SFNode'>
            <!-- no initialization node -->
          </field>
          <IS>
            <connect nodeField='shape' protoField='shape'/>
          </IS>
          <![CDATA[
ecmascript:
// no script code, this node is simply a container

// silence warning: no function provided that includes shape = something;
]]>
        </Script>
      </ProtoBody>
    </ProtoDeclare>
    <!-- = = = = = -->
    <ProtoDeclare appinfo='The CADFace node holds the geometry representing a face of a part.' documentation='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/CadGeometry.html#CADFace' name='CADFace'>
      <ProtoInterface>
        <field accessType='inputOutput' appinfo='The name field documents the name of this CADFace.' name='name' type='SFString'/>
        <field accessType='inputOutput' appinfo='[X3DShapeNode | LOD]' name='shape' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='initializeOnly' appinfo='Bounding box center: position offset from origin of local coordinate system.' name='bboxCenter' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' appinfo='Bounding box size: automatically calculated can be specified as an optimization or constraint.' name='bboxSize' type='SFVec3f' value='-1 -1 -1'/>
        <field accessType='inputOutput' appinfo='[X3DMetadataObject]' name='metadata' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
      </ProtoInterface>
      <ProtoBody>
        <ProtoInstance name='ShapeHolder'>
          <IS>
            <connect nodeField='shape' protoField='shape'/>
          </IS>
        </ProtoInstance>
        <Group>
          <IS>
            <connect nodeField='bboxCenter' protoField='bboxCenter'/>
            <connect nodeField='bboxSize' protoField='bboxSize'/>
          </IS>
          <MetadataString name='metadataHolder'>
            <IS>
              <connect nodeField='metadata' protoField='metadata'/>
            </IS>
          </MetadataString>
          <!-- name holder -->
          <Anchor url='"#hideWarning2"'>
            <IS>
              <connect nodeField='description' protoField='name'/>
            </IS>
          </Anchor>
        </Group>
      </ProtoBody>
    </ProtoDeclare>
    <!-- ======================================== -->
    <ProtoDeclare appinfo='The CADLayer node defines a hierarchy of nodes used for showing layer structure.' documentation='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/CadGeometry.html#CADPart' name='CADLayer'>
      <ProtoInterface>
        <field accessType='inputOnly' name='addChildren' type='MFNode'/>
        <field accessType='inputOnly' name='removeChildren' type='MFNode'/>
        <field accessType='inputOutput' appinfo='The children field can contain X3DChildNode types.' name='children' type='MFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' appinfo='The name field documents the name of this CADLayer.' name='name' type='SFString'/>
        <field accessType='inputOutput' appinfo='specifies whether a particular child and its subchildren are visible. If the number of values is less than the number of children the remaining children shall be visible.' name='visible' type='MFBool'/>
        <field accessType='initializeOnly' appinfo='Bounding box center: position offset from origin of local coordinate system.' name='bboxCenter' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' appinfo='Bounding box size: automatically calculated can be specified as an optimization or constraint.' name='bboxSize' type='SFVec3f' value='-1 -1 -1'/>
        <field accessType='inputOutput' appinfo='[X3DMetadataObject]' name='metadata' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
      </ProtoInterface>
      <ProtoBody>
        <Group>
          <IS>
            <connect nodeField='addChildren' protoField='addChildren'/>
            <connect nodeField='removeChildren' protoField='removeChildren'/>
            <connect nodeField='children' protoField='children'/>
            <connect nodeField='bboxCenter' protoField='bboxCenter'/>
            <connect nodeField='bboxSize' protoField='bboxSize'/>
          </IS>
        </Group>
        <Group>
          <MetadataString name='metadataHolder'>
            <IS>
              <connect nodeField='metadata' protoField='metadata'/>
            </IS>
          </MetadataString>
          <!-- name holder -->
          <Anchor url='"#hideWarning3"'>
            <IS>
              <connect nodeField='description' protoField='name'/>
            </IS>
          </Anchor>
        </Group>
        <Script DEF='HoldMFBoolFieldScript'>
          <field accessType='inputOutput' name='visible' type='MFBool'>
            <!-- no initialization node -->
          </field>
          <IS>
            <connect nodeField='visible' protoField='visible'/>
          </IS>
          <![CDATA[
ecmascript:
// no script code, this node is simply a container
]]>
        </Script>
        <!-- No support for MFBool in VRML97, so no functionality provided for visible -->
      </ProtoBody>
    </ProtoDeclare>
    <!-- ======================================== -->
    <ProtoDeclare appinfo='CADPart represents the location and faces that constitute apart' documentation='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/CadGeometry.html#CADPart' name='CADPart'>
      <ProtoInterface>
        <field accessType='inputOnly' name='addChildren' type='MFNode'/>
        <field accessType='inputOnly' name='removeChildren' type='MFNode'/>
        <field accessType='inputOutput' appinfo='The children field can only contain CADFace nodes.' name='children' type='MFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
        <field accessType='inputOutput' name='name' type='SFString'/>
        <field accessType='inputOutput' name='translation' type='SFVec3f' value='0 0 0'/>
        <field accessType='inputOutput' name='rotation' type='SFRotation' value='0 0 1 0'/>
        <field accessType='inputOutput' name='center' type='SFVec3f' value='0 0 0'/>
        <field accessType='inputOutput' name='scale' type='SFVec3f' value='1 1 1'/>
        <field accessType='inputOutput' name='scaleOrientation' type='SFRotation' value='0 0 1 0'/>
        <field accessType='initializeOnly' name='bboxCenter' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' name='bboxSize' type='SFVec3f' value='-1 -1 -1'/>
        <field accessType='inputOutput' appinfo='[X3DMetadataObject]' name='metadata' type='SFNode'>
          <!-- Specification initialization: NULL node -->
        </field>
      </ProtoInterface>
      <ProtoBody>
        <Transform>
          <IS>
            <connect nodeField='children' protoField='children'/>
            <connect nodeField='addChildren' protoField='addChildren'/>
            <connect nodeField='removeChildren' protoField='removeChildren'/>
            <connect nodeField='translation' protoField='translation'/>
            <connect nodeField='rotation' protoField='rotation'/>
            <connect nodeField='center' protoField='center'/>
            <connect nodeField='scale' protoField='scale'/>
            <connect nodeField='scaleOrientation' protoField='scaleOrientation'/>
            <connect nodeField='bboxCenter' protoField='bboxCenter'/>
            <connect nodeField='bboxSize' protoField='bboxSize'/>
          </IS>
        </Transform>
        <Group>
          <MetadataString name='metadataHolder'>
            <IS>
              <connect nodeField='metadata' protoField='metadata'/>
            </IS>
          </MetadataString>
          <!-- name holder -->
          <Anchor url='"#hideWarning4"'>
            <IS>
              <connect nodeField='description' protoField='name'/>
            </IS>
          </Anchor>
        </Group>
      </ProtoBody>
    </ProtoDeclare>
    <!-- ======================================== -->
    <Anchor description='CadGeometryExternPrototypes' parameter='"target=_blank"' url='"CadGeometryExternPrototypes.x3d" "https://www.web3d.org/x3d/content/examples/Basic/development/CadGeometryExternPrototypes.x3d" "CadGeometryExternPrototypes.wrl" "https://www.web3d.org/x3d/content/examples/Basic/development/CadGeometryExternPrototypes.wrl"'>
      <Shape>
        <Text string='"CadGeometryExternPrototypes" "defines prototype examples" "" "Click text to see" "CadGeometryExternPrototypes"'>
          <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.9'/>
        </Text>
        <Appearance>
          <Material diffuseColor='1 1 0.2'/>
        </Appearance>
      </Shape>
    </Anchor>
    <!-- ======================================== -->
    <Transform translation='-3 2 0'>
      <Shape>
        <Appearance DEF='White'>
          <Material diffuseColor='1 1 1'/>
        </Appearance>
        <ProtoInstance containerField='geometry' name='IndexedQuadSet'>
          <fieldValue name='index' value='0 3 2 1 4 5 6 7 2 7 9 8 2 3 4 7'/>
          <fieldValue name='coord'>
            <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'/>
          </fieldValue>
        </ProtoInstance>
      </Shape>
    </Transform>
    <Transform translation='3 2 0'>
      <Shape>
        <Appearance USE='White'/>
        <ProtoInstance containerField='geometry' name='QuadSet'>
          <fieldValue name='coord'>
            <Coordinate 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'/>
          </fieldValue>
        </ProtoInstance>
      </Shape>
    </Transform>
    <!-- ======================================== -->
    <!-- Silence scene warnings by providing ordered ProtoInstance examples. Note warning above that this scene is for developmental use. The ProtoInstance form of the CAD nodes should not be used, native X3D encoding should be used instead. -->
    <ProtoInstance name='CADLayer'>
      <fieldValue name='children'>
        <ProtoInstance name='CADAssembly'>
          <fieldValue name='children'>
            <ProtoInstance name='CADPart'>
              <fieldValue name='children'>
                <ProtoInstance name='CADFace'>
                  <fieldValue name='shape'>
                    <Shape>
                      <Cylinder bottom='false' height='0.000001' radius='0.000001' side='false'/>
                      <Appearance>
                        <Material/>
                      </Appearance>
                    </Shape>
                  </fieldValue>
                </ProtoInstance>
              </fieldValue>
            </ProtoInstance>
          </fieldValue>
        </ProtoInstance>
      </fieldValue>
    </ProtoInstance>
  </Scene>
</X3D>