Loading client/src/bz-viewer/BZViewOptionsDropDown.js +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ export default class BZViewOptionsDropDown extends DropDownMenu{ this.REC_LATTICE_AXES_OPTION = 'show-lattice-vectors-parameters' this.addOption(this.REC_UNIT_CELL_OPTION, 'Show reciprocal cell', true) this.addOption(this.REC_CART_AXES_OPTION, 'Show Cartesian axes', true) this.addOption(this.REC_CART_AXES_OPTION, 'Show Cartesian axes', false) this.addOption(this.REC_LATTICE_AXES_OPTION, 'Show reciprocal axes', true) } Loading client/src/bz-viewer/BZViewer.js +8 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,12 @@ export default class BZViewer { transpose33(invert33(data)).forEach(v => { recCell.push(multiplyScalar(v,2.0 * Math.PI)) }) // Scale up small BZs (large supercells) so arrows stay proportional to the cell const minLen = Math.min(...recCell.map(v => Math.sqrt(v[0]**2 + v[1]**2 + v[2]**2))) if (minLen < 1.0) { const displayScale = 1.0 / minLen recCell = recCell.map(v => v.map(c => c * displayScale)) } this.recCell = util.createBasisVectors(recCell) // console.log('this.recCell',this.recCell); this.root = new THREE.Group() Loading @@ -91,7 +97,7 @@ export default class BZViewer { // this.bz = new THREE.Geometry() this.latticeVectors = this.createLatticeVectors(this.recCell) this.recCartAxes = this.createRecCartAxes() // this.recCartAxes.visible = false this.recCartAxes.visible = false this.root.add(this.latticeVectors) this.root.add(this.recCartAxes) // this.bz_vertices = this.request_bz_vertices(recCell) Loading Loading @@ -291,6 +297,7 @@ export default class BZViewer { // this.viewerControls.appendChild(this.heading) this.hostElement.appendChild(this.viewerControls); this.viewerControls.className = 'viewing-controls' this.viewerControls.addEventListener('pointerdown', e => e.stopPropagation()) this.viewOptionsDropdown = new BZViewOptionsDropDown()//this) this.viewerControls.appendChild(this.viewOptionsDropdown.e) Loading Loading
client/src/bz-viewer/BZViewOptionsDropDown.js +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ export default class BZViewOptionsDropDown extends DropDownMenu{ this.REC_LATTICE_AXES_OPTION = 'show-lattice-vectors-parameters' this.addOption(this.REC_UNIT_CELL_OPTION, 'Show reciprocal cell', true) this.addOption(this.REC_CART_AXES_OPTION, 'Show Cartesian axes', true) this.addOption(this.REC_CART_AXES_OPTION, 'Show Cartesian axes', false) this.addOption(this.REC_LATTICE_AXES_OPTION, 'Show reciprocal axes', true) } Loading
client/src/bz-viewer/BZViewer.js +8 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,12 @@ export default class BZViewer { transpose33(invert33(data)).forEach(v => { recCell.push(multiplyScalar(v,2.0 * Math.PI)) }) // Scale up small BZs (large supercells) so arrows stay proportional to the cell const minLen = Math.min(...recCell.map(v => Math.sqrt(v[0]**2 + v[1]**2 + v[2]**2))) if (minLen < 1.0) { const displayScale = 1.0 / minLen recCell = recCell.map(v => v.map(c => c * displayScale)) } this.recCell = util.createBasisVectors(recCell) // console.log('this.recCell',this.recCell); this.root = new THREE.Group() Loading @@ -91,7 +97,7 @@ export default class BZViewer { // this.bz = new THREE.Geometry() this.latticeVectors = this.createLatticeVectors(this.recCell) this.recCartAxes = this.createRecCartAxes() // this.recCartAxes.visible = false this.recCartAxes.visible = false this.root.add(this.latticeVectors) this.root.add(this.recCartAxes) // this.bz_vertices = this.request_bz_vertices(recCell) Loading Loading @@ -291,6 +297,7 @@ export default class BZViewer { // this.viewerControls.appendChild(this.heading) this.hostElement.appendChild(this.viewerControls); this.viewerControls.className = 'viewing-controls' this.viewerControls.addEventListener('pointerdown', e => e.stopPropagation()) this.viewOptionsDropdown = new BZViewOptionsDropDown()//this) this.viewerControls.appendChild(this.viewOptionsDropdown.e) Loading