Table of Contents

Method Build

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

Build(CadDocument, string, double)

Builds the graph of a drawing: walks it (Walk(CadDocument, string)) and finds the edges.

public static CadDrawingGraph Build(CadDocument document, string layout, double tolerance)

Parameters

document CadDocument

The drawing.

layout string

The layout to take, or null for model space and every layout.

tolerance double

How near two ends must be to touch, in millimetres: 0.001 is the library's own.

Returns

CadDrawingGraph

The graph.

Exceptions

ArgumentNullException

Thrown when the drawing is null.

ArgumentException

Thrown when the drawing has no layout of that name, or the tolerance is not a finite number above nought.

Build(CadDocument, string, double, int)

Builds the graph of a drawing, stopping when it has more than maxEdges edges, so that a dense drawing (thousands of lines that cross each other) does not cost as many edges as it has crossings: the graph keeps the first maxEdges edges of the whole one in its order (kind, source, target) and says so with Truncated and EdgesFound. A drawing of 600 lines across 600 others, whose 360 000 crossings are the touches, built with a cap of 50, keeps the 50 edges of its first line and has EdgesFound 600.

public static CadDrawingGraph Build(CadDocument document, string layout, double tolerance, int maxEdges)

Parameters

document CadDocument

The drawing.

layout string

The layout to take, or null for model space and every layout.

tolerance double

How near two ends must be to touch, in millimetres: 0.001 is the library's own.

maxEdges int

The most edges to keep; above nought.

Returns

CadDrawingGraph

The graph.

Exceptions

ArgumentNullException

Thrown when the drawing is null.

ArgumentException

Thrown when the drawing has no layout of that name, the tolerance is not a finite number above nought, or the cap is not above nought.

Build(CadFlatDrawing, double)

Builds the graph of a drawing already walked.

public static CadDrawingGraph Build(CadFlatDrawing flat, double tolerance)

Parameters

flat CadFlatDrawing

The walk.

tolerance double

How near two ends must be to touch, in millimetres.

Returns

CadDrawingGraph

The graph.

Exceptions

ArgumentNullException

Thrown when the walk is null.

ArgumentException

Thrown when the tolerance is not a finite number above nought.

Build(CadFlatDrawing, double, int)

Builds the graph of a drawing already walked, with a cap on its edges (see Build(CadDocument, string, double, int)).

public static CadDrawingGraph Build(CadFlatDrawing flat, double tolerance, int maxEdges)

Parameters

flat CadFlatDrawing

The walk.

tolerance double

How near two ends must be to touch, in millimetres.

maxEdges int

The most edges to keep; above nought.

Returns

CadDrawingGraph

The graph.

Exceptions

ArgumentNullException

Thrown when the walk is null.

ArgumentException

Thrown when the tolerance is not a finite number above nought, or the cap is not above nought.