[X3D-Public] CAD examples errors

Michalis Kamburelis michalis.kambi at gmail.com
Wed Apr 24 11:33:06 PDT 2013


I noticed a link to CAD component examples on 
http://www.web3d.org/x3d/content/examples/Basic/CAD/ . It seems there 
are a couple of errors in the test files, i.e. they do not conform to 
the X3D specification (they declare in header X3D 3.0 or 3.1 spec versions).

1. "Cad Design Pattern Examples": contains Transform node inside 
CADFace. This is invalid, X3D spec (checked 3.1 and 3.3 versions) says 
that CADFace can only contain (inside "shape" field) the [X3DShapeNode, 
LOD] nodes. So, Transform is not allowed there.

2. "Cad Geometry Extern Prototypes": it indirectly (though 
) links to 
, and MetadataPrototypes.wrl is invalid: the manner in which it uses 
DEF/USE of "HideWarnings" is invalid. It makes "DEF HideWarnings" inside 
a PROTO MetadataDouble, and then inside another PROTO MetadataFloat it 
does "USE HideWarnings".

This is incorrect, as each PROTO has a separate namespace for DEF/USE 
names. See X3D 3.3 spec: 
: "Nodes given a name by a DEF construct inside the prototype may not be 
referenced in a USE construct outside of the prototype's scope.".

The simplest fix would be to update MetadataPrototypes.wrl to always do 
"DEF HideWarnings ... { }" instead of trying to reUSE the HideWarnings name.

3. "Cad Geometry Prototypes": the example in classic encoding 
(CadGeometryPrototypes.x3dv) has a parsing error: on line 110, within a 
url with ecmascript: contents, the double quotes should be escaped. 
There is:

//colorPerVertex ignored in IndexedQuadSet, and always treated as "true"

but it should be

//colorPerVertex ignored in IndexedQuadSet, and always treated as \"true\"

The version in XML encoding seems Ok, so it's probably some bug in 
(probably automatic) generation of the classic version.

4. "CADPart Child Transformation Alternative A": same problem as 1., 
Transform node is used inside CADFace. The comments inside say

   "Developer scene to explore Mantis Issue 528 Alternative A for 
transformation of CADFace children: allow Transform node as child of 

and links to member-only 
http://www.web3d.org/membership/login/mantis/view.php?id=528 . I guess 
you guys are working on it :) Either the testcase should be fixed, or 
the spec should be updated to allow Transform as child of CADFace in 
next X3D version. This example declares X3D 3.1 in the header.

I see that "CADPart Child Transformation Alternative B" and "CADPart 
Child Transformation Alternative C" are exploring other ideas for 
putting transformations inside.

Everything else seems working perfectly :) I tested with view3dscene, 
simply opening the files in XML and classic encoding with view3dscene 
(from snapshots http://michalis.ii.uni.wroc.pl/castle-engine-snapshots/ 
, since the CAD level 2 support in view3dscene is new).

See X3D specification "CAD geometry component": for X3D 3.1: 
, for latest X3D 3.3: 
. I think that my comments above are true regardless of X3D spec version.


More information about the X3D-Public mailing list