From 3555f19e655e500c84bbc87d0371914f6fdfdab7 Mon Sep 17 00:00:00 2001
From: Sean Hickey <hisean@media.mit.edu>
Date: Fri, 10 Aug 2018 17:37:10 -0400
Subject: [PATCH] Updated pot and profile modules

---
 modules/hardware/pot     | 11 +++++++++++
 modules/hardware/profile |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules/hardware/pot b/modules/hardware/pot
index 3e6ffe9..ef127f6 100644
--- a/modules/hardware/pot
+++ b/modules/hardware/pot
@@ -141,6 +141,17 @@
         // Construct an updated profile given the number of layers specified
         // using linear interpolation
         var geomPoints = [];
+
+        // Construct the base
+        var firstPt = mod.points[0];
+        var firstX = firstPt.x;
+        var numSprials = Math.floor((firstX * +(mod.widthInput.value)) / 3.0);
+        for ( var spiral = 0; spiral < numSprials; ++spiral) {
+            var spiralX = (3.0 * spiral) + 2.0;
+            geomPoints.push(new THREE.Vector2( spiralX, 0 ));
+        }
+
+        // Construct the rest of the layers
         var layers = mod.layersInput.value;
         for ( var i = 0; i < layers; ++i ) {
             var scaledLayerIndex = (i / layers) * (mod.points.length - 1);
diff --git a/modules/hardware/profile b/modules/hardware/profile
index e72da16..4f60e25 100644
--- a/modules/hardware/profile
+++ b/modules/hardware/profile
@@ -79,7 +79,7 @@
         for (var i = 1; i < TOTAL_POINTS; ++i) {
             points.push({
                 x: (400 * (i / TOTAL_POINTS)),
-                y: (600 * (i / TOTAL_POINTS) * (i / TOTAL_POINTS))
+                y: (600 * (i / TOTAL_POINTS))
             })
         }
 
-- 
GitLab