Difference between revisions of "CADPart"

From Web3D.org
Jump to: navigation, search
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
* [[Node Reference]]
 
* [[Node Reference]]
 
==CADPart==
 
==CADPart==
 +
 +
Specification Link: [http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/CADGeometry.html#CADPart CADPart]
  
 
<pre>
 
<pre>
Line 19: Line 21:
 
</pre>
 
</pre>
  
The CADPart node is a grouping node that defines a coordinate system for its children that is relative to the coordinate systems of its ancestors. See the ''Transformation hierarchy and Standard units and coordinate system'' sections of the X3D specification for a description of coordinate systems and transformations.
+
==DTD Validation==
 +
 
 +
===Children===
 +
 
 +
Children must appear as follows:
  
The CADPart node represents the location and faces that constitute a part in the CAD model.
+
# A single, optional IS.
 +
# A single, optional node derived from ''X3DMetadataObject'' for the ''metadata'' field.
 +
# A single, optional CADFace or appropriately derived Prototype node.
  
The ''Grouping and children node types'' section of the X3D specification provides a description of the ''children'', ''addChildren'', and ''removeChildren'' fields.
+
===Attributes===
  
The ''bboxCenter'' and ''bboxSize'' fields specify a bounding box that encloses the children of the Part node. This is a hint that may be used for optimization purposes. The results are undefined if the specified bounding box is smaller than the actual bounding box of the children at any time. A default bboxSize value, (-1, -1, -1), implies that the bounding box is not specified and, if needed, shall be calculated by the browser. The bounding box shall be large enough at all times to enclose the union of the group's children's bounding boxes; it shall not include any transformations performed by the group itself (i.e., the bounding box is defined in the local coordinate system of the children).
+
There is no validation of the numerical values of the ''rotation'' or ''scaleOrientation'' fields. Neither is there any validation of the number of values.
  
The ''translation'', ''rotation'', scale, ''scaleOrientation'' and ''center'' fields define a geometric 3D transformation consisting of (in order):
+
There is no validation of the numerical values of the ''bboxCenter'' or ''bboxSize'' fields. Neither is there any validation of the number of values.
  
  1. a (possibly) non-uniform scale about an arbitrary point;
+
==Schema Validation==
  2. a rotation about an arbitrary point and axis;
+
  3. a translation.
+
  
The ''center'' field specifies a translation offset from the origin of the local coordinate system (0,0,0). The ''rotation'' field specifies a rotation of the coordinate system. The ''scale'' field specifies a non-uniform scale of the coordinate system. scale values may have any value: positive, negative (indicating a reflection), or zero. A value of zero indicates that any child geometry shall not be displayed. The ''scaleOrientation'' specifies a rotation of the coordinate system before the scale (to specify scales in arbitrary orientations). The ''scaleOrientation'' applies only to the scale operation. The ''translation'' field specifies a translation to the coordinate system.
+
===Children===
  
Given a 3-dimensional point P and Part node, P is transformed into point P' in its parent's coordinate system by a series of intermediate transformations. In matrix transformation notation, where C (center), SR (scaleOrientation), T (translation), R (rotation), and S (scale) are the equivalent transformation matrices,
+
Children must appear as follows:
  
  '''P' = T * C * R * SR * S * -SR * -C * P'''
+
# A single, optional IS.
 +
# A single, optional node derived from ''X3DMetadataObject'' for the ''metadata'' field.
 +
# A single, optional CADFace or appropriately derived Prototype node.
  
The following Part node:
+
===Attributes===
  
'''CADPart {'''
+
* The ''rotation'' field accepts a quadruplet of values. The Schema aims to limit the each of the first three values to the range -1 to +1 inclusive.
'''  center          C'''
+
* The ''scaleOrientation'' field accepts a quadruplet of values. The Schema aims to limit the each of the first three values to the range -1 to +1 inclusive.
'''  rotation         R'''
+
* The ''bboxCenter'' field accepts a triplet of numerical values.
'''  scale            S'''
+
* The ''bboxsize'' field accepts either three values, each one being greater than or equal to zero, or the triplet -1 -1 -1.
'''  scaleOrientation SR'''
+
''' translation      T'''
+
'''  children        [...]'''
+
'''}'''
+
  
is equivalent to the nested sequence of:
+
Note: Issues with the validation of the ''rotation'' and ''scaleOrientation'' fields have been reported and resolution is awaited.
  
'''CADPart {'''
+
==Schematron Validation==
'''  translation T'''
+
'''  children CADPart {'''
+
'''    translation C'''
+
'''    children CADPart {'''
+
'''      rotation R'''
+
'''      children CADPart {'''
+
'''        rotation SR'''
+
'''        children CADPart {'''
+
'''          scale S'''
+
'''          children CADPart {'''
+
'''            rotation -SR'''
+
'''            children CADPart {'''
+
'''              translation -C'''
+
'''              children [...]'''
+
'''}}}}}}}'''
+
  
The ''name'' field documents the name of this part.
+
TBD
  
 
* [[Node Reference]]
 
* [[Node Reference]]

Latest revision as of 06:58, 3 May 2015

CADPart

Specification Link: CADPart

CADPart : X3DGroupingNode, X3DProductStructureChildNode {
  MFNode     [in]     addChildren
  MFNode     [in]     removeChildren
  MFNode     [in,out] children       []       [CADFace]
  SFVec3f    [in,out] center           0 0 0    (-∞,∞)
  SFNode     [in,out] metadata NULL  [X3DMetadataObject]
  SFString   [in,out] name ""
  SFRotation [in,out] rotation         0 0 1 0  [-1,1] or (-∞,∞)
  SFVec3f    [in,out] scale            1 1 1    (0,∞)
  SFRotation [in,out] scaleOrientation 0 0 1 0  [-1,1] or (-∞,∞)
  SFVec3f    [in,out] translation      0 0 0    (-∞,∞)
  SFVec3f    []       bboxCenter       0 0 0    (-∞,∞)
  SFVec3f    []       bboxSize         -1 -1 -1 [0,∞) or −1 −1 −1
}

DTD Validation

Children

Children must appear as follows:

  1. A single, optional IS.
  2. A single, optional node derived from X3DMetadataObject for the metadata field.
  3. A single, optional CADFace or appropriately derived Prototype node.

Attributes

There is no validation of the numerical values of the rotation or scaleOrientation fields. Neither is there any validation of the number of values.

There is no validation of the numerical values of the bboxCenter or bboxSize fields. Neither is there any validation of the number of values.

Schema Validation

Children

Children must appear as follows:

  1. A single, optional IS.
  2. A single, optional node derived from X3DMetadataObject for the metadata field.
  3. A single, optional CADFace or appropriately derived Prototype node.

Attributes

  • The rotation field accepts a quadruplet of values. The Schema aims to limit the each of the first three values to the range -1 to +1 inclusive.
  • The scaleOrientation field accepts a quadruplet of values. The Schema aims to limit the each of the first three values to the range -1 to +1 inclusive.
  • The bboxCenter field accepts a triplet of numerical values.
  • The bboxsize field accepts either three values, each one being greater than or equal to zero, or the triplet -1 -1 -1.

Note: Issues with the validation of the rotation and scaleOrientation fields have been reported and resolution is awaited.

Schematron Validation

TBD