Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const triangleGroups = this._getTriangleGroups(section);
const triangleCount = Object.keys(triangleGroups).reduce((sum, key) => (
sum + triangleGroups[key].length
), 0);
const positionBuffer = new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 3), 3
);
const normalBuffer = normals && new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 3), 3, true
);
const colorBuffer = vertexColors && new THREE.BufferAttribute(
new Uint8Array(triangleCount * 3 * 3), 3, true
);
const uvBuffer = textureCoords && new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 2), 2, true
);
let vertexPos = 0;
const newVertexIndices = {};
for (const materialIndex of Object.keys(triangleGroups)) {
const faces = triangleGroups[materialIndex];
geometry.addGroup(vertexPos, faces.length * 3, Number(materialIndex));
for (const indices of faces) {
for (const index of indices) {
const [ vx, vy, vz ] = vertices[index];
positionBuffer.setXYZ(vertexPos, vx, vy, vz);
newVertexIndices[index] = newVertexIndices[index] || [];
newVertexIndices[index].push(vertexPos);
if (normalBuffer) {
const [ nx, ny, nz ] = normals[index];
_parseGeometry(section) {
const { vertices, normals, vertexColors, textureCoords} = this._getData(section);
const geometry = new THREE.BufferGeometry();
const triangleGroups = this._getTriangleGroups(section);
const triangleCount = Object.keys(triangleGroups).reduce((sum, key) => (
sum + triangleGroups[key].length
), 0);
const positionBuffer = new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 3), 3
);
const normalBuffer = normals && new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 3), 3, true
);
const colorBuffer = vertexColors && new THREE.BufferAttribute(
new Uint8Array(triangleCount * 3 * 3), 3, true
);
const uvBuffer = textureCoords && new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 2), 2, true
);
let vertexPos = 0;
const newVertexIndices = {};
for (const materialIndex of Object.keys(triangleGroups)) {
const faces = triangleGroups[materialIndex];
geometry.addGroup(vertexPos, faces.length * 3, Number(materialIndex));
for (const indices of faces) {
for (const index of indices) {
_parseGeometry(section) {
const { vertices, normals, vertexColors, textureCoords} = this._getData(section);
const geometry = new THREE.BufferGeometry();
const triangleGroups = this._getTriangleGroups(section);
const triangleCount = Object.keys(triangleGroups).reduce((sum, key) => (
sum + triangleGroups[key].length
), 0);
const positionBuffer = new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 3), 3
);
const normalBuffer = normals && new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 3), 3, true
);
const colorBuffer = vertexColors && new THREE.BufferAttribute(
new Uint8Array(triangleCount * 3 * 3), 3, true
);
const uvBuffer = textureCoords && new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 2), 2, true
);
let vertexPos = 0;
const newVertexIndices = {};
for (const materialIndex of Object.keys(triangleGroups)) {
const faces = triangleGroups[materialIndex];
_parseGeometry(section) {
const { vertices, normals, vertexColors, textureCoords} = this._getData(section);
const geometry = new THREE.BufferGeometry();
const triangleGroups = this._getTriangleGroups(section);
const triangleCount = Object.keys(triangleGroups).reduce((sum, key) => (
sum + triangleGroups[key].length
), 0);
const positionBuffer = new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 3), 3
);
const normalBuffer = normals && new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 3), 3, true
);
const colorBuffer = vertexColors && new THREE.BufferAttribute(
new Uint8Array(triangleCount * 3 * 3), 3, true
);
const uvBuffer = textureCoords && new THREE.BufferAttribute(
new Float32Array(triangleCount * 3 * 2), 2, true
);
let vertexPos = 0;
const newVertexIndices = {};
for (const materialIndex of Object.keys(triangleGroups)) {
const faces = triangleGroups[materialIndex];
geometry.addGroup(vertexPos, faces.length * 3, Number(materialIndex));
for (const indices of faces) {
for (const index of indices) {
const [ vx, vy, vz ] = vertices[index];
positionBuffer.setXYZ(vertexPos, vx, vy, vz);
newVertexIndices[index] = newVertexIndices[index] || [];