[STRONG_SHAPE]: function () {
const { particleStore, artefact:art, historyLength, engine, forces, mass, name, shapeTemplate, precision, joinTemplateEnds } = this;
let i, p, f, t;
if (shapeTemplate && precision) {
for (i = 0; i < precision; i++) {
const coords = shapeTemplate.getPathPositionData(i / precision);
p = makeParticle({
name: `${name}-${i}`,
positionX: coords.x,
positionY: coords.y,
positionZ: 0,
velocityX: 0,
velocityY: 0,
velocityZ: 0,
historyLength,
engine,
forces,
mass,
fill: art.get(FILL_STYLE),
stroke: art.get(STROKE_STYLE),
});
p.run(0, 0, false);
particleStore.push(p);
}
for (i = 0; i < precision - 1; i++) {
f = particle[`${name}-${i}`];
t = particle[`${name}-${i + 1}`];
springMaker.call(this, f, t, `${name}-${i}~${name}-${i + 1}`);
}
if (joinTemplateEnds) {
f = particle[`${name}-${precision - 1}`];
t = particle[`${name}-${0}`];
springMaker.call(this, f, t, `${name}-${precision - 1}~${name}-${0}`);
}
for (i = 0; i < precision - 2; i++) {
f = particle[`${name}-${i}`];
t = particle[`${name}-${i + 2}`];
springMaker.call(this, f, t, `${name}-${i}~${name}-${i + 2}`);
}
if (joinTemplateEnds) {
f = particle[`${name}-${precision - 2}`];
t = particle[`${name}-${0}`];
springMaker.call(this, f, t, `${name}-${precision - 2}~${name}-${0}`);
f = particle[`${name}-${precision - 1}`];
t = particle[`${name}-${1}`];
springMaker.call(this, f, t, `${name}-${precision - 1}~${name}-${1}`);
}
for (i = 0; i < precision - 3; i++) {
f = particle[`${name}-${i}`];
t = particle[`${name}-${i + 3}`];
springMaker.call(this, f, t, `${name}-${i}~${name}-${i + 3}`);
}
if (joinTemplateEnds) {
f = particle[`${name}-${precision - 3}`];
t = particle[`${name}-${0}`];
springMaker.call(this, f, t, `${name}-${precision - 3}~${name}-${0}`);
f = particle[`${name}-${precision - 2}`];
t = particle[`${name}-${1}`];
springMaker.call(this, f, t, `${name}-${precision - 2}~${name}-${1}`);
f = particle[`${name}-${precision - 1}`];
t = particle[`${name}-${2}`];
springMaker.call(this, f, t, `${name}-${precision - 1}~${name}-${2}`);
}
const halfPrecision = _floor(precision / 2);
for (i = 0; i < precision - halfPrecision; i++) {
f = particle[`${name}-${i}`];
if (i + halfPrecision < precision - 1) {
t = particle[`${name}-${i + halfPrecision}`];
springMaker.call(this, f, t, `${name}-${i}~${name}-${i + halfPrecision}`);
}
}
}
},