[x3d-public] Edge cases of Extrusion

Alekseyev, Vsevolod (NIH/NIAID) [E] VAlekseyev at niaid.nih.gov
Wed Jun 10 10:53:36 PDT 2015

Blender (with my edits) takes it.


But those are not truly pathological examples, like the ones I've talked about. Hold on, let me give you some tricky ones.

-----Original Message-----
From: Don Brutzman [mailto:brutzman at nps.edu] 
Sent: Wednesday, June 10, 2015 1:27 PM
To: Alekseyev, Vsevolod (NIH/NIAID) [E]
Cc: X3D Graphics public mailing list
Subject: Re: [x3d-public] Edge cases of Extrusion

Thanks Seva.

We're definitely interested... just been busy with Schema and conference preparations.

I've previously created a test scene that may help, am happy to add more examples that illustrate proper use.  Having examples (and validating them) for the issues you've posed would be great.


Looks like X3DOM is getting close to covering all of these cases:

(view3dscene wouldn't load it)

Xj3D only works on some cases of Extrusion.  There is a verbose mode for console output that has helped with troubleshooting to date.

Since Extrusion implementation is a perennial issue, it might be a good idea to create a web3d wiki page regarding implementation trickiness, proper algorithms, etc.  Perhaps we should also create another scene with anomalies or illegal cases.

Looking at this together will help us really get precise on whether & what spec definitions need to be improved.

On 6/10/2015 8:20 AM, Alekseyev, Vsevolod (NIH/NIAID) [E] wrote:
> In the spirit of the spec review, did anyone maybe get a chance to review the Extrusion spec in light of the problems that I've outlined at http://web3d.org/pipermail/x3d-public_web3d.org/2015-June/003412.html ?
> There's one more problem with coincident spine points that I forgot to mention: the algorithm for CSP Y calculation in case of coincident spine points is inconsistent with the "special cases" rule that CSP for coincident points should match. It's entirely unclear rule takes precedence.


p.s. another piece: here are the QA tests for extrusion that are in X3D Schematron:


     <!-- ========= 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'  beginCap='true' instead</report>
       <report test="(@beginCap='FALSE')" role="error">&NodeDEFname; beginCap='FALSE'  beginCap='false' instead</report>
       <report test="(@endCap='TRUE'   )" role="error">&NodeDEFname; endCap='TRUE'  endCap='true' instead</report>
       <report test="(@endCap='FALSE'  )" role="error">&NodeDEFname; endCap='FALSE'  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>

p.s. for anyone interested who is able to go to Web3D 2015 conference, am happy to meet and discuss further there.

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