1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 12:22:03 +08:00
trois/src/geometries/CircleGeometry.js
2021-03-15 19:54:33 +01:00

24 lines
564 B
JavaScript

import { CircleGeometry } from 'three';
import Geometry from './Geometry.js';
export const props = {
radius: { type: Number, default: 1 },
segments: { type: Number, default: 8 },
thetaStart: { type: Number, default: 0 },
thetaLength: { type: Number, default: Math.PI * 2 },
};
export function createGeometry(comp) {
return new CircleGeometry(comp.radius, comp.segments, comp.thetaStart, comp.thetaLength);
};
export default {
extends: Geometry,
props,
methods: {
createGeometry() {
this.geometry = createGeometry(this);
},
},
};