2021-03-07 06:14:22 +08:00
|
|
|
import { TorusKnotGeometry } from 'three';
|
2020-09-28 21:36:22 +08:00
|
|
|
import Geometry from './Geometry.js';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
extends: Geometry,
|
|
|
|
props: {
|
|
|
|
radius: { type: Number, default: 1 },
|
|
|
|
tube: { type: Number, default: 0.4 },
|
2021-03-11 05:05:01 +08:00
|
|
|
tubularSegments: { type: Number, default: 64 },
|
|
|
|
radialSegments: { type: Number, default: 8 },
|
2020-09-28 21:36:22 +08:00
|
|
|
p: { type: Number, default: 2 },
|
|
|
|
q: { type: Number, default: 3 },
|
|
|
|
},
|
2020-10-03 17:00:37 +08:00
|
|
|
methods: {
|
|
|
|
createGeometry() {
|
2021-03-11 05:05:01 +08:00
|
|
|
this.geometry = new TorusKnotGeometry(this.radius, this.tube, this.tubularSegments, this.radialSegments, this.p, this.q);
|
2020-10-03 17:00:37 +08:00
|
|
|
},
|
2020-09-28 21:36:22 +08:00
|
|
|
},
|
|
|
|
};
|