Motivation
Extruded shapes are very common
- Tubes, pipes, bars, vases, donuts
- Other tricky uses...
How can you do it:
- You can build extruded shapes using an IndexedFaceSet node.
- You can build extruded shapes more easily and efficiently using an Extrusion node.
Syntax: Extrusion
An Extrusion geometry node creates extruded geometry:
- crossSection - 2-D cross-section
- spine - 3-D sweep path
- endCap and beginCap - cap ends
XML Encoding
1 2 3 4 5 6 7 8 9 |
<Shape> <Appearance><!-- ... --></Appearance> <Extrusion crossSection='...' spine='...' endCap='true' beginCap='true' ... /> </Shape> |
Classic Encoding
1 2 3 4 5 6 7 8 9 10 |
Shape { appearance Appearance { ... } geometry Extrusion { crossSection [ ... ] spine [ ... ] endCap TRUE beginCap TRUE ... } } |
An Extrusion geometry node creates extruded geometry:
- solid - shape is solid
- ccw - faces are counter-clockwise
- convex - faces are convex
XML Encoding
1 2 3 4 5 6 7 8 |
<Shape> <Appearance><!-- ... --></Appearance> <Extrusion ... solid='true' ccw='true' convex='true'/> </Shape> |
Classic Encoding
1 2 3 4 5 6 7 8 9 |
Shape { appearance Appearance { ... } geometry Extrusion { ... solid TRUE ccw TRUE convex TRUE } } |
Syntax: Extrusion
An Extrusion geometry node creates geometry using:
- scale - cross-section scaling per spine point
- orientation - cross-section rotation per spine point
XML Encoding
1 2 3 4 5 6 7 |
<Shape> <Appearance><!-- ... --></Appearance> <Extrusion ... scale='...' orientation='...'/> </Shape> |
Classic Encoding
1 2 3 4 5 6 7 8 |
Shape { appearance Appearance { ... } geometry Extrusion { ... scale [ ... ] orientation [ ... ] } } |
Summary
- An Extrusion node efficiently creates extruded shapes
- The crossSection field specifies the cross-section
- The spine field specifies the sweep path
- The scale and orientation fields specify scaling and rotation at each spine point