Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions dist/mixins/bonds.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { math } from "@mat3ra/code/dist/js/math";
import { Made } from "@mat3ra/made";
import { filterBondsDataByElementsAndOrder, getElementsBondsData } from "@mat3ra/periodic-table";
import { sharedUtils } from "@mat3ra/utils";
import createKDTree from "static-kdtree";
import * as THREE from "three";
/*
Expand Down Expand Up @@ -38,7 +37,7 @@ export const BondsMixin = (superclass) => class extends superclass {
*/
// TODO: move to made basis bonded
areElementsBonded(element1, coordinate1, element2, coordinate2, bondsData) {
const distance = Made.math.vDist(coordinate1, coordinate2);
const distance = sharedUtils.math.vDist(coordinate1, coordinate2);
const connectivityFactor = this.settings.chemicalConnectivityFactor;
return Boolean(filterBondsDataByElementsAndOrder(bondsData, element1, element2).find((b) => {
return (b.length.value &&
Expand Down Expand Up @@ -73,7 +72,7 @@ export const BondsMixin = (superclass) => class extends superclass {
getMaxBondLength(bondsData) {
const connectivityFactor = this.settings.chemicalConnectivityFactor;
return (connectivityFactor *
math.max(bondsData.map((b) => b.length.value || 0)));
sharedUtils.math.max(bondsData.map((b) => b.length.value || 0)));
}
/**
* Returns an array of [element, coordinate] for all elements and their neighbors.
Expand Down
3 changes: 1 addition & 2 deletions dist/mixins/boundary.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Made } from "@mat3ra/made";
import * as THREE from "three";
import { BOUNDARY_CONDITIONS } from "../enums";
export const BoundaryMixin = (superclass) => class extends superclass {
Expand Down Expand Up @@ -88,7 +87,7 @@ export const BoundaryMixin = (superclass) => class extends superclass {
coordinate: [
coord[0],
coord[1],
Made.math.abs(coord[2]) <= 0.5 ? coord[2] : coord[2] - 1,
Math.abs(coord[2]) <= 0.5 ? coord[2] : coord[2] - 1,
],
});
});
Expand Down
Loading
Loading