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='Interchange' 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 | <component level='3' name='NURBS'/> |
6 | <meta name='title' content='NurbsSweptSurfaceExample.x3d'/> |
7 | <meta name='description' content='X3D Architecture example: NurbsSweptSurface demonstration.'/> |
8 | <meta name='creator' content='Doug Sanden and Don Brutzman'/> |
9 | <meta name='created' content='13 April 2022'/> |
10 | <meta name='modified' content='22 November 2023'/> |
11 | <meta name='Image' content='NurbsSweptSurfaceExample.png'/> |
12 | <meta name='specificationSection' content='X3D Architecture, 27 NURBS component, 27.4.11 NurbsSweptSurface'/> |
13 | <meta name='specificationUrl' content='https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/nurbs.html#NurbsSweptSurfaceExample'/> |
14 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/NurbsSweptSurfaceExample.x3d'/> |
15 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
16 | <meta name='license' content='../license.html'/> |
17 | </head> |
18 | <Scene> |
19 | <Group> |
20 | <Shape> |
21 | <LineSet vertexCount='2' containerField='geometry'> |
22 | <Coordinate point='0 0 0 4 0 0'/> |
23 | </LineSet> |
24 | <Appearance> |
25 | <Material emissiveColor='1 0 0'/> |
26 | <LineProperties linewidthScaleFactor='4' containerField='lineProperties'/> |
27 | </Appearance> |
28 | </Shape> |
29 | <Shape> |
30 | <LineSet vertexCount='2' containerField='geometry'> |
31 | <Coordinate point='0 0 0 0 4 0'/> |
32 | </LineSet> |
33 | <Appearance> |
34 | <Material emissiveColor='0 1 0'/> |
35 | <LineProperties linewidthScaleFactor='4' containerField='lineProperties'/> |
36 | </Appearance> |
37 | </Shape> |
38 | <Shape> |
39 | <LineSet vertexCount='2' containerField='geometry'> |
40 | <Coordinate point='0 0 0 0 0 4'/> |
41 | </LineSet> |
42 | <Appearance> |
43 | <Material emissiveColor='0 0 1'/> |
44 | <LineProperties linewidthScaleFactor='4' containerField='lineProperties'/> |
45 | </Appearance> |
46 | </Shape> |
47 | </Group> |
48 | <Background skyColor='1 1 1' transparency='1.0'/> |
49 | <Viewpoint/> |
50 | <Transform> |
51 | <Shape> |
52 | <Appearance> |
53 | <Material transparency='.5'/> |
54 | </Appearance> |
55 | <NurbsSweptSurface solid='false' containerField='geometry'> |
56 |
<!-- NurbsCurve
TRAJECTORY is a DEF node that has 1 USE node: USE_1 -->
<NurbsCurve DEF='TRAJECTORY' containerField='trajectoryCurve' knot='0 0 0 1 2 3 4 5 5 5' weight='1 1 1 1 1 1 1'> |
57 |
<!-- Coordinate
TRAJECTORYCONTROLPTS is a DEF node that has 1 USE node: USE_1 --> <Coordinate DEF='TRAJECTORYCONTROLPTS' containerField='controlPoint' point='0 2 4 0 2 2 0 0 2 2 0 2 2 0 0 2 4 0 2 4 2'/> |
58 | <!-- Coordinate DEF='TRAJECTORYCONTROLPTS' containerField='controlPoint' point='4 0 2, 2 0 2, 2 0 0, 2 2 0, 0 2 0, 0 2 4, 2 2 4' / --> |
59 | </NurbsCurve> |
60 | <NurbsCurve2D containerField='crossSectionCurve' controlPoint='-.25 0 .5 0 .5 .25 0 .5 .5 .75 .5 1 -.25 1 -.25 0' knot='0 0 0 1 2 3 4 5 6 6 6' tessellation='30' weight='1 1 1 1 1 1 1 1'/> |
61 | </NurbsSweptSurface> |
62 | </Shape> |
63 | </Transform> |
64 | <Transform> |
65 | <Shape> |
66 | <Appearance> |
67 | <Material DEF='CYAN' diffuseColor='0 .8 .8'/> |
68 | <LineProperties linewidthScaleFactor='6' containerField='lineProperties'/> |
69 | </Appearance> |
70 | <!-- To convert a NurbsCurve2D control curve to a displayable NurbsCurve 1. rename element NurbsCurve2D -> NurbsCurve 2. cut controlPoint= field and paste into child node CoordinateDouble point field 3. edit point field adding a 3rd (z) = 0 to each xy point --> |
71 | <NurbsCurve DEF='CROSSSECTION' knot='0 0 0 1 2 3 4 5 6 6 6' weight='1 1 1 1 1 1 1 1' containerField='geometry'> |
72 | <CoordinateDouble containerField='controlPoint' point='-0.25 0 0 0.5 0 0 0.5 0.25 0 0 0.5 0 0.5 0.75 0 0.5 1 0 -0.25 1 0 -0.25 0 0'> |
73 | <!-- point array (8 tuples, 24 total doubles) has closed geometry with coincident endpoints --> |
74 | </CoordinateDouble> |
75 | </NurbsCurve> |
76 | </Shape> |
77 | <Shape> |
78 | <Appearance> |
79 | <Material DEF='MAGENTA' diffuseColor='.8 0 .8'/> |
80 | <LineProperties linewidthScaleFactor='6' containerField='lineProperties'/> |
81 | </Appearance> |
82 | <NurbsCurve USE='TRAJECTORY' containerField='geometry'/> |
83 | </Shape> |
84 | <Shape> |
85 | <Appearance> |
86 | <Material DEF='GRAY' diffuseColor='.5 .5 .5' transparency='.5'/> |
87 | <LineProperties linewidthScaleFactor='6' containerField='lineProperties'/> |
88 | </Appearance> |
89 | <NurbsCurve DEF='TRAJECTORYCONTROLLINES' knot='0 0 1 2 3 4 5 6 6' order='2' weight='1 1 1 1 1 1 1' containerField='geometry'> |
90 | <Coordinate USE='TRAJECTORYCONTROLPTS' containerField='controlPoint'/> |
91 | </NurbsCurve> |
92 | </Shape> |
93 | </Transform> |
94 | </Scene> |
95 | </X3D> |
<!--
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)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->