Table of Contents

Class PathTesselator.Contouring

Namespace
Xui.Runtime.Software.Tessellate
Assembly
Xui.Runtime.Software.dll
public class PathTesselator.Contouring : IPathBuilder, IGlyphPathBuilder
Inheritance
PathTesselator.Contouring
Implements
Inherited Members

Constructors

Contouring()

public Contouring()

Contouring(NFloat)

public Contouring(NFloat precision)

Parameters

precision NFloat

Properties

Contours

public IReadOnlyList<PathTesselator.ClosedContour> Contours { get; }

Property Value

IReadOnlyList<PathTesselator.ClosedContour>

Result

public List<PathTesselator.ClosedContour> Result { get; }

Property Value

List<PathTesselator.ClosedContour>

Methods

Arc(Point, NFloat, NFloat, NFloat, Winding)

Adds an arc to the path centered at the specified point.

public void Arc(Point center, NFloat radius, NFloat startAngle, NFloat endAngle, Winding winding = Winding.ClockWise)

Parameters

center Point

Center of the arc.

radius NFloat

Radius of the arc.

startAngle NFloat

Start angle in radians.

endAngle NFloat

End angle in radians.

winding Winding

Direction in which the arc is drawn.

ArcTo(Point, Point, NFloat)

Adds an arc to the path, connecting two tangents defined by control points.

public void ArcTo(Point cp1, Point cp2, NFloat radius)

Parameters

cp1 Point

First control point.

cp2 Point

Second control point.

radius NFloat

Arc radius.

BeginPath()

Begins a new path by resetting the current path list.

public void BeginPath()

ClosePath()

Closes the current path contour.

public void ClosePath()

ContourPath(Path2D, NFloat)

public static IReadOnlyList<PathTesselator.ClosedContour> ContourPath(Path2D path, NFloat precision)

Parameters

path Path2D
precision NFloat

Returns

IReadOnlyList<PathTesselator.ClosedContour>

CurveTo(Point, Point)

Draws a quadratic Bézier curve using a control point and end point.

public void CurveTo(Point control, Point to)

Parameters

control Point
to Point

CurveTo(Point, Point, Point)

Draws a cubic Bézier curve from the current point to the specified point, using two control points.

public void CurveTo(Point cp1, Point cp2, Point to)

Parameters

cp1 Point

First control point.

cp2 Point

Second control point.

to Point

End point.

Ellipse(Point, NFloat, NFloat, NFloat, NFloat, NFloat, Winding)

Adds an elliptical arc to the path.

public void Ellipse(Point center, NFloat rx, NFloat ry, NFloat rotation, NFloat startAngle, NFloat endAngle, Winding winding = Winding.ClockWise)

Parameters

center Point

Center of the ellipse.

rx NFloat
ry NFloat
rotation NFloat

Rotation of the ellipse, in radians.

startAngle NFloat

Start angle in radians.

endAngle NFloat

End angle in radians.

winding Winding

Direction in which the arc is drawn.

LineTo(Point)

Draws a straight line to the specified point.

public void LineTo(Point to)

Parameters

to Point

MoveTo(Point)

Begins a new sub-path at the specified point.

public void MoveTo(Point to)

Parameters

to Point

Rect(Rect)

Adds a rectangle path to the current path.

public void Rect(Rect rect)

Parameters

rect Rect

The rectangle to add.

RoundRect(Rect, NFloat)

Adds a rounded rectangle path with a uniform radius.

public void RoundRect(Rect rect, NFloat radius)

Parameters

rect Rect

The rectangle to round.

radius NFloat

Corner radius.

RoundRect(Rect, CornerRadius)

Adds a rounded rectangle path with per-corner radii.

public void RoundRect(Rect rect, CornerRadius radius)

Parameters

rect Rect

The rectangle to round.

radius CornerRadius

Corner radius object defining each corner.