1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 20:32:02 +08:00
trois/src/geometries/PolyhedronGeometry.ts

16 lines
469 B
TypeScript
Raw Normal View History

2021-04-16 10:13:00 +08:00
import { geometryComponent } from './Geometry.js'
import { PolyhedronGeometry } from 'three'
2020-09-28 21:36:22 +08:00
2021-03-16 03:39:24 +08:00
export const props = {
vertices: Array,
indices: Array,
radius: { type: Number, default: 1 },
detail: { type: Number, default: 0 },
2021-04-16 10:13:00 +08:00
}
2021-03-16 03:39:24 +08:00
2021-04-16 10:13:00 +08:00
export function createGeometry(comp: any): PolyhedronGeometry {
return new PolyhedronGeometry(comp.vertices, comp.indices, comp.radius, comp.detail)
}
2021-03-16 03:39:24 +08:00
2021-04-16 10:13:00 +08:00
export default geometryComponent('PolyhedronGeometry', props, createGeometry)