Skip to content
Snippets Groups Projects
Commit 75ec32ec authored by Jakob Yanagibashi's avatar Jakob Yanagibashi :nail_care_tone4:
Browse files

Tweak example model for print

parent 597707c1
No related branches found
No related tags found
No related merge requests found
Pipeline #254287 passed
......@@ -409,17 +409,38 @@ function getPresetModelmain() {
var precision = 10;
var zoom = 30;
const levels = 20;
var extrusion = 0;
const extMultiplier = 1;
var previousGoal = {
x: 0,
y: 0,
e: -zoom,
};
var currentGoal = {
x: 0,
y: 0,
e: 0,
};
for (var e = 0; e < levels; e++) {
for (var i = 0; i < precision; i++) {
currentGoal.x = Math.sin((1 / precision) * 2 * Math.PI * i) * zoom;
currentGoal.y = Math.cos((1 / precision) * 2 * Math.PI * i) * zoom;
currentGoal.e =
previousGoal.e +
Math.hypot(
currentGoal.x - previousGoal.x,
currentGoal.y - previousGoal.y
);
var newCommand = new Move(
(extrusion += 10),
1000,
Math.sin((1 / precision) * 2 * Math.PI * i) * zoom,
Math.cos((1 / precision) * 2 * Math.PI * i) * zoom,
currentGoal.e * extMultiplier,
1250,
currentGoal.x,
currentGoal.y,
e + (1 / precision) * i
);
presetProject.model.append(newCommand);
previousGoal.x = currentGoal.x;
previousGoal.y = currentGoal.y;
previousGoal.e = currentGoal.e;
}
if (e < levels / 2) {
zoom += 0.5 + (e % 10) / 10;
......@@ -830,8 +851,8 @@ G28
gcode += initCode.end;
// DEBUG!!
console.log(gcode);
return;
//console.log(gcode);
//return;
var blob = new Blob([gcode], { type: "text/plain;charset=utf-8" });
saveAs(blob, "tailorbird.gcode");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment