# Validation

## Upgrade old VSXML

For hassle free validation of VSXML files the <VSXML> node is required to have the following three attributes defined:

<VSXML xmlns="http://viewer.kisters.de/VSXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://viewer.kisters.de/VSXML VSXML.xsd" ...>    <!-- Content --></VSXML>

Newer versions of 3DViewStation add these attributes per default, if you got a VSXML file without them please feel free to add them using any text editor.

Note

The xsi:schemaLocation="http://viewer.kisters.de/VSXML VSXML.xsd" specifies the location of the XSD file to validate against.
If the VSXML.xsd file is not located next to your VSXML file you have to either remove this attribute or update the path to the XSD file on you system.
Please just update the last part of the attribute's value and leave http://viewer.kisters.de/VSXML as it is.

## Visual Studio Code

Necessary extension: XML Extension by Red Hat

RedHat's extension supports different ways to validate XML files as described in this GitHub wiki article.

This extension requires the <VSXML> node to contain all attributes described in Upgrade old VSXML.
If that's the case and the XSD file can be found, the extension should provide IntelliSense and auto validation capabilities automatically.

## Notepad++

XSD validation can be done using the Xml Tools plugin, the latest version at the time of writing is version 3.1.1.1.
Go to Plugins -> Plugin manager -> Show Plugin manager, search for Xml Tools, check the plugin's list entry and click on Install.
Notepad++ will restart for installation.

If the VSXML contains an xsi:schemaLocation attribute (see above) the plugin automatically validates against the XSD file defined in it otherwise the plugin will prompt you to manually select an XSD file for validation.

Note For validation to work correctly please ensure that the <VSXML> node contains at least the xmlns="http://viewer.kisters.de/VSXML" attribute mentioned in Upgrade old VSXML.

# VSXML

## Example

xxxxxxxxxx<VSXML xmlns="http://viewer.kisters.de/VSXML" Version="2021.0.119-85407f07" FileVersion="17" Created="Wed Jun  2 16:23:30 2021" UnitScale="1.000000" Calibration2D="1.000000" UpVector="Z">  <BoundingBox Center="42.014015 28.500000 -45.155006" Extents="43.164040 28.845001 45.155006"/>  <Node Name="RootNode" Type="Root" FileName="Test.3dvs"/></VSXML>

## Node

### Example

xxxxxxxxxx<VSXML xmlns="http://viewer.kisters.de/VSXML">  <Node CustomId="15ed4b28-0886-48c7-9949-34c38844786c" Name="Seen Root Node" Type="Root">    <Node Name="Second level" Type="ProductOccurrence">        <Node Name="Dustcap1" Type="ProductOccurrence" Transformation="1 0 0 0 0 1 0 0 0 0 1 0 -300 -200 -100 1">            <Attribute key="InstanceName" value="sample1"/>            <!-- More Attributes -->        </Node>    </Node>    <!-- More Nodes -->  </Node></VSXML>

## Attribute

Note
3DViewStation versions prior to version 2020.1.385 require the following attributes to be lower cased, i.e. key and value.
From 2020.1.385 on you can use any casing.

### Example

xxxxxxxxxx<VSXML xmlns="http://viewer.kisters.de/VSXML">    <Node>        <Attribute Key="Cost" Value="156€"/>        <Attribute Key="Product Number " Value="AD1874"/>    </Node></VSXML>

## VectorExport

Defines how a node is exported to DXF.

### Bool

"1" as true and "0" as false.

### Color

For "Color" its an 32 bit ARGB color.

xxxxxxxxxx#AARRGGBB

###HLRMode

xxxxxxxxxxAll             // Normal visibility of lines in 2D ExportSelfClipping    // The Node (Component) geometry itself is clipped.                // You cannot see lines of its back side.                // Lines generated for this Node will not be clipped by any other objectNoClipping      // No lines are clippedSilhouette      // Only silhouete (outline) of Node geometry is visible,                // no clipping by other objects.

### FrameType

xxxxxxxxxxRectangle = 0Circle = 1Underline = 2

### Layer

Limited to 31 characters to provide DXF R14 compatibility

Letters: A - Z

Numbers: 0 - 9

Special characters: "\$", "_", "-"

### LineReductionMode

xxxxxxxxxxNone        // All lines visibleEdgesOnly   // Reducing lines by recognition of hard edges

### MarkupAlignment

xxxxxxxxxxNone = 0Top = 1Bottom = 2Left = 3Right = 4TopBottom = 5LeftRight = 6Rectangle = 7Circle = 8NearToSolid = 9

### Material

xxxxxxxxxxChrome shinySteelSteel polishedGold shinyGold mattCopper shinyCopper mattAluminiumPlastic RoughPlastic SmoothRubberMirrorCabin GlassGlass lightSolid PaintMetallic PaintPowdercoat

### NodeColorOverwrite

xxxxxxxxxxNone        // Vertex color is used if present, otherwise node color.Node        // Node color is used.Material    // Material color is used if render mode is set to "Material"            // and the node has a material with color.            // Otherwise node color is used.

### NodeType

xxxxxxxxxxNoneRootProductOccurrenceRi_BrepModelRi_PolyBrepModelRi_SetRi_PolyWireRi_TessMarkupPartAxisRootAxisPMIViewAnnotationAnnotationReferenceAnnotationSetCurveLinePlaneDirectionPointPointSetCoordinateSystemHandle_RootHandle_ArrowHandle_SphereHandle_CurlyarrowSolidWireAnnotationItemMarkup_TextDimensioningPointMarkerEdgeMarkerCircleMarkerAxisMarkerReferenceLineLineMarkerTriangleMeshMarkup_CircleMarkup_RectangleMarkup_FreehandCutGeometry_SurfaceCutGeometry_WirePMIMarkup_UnknownPMIMarkup_TextPMIMarkup_DimensionPMIMarkup_ArrowPMIMarkup_BalloonPMIMarkup_CircleCenterPMIMarkup_CoordinatePMIMarkup_DatumPMIMarkup_FastenerPMIMarkup_GdtPMIMarkup_LocatorPMIMarkup_MeasurementPointPMIMarkup_RoughnessPMIMarkup_WeldingPMIMarkup_TablePMIMarkup_OtherOffsetLineDummyCutGeometry_SetMasterRootNodeMarkupSetDataAnalysisResultMarkupUnitTranslationDocument2DAnimationCoordinateSystemCustomCoordinateSystemHighlightSplitSessionSplitDirectionRootSplitFaceGroupUpSplitFaceGroupDownSplitFaceGroupUnassigned

### Markup Type

Note: Markup type values might be required in Integer form.
They are numbered in ascending order, i.e. Text has the value 1, Dimension has the value 2 and so on.

xxxxxxxxxxText = 1DimensionArrowBalloonCirclecenterCoordinateDatumFastenerGDTLocatorMeasurementPointRoughnessWeldingTableOtherAngleDimension

### Quaternion

Example:

$\left(\begin{array}{c}0.239\\ 0.370\\ 0.099\\ 0.892\end{array}\right)$
xxxxxxxxxx"0.239 0.370 0.099 0.892"

### RGB

24 bit color value.

xxxxxxxxxx#RRGGBB

### Transformation

4 x 4 Matrix written as space separated String. (Row 1 to 4) See Transformation matrix for detailed information.

Example:

$\left(\begin{array}{cccc}1& 0& 0& 0\\ 0& 1& 0& 0\\ 0& 0& 1& 0\\ 10.5& 0.05& -5.55& 1\end{array}\right)$
xxxxxxxxxx"1 0 0 0 0 1 0 0 0 0 1 0 10.5 0.05 -5.55 1"

A simple string.

### Float

A floating point number

### UnsignedLong

A 64bit unsigned integer value.

### UpVector

String value, valid values are

• "X"
• "Y"
• "Z"

### Vector2f

Vector of two floating point numbers.

#### Example

"1.0 2.0"

### Vector3f

Vector of three floating point numbers.

#### Example

"1.0 2.0 3.0"

### Vector4f

Vector of four floating point numbers.

#### Example

"1.0 2.0 3.0 4.0"

## Calculations

### Transformation matrix

Identity matrix (no rotation, no movement):

$\left(\begin{array}{cccc}1& 0& 0& 0\\ 0& 1& 0& 0\\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{array}\right)$

Movement X, Y or Z axis change the last part:

$\left(\begin{array}{cccc}1& 0& 0& 0\\ 0& 1& 0& 0\\ 0& 0& 1& 0\\ X& Y& Z& 0\end{array}\right)$

For simple rotations change the first part of the transformation matrix.

Reference orientation (no rotation, identity matrix):

$\left(\begin{array}{ccc}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1\end{array}\right)$

which equals:

$\left(\begin{array}{ccc}0& 0& 1\\ 0& 1& 0\\ -1& 0& 0\end{array}\right)$

which equals:

which equals:

http://www.euclideanspace.com/maths/geometry/affine/matrix4x4/index.htm

Math on computing the rotation matrix You can compute rotation from any angle about an axis using this formula.

#### Basic rotations

A basic rotation (also called elemental rotation) is a rotation about one of the axes of the Coordinate system. The following three basic rotation matrices rotate vectors by an angle $$\theta$$ about the x, y and z axis, in three dimensions, using the right hand rule - which codifies their alternating signs. (The same matrices can also represent a clockwise rotation of the axes)

$\begin{array}{c}{R}_{x}\left(\theta \right)=\left(\begin{array}{ccc}1& 0& 0\\ 0& cos\theta & -sin\theta \\ 0& sin\theta & -cos\theta \end{array}\right)\end{array}$
$\begin{array}{c}{R}_{y}\left(\theta \right)=\left(\begin{array}{ccc}cos\theta & 0& sin\theta \\ 0& 1& 0\\ -sin\theta & 0& cos\theta \end{array}\right)\end{array}$
$\begin{array}{c}{R}_{z}\left(\theta \right)=\left(\begin{array}{ccc}cos\theta & -sin\theta & 0\\ sin\theta & cos\theta & 0\\ 0& 0& 1\end{array}\right)\end{array}$

For column vectors, each of these basic vector rotations appears counter-clockwise when the axis about which they are located points toward the observer, the coordinate system is right-handed, and the angle $$\theta$$ is positive. $$R_z$$, for instance, would rotate a vector aligned with the x-axis towards the y-axis, as can easily be checked by operating with $$R_z$$ on the vector (1,0,0):

$\begin{array}{c}{R}_{z}\left(90°\right)=\left(\begin{array}{c}1\\ 0\\ 0\end{array}\right)=\left(\begin{array}{ccc}cos90°& -sin90°& 0\\ sin90°& cos90°& 0\\ 0& 0& 1\end{array}\right)\left(\begin{array}{c}1\\ 0\\ 0\end{array}\right)=\left(\begin{array}{ccc}0& -1& 0\\ 1& 0& 0\\ 0& 0& 1\end{array}\right)\left(\begin{array}{c}1\\ 0\\ 0\end{array}\right)=\left(\begin{array}{c}0\\ 1\\ 0\end{array}\right)\end{array}$

This is similar to the rotation produced by the above mentioned 2-D rotation matrix.