1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-25 04:42:01 +08:00
trois/src/geometries/PolyhedronGeometry.js
2021-03-15 20:39:24 +01:00

24 lines
500 B
JavaScript

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