Table of Contents

Class LineBuilder

Namespace
HelixToolkit.SharpDX
Assembly
HelixToolkit.SharpDX.dll
public class LineBuilder
Inheritance
LineBuilder
Inherited Members

Constructors

LineBuilder()

public LineBuilder()

Methods

Add(bool, params Vector3[])

public void Add(bool isClosed, params Vector3[] points)

Parameters

isClosed bool
points Vector3[]

AddBox(Vector3, double, double, double)

public void AddBox(Vector3 center, double xlength, double ylength, double zlength)

Parameters

center Vector3
xlength double
ylength double
zlength double

AddCircle(Vector3, Vector3, float, int)

Adds the circle.

public void AddCircle(Vector3 position, Vector3 normal, float radius, int segments)

Parameters

position Vector3

The position.

normal Vector3

The normal.

radius float

The radius.

segments int

The segments.

AddGrid(BoxFaces, int, int, float, float)

public void AddGrid(BoxFaces plane, int columns, int rows, float width, float height)

Parameters

plane BoxFaces
columns int
rows int
width float
height float

AddLine(Vector3, Vector3)

public void AddLine(Vector3 p1, Vector3 p2)

Parameters

p1 Vector3
p2 Vector3

Clear()

Removes all the data from the current LineBuilder instance.

public void Clear()

GenerateBoundingBox(BoundingBox)

Returns a line geometry of the axis-aligned bounding-box.

public static LineGeometry3D GenerateBoundingBox(BoundingBox bb)

Parameters

bb BoundingBox

The bounding-box

Returns

LineGeometry3D

GenerateBoundingBox(Geometry3D)

Returns a line geometry of the axis-aligned bounding-box of the given mesh.

public static LineGeometry3D GenerateBoundingBox(Geometry3D mesh)

Parameters

mesh Geometry3D

Input mesh for the computation of the b-box

Returns

LineGeometry3D

GenerateBoundingBox(Vector3[])

Returns a line geometry of the axis-aligned bounding-box of the given mesh.

public static LineGeometry3D GenerateBoundingBox(Vector3[] points)

Parameters

points Vector3[]

Input points for the computation of the b-box

Returns

LineGeometry3D

GenerateCircle(Plane, float, int)

Generates the circle.

public static LineGeometry3D GenerateCircle(Plane plane, float radius, int segments)

Parameters

plane Plane

The plane.

radius float

The radius.

segments int

The segments.

Returns

LineGeometry3D

GenerateCircle(Vector3, float, int)

public static LineGeometry3D GenerateCircle(Vector3 plane, float radius, int segments)

Parameters

plane Vector3
radius float
segments int

Returns

LineGeometry3D

GenerateGrid(int)

Generates a square grid with a step of 1.0

public static LineGeometry3D GenerateGrid(int width = 10)

Parameters

width int

Returns

LineGeometry3D

GenerateGrid(Vector3, int, int)

Generates a square grid with a step of 1.0

public static LineGeometry3D GenerateGrid(Vector3 plane, int min = 0, int max = 10)

Parameters

plane Vector3
min int
max int

Returns

LineGeometry3D

GenerateGrid(Vector3, int, int, int, int)

Generates a square grid with a step of 1.0

public static LineGeometry3D GenerateGrid(Vector3 plane, int min0 = 0, int max0 = 10, int min1 = 0, int max1 = 10)

Parameters

plane Vector3
min0 int
max0 int
min1 int
max1 int

Returns

LineGeometry3D

GetLineToLineDistance(Vector3, Vector3, Vector3, Vector3, out Vector3, out Vector3, out float, out float, bool)

Source: http://geomalgorithms.com/a07-_distance.html ~2341920 tests per second

public static float GetLineToLineDistance(Vector3 s0, Vector3 s1, Vector3 t0, Vector3 t1, out Vector3 sp, out Vector3 tp, out float sc, out float tc, bool sIsRay = false)

Parameters

s0 Vector3
s1 Vector3
t0 Vector3
t1 Vector3
sp Vector3
tp Vector3
sc float
tc float
sIsRay bool

Returns

float

GetPointToLineDistance2D(ref Vector3, ref Vector3, ref Vector3, out Vector3, out float)

~7874015 tests per second, 3.36 times faster than GetRayToLineDistance()

public static float GetPointToLineDistance2D(ref Vector3 pt, ref Vector3 p0, ref Vector3 p1, out Vector3 closest, out float t)

Parameters

pt Vector3
p0 Vector3
p1 Vector3
closest Vector3
t float

Returns

float

GetRayToLineDistance(Ray, Vector3, Vector3, out Vector3, out Vector3, out float, out float)

public static float GetRayToLineDistance(Ray ray, Vector3 t0, Vector3 t1, out Vector3 sp, out Vector3 tp, out float sc, out float tc)

Parameters

ray Ray
t0 Vector3
t1 Vector3
sp Vector3
tp Vector3
sc float
tc float

Returns

float

ToLineGeometry3D(bool)

Creates the resulting LineGeometry3D.

public LineGeometry3D ToLineGeometry3D(bool unshareVertices = false)

Parameters

unshareVertices bool

If true, the resulting LineGeometry3D has no shared vertices.

Returns

LineGeometry3D

Returns the resulting LineGeometry3D.