Class VectorUtils
Provides various tools to work with vector graphics.
Inherited Members
Namespace: Unity.VectorGraphics
Assembly: solution.dll
Syntax
public static class VectorUtils
Fields
Name | Description |
---|---|
Epsilon | A small value used everywhere by the vector graphics package. |
Methods
Name | Description |
---|---|
ApproximateSceneNodeBounds(SceneNode) | Computes a rough approximation of the node hierarchy bounds. |
BezierSegmentToPath(BezierSegment) | Convert a segments into a path. |
BezierSegmentsToPath(BezierSegment[]) | Converts an array of BezierSegments into a connected path. |
Bounds(IEnumerable<Vector2>) | Computes the bounds of a list of vertices. |
Bounds(BezierPathSegment[]) | Computes the bounds of a bezier path. |
Bounds(BezierSegment, out Vector2, out Vector2) | Computes the bounds of a segment. |
BuildRectangleContour(Rect, Vector2, Vector2, Vector2, Vector2) | Builds a BezierContour from a Rectangle. |
BuildSprite(List<Geometry>, float, Alignment, Vector2, ushort, bool) | Builds a sprite asset from a scene tessellation. |
BuildSprite(List<Geometry>, Rect, float, Alignment, Vector2, ushort, bool) | Builds a sprite asset from a scene tessellation. |
Eval(BezierSegment, float) | Evaluates the position on a curve segment. |
EvalFull(BezierSegment, float, out Vector2) | Evalutes both the position and tangent on a curve segment. |
EvalFull(BezierSegment, float, out Vector2, out Vector2) | Evalutes the position, tangent and normal on a curve segment. |
EvalNormal(BezierSegment, float) | Evalutes the normal on a curve segment. |
EvalTangent(BezierSegment, float) | Evaluates the tangent on a curve segment. |
FillMesh(Mesh, List<Geometry>, float, bool) | Fills a mesh geometry from a scene tessellation. |
FillUVs(IEnumerable<Geometry>, TextureAtlas) | Fill the UVs of the geometry using the provided texture atlas. |
FindBezierLineIntersections(BezierSegment, Vector2, Vector2) | Find the intersections (up to three) between a line and a curve segment. |
FlipSegment(BezierSegment) | Flips a segment direction. |
FlipVerticesInBounds(IList<Vector2>, Rect) | Flip the vertices (in-place) inside their axis-aligned bounding-box. |
GenerateAtlas(IEnumerable<Geometry>, uint, bool, bool) | Generates a Texture2D atlas containing the textures and gradients for the vector geometry. |
GenerateAtlasAndFillUVs(IEnumerable<Geometry>, uint) | Generates a Texture2D atlas containing the textures and gradients for the vector geometry, and fill the UVs of the geometry. |
IntersectLineSegments(Vector2, Vector2, Vector2, Vector2) | Finds the intersection between two line segments |
IntersectLines(Vector2, Vector2, Vector2, Vector2) | Finds the intersection between two infinite lines |
MakeArc(Vector2, float, float, float) | Approximates a circle arc with up to 4 segments. |
MakeCircleShape(Shape, Vector2, float) | Builds a circle shape. |
MakeEllipseShape(Shape, Vector2, float, float) | Builds an ellipse shape. |
MakeLine(Vector2, Vector2) | Builds a line segment. |
MakePathLine(Vector2, Vector2) | Builds a line path segment. |
MakeRectangleShape(Shape, Rect) | Builds a rectangle shape. |
MakeRectangleShape(Shape, Rect, Vector2, Vector2, Vector2, Vector2) | Builds a rectangle shape. |
PathEndsPerfectlyMatch(IList<BezierPathSegment>) | Checks if the two ends of a BezierPathSegment chain are at the same location. |
PathSegmentAtIndex(IList<BezierPathSegment>, int) | Computes the BezierSegment at a given index from a list of BezierPathSegments. |
QuadraticToCubic(Vector2, Vector2, Vector2) | Converts a quadratic bezier to a cubic bezier |
RealignVerticesInBounds(IList<Vector2>, Rect, bool) | Realigns the vertices (in-place) inside their axis-aligned bounding-box. |
RenderSprite(Sprite, Material, bool) | Draws a vector sprite using the provided material. |
RenderSpriteToTexture2D(Sprite, int, int, Material, int, bool) | Renders a vector sprite to Texture2D. |
SceneNodeBounds(SceneNode) | Computes a pretty accurate approximation of the scene bounds. |
SceneNodes(SceneNode) | Lists every nodes under a root node. |
SegmentLength(BezierSegment, float) | Computes the length of a single curve segment. |
SegmentsInPath(IEnumerable<BezierPathSegment>, bool) | Iterates through every segment in a list of path segments. |
SegmentsLength(IList<BezierPathSegment>, bool, float) | Computes the combined length of a segment chain. |
SegmentsLengths(IList<BezierPathSegment>, bool, float) | Computes the individual lengths of a segment chain. |
SplitSegment(BezierSegment, float, out BezierSegment, out BezierSegment) | Splits a curve segment at a given parametric location. |
TessellatePath(BezierContour, PathProperties, TessellationOptions, out Vector2[], out ushort[]) | Tessellates a path. |
TessellateRect(Rect, out Vector2[], out ushort[]) | Tessellates a rectangle. |
TessellateRectBorder(Rect, float, out Vector2[], out ushort[]) | Tessellates a rectangle border. |
TessellateScene(Scene, TessellationOptions, Dictionary<SceneNode, float>) | Tessellates a Scene object into triangles. |
TransformBezierPath(BezierPathSegment[], Matrix2D) | Transforms a path by a transformation matrix. |
TransformBezierPath(BezierPathSegment[], Vector2, float, Vector2) | Transforms a path by a transformation matrix. |
TransformSegment(BezierSegment, Matrix2D) | Transforms a curve segment by a transformation matrix. |
TransformSegment(BezierSegment, Vector2, float, Vector2) | Transforms a curve segment by a translation, rotation and scaling. |
WorldTransformedSceneNodes(SceneNode, Dictionary<SceneNode, float>) | Iterates through every nodes under a root with computed transform and opacities. |