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

18 lines
414 B
JavaScript
Raw Normal View History

2021-03-07 06:14:22 +08:00
import { PolyhedronGeometry } from 'three';
2020-09-28 21:36:22 +08:00
import Geometry from './Geometry.js';
export default {
extends: Geometry,
props: {
2020-09-28 22:56:10 +08:00
vertices: Array,
indices: Array,
2020-09-28 21:36:22 +08:00
radius: { type: Number, default: 1 },
detail: { type: Number, default: 0 },
},
2020-10-03 17:00:37 +08:00
methods: {
createGeometry() {
2021-03-07 06:14:22 +08:00
this.geometry = new PolyhedronGeometry(this.vertices, this.indices, this.radius, this.detail);
2020-10-03 17:00:37 +08:00
},
2020-09-28 21:36:22 +08:00
},
};