1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 12:22:03 +08:00
trois/src/geometries/CylinderGeometry.js

22 lines
759 B
JavaScript
Raw Normal View History

2021-03-07 06:14:22 +08:00
import { CylinderGeometry } from 'three';
2020-09-28 21:36:22 +08:00
import Geometry from './Geometry.js';
export default {
extends: Geometry,
props: {
radiusTop: { type: Number, default: 1 },
radiusBottom: { type: Number, default: 1 },
height: { type: Number, default: 1 },
radialSegments: { type: Number, default: 8 },
heightSegments: { type: Number, default: 1 },
openEnded: { type: Boolean, default: false },
thetaStart: { type: Number, default: 0 },
thetaLength: { type: Number, default: Math.PI * 2 },
},
2020-10-03 17:00:37 +08:00
methods: {
createGeometry() {
2021-03-07 06:14:22 +08:00
this.geometry = new CylinderGeometry(this.radiusTop, this.radiusBottom, this.height, this.radialSegments, this.heightSegments, this.openEnded, this.thetaStart, this.thetaLength);
2020-10-03 17:00:37 +08:00
},
2020-09-28 21:36:22 +08:00
},
};