SVGLoader.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import {
  2. LoadingManager,
  3. ShapePath,
  4. BufferGeometry,
  5. Vector3
  6. } from '../../../src/Three';
  7. export interface SVGResult {
  8. paths: ShapePath[];
  9. xml: XMLDocument;
  10. }
  11. export interface StrokeStyle {
  12. strokeColor: string;
  13. strokeWidth: number;
  14. strokeLineJoin: string;
  15. strokeLineCap: string;
  16. strokeMiterLimit: number;
  17. }
  18. export class SVGLoader {
  19. constructor(manager?: LoadingManager);
  20. manager: LoadingManager;
  21. path: string;
  22. load(url: string, onLoad: (data: SVGResult) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void) : void;
  23. setPath(path: string) : this;
  24. parse(text: string) : SVGResult;
  25. static getStrokeStyle(width: number, color: string, lineJoin: string, lineCap: string, miterLimit: number): StrokeStyle;
  26. static pointsToStroke(points: Vector3[], style: StrokeStyle, arcDivisions: number, minDistance: number ): BufferGeometry;
  27. static pointsToStrokeWithBuffers(points: Vector3[], style: StrokeStyle, arcDivisions: number, minDistance: number, vertices: number[], normals: number[], uvs: number[], vertexOffset: number): number;
  28. }