Intro

CmSym is a scene graph API and file format that allow you to create, edit, read and write graphics entities.
The scene graph is a DAG (directed acyclic graph) where SymNode is the node type. Attributes on the nodes is controlled by SymComponents. The CmSym file format, built on top of Dex, stores CmSym data in files with the suffix ".cmsym". It is designed with the assumption that not all graphics data is read at once. This is the reason why CmSym supports lazy loading of data which means that only data that is requested is read.
Here is an example of a simple sym structure (download) and a dump of it's generated Dex file structure:
SymNode(nodeId)
  symReps 3D(high)
  symProps localBound, hasGeometry, _features
   _features {"solid"->"symMesh", "mesh"->"symMesh"} Object {#stream_null}
   hasGeometry true
   localBound box(p0=(0, 0, 0), w=1, d=1, h=1)
  symMesh ATriMeshF(triangles=12, vertices=24, normals, uv=24)
  symGMaterial colorF(1, 0, 0)
DexObj(104436: node nodeId)
 symGMaterial=DexObj(104445: SymGMaterial)
  gm=DexObj(104442: gm)
   ambient=DexObj(104444: ambient)
    amount=1
    c=colorF(1, 0, 0)
   diffuse=DexObj(104443: diffuse)
    amount=1
    c=colorF(1, 0, 0)
   doubleSided=false
   fileVersion=1.00.07
   fresnel=false
   materialKey=$1(9de2176eeb025e79cb56662af1164e5b6c7ab68a6d06278c2262e78df97de67b)
   solid=false
   version=1.00.05
 symMesh=DexObj(104441: SymMesh)
  mesh=DexObj(104440: ctmMesh)
   compression=mg2
   data=byte[] (count=317)
   sha256Key=rJDxAajMaxEIm4unHk4fwgmV4OVBQGipfdhhuagHE6k
 symProps=DexObj(104439: SymProps)
  hasGeometry=true
  localBound=box(p0=(0, 0, 0), w=1, d=1, h=1)
 symReps=DexObj(104438: SymReps)
  mask3D=4

Version history

1.0.0
Initial release
1.1.0
Improved release for CET 8.5
Several new components and SymGfx properties have been added.
Default properties in SymGfx are not streamed to root by default.
Use default values for properties not found in the sym.
"mode" removed from SymVisibility, instead a combination of "includeParent" and "visibility is used.
Remove "curr()" as reference to the current node, Z uses "this" semantics instead.le
1.1.1
Removed "symText" in favor of SymText2D and SymText3D.
Previously if d > 0 then the text is converted to a 3D text (which is meshed). Otherwise a 2D text (native) is used.
1.2.0
Generalized stretching. See SymMeasure.
Store symGfxMode in symRep as "2D" and "3D" instead of "x2D" and "x3D".
1.2.1
Removed "symPoint" and "symLine", use SymPoints and SymLines instead.
Changed how path trie is streamed for SymDivider. Each node in the path trie is no longer necessary a target.
Removed "symCache" in favor of SymProps.
Rename "symLines" to SymLines3D and introduce SymLines2D.
Allow SymText2D to hold multiple strings with the same font face but different positions.
Introduced a SymGfx bool property called symRenderMeshInsideOut.
Which if set to true turns meshes of SymPrimitive3D and SymMesh inside out.
Introduced a SymExtrusion component and extended the Z function library.
Introduced a SymGfx bool property called symRenderShapeInsideOut.
Which if set to true turns shapes of SymPrimitive2D and SymShape inside out.
Make sure all LODs are exported (redundant LODs are merged).
Use semantic versioning properly for cmsym files.
Backwards incompatible changes have been pushed out as minor changes previously, but it ends now.
Also denote wether a version is only available during development.
Changed SymExtrusion meshing and interface.
Reps remodeling.
Propagated reps are now differentiated from reps on the actual node.
New Z functionality.
Set SymGfx properties.
Set visibility.
New Z functionality.
Added some APolyline2D functionality.
Added parent/sibling by id.
Text manipulation.
Set material.
Added SymGMaterialSelector which allows for different materials on a single node.
Added some Z functions (loadSym, toPath(AShape2D)).
Rework level from a straight int to a bitmask. Reassign levels for components.
3.0.0
Remove key from SymProg.
Added functions toPath, loadSym and setTransform.

How To Read

The contents of this file is focused on the dex types defined in a CmSym file. Each type will be a DexObj and contain a number of key/value pairs. symFile is the first type encountered in a CmSym file.

Legend

"version"
childId
PathTrie
"version" -> version
The actual key "version" in the DexObj
Marking a set of different keys
The type SymNode (defined elsewhere)
The type PathTrie (defined inline)
The native dex type double
The key "version" corresponds to the built in type 'version'

File

A CmSym files uses the extension ".cmsym" and is saved as a Dex file.
symFile
The type of all CmSym files, always the dex root.
"version" -> version
The CmSym version of the file.
"sym" -> SymNode
The sym structure in the file.
"level" -> int
A bitmask defining the levels of the sym structure. The SymComponents are divided into different levels placing different demands on the implementation.
  • basic (1st bit)
  • shapes (2nd bit)
  • primitives (3rd bit)
  • uvmapping (4th bit)
  • xref (5th bit)
  • aux (6th bit)
  • connection (7th bit)
  • params (8th bit)
  • stretch (9th bit)
  • brep (10th bit)
  • solid (11th bit)

SymNode

A SymNode can be stored either in the current file or in an external file as an external reference.
node
The regular type of a SymNode.
"children" -> children optional
The node's children.
childId -> SymNode
Each child is stored with it's node id as key.
componentId -> SymComponent
All other keys corresponds to the node's components. The key is the same as the component's id.
xRefNode
The type of an external reference (xRef) node. The node does not contain any children except the single external node.
"symNXRef" -> DexXRef
Externel reference returning a SymNode. Will be considered the only child to this node. Refer to the implementation of DexXRef read/write for more details.
componentId -> SymComponent
All other keys corresponds to the node's components. The key is the same as the component's id.

SymComponent

SymComponent is used to assign attributes to SymNode.

SymBSplineCurve

SymBSplineCurve
SymBSplineCurve define the nurbs curves geometry.
bsplineCurve
Contains all neccessary information that required to rebuild B-Spline curve. Tessellation of this will produce set of connected vertices.
"refinementFrom" -> int
The start of the refinement range for the nurbs curve.
"refinementTo" -> int
The end of the refinement range for the nurbs curve.
bsplineCurve
NURBS - Non-Uniform Rational B-Spline, a mathematical model that commonly use for generating and representing curves and surfaces.

SymBSplineSurface

SymBSplineSurface
SymBSplineSurface defines the BSpline surface geometry.
"bsplineSurface" -> BrepBSplineSurface
Contains all canonical information that required to rebuild B-Spline surface.
"refinementFrom" -> int
The start of the refinement range for the BSpline surface.
"refinementTo" -> int
The end of the refinement range for the BSpline surface.
bsplineSurface
A B-Spline surface is obtained by taking a bidirectional net of contol points, two knot vectors(uKnots, vKnots), and the product of univariate BSpline function.
trimInfo
Boundary or trim information for surfaces. This describes how underlying surfaces will be trimmed when creating the object.
SymBoolOp
SymBoolOp component can be used to produce a boolean result between two nodes.
"node0" -> SymNode
Node on left hand side of operation.
"node1" -> SymNode
Node on right hand side of operation.
"op" -> str
Operation to be execute between "node0" and "node1".
"_weldVertices" -> bool
Mesh produce by the boolean operation by default will have a normal vector perpendicular to the face of a mesh and will have duplicated vertices. Welding vertices will remove duplicated vertices and recalculate its normals.
SymBox
A SymBox defines a box. upper right corner is located in (w, d, h).
"p0" -> point
Down southwest corner.
"p1" -> double
Up northeast corner.
SymBrep
Boundary representation, B-rep, is a method that representing shapes using limits. A solid is represented as a collection of connected surface elements, the boundary between solid and non-solid. It mainly consist of numbers of surfaces that are trimmed by boundary curves.
surfaces
The main geometry that describes a brep when sewn together. This will make up manifold, non-manifold, solid or non-solid.
SymCircle
A SymCircle defines a circle.
"center" -> point2D
The center of the circle.
"r" -> double
The radius of the circle. Must be positive.
"refinement" -> int
The refinement of the circle.
SymCone
A SymCone defines a cone between two position with different radius.
"p0" -> double
Starting position.
"p1" -> double
Ending position.
"r0" -> double
Radius for 'p0'. Must be positive.
"r1" -> double
Radius for 'p1'. Must be positive.
"closed" -> bool
Defines whether the ends of the cone should be tesselated.
"refinementFrom" -> int
The start of the refinement range for the cone.
"refinementTo" -> int
The end of the refinement range for the cone.
SymConnector
If SymNode carries a SymConnector it means the SymNode and its descendents represent a connector.
SymCylinder
"p0" -> point
Start point of the cylinder.
"p1" -> point
End point of the cylinder.
"r" -> double
The radius of the cylinder. Must be positive.
"closed" -> bool
Defines whether the ends of the cylinder should be tesselated.
"refinementFrom" -> int
The start of the refinement range for the cylinder.
"refinementTo" -> int
The end of the refinement range for the cylinder.
SymDivider
SymDivider divides the space into spatial areas/volumes. Together with selectors they can be used to create selections on which we can execute various operations.
"pathTrie" -> PathTrie
The pathTrie defines the paths which the divider should operate on.
SymEllipse
A SymEllipse defines a ellipse by two vectors originating from a center point.
"a0" -> vector2D
"a1" -> vector2D
"center" -> point2D
"refinement" -> int
The refinement of the circle.
SymExtrusion
The SymExtrusion component can be used to produce meshes by extruding a flat surface.
"profile" -> AShape2D
Profile to extrude along the 'path' (defined in the field below). A sequence of 2D-points where each element is defined by (xyOffset, z). 'xyOffset' defines the variation in the x/y-plane compared to the 'path' we extrude along. 'z' defines the height along the z-axis for each segment that is being extruded.
"path" -> AShape2D
Path to extrude along. A sequence of 2D-points where each element is defined by a (x, y) coordinate forming the path to extrude along.
"tesselateVerticalStart" -> bool
If 'tesselateVerticalStart' is set to true the produced mesh will contain a surface perpendicular to the profile in the starting-element of 'path'.
"tesselateVerticalEnd" -> bool
If 'tesselateVerticalEnd' is set to true the produced mesh will contain a surface perpendicular to the profile in the end-element of 'path'.
"tesselateHorizontalDown" -> bool
If 'tesselateHorizontalDown' is set to true the produced mesh will contain a horizontal surface pointing downwards. The surface is created by using the vertices of the first "path sweep".
"tesselateHorizontalUp" -> bool
If 'tesselateHorizontalUp' is set to true the produced mesh will contain a horizontal surface pointing upwards. The surface is created by using the vertices of the last "path sweep".
"autoNormalsAngle" -> angle
The vertices of the mesh produced by SymExtrusion requires normals in order to be rendered with proper shading. There can only be a single normal for each vertex so in order to produce sharp looking shading we may need to duplicate some vertices so they can have different normals. Example: A 3D-box can be defined with just eight vertices but eight normals is not enough to produce sharp shading between the different sides of the box. New vertices/normals are required. The 'autoNormalsAngle' defines the minimum angle between polygons where we like to introduce sharp shading. Example: If a vertex is re-used in three polygons (A, B and C) we look at the angles between the polygons to decide if a new vertex/normal is needed. If the angle between A and B is equal or greater than 'autoNormalsAngle' we introduce a new vertex and normal. Same analysis is done between each pair of polygons (A-B, A-C and B-C). At most we create two new vertices, that is we go from one vertex/normal-pair to three vertices/normals-pairs.
"refinementFrom" -> int
The start of the refinement range for the path/profile.
"refinementTo" -> int
The end of the refinement range for the path/profile.
SymGMaterial
The material used when rendering the node. SymGMaterial is inherited by child nodes but if a child node specifies its own SymGMaterial it overrides the parent SymGMaterial.
"gm" -> gm

GMaterial3D

gm
"fileVersion" -> version
Version of the .gm file.
"version" -> version
Version of the generic material.
"materialKey" -> str
A sha256 based material key.
"diffuse" -> Diffuse
Specifies the diffuse property of the material.
"ambient" -> Ambient
Specifies the ambient property of the material.
"specular" -> Specular
Specifies the specular property of the material.
"transparency" -> Transparency
Specifies the transparency property of the material.
"reflection" -> Reflection
Specifies the reflection property of the material.
"refraction" -> Refraction
Specifies the refraction property of the material.
"bump" -> Bump
Specifies the bump property of the material.
"doubleSided" -> bool
Specifies whether the material should be double sided or not.
"fresnel" -> bool
Specifies whether we should use fresnel equations in the shaders or not.
"solid" -> bool
Specifies whether the material should take light into account or not. If solid is true and there are no lights in the scene the material should still be rendered in with the specified color/texture.
"misc" -> str to Object map
Contains miscellaneous data.
"redCustomProperties" -> redCustomProperties
Custom properties used by REDSdk based rendering.

GMaterialProp3D

Ambient
"amount" -> float
The intensity of the ambient contribution of material [0 - 1].
Inherited from super
"imageUrl" -> DexXRef
An url to an image used for the material property.
"avgTextureColor" -> colorF
The average color of the image referred to by image url.
"c" -> color
The color of the material. If an image url is specified it overrides the color.
"uScale" -> float
The scale in texture space u-direction. Translates to repetition. For instance, if uScale is 2 then the texture is repeated twice horizontally in the u [0, 1] range.
"vScale" -> float
The scale in texture space v-direction. Translates to repetition. For instance, if vScale is 2 then the texture is repeated twice vertically in the v [0, 1] range.
"uOffset" -> float
The offset of the image in the u-direction.
"vOffset" -> float
The offset of the image in the v-direction.
"rot" -> angleF
The rotation (clock wise) of the image.
"wrap" -> str
The wrap mode of the image. Check textureWrap for possible wrap modes.
Bump
"amount" -> float
The amount of bump. Increasing this value will yield more visible bumps.
"effectRR" -> float
Intensity of the bump map that may be considered in the reflection/vectors calculation [0, 1].
"prepared" -> float
If true the bump map is already a normal map. Otherwise it is an ordinary image that must be translated into a normal map.
Inherited from super
"imageUrl" -> DexXRef
An url to an image used for the material property.
"avgTextureColor" -> colorF
The average color of the image referred to by image url.
"c" -> color
The color of the material. If an image url is specified it overrides the color.
"uScale" -> float
The scale in texture space u-direction. Translates to repetition. For instance, if uScale is 2 then the texture is repeated twice horizontally in the u [0, 1] range.
"vScale" -> float
The scale in texture space v-direction. Translates to repetition. For instance, if vScale is 2 then the texture is repeated twice vertically in the v [0, 1] range.
"uOffset" -> float
The offset of the image in the u-direction.
"vOffset" -> float
The offset of the image in the v-direction.
"rot" -> angleF
The rotation (clock wise) of the image.
"wrap" -> str
The wrap mode of the image. Check textureWrap for possible wrap modes.
Diffuse
"amount" -> float
The intensity of the diffusive contribution of material [0 - 1].
Inherited from super
"imageUrl" -> DexXRef
An url to an image used for the material property.
"avgTextureColor" -> colorF
The average color of the image referred to by image url.
"c" -> color
The color of the material. If an image url is specified it overrides the color.
"uScale" -> float
The scale in texture space u-direction. Translates to repetition. For instance, if uScale is 2 then the texture is repeated twice horizontally in the u [0, 1] range.
"vScale" -> float
The scale in texture space v-direction. Translates to repetition. For instance, if vScale is 2 then the texture is repeated twice vertically in the v [0, 1] range.
"uOffset" -> float
The offset of the image in the u-direction.
"vOffset" -> float
The offset of the image in the v-direction.
"rot" -> angleF
The rotation (clock wise) of the image.
"wrap" -> str
The wrap mode of the image. Check textureWrap for possible wrap modes.
Reflection
"amount" -> float
The amount of reflection [0 - 1].
Inherited from super
"imageUrl" -> DexXRef
An url to an image used for the material property.
"avgTextureColor" -> colorF
The average color of the image referred to by image url.
"c" -> color
The color of the material. If an image url is specified it overrides the color.
"uScale" -> float
The scale in texture space u-direction. Translates to repetition. For instance, if uScale is 2 then the texture is repeated twice horizontally in the u [0, 1] range.
"vScale" -> float
The scale in texture space v-direction. Translates to repetition. For instance, if vScale is 2 then the texture is repeated twice vertically in the v [0, 1] range.
"uOffset" -> float
The offset of the image in the u-direction.
"vOffset" -> float
The offset of the image in the v-direction.
"rot" -> angleF
The rotation (clock wise) of the image.
"wrap" -> str
The wrap mode of the image. Check textureWrap for possible wrap modes.
Refraction
"index" -> float
The refraction index.
Inherited from super
"imageUrl" -> DexXRef
An url to an image used for the material property.
"avgTextureColor" -> colorF
The average color of the image referred to by image url.
"c" -> color
The color of the material. If an image url is specified it overrides the color.
"uScale" -> float
The scale in texture space u-direction. Translates to repetition. For instance, if uScale is 2 then the texture is repeated twice horizontally in the u [0, 1] range.
"vScale" -> float
The scale in texture space v-direction. Translates to repetition. For instance, if vScale is 2 then the texture is repeated twice vertically in the v [0, 1] range.
"uOffset" -> float
The offset of the image in the u-direction.
"vOffset" -> float
The offset of the image in the v-direction.
"rot" -> angleF
The rotation (clock wise) of the image.
"wrap" -> str
The wrap mode of the image. Check textureWrap for possible wrap modes.
Specular
"amount" -> float
The intensity of the specular contribution of material [0 - 1].
"exponent" -> float
The exponent of the specular hight light being used.
Inherited from super
"imageUrl" -> DexXRef
An url to an image used for the material property.
"avgTextureColor" -> colorF
The average color of the image referred to by image url.
"c" -> color
The color of the material. If an image url is specified it overrides the color.
"uScale" -> float
The scale in texture space u-direction. Translates to repetition. For instance, if uScale is 2 then the texture is repeated twice horizontally in the u [0, 1] range.
"vScale" -> float
The scale in texture space v-direction. Translates to repetition. For instance, if vScale is 2 then the texture is repeated twice vertically in the v [0, 1] range.
"uOffset" -> float
The offset of the image in the u-direction.
"vOffset" -> float
The offset of the image in the v-direction.
"rot" -> angleF
The rotation (clock wise) of the image.
"wrap" -> str
The wrap mode of the image. Check textureWrap for possible wrap modes.
Transparency
"alphaThreshold" -> float
The alpha that should be considered to be fully transparent [0, 1]. For instance, if the threshold is 0.1, all alphas below 0.1 will be considered to be fully transparent.
"opacity" -> float
The opacity level of the material [0, 1]. A material with opacity 0 is fully transparent. A material with opacity 1 is fully opaque.
Inherited from super
"imageUrl" -> DexXRef
An url to an image used for the material property.
"avgTextureColor" -> colorF
The average color of the image referred to by image url.
"c" -> color
The color of the material. If an image url is specified it overrides the color.
"uScale" -> float
The scale in texture space u-direction. Translates to repetition. For instance, if uScale is 2 then the texture is repeated twice horizontally in the u [0, 1] range.
"vScale" -> float
The scale in texture space v-direction. Translates to repetition. For instance, if vScale is 2 then the texture is repeated twice vertically in the v [0, 1] range.
"uOffset" -> float
The offset of the image in the u-direction.
"vOffset" -> float
The offset of the image in the v-direction.
"rot" -> angleF
The rotation (clock wise) of the image.
"wrap" -> str
The wrap mode of the image. Check textureWrap for possible wrap modes.
redCustomProperties
Stores some custom properties used by REDSdk based rendering.
"realtimeReflection" -> bool
Specifies whether the material should use real-time reflection or not.
"reflectionGlossiness" -> float
Specifies the reflection glossiness of the material in a range [0 - 1].
"environmentMapUrl" -> Url
Specifies the url used for environment mapping.
textureWrap
The wrap mode of the image stored as a string.
  • repeat: Repeat the texture pattern out of the texture's limits.
  • mirroredRepeat: Repeat the texture pattern with an inversion of the texture out of the texture's limits.
  • clamp: The texture sampling result is zero outside of the texture's limits.
  • clampToEdge: The texture sampling results remain slightly inside the texture when it's out of the texture's limits.
  • clampToBorder: The texture sampling results are set to the texture's border color when it's out of the texture's limits.
SymGMaterialSelector
Materials to be used when rendering the node. Material with a matching layer should be used, otherwise the last material is the default (which have a null layer).
"options" -> SymGMaterialOption sequence
The different materials.
SymGMaterialOption
Material option.
"gm" -> gm
The material used when rendering a node.
"layer" -> LayerExpr
Layer expression which describes when a material should be used.
SymGfx
Used to control how the sym graph is rendered. SymGfx is inherited by child nodes but if a child node specifies its own SymGfx it overrides the the parent SymGfx.
"renderDisabled" -> bool
If true rendering is disabled for the node and its descendents provided they do not override SymGfx and set a different value for render disabled.
"shadowMode" -> str
  • none: not affected by shadow at all.
  • receiver:receives shadow but does not cast shadows.
  • caster: casts shadow but does not receive shadows.
  • solid: both receives shadows and casts shadows.
defaultsolid
"shapeFill" -> bool
Specifies whether the shape should be filled or not.
defaulttrue
"shapeFillColor" -> color
Specifies the color to fill a shape with.
defaultTries to use the average material color or white if no material
"overlayColor" -> color
Define the color of the overlay on top of other objects.
defaultdarkGray if "overlayLineStyle" exists
"overlayLineStyle" -> str
Define the outline style of the overlay on top of other objects.
default"dot" if "overlayColor" exists
"linePixelWidth" -> int
The line pixel width.
default1
"lineColor" -> color
Color of the lines being rendered.
defaultcolor(0, 0, 0)
"lineStyle" -> str
  • none: no line.
  • solid: ordinary line.
  • dot: dotted line.
  • dashed: dashed line.
  • dashDot: dashes dot alternating line.
  • dashDotDot: dash dot dot alternating line.
defaultsolid
"pointPixelSize" -> int
The diameter size in pixels used for points.
default1
"pointColor" -> color
Color of the points being rendered.
defaultcolor(0, 0, 0)
"textColor" -> color
Text color.
defaultcolor(0, 0, 0)
"renderShapeInsideOut" -> bool
If true the faces of the shape will be rendered inside out.
defaultfalse
"renderMeshAsDoubleSided" -> bool
Specifies if the meshes should be generated double sided. Relevant for primitive components.
defaultfalse
"renderMeshAsWireFrame" -> bool
If true the mesh should be rendered as a wireframe.
defaultfalse
"renderMeshAsPoints" -> bool
If true the vertices of the mesh should be rendered as points.
defaultfalse
"renderMeshInsideOut" -> bool
If true the faces of the mesh will be rendered inside out.
defaultfalse
"selectionLinePixelWidth" -> int
The width of selection lines.
"selectionLineColor" -> color
The color of selection lines.
"selectionLineStyle" -> str
The style of selection lines.
"selectionPointPixelSize" -> int
The size of selection points.
"selectionPointColor" -> color
The color of selection points.
SymLODGroup
When a SymNode has a SymLODGroup component it means that its descendents, regardless of their SymReps, represent the same 'object', for instance an arm rest of a chair. CmSym does not requires LODs representing the same 'object' to be arranged under a SymLODGroup but it is considered to be best practice. It also makes it possible to perform changes, such as setting a material to an 'object' in a simple manner without the need of programs/parameters.
SymLines2D
SymLines2D defines a set of lines
"vertices" -> point2D sequence
Contains all vertices.
"lines" -> int sequence
Contains vertex indices and each pair defines a line.
SymLines3D
SymLines3D defines a set of lines
"vertices" -> point sequence
Contains all vertices.
"lines" -> int sequence
Contains vertex indices and each pair defines a line.
SymMeasure
A valid SymMeasure requires two child nodes named "sp" (starting point) and "ep" (end point). The distance between "sp" and "ep" (in root coordinates) define the length of the measure. A measure may not be instanced nor have instanced descendents/ancestors.
"measureParam" -> str
The name of the param used to stretch.
"stretchingEPParam" -> str
The param controlling which end point to stretch.
"originalLength" -> double
The original length of the measure.
"dividers" -> divider sequence
Dividers divides the space into sections.
measureId -> subPath
"rep" -> symRep
The representation of the path.
"path" -> str
The relative path below this.
"currentStretch" -> double
Defines how much the divider is stretched.
default0
"section" -> section sequence
Sections define the behavior of the space between dividers.
"sizeChange" -> double
Defines how long a selection is moved for one unit of stretch.
"move" -> bool
If true the section defines movement, otherwise vertices should be scaled.
"currentStretch" -> double
Defines how much the section is stretched.
default0
measureId -> repToSelector
"rep" -> symRep
The represantion of the selector.
"selector" -> SymMultiSelector
A selector defining the contained geometry.
SymMesh
A SymMesh is stored as an open CTM compressed mesh.
"mesh" -> ctmMesh
ctmMesh
A ctmMesh is a triangular float based mesh that has been compressed using Open CTM: http://openctm.sourceforge.net/
The compressed triangular mesh may contain:
  • vertices float sequence
  • normals float sequence
  • uv-coordinates float sequence
  • triangle indices int sequence
The triangle indices are integers stored in groups of three that refer to positions in the vertex-, normal- and uv-sequences. Three indices represent a triangular polygon. For instance, if the triangle index sequence contains 0, 1, 2, 2, 3, 1 it defines two triangles, 0, 1, 2 and 2, 3, 1. In order to have a valid mesh there must be four vertices and normals stored in respective sequence (uv-coordinates are optional). Note that only one side of a triangular polygon is considered to be visible (unless a double sided material is being used). Triangle indices referring vertices in counter clockwise order, from the view point, are considered to be visible.
"lowerLeftTextureOrigin" -> bool optional
If lowerLeftTextureOrigin is true it means that uv=(0, 0) will refer to the lower left corner of the texture.
If lowerLeftTextureOrigin is false it mean that uv=(0, 0) will refer to the upper left corner of the texture. Material can override this.
"doubleSided" -> bool optional
Defines the double sidedness of the mesh. Material can override this.
"compression" -> str
The compression algorithm used. Currently we only support mg2.
"sha256key" -> str
A unique key generated by hashing the byte data using sha256.
"data" -> byte sequence
SymParams
SymParams contains the params on the node. The params are used as input to the programs on this node and to nodes below.
"paramsTrie" -> PathTrie
The params are stored in a trie structure tokenized on '.' treating a string entry as a path.
All params on the nodes below this node are reachable through the trie. The nodes in the trie are shared across the nodes to avoid data duplication.
"params" -> params optional
Stored if the node represented by the trie node has any parameters.
paramName -> ParamValue
Each param name is stored with it's name as a key.
"children" -> children optional
The children of the trie node.
childId -> PathTrie
The children in the trie are stored with their id as key.
ParamValue
The value of a parameter.
"v" -> Object
The parameter value.
"progDependencies" -> str set
The paths to the nodes with program dependencies to this parameter. When this value is changed these programs needs to be validated. An empty string refers to this node.
SymPlane
A SymPlane defines a plane.
"plane" -> plane
The plane is defined by a double based 'normal' vector and a double constant 'd'. The plane is guaranteed to be normalized.
SymPoints
SymPoints defines a sequence of three dimensional points in space.
"points" -> point sequence
A sequence of double based three dimensional points (x, y, z).
SymProgs
SymProgs contains the programs on the node. The programs are defined using Z extended with CmSym context types and functions.
"progsTrie" -> PathTrie
The programs are stored in a trie structure tokenized on '.' treating a string entry as a path.
All programs on the nodes below this node are reachable through the trie. The nodes in the trie are shared across the nodes to avoid data duplication.
"progs" -> SymProg sequence optional
Each trie node contains a sequence of SymProg wrapping over an RProg.
"children" -> children optional
The children of the trie node.
childId -> PathTrie
The children in the trie are stored with their id as key.
SymProg
SymProg is a wrapper around a Z program.
"rProg" -> RProg
The program is streamed as a Z runtime program.
"key" -> str
A key uniquely identifying the program.
"prio" -> int
The prio decides when a program is executed. Higher priority programs run before lower priority programs. If 'prio' is null the priority is given from where the owner node is located in the sym graph: Programs on nodes with depth n get higher prio than programs on nodes located a detpth n + 1.

SymProps

SymCachedMeshes
Stored a sequence meshes. Used to store generated meshes for primitives.
"entries" -> SymCachedMeshEntry sequence
SymCachedMeshEntry
Used to cache meshes for primitives.
"reps" -> SymReps
Stores the SymReps that the mesh represents.
"key" -> str
The key that was used when producing the mesh for the primitive.
"mesh" -> ctmMesh
The actual mesh.
SymProp
A container for a prop if extra metadata exists.
"v" -> Object
The actual prop value.
"attributes" -> str set
Attributes for the value.
SymProps
SymProps stores cached data such as the local bound of a SymNode. The purpose is to avoid time consuming task such as calculating the bound of a high res mesh.
"hasGeometry" -> bool
Answers the question of whether the owner node or its descendents contains geometry.
"structuralKey" -> str
Specifies a str that is used to identify the node (including its descendents). Other SymNode(s) that reference the same data will produce the same key.
"nodeKey" -> str
Specifies a str that can be used to identify the node (does not include descendents).
"localBound" -> box
Specifies the bound of the node described in local node coordinates. The local bound include the bound of node's descendents.
"userBound" -> box
Specifies a user defined bound in node coordinates. Can be used to override the bound calculated from the geometry.
"meshes" -> SymCachedMeshes
SymCachedMeshes is a sequence of cached meshes. It is used to store meshes for primitives.
SymRect
A SymRect defines a rect.
"p0" -> point2D
Down left corner.
"p1" -> point2D
Up right corner.
SymReps
SymReps defines where the graphics related to the owner node is intended to be used for rendering. By using one or more symGfxMode(s) SymReps specifies in which context the node should be rendered - currently 2D or 3D. For each symGfxMode the SymReps carry information about which LOD(s) the owner node represents. Note that one node can be used to represent multiple detail levels.
"mode3D" -> int optional
Specifies the detail levels that the owner node repesents intened for 3D-rendering. The detail levels are represented as a bit mask - detailMask.
"mode2D" -> int optional
Specifies the detail levels that the owner node repesents intened for 2D-rendering. The detail levels are represented as a bit mask - detailMask.
"containsAny2D" -> bool optional
If set node should be included in all 2D detail levels the parent is visible in.
"containsAny3D" -> bool optional
If set node should be included in all 3D detail levels the parent is visible in.
"propagated" -> propagated
SymReps is propagated upwards meaning that a parent node will know the SymReps of its descendents. See above for descriptions.
"mode3D" -> int optional
"mode2D" -> int optional
"containsAny2D" -> bool optional
"containsAny3D" -> bool optional
symRep
symRep defines a single mode and detail level. See SymReps for more info.
"mode" -> symGfxMode
"detail" -> detailLevel
symGfxMode
The different gfx modes stored as a string:
  • 2D
  • 3D
detailMask
A mask specifying a set of LODs. CmSym support five detail levels:
  • low (1st bit)
  • medium (2nd bit)
  • high (3rd bit)
  • super (4th bit)
  • base (10th bit)
The base level is generally not exported since it used to store the original representation of a model.
detailLevel
The different detail levels stored as a string:
  • low
  • medium
  • high
  • super
  • base
SymShape
A SymShape represents a piece of geometry that may vary in the x- and y-direction.
"shape" -> shape2D
Despite the name of the types a SymShape is used to visualize not only 2D but also 3D.

shape2D

shape2D TODO
complexShape2D
A complexShape2D is represented by a sequence of hollowShape2D.
"shapes" -> hollowShape2D sequence
hollowShape2D
A hollowShape2D is defined by an outline (any shape2D) and a sequence of holes (any shape2D).
"outline" -> shape2D
The outline surrounding the shape is defined by a shape2D.
"holes" -> shape2D
The holes represent cut outs from the surface described by the outline.
path2D
A path is a sequence of lines and arcs that defines a 2D-curve (x- and y-direction).
"startPoint" -> point2D
The start point is a double based point.
"members" -> path2DMember
A sequence of path2D members that continues to build a curve from the start point.
polyline2D
A polyline2D is a sequence of points forming a consecutive line.
"points" -> point sequence
A sequence of double based points that represet the line.
"closed" -> bool
If the polyline is closed when the first and the last point, in the points sequence, are considered to be a the same position (precision 10^-6).

path2DMember

path2DMember A path2D member is part of a path2D to form a curve.
path2DArcTo
Defines an arc that is part of a path2D to form a curve.
"endPoint" -> point2D
Defines the end point of this part of the path2D.
"startTangent" -> angle
Defines the starting tangent angle of the this part of the path2D.
path2DLineTo
Defines a line that is part of a path2D to form a curve.
"endPoint" -> point2D
Defines the end point of this part of the path2D.
SymSphere
SymSphere defines a sphere with its center at origo.
"center" -> point optional
The center of the sphere, or (0, 0, 0).
"r" -> double
The radius of the sphere.
"refinementFrom" -> int
The start of the refinement range for the sphere.
"refinementTo" -> int
The end of the refinement range for the sphere.
SymTags
SymTags provide a way define groups for nodes.
"main" -> str
The main tag.
"tags" -> LayerSet
Defines a set of symbols that specify which group(s) a node belong to.
SymText2D
Defines text
"strings" -> SymTextString sequence
The strings in the text.
"fontFace" -> str
The fontFace that should be used
SymText3D
SymText3D defines a text
"text" -> str
The text.
"fontFace" -> str
The fontFace that should be used
"h" -> double
Height of the text.
"d" -> double
Thickness of the text. If d > 0 the text should be represented by a mesh.
SymTransform
Specifies the transform of a node.
"pivot" -> point
The pivot is described in local node coordinates
"scale" -> vector
The scale is described in node coordinates
"rot" -> orientation
The rotation is described in node coordinates
"pos" -> point
The position is described in node coordinates
"originalTransform" -> Transform
The original transform is applied before the transform parameters described above. It is useful when importing a model where the transformation matrix is non-trivial to decompose.
SymUVMapper
Defines the texture mapping technique intended for the node.
"mapper" -> UVMapper
Defines how uv-coordinates should be generated.
UVMapper
"class" -> str
The name of the uv-mapping technique used.
"env" -> UVMapEnv
Specifies details about how the UV mapping should be performed.
UVMapEnv
"type" -> str
Specifies the type of the uv-mapping used.
"normal" -> vector optional
Specifies the direction of the projection.
"uniform" -> bool
Specifies whether the mesh being uv-mapped should be uniformly scaled before the uv-projection takes place. For instance when using the BoxUVMapper the mesh is scaled to fit within the unit cube. The uniform state specifies whether this scaling process should scale the mesh uniformly (keep proportions) or try to stretch our the mesh in each direction (non-uniform scale).
"transforms" -> uvTransform sequence
Specifies a way to transform the UV-coordinates once generated.
"pos" -> point2D
Specifies the translation part of the 2D-transform.
"mapping_c0" -> vector2D
Specifies the first column of the rotation matrix for the 2D-transform.
"mapping_c1" -> vector2D
Specifies the second column of the rotation matrix for the 2D-transform.
SymVisibility
"visibility" -> LayerExpr
A layer expression describing the visibility of the node. If null then everything should be visible and if an empty layer set then nothing should be visible.
"includeParent" -> bool
Specifies if the visibility of the parent should be taken into account or not.

Selection

SymDividerSelector
A SymDivider divides the space into spatial areas/volumes. Together with selectors they can be used to create selections on which we can execute various operations.
"dividerId" -> str
The dividerId is the id of the node holding the divider 'this' uses.
"ownerId" -> str
The ownerId is the id of the node holding 'this'.
"outside" -> bool
Defines the selection direction of the divider
"include" -> bool
If true this selection should be included, otherwise excluded.
SymMultiSelector
Holds several selectors.
"selectors" -> SymSelector sequence

Dex

Dex is a file based binary data format. A DexObj is a (string) id and type plus a property list of (string key, Object(cm)/DexEntity(c++) value) pairs. Dex contains a number of predefined types:
  • Values (bool, int, point, ...)
  • Geometric objects (Transform and similar)
  • Collections (seq, set map)
For more info see the documentation and C++ implementation in the dex lib.

Z

Z is the language embedded in CmSym.
RProg
Represents the runtime information of Z.
In depth documentation is missing.

Other

SymTextString
Defines a string of text
"text" -> str
The text.
"h" -> double
Height of the text.
"align" -> alignment
Alignment of the text.
"pos" -> point2D
Position.
"rot" -> angle
Rotation.
semver
Semantic versioning.