[x3d-public] Edge cases of Extrusion

Vincent Marchetti vmarchetti at ameritech.net
Thu Aug 20 07:43:15 PDT 2015


I have taken up Don Brutzmann's suggestion about starting a wiki page in the X3X3D-Public wiki to archive and summarize this discussion on the Extrusion node. The page is at http://www.web3d.org/wiki/index.php/Extrusion_Edge_Cases (so far just a place holder). Anyone with editing privileges is welcome to edit the page; but I suggest that any debate can take place in the mailing list and the wiki page would hold consensus results and references to useful resources such as Seva's test cases at http://www.jishop.com/temp/x3d/

So here's my contribution to the discussion. In his original posting on June 2, Seva pointed out a number of cases in which the standard's construction of the SCP (spine-aligned cross section plane) gives ambiguous or inconsistent results. Would it be useful to formally introduce a distinction between the sequence of spine_points and a sequence of distinct spine_points. As an analogy, in the definition of spline functions defined for a spline parameter s, there is a distinction made between a sequence of "knots", which might be [0,0,0,0.5,0.5,1,1,1] and a corresponding set of "breakpoints", which for this case would be [0, 0.5, 1] { See for example "The Nurbs Book", Les Piegl & Wayne Tiller, section 2.2}

For the definition of the Extrusion node, the geometric construction of the SCP would use the sequence of distinct spine points in 3D space. The presence of identical spine points would be allowed for the explicit purpose of allowing discontinuities in the orientation or scale factors; allowing modelling of stepped-features. This is again analogous to the knot-breakpoint distinction in spline definitions; duplicate knot values are uses to represent discontinuities in the derivatives of the spline function.

Seva also pointed out that for the case of a simple linear extrusion along one segment, which is practically speaking the most common case in CAD modelling, the standard is inconsistent when the extrusion is along the -y axis. -- I would go further and claim that the standard is ambiguous whenever the extrusion is not in the +y direction. It seems to me that the standard could be clarified to specify that for purely linear extrusions, the extrusion direction is always in the +y direction. This interpretation is strengthened by the default values for the spine field defined in the standard. For a linear extrusion; after the shape is defined as an extrusion in the +y direction, it can then be moved into position in the overall X3D by enclosing it in a Transform node -- this is the modelling techique used in some of the other Geometry3D nodes such as Box, Cone, Cylinder.

Vince Marchetti

> On Aug 18, 2015, at 12:25 AM, simon place <psiplace at netscape.net> wrote:
> 
>> Extrusion is a really important and valuable node.  I'm glad we are all
>> looking at it again!
> 
> i played with them at lot, they seemed to me to have the potential for
> simple progressive refinement, unlike IFS's where an editor is
> required and changes tend to cause a knock on need for more editing.
> 
> 
>> In addition to possible co-linearity/roundoff issues,
> 
> the changes needed to fix this are, i think, fundamental, and so
> backward compatibility breaking.
> did you read how the blaxxun player ignores the rotation and so has
> something defined.(shame they didn't call it "Extrusion2" or
> something.)
> 
>> I think we could
>> define a consistent triangulation of side quads.
> 
> quad texturing is a bit separate because its the same problem with the
> elevation node.
> for me leaving it to the player maker, to make the best choice, is
> fine, just what i felt was the best solution hasn't been chosen by any
> player i know of; add a new point, and average of the existing 4 and
> then have 4 triangles, like tessellation shaders, or the castle
> engines over triangulation option.
> 
> On 16 August 2015 at 18:44, Don Brutzman <brutzman at nps.edu> wrote:
>> 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
> 
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org

Vincent Marchetti
vmarchetti at ameritech.net






More information about the x3d-public mailing list