3 Jul 2020, 20:53

Hey folks,

I've added a couple of features to my fork, and I'm wondering if they are valuable additions for anyone else:

  1. Simple vagrant file. Once you've cloned the repo, "cd vagrant; vagrant up" will launch a vm, configure it with the packages needed, build the project, run the tests, build the docs, and be ready to launch. All without messing with the host machine.

  2. Bezier easing:

const main = () => {
	return [
		extrudeWobble(30)
	]
}

function extrudeWobble(height) {
	var squareSlice = slice.fromPoints([[10, 10], [-10, 10], [-10, -10], [10, -10]]);

	var xCurve = math.bezier.create([1, 2, 0.4, 1]);
	var yCurve = math.bezier.create([1, 2, 0.5]);

	let wobble = extrusions.extrudeFromSlices({
			numberOfSlices: 30,
			isCapped: true,
			callback: function (progress, count, base) {
        		let newslice = slice.transform(math.mat4.fromTranslation([0, 0, height * progress]), base);
        		newslice = slice.transform(math.mat4.fromScaling([
     				xCurve.at(progress),
		        	yCurve.at(progress),  // y
		        	1  // z
		        ]), newslice);
		        return newslice
			}
		}, squareSlice);
	return wobble;
}

will produce:0_1593809538569_Screen Shot 2020-07-03 at 4.51.55 PM.png