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='title' content='ExtrusionCrossSectionITSSPrototype.x3d'/> |
6 | <meta name='creator' content='Don Brutzman and Sungmin Kwon'/> |
7 | <meta name='created' content='23 October 2017'/> |
8 | <meta name='modified' content='19 August 2024'/> |
9 | <meta name='description' content='Shape prototype for Enclosing IndexedTriangleStripSet that also draws spine line plus oriented, scaled cross sections at each spine point.'/> |
10 | <meta name='hint' content='Utilize ExtrusionCrossSectionITSS ProtoInstance as if it is a Shape node (with containerField="children") rather than an Extrusion node (with containerField="geometry") under a Shape.'/> |
11 | <meta name='reference' content='https://en.wikipedia.org/wiki/Extrusion'/> |
12 | <meta name='reference' content='VRML 97 Specification, 6.18 Extrusion'/> |
13 | <meta name='reference' content='https://www.web3d.org/technicalinfo/specifications/vrml97/part1/nodesRef.html#Extrusion'/> |
14 |
<meta name='Image' content='VRML 97 Specification, Figure 6.6' |
15 |
<meta name='Image' content='https://www.web3d.org/technicalinfo/specifications/vrml97/Images/Extrusion.gif'![]() |
16 | <meta name='reference' content='http://realism.com/x3d/examples/Extrusion/_frame.html'/> |
17 | <meta name='reference' content='http://www.cs.brown.edu/~gss/vrml/drawpoly.html'/> |
18 | <meta name='reference' content='ExtrusionXj3dGoldberg1999.java'/> |
19 | <meta name='reference' content='http://web3d.metrolink.com/cgi-bin/cvsweb.cgi/x3d/src/com/sun/j3d/loaders/vrml97/impl/Attic/Extrusion.java'/> |
20 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionCrossSectionITSSPrototype.x3d'/> |
21 | <meta name='generator' content='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/> |
22 | <meta name='license' content='../license.html'/> |
23 | </head> |
24 | <Scene> |
25 | <WorldInfo title='ExtrusionCrossSectionITSSPrototype.x3d'/> |
26 | <ProtoDeclare name='ExtrusionCrossSectionITSS' appinfo='Shape prototype for Extrusion node that also draws spine line plus oriented scaled cross sections at each spine point' documentation='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionCrossSectionPrototype.x3d'> |
27 | <ProtoInterface> |
28 |
<field name='name' type='SFString' accessType='initializeOnly'
appinfo='Extrusion name'/> |
29 |
<field name='crossSection' type='MFVec2f' value='1 1 1 -1 -1 -1 -1 1 1 1' accessType='initializeOnly'
appinfo='Extrusion field'/> |
30 |
<field name='spine' type='MFVec3f' value='0 0 0 0 1 0' accessType='initializeOnly'
appinfo='Extrusion field'/> |
31 |
<field name='scale' type='MFVec2f' value='1 1' accessType='initializeOnly'
appinfo='Extrusion field'/> |
32 |
<field name='orientation' type='MFRotation' value='0 0 1 0' accessType='initializeOnly'
appinfo='Extrusion field'/> |
33 |
<field name='beginCap' type='SFBool' value='false' accessType='initializeOnly'
appinfo='Extrusion field'/> |
34 |
<field name='endCap' type='SFBool' value='false' accessType='initializeOnly'
appinfo='Extrusion field'/> |
35 |
<field name='ccw' type='SFBool' value='true' accessType='initializeOnly'
appinfo='Extrusion field'/> |
36 |
<field name='convex' type='SFBool' value='true' accessType='initializeOnly'
appinfo='Extrusion field'/> |
37 |
<field name='creaseAngle' type='SFFloat' value='0' accessType='initializeOnly'
appinfo='Extrusion field'/> |
38 |
<field name='solid' type='SFBool' value='true' accessType='initializeOnly'
appinfo='Extrusion field'/> |
39 |
<field name='spineColor' type='SFColor' value='0 0.9 0.8' accessType='inputOutput'
appinfo='emissiveColor of spine'/> |
40 |
<field name='crossSectionColor' type='SFColor' value='0.2 0.8 0.3' accessType='inputOutput'
appinfo='diffuseColor of crossSection'/> |
41 |
<field name='crossSectionTransparency' type='SFFloat' value='0.2' accessType='inputOutput'
appinfo='transparency of crossSection'/> |
42 |
<field name='extrusionColor' type='SFColor' value='0.3 0.3 0.3' accessType='inputOutput'
appinfo='diffuseColor of extrusion hull'/> |
43 |
<field name='extrusionTransparency' type='SFFloat' value='0.7' accessType='inputOutput'
appinfo='transparency of extrusion hull'/> |
44 |
<field name='extrusionImageTexture' type='SFNode' accessType='initializeOnly'
appinfo='Image to apply to Extrusion'> |
45 | <!-- initialization node (if any) goes here --> |
46 | </field> |
47 |
<field name='extrusionTextureTransform' type='SFNode' accessType='initializeOnly'
appinfo='TextureTransform coordinates of image applied to Extrusion'> |
48 | <!-- initialization node (if any) goes here --> |
49 | </field> |
50 |
<field name='set_crossSection' type='MFVec2f' accessType='inputOnly'
appinfo='Extrusion field'/> |
51 |
<field name='set_spine' type='MFVec3f' accessType='inputOnly'
appinfo='Extrusion field'/> |
52 |
<field name='set_scale' type='MFVec2f' accessType='inputOnly'
appinfo='Extrusion field'/> |
53 |
<field name='set_orientation' type='MFRotation' accessType='inputOnly'
appinfo='Extrusion field'/> |
54 |
<field name='traceEnabled' type='SFBool' value='false' accessType='initializeOnly'
appinfo='Whether to provide initialization trace statements showing node construction'/> |
55 | </ProtoInterface> |
56 | <ProtoBody> |
57 | <Group> |
58 | <Shape DEF='Spine'> |
59 |
<!-- ROUTE information for SpineLine node:
[from CrossSectionScript.spineIndex to set_coordIndex
]
-->
<IndexedLineSet DEF='SpineLine' colorPerVertex='false'> |
60 | <Coordinate DEF='SpineCoordinates'> |
61 | <IS> |
62 | <connect nodeField='point' protoField='spine'/> |
63 | <connect nodeField='set_point' protoField='set_spine'/> |
64 | </IS> |
65 | </Coordinate> |
66 | </IndexedLineSet> |
67 | <Appearance> |
68 | <Material DEF='SpineMaterial'> |
69 | <IS> |
70 | <connect nodeField='emissiveColor' protoField='spineColor'/> |
71 | </IS> |
72 | </Material> |
73 | </Appearance> |
74 | </Shape> |
75 | <Shape DEF='InternalCrossSections'> |
76 |
<!-- ROUTE information for CrossSectionFaces node:
[from CrossSectionScript.facesIndex to set_index
]
-->
<IndexedTriangleFanSet DEF='CrossSectionFaces' ccw='true' colorPerVertex='true' normalPerVertex='true' solid='false' containerField='geometry'> |
77 |
<!-- ROUTE information for CrossSectionFacesCoordinates node:
[from CrossSectionScript.facePoints to point
]
-->
<Coordinate DEF='CrossSectionFacesCoordinates'/> |
78 | </IndexedTriangleFanSet> |
79 | <Appearance> |
80 | <Material DEF='CrossSectionMaterial'> |
81 | <IS> |
82 | <connect nodeField='diffuseColor' protoField='crossSectionColor'/> |
83 | <connect nodeField='transparency' protoField='crossSectionTransparency'/> |
84 | </IS> |
85 | </Material> |
86 | </Appearance> |
87 | </Shape> |
88 | <Shape DEF='ExternalExtrusion2'> |
89 | <Appearance DEF='ExtrusionAppearance2'> |
90 | <IS> |
91 | <connect nodeField='texture' protoField='extrusionImageTexture'/> |
92 | <connect nodeField='textureTransform' protoField='extrusionTextureTransform'/> |
93 | </IS> |
94 | <Material DEF='ExtrusionMaterial2'> |
95 | <IS> |
96 | <connect nodeField='diffuseColor' protoField='extrusionColor'/> |
97 | <connect nodeField='transparency' protoField='extrusionTransparency'/> |
98 | </IS> |
99 | </Material> |
100 | </Appearance> |
101 |
<!-- ROUTE information for EnclosingExtrusion2 node:
[from CrossSectionScript.triStripIndex to set_index
]
-->
<IndexedTriangleStripSet DEF='EnclosingExtrusion2' ccw='true' colorPerVertex='true' index='0 1 2' normalPerVertex='true' solid='true' containerField='geometry'> |
102 |
<!-- ROUTE information for ExtrusionCoordinates2 node:
[from CrossSectionScript.facePoints to point
]
-->
<Coordinate DEF='ExtrusionCoordinates2'/> |
103 | </IndexedTriangleStripSet> |
104 | </Shape> |
105 | <!-- <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> --> |
106 | </Group> |
107 | <!-- TODO hardwired local Script path to workaround BS Contact bug --> |
108 |
<!-- 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://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/ExtrusionCrossSectionITSSPrototype.js" '> |
109 | <field name='name' type='SFString' accessType='initializeOnly'/> |
110 | <field name='crossSection' type='MFVec2f' accessType='initializeOnly'/> |
111 | <field name='spine' type='MFVec3f' accessType='initializeOnly'/> |
112 | <field name='scale' type='MFVec2f' accessType='initializeOnly'/> |
113 | <field name='orientation' type='MFRotation' accessType='initializeOnly'/> |
114 | <field name='spineColor' type='SFColor' accessType='inputOutput'/> |
115 | <field name='crossSectionColor' type='SFColor' accessType='inputOutput'/> |
116 | <field name='crossSectionTransparency' type='SFFloat' accessType='inputOutput'/> |
117 | <field name='extrusionColor' type='SFColor' accessType='inputOutput'/> |
118 | <field name='extrusionTransparency' type='SFFloat' accessType='inputOutput'/> |
119 | <field name='set_crossSection' type='MFVec2f' accessType='inputOnly'/> |
120 | <field name='set_spine' type='MFVec3f' accessType='inputOnly'/> |
121 | <field name='set_scale' type='MFVec2f' accessType='inputOnly'/> |
122 | <field name='set_orientation' type='MFRotation' accessType='inputOnly'/> |
123 | <field name='spineIndex' type='MFInt32' accessType='outputOnly'/> |
124 | <field name='facesIndex' type='MFInt32' accessType='outputOnly'/> |
125 | <field name='facePoints' type='MFVec3f' accessType='outputOnly'/> |
126 | <field name='triStripIndex' type='MFInt32' accessType='outputOnly'/> |
127 | <field name='traceEnabled' type='SFBool' accessType='initializeOnly'/> |
128 | <!-- local variables --> |
129 | <field name='computedFacesIndex' type='MFInt32' accessType='initializeOnly'/> |
130 | <field name='computedFacePoints' type='MFVec3f' accessType='initializeOnly'/> |
131 | <field name='computedTriStripIndex' type='MFInt32' accessType='initializeOnly'/> |
132 | <IS> |
133 | <connect nodeField='name' protoField='name'/> |
134 | <connect nodeField='crossSection' protoField='crossSection'/> |
135 | <connect nodeField='spine' protoField='spine'/> |
136 | <connect nodeField='scale' protoField='scale'/> |
137 | <connect nodeField='spineColor' protoField='spineColor'/> |
138 | <connect nodeField='crossSectionColor' protoField='crossSectionColor'/> |
139 | <connect nodeField='crossSectionTransparency' protoField='crossSectionTransparency'/> |
140 | <connect nodeField='extrusionColor' protoField='extrusionColor'/> |
141 | <connect nodeField='extrusionTransparency' protoField='extrusionTransparency'/> |
142 | <connect nodeField='orientation' protoField='orientation'/> |
143 | <connect nodeField='set_crossSection' protoField='set_crossSection'/> |
144 | <connect nodeField='set_spine' protoField='set_spine'/> |
145 | <connect nodeField='set_scale' protoField='set_scale'/> |
146 | <connect nodeField='set_orientation' protoField='set_orientation'/> |
147 | <connect nodeField='traceEnabled' protoField='traceEnabled'/> |
148 | </IS> |
149 | </Script> |
150 | < ROUTE fromNode='CrossSectionScript' fromField='spineIndex' toNode='SpineLine' toField='set_coordIndex'/> |
151 | < ROUTE fromNode='CrossSectionScript' fromField='facesIndex' toNode='CrossSectionFaces' toField='set_index'/> |
152 | < ROUTE fromNode='CrossSectionScript' fromField='facePoints' toNode='CrossSectionFacesCoordinates' toField='point'/> |
153 | < ROUTE fromNode='CrossSectionScript' fromField='triStripIndex' toNode='EnclosingExtrusion2' toField='set_index'/> |
154 | <Group> |
155 | <!-- ======= ROUTE Trace ============================================== --> |
156 |
<!-- 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_index' mustEvaluate='true'> |
157 | <!-- Trace ROUTEd event values on X3D browser console --> |
158 |
<field name='reportInterval' type='SFTime' value='1.0' accessType='initializeOnly'
appinfo='Sampling frequency in seconds (0 means all values)'/> |
159 | <field name='traceValue' type='MFInt32' accessType='inputOnly'/> |
160 | <field name='timeStampPreviousReport' type='SFTime' value='-1' accessType='initializeOnly'/> |
162 | </Script> |
163 | < ROUTE fromNode='CrossSectionScript' fromField='triStripIndex' toNode='Trace_ROUTE_CrossSectionScript_triStripIndex_TO_EnclosingExtrusion2_set_index' toField='traceValue'/> |
164 | <!-- ======= ROUTE Trace block complete ===================================================== --> |
165 | </Group> |
166 | < ROUTE fromNode='CrossSectionScript' fromField='facePoints' toNode='ExtrusionCoordinates2' toField='point'/> |
167 | <!-- --> |
168 | </ProtoBody> |
169 | </ProtoDeclare> |
170 | <!-- ==================== --> |
171 | <!-- Example instance adapted from Figure15.12Torus.x3d --> |
172 | <!-- https://www.web3d.org/x3d/content/examples/Basic/Vrml2Sourcebook/Chapter15-Extrusion/Figure15.12Torus.x3d --> |
173 | <!-- Redirection text in case a user examines this PROTO file via a 3D browser: --> |
174 | <Group> |
175 | <Transform translation='0 0.5 0'> |
176 | <Shape> |
177 | <Appearance> |
178 | <Material diffuseColor='0 1 1' emissiveColor='0 1 1'/> |
179 | </Appearance> |
180 | <Text string='"ExtrusionCrossSectionITSS" "is a Prototype definition scene"'> |
181 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.7'/> |
182 | </Text> |
183 | </Shape> |
184 | </Transform> |
185 | </Group> |
186 | </Scene> |
187 | </X3D> |
Event Graph ROUTE Table entries with 6 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.
CrossSectionScript
Script spineIndex MFInt32 |
SpineLine
IndexedLineSet set_coordIndex MFInt32 |
|
CrossSectionScript
Script facesIndex MFInt32 |
CrossSectionFaces
IndexedTriangleFanSet set_index MFInt32 |
|
CrossSectionScript
Script facePoints MFVec3f |
CrossSectionFacesCoordinates
Coordinate point MFVec3f |
|
CrossSectionScript
Script triStripIndex MFInt32 |
EnclosingExtrusion2
IndexedTriangleStripSet set_index MFInt32 |
|
CrossSectionScript
Script triStripIndex MFInt32 |
Trace_ROUTE_CrossSectionScript_triStripIndex_TO_EnclosingExtrusion2_set_index
Script traceValue MFInt32 |
|
CrossSectionScript
Script facePoints MFVec3f |
ExtrusionCoordinates2
Coordinate point MFVec3f |
<!--
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)
<ProtoDeclare
name='ProtoName'>
<field
name='fieldName'/> </ProtoDeclare>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->