bytev-charts
Version:
基于echarts和JavaScript及ES6封装的一个可以直接调用的图表组件库,内置主题设计,简单快捷,且支持用户自定义配置; npm 安装方式: npm install bytev-charts 若启动提示还需额外install插件,则运行 npm install @babel/runtime-corejs2 即可;
45 lines (33 loc) • 1.91 kB
JavaScript
import _Object$create from "@babel/runtime-corejs2/core-js/object/create";
console.warn("THREE.ConvexGeometry: As part of the transition to ES6 Modules, the files in 'examples/js' were deprecated in May 2020 (r117) and will be deleted in December 2020 (r124). You can find more information about developing using ES6 Modules in https://threejs.org/docs/#manual/en/introduction/Installation."); // ConvexGeometry
THREE.ConvexGeometry = function (points) {
THREE.Geometry.call(this);
this.fromBufferGeometry(new THREE.ConvexBufferGeometry(points));
this.mergeVertices();
};
THREE.ConvexGeometry.prototype = _Object$create(THREE.Geometry.prototype);
THREE.ConvexGeometry.prototype.constructor = THREE.ConvexGeometry; // ConvexBufferGeometry
THREE.ConvexBufferGeometry = function (points) {
THREE.BufferGeometry.call(this); // buffers
var vertices = [];
var normals = [];
if (THREE.ConvexHull === undefined) {
console.error('THREE.ConvexBufferGeometry: ConvexBufferGeometry relies on THREE.ConvexHull');
}
var convexHull = new THREE.ConvexHull().setFromPoints(points); // generate vertices and normals
var faces = convexHull.faces;
for (var i = 0; i < faces.length; i++) {
var face = faces[i];
var edge = face.edge; // we move along a doubly-connected edge list to access all face points (see HalfEdge docs)
do {
var point = edge.head().point;
vertices.push(point.x, point.y, point.z);
normals.push(face.normal.x, face.normal.y, face.normal.z);
edge = edge.next;
} while (edge !== face.edge);
} // build geometry
this.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3));
this.setAttribute('normal', new THREE.Float32BufferAttribute(normals, 3));
};
THREE.ConvexBufferGeometry.prototype = _Object$create(THREE.BufferGeometry.prototype);
THREE.ConvexBufferGeometry.prototype.constructor = THREE.ConvexBufferGeometry;