@threepipe/plugin-svg-renderer
Version:
Plugins for SVG Rendering of 3d objects for Threepipe
64 lines • 2.48 kB
TypeScript
import { Color, Material, Mesh, Vector3 } from '../../threepipe';
import { HalfedgeDS } from '../../three-mesh-halfedge';
import { computeBoundsTree, disposeBoundsTree, MeshBVH, MeshBVHOptions } from 'three-mesh-bvh';
export interface SVGMeshOptions {
bvhOptions?: MeshBVHOptions;
}
/**
* SVGTexture allows to add a texture to a SVGMesh.
* Raster image (.jpeg, .png) or vector graphics (.svg) are supported.
*/
export interface SVGTexture {
/**
* Name of the texture
*/
name: string;
/**
* DataUrl to the image and vector graphics texture
*/
url: string;
}
declare module 'three/src/core/BufferGeometry.js' {
interface BufferGeometry {
boundsTree?: MeshBVH;
computeBoundsTree: typeof computeBoundsTree;
disposeBoundsTree: typeof disposeBoundsTree;
}
}
/**
* Mesh object that can be rendered as SVG.
* Wrapper class around three mesh object that duplicates geometry if needed (i.e.
* for SkinnedMesh) and computes BVH and HalfEdgeStructure on demand)
*/
export declare class SVGMesh {
readonly sourceMesh: Mesh;
readonly threeMesh: Mesh<import('../../threepipe').BufferGeometry<import('../../threepipe').NormalBufferAttributes, import('../../threepipe').BufferGeometryEventMap>, Material<import('../../threepipe').MaterialEventMap> | Material<import('../../threepipe').MaterialEventMap>[], import('../../threepipe').Object3DEventMap>;
readonly hes: HalfedgeDS;
readonly bvhOptions: MeshBVHOptions;
bvh: MeshBVH;
drawFills: boolean;
drawVisibleContours: boolean;
drawHiddenContours: boolean;
isUsingBVHForRaycasting: boolean;
texture?: SVGTexture;
constructor(mesh: Mesh, options?: SVGMeshOptions);
/**
* Adds a SVGtexture to the mesh.
*
* @param texture The image or vector graphics texture to use.
*/
addTexture(texture: SVGTexture): void;
updateMorphGeometry(): void;
updateBVH(updateMorphGeometry?: boolean): void;
updateHES(updateMorphGeometry?: boolean): void;
localToWorld(target: Vector3): Vector3;
colorForFaceIndex(faceIndex: number): null | Color;
dispose(): void;
get material(): Material<import('../../threepipe').MaterialEventMap> | Material<import('../../threepipe').MaterialEventMap>[];
get matrixWorld(): import('../../threepipe').Matrix4;
get name(): string;
set name(name: string);
updateObject(): void;
remakeBVH(): void;
}
//# sourceMappingURL=SVGMesh.d.ts.map