为 Unity 实时生成来自 SVG 路径的网格。
Generates mesh from SVG path in realtime for Unity.
This is a port of https://github.com/mattdesl/svg-mesh-3d
Copy Assets/SVGMeshUnity directory to your Assets directory.
Add a SVGMesh component to a GameObject that has MeshFilter and MeshRenderer.
var mesh = GetComponent();
var svg = new SVGData();
svg.Path("M17.316,6.246c0.008,0.162,0.011,... and so on");
mesh.Fill(svg);Simply create an instance of SVGData and set SVG path data string by calling SVGData.Path().
Then call Mesh.Fill(), a mesh will be generated.
Instead of use SVG path data, you can directly make path data in your code.
……Use SVGData.Move, SVGData.Line, SVGData.Curve, ... and so on. Create realtime path as you like.
The following options are provided in SVGMesh component.
Delaunay (default false)Scale (default 1)Interior if set, only return interior faces. See note. (Default true)Exterior if set, only return exterior faces. See note. (Default false)Infinity if set, then the triangulation is augmented with a point at infinity represented by the index -1. (Default false)MIT
暂无开放 Issues,或尚未同步最近议题。