Skip to content

Commit

Permalink
Generalize different force init signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
vasturiano committed Mar 16, 2021
1 parent 033ea14 commit 3e26717
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ export default function() {

function initialize() {}

force.initialize = function(initNodes, nDims) {
const numDimensions = [1,2,3].includes(nDims) ? nDims : 2;

force.initialize = function(initNodes, ...args) {
nodes = initNodes;
nDim = numDimensions;
nDim = args.find(arg => [1, 2, 3].includes(arg)) || 2;
initialize();
};

Expand Down

0 comments on commit 3e26717

Please sign in to comment.