@@ -36,6 +36,7 @@ export const BondsMixin = (superclass) => class extends superclass {
36
36
* @param bondsData {Array} an array of bond data entries for unique element pairs inside structure.
37
37
* @returns {Boolean }
38
38
*/
39
+ // TODO: move to made basis bonded
39
40
areElementsBonded ( element1 , coordinate1 , element2 , coordinate2 , bondsData ) {
40
41
const distance = Made . math . vDist ( coordinate1 , coordinate2 ) ;
41
42
const connectivityFactor = this . settings . chemicalConnectivityFactor ;
@@ -50,6 +51,7 @@ export const BondsMixin = (superclass) => class extends superclass {
50
51
* combinations as it is required to repeat the cell in all directions to determine the bonds.
51
52
* @returns {Array } an array of bond data entries for unique element pairs inside structure.
52
53
*/
54
+ // TODO: move to made basis bonded
53
55
getBondsDataForUniqueElementPairs ( ) {
54
56
const bonds = [ ] ;
55
57
const { uniqueElements } = this . basis ;
@@ -67,6 +69,7 @@ export const BondsMixin = (superclass) => class extends superclass {
67
69
* @param bondsData {Array} an array of bond data entries for unique element pairs inside structure.
68
70
* @returns {Number }
69
71
*/
72
+ // TODO: move to made basis bonded
70
73
getMaxBondLength ( bondsData ) {
71
74
const connectivityFactor = this . settings . chemicalConnectivityFactor ;
72
75
return ( connectivityFactor *
@@ -80,14 +83,15 @@ export const BondsMixin = (superclass) => class extends superclass {
80
83
* @param maxBondLength {Number}
81
84
* @return {Array }
82
85
*/
86
+ // TODO: move to made basis bonded
83
87
getElementsAndCoordinatesArrayWithEdgeNeighbors ( maxBondLength ) {
84
88
const newBasis = this . basis . clone ( ) ;
85
89
const basisCloneInCrystalCoordinates = this . basis . clone ( ) ;
86
90
newBasis . toCrystal ( ) ;
87
91
basisCloneInCrystalCoordinates . toCrystal ( ) ;
88
92
const planes = this . getCellPlanes ( this . cell ) ;
89
93
basisCloneInCrystalCoordinates . elements . forEach ( ( element , index ) => {
90
- const coord = basisCloneInCrystalCoordinates . getCoordinateByIndex ( index ) . value ;
94
+ const coord = basisCloneInCrystalCoordinates . getCoordinateValueByIndex ( index ) ;
91
95
if ( planes . find ( ( plane ) => plane . distanceToPoint ( new THREE . Vector3 ( ...coord ) ) <= maxBondLength ) ) {
92
96
[ - 1 , 0 , 1 ] . forEach ( ( shiftI ) => {
93
97
[ - 1 , 0 , 1 ] . forEach ( ( shiftJ ) => {
@@ -115,6 +119,7 @@ export const BondsMixin = (superclass) => class extends superclass {
115
119
* k-d tree algorithm is used to optimize the time to find the element's neighbors.
116
120
* See https://en.wikipedia.org/wiki/K-d_tree for more information.
117
121
*/
122
+ // TODO: move to made basis bonded - refactor to return bonds array and use the array in createBondsGroup
118
123
createBondsGroup ( ) {
119
124
const bondsGroup = new THREE . Group ( ) ;
120
125
const bondsData = this . getBondsDataForUniqueElementPairs ( ) ;
0 commit comments