[x3d-public] Edge cases of Extrusion

Don Brutzman brutzman at nps.edu
Sun Aug 16 10:44:15 PDT 2015


Thanks for the helpful reference Simon.  Really interesting details in that thread.

Extrusion is a really important and valuable node.  I'm glad we are all looking at it again!

Extrusion support is mostly working, but it has always been difficult for different X3D players to implement Extrusion consistently.  Perhaps there some edge cases overlooked by the specification which have something to do with that.

Since there is so much discussion going on with Extrusion, we should start collecting all of the information about issues in one place... several of us are interested.

As discussed previously, we probably should schedule a dedicated X3D meeting to explore in depth.  This week is post-SIGGRAPH review, next week will be overshadowed by several of us attending the annual ISO Standards Committee meeting in London to review formal X3D progress and planned specifications.  Early September perhaps?

Wondering if a Web3D Consortium member is willing to maintain a public web3d.org page about this?  I can do it if people like, but things might proceed faster with someone less overcommitted!  8)

On 8/9/2015 7:27 PM, simon place wrote:
> FWIW
>
> see this discussion;
> http://sourceforge.net/p/castle-engine/tickets/13/  ,where Extrusion,
> as currently defined, is considered to be broken, having, as it does,
> discontinuities exactly at co-linear spline point arrangements and
> there being no way to consistently determine co-linearity due to
> standard maths rounding issues.
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org

In addition to possible co-linearity/roundoff issues, I think we could define a consistent triangulation of side quads.  At least extrusions would render consistently among players then, and authors could reverse spine array order or crossSection array order if they preferred a particular tesselation.

I was looking around for the primary list of Castle Game Engine recommended changes but had trouble finding it this time... got link?

Xj3D mostly works, but still has a problem with handling of orientation array values:
http://x3dgraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/_viewpoints/ExtrusionExamplesTest.x3d._VP_Extrusion_examples.png	

Preliminary list of references for an Extrusion page:

	X3D Graphics Abstract Specification
	13.3.5 Extrusion
	http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/geometry3D.html#Extrusion

	X3D for Web Authors, Chapter 6: Points Lines and Polygons, slides 54-72 and (with notes) slides 146-164
	http://x3dgraphics.com/slidesets/X3dForWebAuthors/Chapter06-GeometryPointsLinesPolygons.pdf

	X3D Example Archives: Conformance Nist, Geometry, Extrusion (18 examples)
	http://www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/Extrusion

	X3D Example Archives: VRML 2.0 Sourcebook, Chapter 15 - Extrusion (17 examples)
	http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter15-Extrusion

	X3D Example Archives: X3D for Web Authors, Chapter 06 - Geometry Points Lines Polygons
	http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter06-GeometryPointsLinesPolygons

	X3D Example Archives: X3D for Advanced Modeling, Geometric Shapes, Extrusion Examples Test
	http://x3dgraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/ExtrusionExamplesTest.x3d
	
	Helpful ExtrusionCrossSection prototype makes spine and crossSection geometries visible:
	http://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionExampleTorus.x3d
	http://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionExampleShip.x3d
	http://www.web3d.org/x3d/content/examples/Basic/course/ExtrusionCrossSectionPrototype.x3d

	X3D Tooltips: Extrusion
	http://www.web3d.org/x3d/content/X3dTooltips.html#Extrusion

	Castle Game Engine Geometry3D component
	http://castle-engine.sourceforge.net/x3d_implementation_geometry3d.php

	X3D Schematron: Extrusion diagnostic rules
	http://www.web3d.org/x3d/tools/schematron/X3dSchematron.html
	http://www.web3d.org/x3d/tools/schematron/X3dSchematronValidityChecks.sch

     <!-- ========= Extrusion ========== -->
     <rule context="Extrusion">
       <let name="crossSection"             value="normalize-space(translate(@crossSection,',',' '))"/>
       <let name="spine"                    value="normalize-space(translate(@spine,       ',',' '))"/>
       <let name="scale"                    value="normalize-space(translate(@scale,       ',',' '))"/>
       <let name="orientation"              value="normalize-space(translate(@orientation, ',',' '))"/>
       <let name="crossSectionCount"        value="string-length($crossSection)      - string-length(translate($crossSection,' ','')) + 1"/>
       <let name="spineCount"               value="string-length($spine)             - string-length(translate($spine,       ' ','')) + 1"/>
       <let name="scaleCount"               value="string-length($scale)             - string-length(translate($scale,       ' ','')) + 1"/>
       <let name="orientationCount"         value="string-length($orientation)       - string-length(translate($orientation, ' ','')) + 1"/>
       <let name="crossSectionResidue"      value="translate($crossSection,     '+-0123456789Ee., ','')"/>
       <let name="spineResidue"             value="translate($spine,            '+-0123456789Ee., ','')"/>
       <let name="scaleResidue"             value="translate($scale,            '+-0123456789Ee., ','')"/>
       <let name="orientationResidue"       value="translate($orientation,      '+-0123456789Ee., ','')"/>
       <extends rule="geometryNode"/>
       <extends rule="NoChildNode"/>
       <extends rule="creaseAngle"/>
       <report test="($crossSectionCount = 0)" role="warning">&NodeDEFname; missing crossSection </report>
       <report test="($spineCount = 0)"        role="warning">&NodeDEFname; missing spine </report>
       <assert test="string-length($crossSectionResidue) = 0" role="error">&NodeDEFname; has illegal character <value-of select='$crossSectionResidue'/> in crossSection array (crossSection='<value-of select='@crossSection'/>') </assert>
       <assert test="string-length($scaleResidue)        = 0" role="error">&NodeDEFname; has illegal character <value-of select='$scaleResidue'/> in scale array (scale='<value-of select='@scale'/>') </assert>
       <assert test="string-length($spineResidue)        = 0" role="error">&NodeDEFname; has illegal character <value-of select='$spineResidue'/> in spine array (spine='<value-of select='@spine'/>') </assert>
       <assert test="string-length($orientationResidue)  = 0" role="error">&NodeDEFname; has illegal character <value-of select='$orientationResidue'/> in orientation array (orientation='<value-of select='@orientation'/>') </assert>
       <!-- check for legal array tuples -->
       <assert test="(($crossSectionCount mod 2) = 0)" role="warning">&NodeDEFname; crossSection array size <value-of select='$crossSectionCount div 2'/> does not have legal number of MFVec2f values, must be evenly divisible by 2 (crossSection='<value-of select='@crossSection'/>') </assert>
       <assert test="(($scaleCount mod 2)        = 0)" role="warning">&NodeDEFname; scale array size <value-of select='$scaleCount div 2'/> does not have legal number of MFVec2f values, must be evenly divisible by 2 (scale='<value-of select='@scale'/>') </assert>
       <assert test="(($spineCount mod 3)        = 0)" role="warning">&NodeDEFname; spine array size <value-of select='$spineCount div 3'/> does not have legal number of MFVec3f values, must be evenly divisible by 3 (spine='<value-of select='@spine'/>') </assert>
       <assert test="(($orientationCount mod 4)  = 0)" role="warning">&NodeDEFname; orientation array size <value-of select='$orientationCount div 4'/> does not have legal number of MFRotation values, must be evenly divisible by 4 (orientation='<value-of select='@orientation'/>') </assert>
       <!-- check for sufficient array size -->
       <assert test="(($spineCount = 0)      or ($spineCount > 5))" role="error">&NodeDEFname; spine array size of <value-of select='$spineCount'/> is insufficient to define a line segment, must have 6 or more values (spine='<value-of select='@spine'/>') </assert>
       <!-- check for matching array sizes -->
       <assert test="($scaleCount = 0)       or ($scaleCount = 2)       or (($scaleCount div 2)       = ($spineCount div 3))" role="warning">&NodeDEFname; scale array size <value-of select='$scaleCount div 2'/> (scale='<value-of select='@scale'/>') must match spine array size <value-of select='$spineCount div 3'/> </assert>
       <assert test="($orientationCount = 0) or ($orientationCount = 4) or (($orientationCount div 4) = ($spineCount div 3))" role="warning">&NodeDEFname; orientation array size <value-of select='$orientationCount div 4'/> (orientation='<value-of select='@orientation'/>') must match spine array size <value-of select='$spineCount div 3'/> </assert>
       <report test="(@beginCap='TRUE' )" role="error">&NodeDEFname; beginCap='TRUE' capitalization is incorrect, define as beginCap='true' instead</report>
       <report test="(@beginCap='FALSE')" role="error">&NodeDEFname; beginCap='FALSE' capitalization is incorrect, define as beginCap='false' instead</report>
       <report test="(@endCap='TRUE')"  role="error">&NodeDEFname; endCap='TRUE' capitalization is incorrect, define as endCap='true' instead</report>
       <report test="(@endCap='FALSE')" role="error">&NodeDEFname; endCap='FALSE' capitalization is incorrect, define as endCap='false' instead</report>
       <report test="not(/X3D[(@profile='Immersive') or (@profile='Full')] or /X3D/head/component[@name='Geometry3D'][number(@level) ge 4] or (count(preceding::*[local-name()=$NodeName]) > 0))" role="error">&NodeDEFname; requires at least <component name='Geometry3D' level='4'/> or <X3D profile='Immersive'/> </report>
     </rule>
<!-- ========= ========= ========== -->

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list