Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


VectorUtils

Provides various tools to work with vector graphics.
Read time 3 minutesLast updated 6 days ago

Definition

public static class VectorUtils

Static Fields

Value

Description

EpsilonA small value used everywhere by the vector graphics package.

Static Methods

Method

Description

ApproximateSceneNodeBoundsComputes a rough approximation of the node hierarchy bounds.
BezierSegmentsToPathConverts an array of BezierSegments into a connected path.
BezierSegmentToPathConvert a segments into a path.
BoundsComputes the bounds of a list of vertices.
BuildRectangleContourBuilds a BezierContour from a Rectangle.
BuildSpriteBuilds a sprite asset from a scene tessellation.
BuildVectorImageBuilds a sprite asset from a scene tessellation.
EvalEvaluates the position on a curve segment.
EvalFullEvalutes both the position and tangent on a curve segment.
EvalNormalEvalutes the normal on a curve segment.
EvalTangentEvaluates the tangent on a curve segment.
FillMeshFills a mesh geometry from a scene tessellation.
FillUVsFill the UVs of the geometry using the provided texture atlas.
FindBezierLineIntersectionsFind the intersections (up to three) between a line and a curve segment.
FlipSegmentFlips a segment direction.
FlipVerticesInBoundsFlip the vertices (in-place) inside their axis-aligned bounding-box.
GenerateAtlasGenerates a Texture2D atlas containing the textures and gradients for the vector geometry.
GenerateAtlasAndFillUVsGenerates a Texture2D atlas containing the textures and gradients for the vector geometry, and fill the UVs of the geometry.
IntersectLinesFinds the intersection between two infinite lines
IntersectLineSegmentsFinds the intersection between two line segments
MakeArcApproximates a circle arc with up to 4 segments.
MakeCircleShapeBuilds a circle shape.
MakeEllipseShapeBuilds an ellipse shape.
MakeLineBuilds a line segment.
MakePathLineBuilds a line path segment.
MakeRectangleShapeBuilds a rectangle shape.
PathEndsPerfectlyMatchChecks if the two ends of a BezierPathSegment chain are at the same location.
PathSegmentAtIndexComputes the BezierSegment at a given index from a list of BezierPathSegments.
QuadraticToCubicConverts a quadratic bezier to a cubic bezier
RealignVerticesInBoundsRealigns the vertices (in-place) inside their axis-aligned bounding-box.
RenderSpriteDraws a vector sprite using the provided material.
RenderSpriteToTexture2DRenders a vector sprite to Texture2D.
SceneNodeBoundsComputes a pretty accurate approximation of the scene bounds.
SceneNodesLists every nodes under a root node.
SegmentLengthComputes the length of a single curve segment.
SegmentsInPathIterates through every segment in a list of path segments.
SegmentsLengthComputes the combined length of a segment chain.
SegmentsLengthsComputes the individual lengths of a segment chain.
SplitSegmentSplits a curve segment at a given parametric location.
TessellatePathTessellates a path.
TessellateRectTessellates a rectangle.
TessellateRectBorderTessellates a rectangle border.
TessellateSceneTessellates a Scene object into triangles.
TransformBezierPathTransforms a path by a transformation matrix.
TransformSegmentTransforms a curve segment by a transformation matrix.
WorldTransformedSceneNodesIterates through every nodes under a root with computed transform and opacities.

Classes

Class

Description

VectorUtils.GeometryHolds the tessellated Scene geometry and associated data.
VectorUtils.TextureAtlasA struct to hold packed atlas entries.

Structs

Struct

Description

VectorUtils.PackRectItemStruct to hold a texture atlas location.
VectorUtils.SceneNodeWorldTransformStructure holding the SceneNode computed transforms, opacities and enumeration path.
VectorUtils.TessellationOptionsStructure to store the tessellation options.

Enums

Enum

Description

VectorUtils.AlignmentThe alignement of the sprite, to determine the location of the pivot.