Skip to content

Commit 39cfafc

Browse files
committed
Removed camera update from LayerViewer.js
1 parent eff9bb0 commit 39cfafc

File tree

3 files changed

+2
-52
lines changed

3 files changed

+2
-52
lines changed

interface.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ async function getExampleVessel(file){
1616

1717
var viewerType = "tpv"; //control which viewer type is currently on screen
1818

19-
// let path = []; //toolpath for vessel
20-
// let referencePath = []; //reference layer (optional)
21-
// let bedPath = []; //toolpath for bed
22-
// var bedDimensions = [280, 265, 305];
23-
2419
//Call in codemirror to change the toolpath in the threejs toolpath viewer
2520
function updatePath(newPath, referencePath=null){
2621
var iframe = document.getElementById("toolpathVieweriFrame");

layerViewer/layerViewer.js

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ function calculateOffsets(){ //radial and angular offset
6666
}
6767

6868
function initializePath(radius, nbPointsInLayer, pos=[0, 0, 0]){ //code repurposed from ToolpathUnitGenerator
69-
//set camera proportional to radius
7069
let circleGeometry = new THREE.CircleGeometry( radius/10, 32 );
71-
camera.position.set(0, 0, radius*2);
7270

7371
//Make three-js group for adding draggable circle points
7472
position = pos;
@@ -159,40 +157,4 @@ controls.addEventListener( 'dragend', function ( event ) {
159157
event.object.material = circleMaterial;
160158
calculateOffsets();
161159
window.parent.postMessage({message:"run-codemirror"}, '*'); // update TPV when dragend finished
162-
});
163-
164-
165-
166-
167-
168-
169-
170-
171-
172-
// TODO:
173-
174-
//Clean up code
175-
//Better UI/color palette
176-
177-
//Updating parameters
178-
//one: what to do if nbpointsinlayer updates
179-
// - linear interpolation algorithm: can calculate the distance between points, divide by certain percentage?
180-
// - should be O(n) ish
181-
//two: what to do if radius updates:
182-
// - scale up/down points from radius (fairly straightforward)
183-
184-
//How to interpret path in TUG
185-
// Toolpath Unit Generator should have a check for RSP to test whether
186-
// RSP is an array or a list of point objects
187-
// If it's a list of point objects, set the radius as those point objects directly
188-
// (after confirming that the number of point objects = nbPointsInLayer)
189-
// Same goes for profile editor
190-
191-
//Future additions
192-
// Add undo+redo+reset button, command+z shortcuts, shortcuts should only work if mouse is hovering over window
193-
// Add a way to select multiple points
194-
// Add a way to snap points to a cylindircal coordinate system/cartesian coordinates
195-
// Include an svg to toolpath function in the coilcam library
196-
// - Something like svgToRadius(radius, nbPointsInLayer, center=[0, 0])
197-
// - layerviewer should also be able to take in an SVG as a starting point
198-
// - Add function to display layerViewer as a popup or extra tab
160+
});

profileViewer/ProfileViewer.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ function initializePath(layerHeight, nbLayers, pos=[0, 0, 0]){ //code repurposed
5757
const crossVertical = new THREE.Line(crossVerticalGeometry, crossMaterial);
5858
scene.add(crossVertical);
5959

60-
//set camera proportional to radius
6160
let circleGeometry = new THREE.CircleGeometry(layerHeight/2, 32 );
6261

6362
//Make three-js group for adding draggable circle points
@@ -151,10 +150,4 @@ controls.addEventListener( 'dragend', function ( event ) {
151150
event.object.material = circleMaterial;
152151
calculateOffsets();
153152
window.parent.postMessage({message:"run-codemirror"}, '*'); // update TPV when dragend finished
154-
});
155-
156-
157-
158-
// TODO:
159-
// Create class for ProfileViewer so that LayerViewer and ProfileViewer both extend one default class
160-
// Add visual warning system if the angle between layers is too high
153+
});

0 commit comments

Comments
 (0)