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

20 lines
575 B
JavaScript

import { TorusKnotGeometry } from 'three';
import Geometry from './Geometry.js';
export default {
extends: Geometry,
props: {
radius: { type: Number, default: 1 },
tube: { type: Number, default: 0.4 },
tubularSegments: { type: Number, default: 64 },
radialSegments: { type: Number, default: 8 },
p: { type: Number, default: 2 },
q: { type: Number, default: 3 },
},
methods: {
createGeometry() {
this.geometry = new TorusKnotGeometry(this.radius, this.tube, this.tubularSegments, this.radialSegments, this.p, this.q);
},
},
};