1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-25 04:42:01 +08:00
trois/src/geometries/PolyhedronGeometry.ts
2021-04-16 04:13:00 +02:00

16 lines
469 B
TypeScript

import { geometryComponent } from './Geometry.js'
import { PolyhedronGeometry } from 'three'
export const props = {
vertices: Array,
indices: Array,
radius: { type: Number, default: 1 },
detail: { type: Number, default: 0 },
}
export function createGeometry(comp: any): PolyhedronGeometry {
return new PolyhedronGeometry(comp.vertices, comp.indices, comp.radius, comp.detail)
}
export default geometryComponent('PolyhedronGeometry', props, createGeometry)