Commit 486546e5 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

assembler json has no string properties

parent 2f8cb393
......@@ -126,6 +126,9 @@ define(['underscore', 'appState', 'lattice', 'cam'], function(_, appState, latti
var offset = self.components.substrate.centerOfRotation.clone().multiplyScalar(settings.scale);//offset in lattice pitch
var dist = position.clone().sub(offset);
position = offset.add(new THREE.Vector3(-dist.y-3*settings.scale, dist.x-0.335, position.z));
} else {
position.y -= 1;
position.x -= settings.scale;
}
var stock = _.find(self.stock, function(thisStock){
......
......@@ -7,7 +7,13 @@ define(['underscore', 'fileSaverLib', 'lattice', 'materials', 'ribbon', 'menuWra
function _saveFile(data, name, extension){
// require(['jsonFn'], function(JSONfn){
var blob = new Blob([JSON.stringify(data, null, '\t')], {type: "text/plain;charset=utf-8"});
// console.log(data.toString());
var jsonString = JSON.stringify(data, null, '\t');
if (data.assembler){
jsonString.replace(/\\"/g,"\uFFFF"); //U+ FFFF
jsonString = jsonString.replace(/\"([^"]+)\":/g,"$1:").replace(/\uFFFF/g,"\\\"");
}
var blob = new Blob([jsonString], {type: "text/plain;charset=utf-8"});
saveAs(blob, name + extension);
// });
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment