diff --git a/js/cam/assemblers/Component.js b/js/cam/assemblers/Component.js index 25b611ddd93fe699390641140bc3f7a374a7cb06..8de54342c45abc221049edc9a110dff6da9be8a1 100644 --- a/js/cam/assemblers/Component.js +++ b/js/cam/assemblers/Component.js @@ -18,6 +18,7 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){ this.isStatic = json.isStatic; this.rotary = json.rotary; this.motionVector = new THREE.Vector3(); + if (json.centerOfRotation) this.centerOfRotation = new THREE.Vector3(json.centerOfRotation.x, json.centerOfRotation.y, json.centerOfRotation.z); if (json.motionVector) this.motionVector.set(json.motionVector.x, json.motionVector.y, json.motionVector.z); } @@ -219,7 +220,8 @@ define(['underscore', 'cam', 'three'], function(_, cam, THREE){ rotation: this.object3D.rotation, isStatic: this.isStatic, rotary: this.rotary, - motionVector: this.motionVector + motionVector: this.motionVector, + centerOfRotation: this.centerOfRotation } }; diff --git a/js/menus/templates/EditComponentMenuView.html b/js/menus/templates/EditComponentMenuView.html index 6bcdff9bf31beb56a4dda57dbcef1b584203d024..5d6c8ac538b7b67e12d18d8b5cd238f1168e2f13 100644 --- a/js/menus/templates/EditComponentMenuView.html +++ b/js/menus/templates/EditComponentMenuView.html @@ -44,11 +44,17 @@ Parent: <input id="isRotary" data-property="rotary" type="checkbox" <% if (thisComponent.rotary){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="component custom-checkbox"> <span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span> Rotary Axis (default is Linear)</label> - Vector (xyz): + Vector of Motion (xyz):<br/> <input data-property="motionVector" data-key="x" value="<%= thisComponent.motionVector.x %>" placeholder="X" class="form-control floatInput component" type="text"> <input data-property="motionVector" data-key="y" value="<%= thisComponent.motionVector.y %>" placeholder="Y" class="form-control floatInput component" type="text"> - <input data-property="motionVector" data-key="z" value="<%= thisComponent.motionVector.z %>" placeholder="Z" class="form-control floatInput component" type="text"><br/> - <!--Jog<br/>--> + <input data-property="motionVector" data-key="z" value="<%= thisComponent.motionVector.z %>" placeholder="Z" class="form-control floatInput component" type="text"><br/><br/> + <% if (thisComponent.rotary){ %> + Center of Rotation, relative to Origin (xyz):<br/> + <input data-property="centerOfRotation" data-key="x" value="<%= thisComponent.centerOfRotation.x %>" placeholder="X" class="form-control floatInput component" type="text"> + <input data-property="centerOfRotation" data-key="y" value="<%= thisComponent.centerOfRotation.y %>" placeholder="Y" class="form-control floatInput component" type="text"> + <input data-property="centerOfRotation" data-key="z" value="<%= thisComponent.centerOfRotation.z %>" placeholder="Z" class="form-control floatInput component" type="text"><br/><br/> + <% } %> + Jog: <br/> <% } %> <br/> <a id="uploadStl" href="#" class="btn btn-block btn-lg btn-default">Upload STL</a><br/>