Click or drag to resize
AB4D logo

DXSceneRenderConnectedLinesAsDisconnectedLinesThicknessLimit Property

Note: This API is now obsolete.

Gets or sets the LineThickness value that will limit rendering connected 3D lines (polylines, line arc, rectangle, etc.), as disconnected 3D lines (fully hardware accelerated). The connected 3D lines that have lower or equal LineThickness then the value of this property will be rendered as disconnected 3D line; other connected lines will still be generated on the CPU by Ab3d.PowerToys library. Default value is 3.

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
[ObsoleteAttribute("RenderConnectedLinesAsDisconnected is obsolete and not used any more because Ab3d.DXEngine v2.3 and newer support full hardware rendering of connected 3D lines. If you still want to render connected lines as disconnected, then manually convert polylines into multiple lines and rendered them.")]
public double RenderConnectedLinesAsDisconnectedLinesThicknessLimit { get; set; }

Property Value

Double
Remarks

RenderConnectedLinesAsDisconnectedLinesThicknessLimit gets or sets the LineThickness value that will limit rendering connected 3D lines (polylines, line arc, rectangle, etc.), as disconnected 3D lines (fully hardware accelerated).

RenderConnectedLinesAsDisconnectedLinesThicknessLimit is not used when RenderConnectedLinesAsDisconnected is set to true.

Default value is 3 which means that if connected line has LineThickness less or equal to 3, it will be rendered as disconnected 3D line.

Connected 3D lines are 3D lines where the end point of one line is the start point of the next line and where the connection between the lines is "smoothed". In Ab3d.PowerToys library the connected 3D lines are created with the following objects: PolyLineVisual3D, LineArcVisual3D, RectangleVisual3D, MultiPolyLineVisual3D, TextVisual3D, LineWithTextVisual3D, CenteredTextVisual3D.

Disconnected 3D lines are simple 3D lines are not connected to each other. In Ab3d.PowerToys library the connected 3D lines are created with the following objects: LineVisual3D, MultiLineVisual3D, WireBoxVisual3D, WireCrossVisual3D, WireGridVisual3D, WireframeVisual3D.

One simple 3D line can be rendered with rendering a rectangle where rectangle's height would be set to LineThickness and its length to line length. A rectangle can be rendered on the graphics card with creating two triangles. This can be easily done on the graphics card in the geometry shader.

But when connected lines are rendered, this also require to render additional triangle that will smooth the line connections and fill the gap between the lines. This is a moch more complicated operation and is not done on the graphics card. Therefore the MeshGeometry3D for connected lines needs to be prepared on the CPU.

Because the connection triangle that is rendered between two connected lines is hardly visible when LineThickness is less or equal to 3, the DXEngine by default renders all connected lines with LineThickness is less or equal to 3 as disconnected lines. This value can be adjusted by changing the RenderConnectedLinesAsDisconnectedLinesThicknessLimit value. Also, setting the RenderConnectedLinesAsDisconnected property to true will render all connected lines as disconnected.

Note that lines with arrows are never rendered with full hardware accelerated DXEngine.

NOTE:
RenderConnectedLinesAsDisconnectedLinesThicknessLimit and RenderConnectedLinesAsDisconnected properties must be set before the 3D lines are initialized and after the DXScene object is created and. This can be done in the DXSceneDeviceCreated event (here the DXScene and DXDevice are already created).

Example
C#
MainDXViewportView.DXSceneDeviceCreated += delegate(object sender, EventArgs args)
{
   if (DXViewportView1.DXScene != null) // DXScene is null in case of WPF 3D rendering
   {
       // Here the values are set to the default values - you can change them if you want.
       DXViewportView1.DXScene.RenderConnectedLinesAsDisconnected = false;
       DXViewportView1.DXScene.RenderConnectedLinesAsDisconnectedLinesThicknessLimit = 2;
   }
};
See Also