> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class Canvas

Namespace: [VM.CAD.Kernel.Render](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render)\
Assembly: VM.CAD.Kernel.dll

```csharp theme={null}
public sealed class Canvas : KernelObject, IDrawReference
```

#### Inheritance

object ←
[KernelObject](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.KernelObject.md) ←
[Canvas](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.Canvas.md)

#### Implements

[IDrawReference](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.IDrawReference.md)

#### Inherited Members

[KernelObject.Dispose()](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.KernelObject.md#VM_CAD_Kernel_KernelObject_Dispose),
[KernelObject.Key](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.KernelObject.md#VM_CAD_Kernel_KernelObject_Key)

#### Extension Methods

[LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkProperties_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkPropertiesAndValues_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkedObjects\<T>(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkedObjects__1_System_Object_VM_Models_Pre_LinkPropertyType_)

## Properties

### BackplaneCull

Sets the back plane cull.

```csharp theme={null}
public bool BackplaneCull { set; }
```

#### Property Value

bool

### Color

Sets the color.

```csharp theme={null}
public Color Color { set; }
```

#### Property Value

Color

### Document

Gets the Document

```csharp theme={null}
public IDocument3D Document { get; }
```

#### Property Value

IDocument3D

### LightInterpolationOption

Sets the light interpolation option.

```csharp theme={null}
public LightInterpolationOptionType LightInterpolationOption { set; }
```

#### Property Value

[LightInterpolationOptionType](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.LightInterpolationOptionType.md)

### LineShape

Sets the line shape.

```csharp theme={null}
public LineType LineShape { set; }
```

#### Property Value

[LineType](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.LineType.md)

### LineWeight

Sets the line weight.

```csharp theme={null}
public double LineWeight { set; }
```

#### Property Value

double

### TextSize

Set the text size.

```csharp theme={null}
public double TextSize { set; }
```

#### Property Value

double

### Transparency

Sets the transparency.

```csharp theme={null}
public double Transparency { set; }
```

#### Property Value

double

### WireframeMode

Sets the wire frame mode.

```csharp theme={null}
public bool WireframeMode { set; }
```

#### Property Value

bool

## Methods

### AppendModellingMatrix(TMatrix)

Append modelling matrix.

```csharp theme={null}
public void AppendModellingMatrix(TMatrix mat)
```

#### Parameters

`mat` TMatrix

The transformation matrix

### Clear()

Clear canvas.

```csharp theme={null}
public void Clear()
```

### Create(IDocument3D, bool)

Create a new instance of the [Canvas](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.Canvas.md) class

```csharp theme={null}
public static Canvas Create(IDocument3D doc, bool ThreadSafeCanvas = true)
```

#### Parameters

`doc` IDocument3D

The document

`ThreadSafeCanvas` bool

true if to create thread-safe canvas, otherwise false.

#### Returns

[Canvas](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.Canvas.md)

### Create(UIntPtr, IDocument3D, bool)

Create a new instance of the [Canvas](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.Canvas.md) class

```csharp theme={null}
public static Canvas Create(UIntPtr key, IDocument3D doc, bool ThreadSafeCanvas = true)
```

#### Parameters

`key` UIntPtr

The key of the canvas

`doc` IDocument3D

The document

`ThreadSafeCanvas` bool

true if to create thread-safe canvas, otherwise false.

#### Returns

[Canvas](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.Canvas.md)

### DisplayTheFront(double)

Display front above all.

```csharp theme={null}
public void DisplayTheFront(double dDepthRange = -1)
```

#### Parameters

`dDepthRange` double

The depth range. If it is negative value, default value will be used.

### DrawArc(Vector, Vector, Vector)

Draw arc.

```csharp theme={null}
public UIntPtr DrawArc(Vector vecFirst, Vector vecSecond, Vector vecThird)
```

#### Parameters

`vecFirst` Vector

The first point

`vecSecond` Vector

The second point

`vecThird` Vector

The third point

#### Returns

UIntPtr

### DrawArrow(Vector, Vector, double)

Draw arrow.

```csharp theme={null}
public UIntPtr DrawArrow(Vector vecStart, Vector vecEnd, double dArrowSize = -1)
```

#### Parameters

`vecStart` Vector

The start point

`vecEnd` Vector

The end point

`dArrowSize` double

The arrow size. If dArrowSize is negative or zero value, default value will be used.

#### Returns

UIntPtr

### DrawCircle(Vector, double, Vector, bool)

Draw circle.

```csharp theme={null}
public UIntPtr DrawCircle(Vector vecCenter, double dRad, Vector vecNormal, bool bFill = false)
```

#### Parameters

`vecCenter` Vector

The center point

`dRad` double

The radius

`vecNormal` Vector

The normal vector

`bFill` bool

The fill flag

#### Returns

UIntPtr

### DrawCylinder(Vector, Vector, double, bool, bool)

Draw cylinder.

```csharp theme={null}
public UIntPtr DrawCylinder(Vector vecStart, Vector vecEnd, double dRad, bool bFirstCap = true, bool bSecondCap = true)
```

#### Parameters

`vecStart` Vector

The start point

`vecEnd` Vector

The end point

`dRad` double

The radius

`bFirstCap` bool

if first cap and second cap is true, "both";
if first cap is true and second cap is false, "first";
if first cap is false and second cap is true, "second";
if first cap and second cap is false, "none"

`bSecondCap` bool

if first cap and second cap is true, "both";
if first cap is true and second cap is false, "first";
if first cap is false and second cap is true, "second";
if first cap and second cap is false, "none"

#### Returns

UIntPtr

### DrawCylinder(Vector, Vector, double, string)

Draw cylinder.

```csharp theme={null}
public UIntPtr DrawCylinder(Vector vecStart, Vector vecEnd, double dRad, string strCapOption)
```

#### Parameters

`vecStart` Vector

The start point

`vecEnd` Vector

The end point

`dRad` double

The radius

`strCapOption` string

String specifying which ends to cap, either "first", "second", "none", or "both"

#### Returns

UIntPtr

### DrawDimension(Vector, string)

Draws the dimension.

```csharp theme={null}
public UIntPtr DrawDimension(Vector vecCenter, string strText)
```

#### Parameters

`vecCenter` Vector

The center position.

`strText` string

The string text.

#### Returns

UIntPtr

### DrawIcon(IconInfo)

Draw icon.

```csharp theme={null}
public void DrawIcon(IconInfo iconInfo)
```

#### Parameters

`iconInfo` [IconInfo](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.IconInfo.md)

The icon information

### DrawIcon(IconInfo, double)

Draw icon.

```csharp theme={null}
public void DrawIcon(IconInfo iconInfo, double dScale)
```

#### Parameters

`iconInfo` [IconInfo](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.IconInfo.md)

The icon information

`dScale` double

The scale

### DrawLine(Vector, Vector)

Draw line.

```csharp theme={null}
public UIntPtr DrawLine(Vector vecStart, Vector vecEnd)
```

#### Parameters

`vecStart` Vector

The start point

`vecEnd` Vector

The end point

#### Returns

UIntPtr

### DrawMarker(Vector)

Draw marker.

```csharp theme={null}
public UIntPtr DrawMarker(Vector vecCenter)
```

#### Parameters

`vecCenter` Vector

The center point

#### Returns

UIntPtr

### DrawMesh(int, int, ICollection\<Vector>)

Draw mesh.

```csharp theme={null}
public UIntPtr DrawMesh(int nRows, int nColumns, ICollection<Vector> points)
```

#### Parameters

`nRows` int

The rows numner

`nColumns` int

The columns number

`points` ICollection\<Vector>

The collection of points

#### Returns

UIntPtr

### DrawMesh(int, int, Vector\[])

Draw mesh.

```csharp theme={null}
public UIntPtr DrawMesh(int nRows, int nColumns, Vector[] points)
```

#### Parameters

`nRows` int

The rows numner

`nColumns` int

The columns number

`points` Vector\[]

The array of points

#### Returns

UIntPtr

### DrawNurbs(int, int, int, int, ICollection\<Vector>, ICollection\<float>, ICollection\<float>, ICollection\<float>)

Draw nurbs.

```csharp theme={null}
public UIntPtr DrawNurbs(int u_degree, int v_degree, int u_count, int v_count, ICollection<Vector> ctrlPts, ICollection<float> weights, ICollection<float> u_knots, ICollection<float> v_knots)
```

#### Parameters

`u_degree` int

Degree of the surface in the u direction

`v_degree` int

Degree of the surface in the v direction

`u_count` int

Number of valid control points in the u direction

`v_count` int

Number of valid control points in the v direction

`ctrlPts` ICollection\<Vector>

Vector of x-y-z triplets for the coordinates of the control points

`weights` ICollection\<float>

Control point weights

`u_knots` ICollection\<float>

Knot sequence in the u direction

`v_knots` ICollection\<float>

Knot sequence in the v direction

#### Returns

UIntPtr

### DrawNurbs(int, int, int, int, Vector\[], float\[], float\[], float\[])

Draw nurbs.

```csharp theme={null}
public UIntPtr DrawNurbs(int u_degree, int v_degree, int u_count, int v_count, Vector[] ctrlPts, float[] weights, float[] u_knots, float[] v_knots)
```

#### Parameters

`u_degree` int

Degree of the surface in the u direction

`v_degree` int

Degree of the surface in the v direction

`u_count` int

Number of valid control points in the u direction

`v_count` int

Number of valid control points in the v direction

`ctrlPts` Vector\[]

Vector of x-y-z triplets for the coordinates of the control points

`weights` float\[]

Control point weights

`u_knots` float\[]

Knot sequence in the u direction

`v_knots` float\[]

Knot sequence in the v direction

#### Returns

UIntPtr

### DrawPolygon(ICollection\<Vector>)

Draw polygon.

```csharp theme={null}
public UIntPtr DrawPolygon(ICollection<Vector> colPoint)
```

#### Parameters

`colPoint` ICollection\<Vector>

The collection of points

#### Returns

UIntPtr

### DrawPolygon(Vector\[])

Draw polygon.

```csharp theme={null}
public UIntPtr DrawPolygon(Vector[] arPoint)
```

#### Parameters

`arPoint` Vector\[]

The array of points

#### Returns

UIntPtr

### DrawPolyline(ICollection\<Vector>)

Draw polyline.

```csharp theme={null}
public UIntPtr DrawPolyline(ICollection<Vector> colPoint)
```

#### Parameters

`colPoint` ICollection\<Vector>

The collection of points

#### Returns

UIntPtr

### DrawPolyline(Vector\[])

Draw polyline.

```csharp theme={null}
public UIntPtr DrawPolyline(Vector[] arPoint)
```

#### Parameters

`arPoint` Vector\[]

The array of points

#### Returns

UIntPtr

### DrawShell(ICollection\<Vector>, ICollection\<int>, double)

Draw shell.

```csharp theme={null}
public UIntPtr DrawShell(ICollection<Vector> points, ICollection<int> connectivities, double dScale = 1)
```

#### Parameters

`points` ICollection\<Vector>

The collection of points.

`connectivities` ICollection\<int>

The collection of connectivities.

`dScale` double

The scale to draw.

#### Returns

UIntPtr

### DrawShell(Vector\[], int\[], double)

Draw shell.

```csharp theme={null}
public UIntPtr DrawShell(Vector[] points, int[] connectivities, double dScale = 1)
```

#### Parameters

`points` Vector\[]

The array of points.

`connectivities` int\[]

The array of connectivities.

`dScale` double

The scale factor to draw.

#### Returns

UIntPtr

### DrawShellWithFaceNormal(ICollection\<Vector>, ICollection\<int>, ICollection\<Vector>)

Draw shell with face normal.

```csharp theme={null}
public UIntPtr DrawShellWithFaceNormal(ICollection<Vector> points, ICollection<int> connectivities, ICollection<Vector> faceNormals = null)
```

#### Parameters

`points` ICollection\<Vector>

The collection of points.

`connectivities` ICollection\<int>

The collection of connectivities.

`faceNormals` ICollection\<Vector>

The collection of face normal vectors.

#### Returns

UIntPtr

### DrawShellWithFaceNormal(Vector\[], int\[], Vector\[])

Draw shell with face normal.

```csharp theme={null}
public UIntPtr DrawShellWithFaceNormal(Vector[] points, int[] connectivities, Vector[] faceNormals = null)
```

#### Parameters

`points` Vector\[]

The array of points.

`connectivities` int\[]

The array of connectivities.

`faceNormals` Vector\[]

The array of face normal vectors.

#### Returns

UIntPtr

### DrawShellWithVertexNormal(ICollection\<Vector>, ICollection\<int>, ICollection\<Vector>)

Draw shell with vertex normal.

```csharp theme={null}
public UIntPtr DrawShellWithVertexNormal(ICollection<Vector> points, ICollection<int> connectivities, ICollection<Vector> vertexNormals = null)
```

#### Parameters

`points` ICollection\<Vector>

The collection of points.

`connectivities` ICollection\<int>

The collection of connectivities.

`vertexNormals` ICollection\<Vector>

The collection of vertex normal vectors.

#### Returns

UIntPtr

### DrawShellWithVertexNormal(Vector\[], int\[], Vector\[])

Draw shell with vertex normal.

```csharp theme={null}
public UIntPtr DrawShellWithVertexNormal(Vector[] points, int[] connectivities, Vector[] vertexNormals = null)
```

#### Parameters

`points` Vector\[]

The array of points.

`connectivities` int\[]

The array of connectivities.

`vertexNormals` Vector\[]

The array of vertex normal vectors.

#### Returns

UIntPtr

### DrawSphere(Vector, double)

Draw sphere.

```csharp theme={null}
public UIntPtr DrawSphere(Vector vecCenter, double dRad)
```

#### Parameters

`vecCenter` Vector

The center point

`dRad` double

The radius

#### Returns

UIntPtr

### DrawSphere(Vector, double, Vector, Vector)

Draw sphere.

```csharp theme={null}
public UIntPtr DrawSphere(Vector vecCenter, double dRad, Vector vecAxis, Vector vecOrtho)
```

#### Parameters

`vecCenter` Vector

The center point

`dRad` double

The radius

`vecAxis` Vector

The axis vector

`vecOrtho` Vector

The orthogonal vector

#### Returns

UIntPtr

### DrawText(Vector, string)

Draw text.

```csharp theme={null}
public UIntPtr DrawText(Vector vecCenter, string strText)
```

#### Parameters

`vecCenter` Vector

The center position of text

`strText` string

The text

#### Returns

UIntPtr

### DrawWireCylinder(Vector, Vector, double)

Draw cylinder with face.

```csharp theme={null}
public UIntPtr DrawWireCylinder(Vector vecStart, Vector vecEnd, double dRad)
```

#### Parameters

`vecStart` Vector

The start point

`vecEnd` Vector

The end point

`dRad` double

The radius

#### Returns

UIntPtr

### DrawWireSphere(Vector, double)

Draw wire sphere.

```csharp theme={null}
public UIntPtr DrawWireSphere(Vector vecCenter, double dRad)
```

#### Parameters

`vecCenter` Vector

The center point

`dRad` double

The radius

#### Returns

UIntPtr

### DrawWireSphere(Vector, double, Vector, Vector)

Draw wire sphere.

```csharp theme={null}
public UIntPtr DrawWireSphere(Vector vecCenter, double dRad, Vector vecAxis, Vector vecOrtho)
```

#### Parameters

`vecCenter` Vector

The center point

`dRad` double

The radius

`vecAxis` Vector

The axis vector

`vecOrtho` Vector

The orthogonal vector

#### Returns

UIntPtr

### EndGeometryEdit()

End geometry for edit.

```csharp theme={null}
public void EndGeometryEdit()
```

### FastDrawShell(UIntPtr, ulong, UIntPtr, ulong, double)

Draw shell (fast).

```csharp theme={null}
public void FastDrawShell(UIntPtr points, ulong nPoints, UIntPtr connectivities, ulong nConnectivities, double dScale)
```

#### Parameters

`points` UIntPtr

The points array

`nPoints` ulong

The number of points

`connectivities` UIntPtr

The connectivities array

`nConnectivities` ulong

The number of connectivities

`dScale` double

The scale

### FastDrawShellWithFaceNormal(UIntPtr, ulong, UIntPtr, ulong)

Draw shell with face normal (fast).

```csharp theme={null}
public void FastDrawShellWithFaceNormal(UIntPtr points, ulong nPoints, UIntPtr connectivities, ulong nConnectivities)
```

#### Parameters

`points` UIntPtr

The points array

`nPoints` ulong

The number of points

`connectivities` UIntPtr

The connectivities array

`nConnectivities` ulong

The number of connectivities

### GetExtension\<T>()

Get canvas extension

```csharp theme={null}
public T GetExtension<T>() where T : KernelExtension
```

#### Returns

T

The canvas extension

#### Type Parameters

`T`

The type of the canvas extension

### GetExtension\<T>(string)

Get canvas extension

```csharp theme={null}
public T GetExtension<T>(string strExtensionName) where T : KernelExtension
```

#### Parameters

`strExtensionName` string

The name of the canvas extension.

#### Returns

T

The canvas extension

#### Type Parameters

`T`

The type of the canvas extension

### GetSubCanvas(string)

Get sub canvas.

```csharp theme={null}
public Canvas GetSubCanvas(string strCanvasName)
```

#### Parameters

`strCanvasName` string

The canvas name

#### Returns

[Canvas](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.Canvas.md)

### IgnoreDepthTest()

Ignore depth test.

```csharp theme={null}
public void IgnoreDepthTest()
```

### SetMarkerSymbol(MarkerType, double)

Set marker symbol.

```csharp theme={null}
public void SetMarkerSymbol(MarkerType type, double dSize = -1)
```

#### Parameters

`type` [MarkerType](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/lib/VM.CAD.Kernel.Render.MarkerType.md)

The type of the marker to draw.

`dSize` double

The marker size. If it is negative value, default value will be used.

### SetModellingMatrix(TMatrix)

Set modelling matrix.

```csharp theme={null}
public void SetModellingMatrix(TMatrix mat)
```

#### Parameters

`mat` TMatrix

The transformation matrix

### SetScale(double, double, double)

Set scale.

```csharp theme={null}
public void SetScale(double dX, double dY, double dZ)
```

#### Parameters

`dX` double

The X coordinate of scale

`dY` double

The Y coordinate of scale

`dZ` double

The Z coordinate of scale

### SetWireframeMode(bool, bool)

Set wireframe mode.

```csharp theme={null}
public void SetWireframeMode(bool bWireframe, bool bVisibleEdge)
```

#### Parameters

`bWireframe` bool

Whether use wire frame mode

`bVisibleEdge` bool

Whether visible edge

### StartGeometryEdit(UIntPtr)

Start geometry for edit.

```csharp theme={null}
public void StartGeometryEdit(UIntPtr pKeyGeom)
```

#### Parameters

`pKeyGeom` UIntPtr

The geometry key

### TrimNurbs(int, int, ICollection\<Vector>, ICollection\<float>, ICollection\<float>, double, double)

Trim nurbs.

```csharp theme={null}
public void TrimNurbs(int degree, int cpcount, ICollection<Vector> ctrlPts, ICollection<float> weights, ICollection<float> knots, double start_u, double end_u)
```

#### Parameters

`degree` int

Degree of the curve

`cpcount` int

Number of valid points in control\_points

`ctrlPts` ICollection\<Vector>

The points

`weights` ICollection\<float>

Control point weights

`knots` ICollection\<float>

Knot sequence

`start_u` double

Start parameter

`end_u` double

End parameter

### TrimNurbs(int, int, Vector\[], float\[], float\[], double, double)

Trim nurbs.

```csharp theme={null}
public void TrimNurbs(int degree, int cpcount, Vector[] ctrlPts, float[] weights, float[] knots, double start_u, double end_u)
```

#### Parameters

`degree` int

Degree of the curve

`cpcount` int

Number of valid points in control\_points

`ctrlPts` Vector\[]

The points

`weights` float\[]

Control point weights

`knots` float\[]

Knot sequence

`start_u` double

Start parameter

`end_u` double

End parameter
