From 359ef505874113b96dc9c753ce278ed7b7182219 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Mon, 15 Aug 2022 00:23:09 -0700 Subject: [PATCH] fix eslint no inner loop functions issue --- web/app/cad/scene/views/viewUtils.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/web/app/cad/scene/views/viewUtils.js b/web/app/cad/scene/views/viewUtils.js index e94697d5..765032ff 100644 --- a/web/app/cad/scene/views/viewUtils.js +++ b/web/app/cad/scene/views/viewUtils.js @@ -52,22 +52,22 @@ export function surfaceAndPolygonsToGeom(surface, polygons) { const isPlane = surface.simpleSurface && surface.simpleSurface.isPlane; let planeNormal = isPlane ? surface.normalInMiddle().data() : null; + function pushVertex(vtx) { + vertices.push(vtx.x, vtx.y, vtx.z); + if (!isPlane) { + const normal = surface.normal(vtx); + normals.push(normal.x, normal.y, normal.z); + } else { + normals.push(...planeNormal); + } + + } for (let p = 0; p < polygons.length; ++p) { const off = vertices.length / 3; const poly = polygons[p]; const vLength = poly.length; if (vLength < 3) continue; - function pushVertex(vtx) { - vertices.push(vtx.x, vtx.y, vtx.z); - if (!isPlane) { - const normal = surface.normal(vtx); - normals.push(normal.x, normal.y, normal.z); - } else { - normals.push(...planeNormal); - } - - } const firstVertex = poly[0]; pushVertex(firstVertex)