add manifold indexed animation option

This commit is contained in:
Stewart Allen 2025-11-16 14:28:12 -05:00
commit ca4df7c223
4 changed files with 13 additions and 8 deletions

View file

@ -932,6 +932,7 @@ export const conf = {
freeLayout: true,
healMesh: false,
lineType: "path",
manifold: false,
ortho: false,
reverseZoom: true,
scrolls: true,

View file

@ -155,6 +155,7 @@ function booleanSave() {
control.freeLayout = ui.freeLayout.checked;
control.healMesh = ui.healMesh.checked;
control.ortho = ui.ortho.checked;
control.manifold = ui.manifold.checked;
control.reverseZoom = ui.reverseZoom.checked;
control.scrolls = ui.scrolls.checked;
control.shiny = ui.shiny.checked;
@ -1046,6 +1047,7 @@ function init_one() {
showSpeeds: newBoolean(LANG.op_sped_s, speedSave, {title:LANG.op_sped_l}),
shiny: newBoolean(LANG.op_shny_s, booleanSave, {title:LANG.op_shny_l, modes:FDM}),
lineType: newSelect(LANG.op_line_s, {title: LANG.op_line_l, action: lineTypeSave, modes:FDM}, "linetype"),
manifold: newBoolean(LANG.op_mani_s, booleanSave, {title: LANG.op_mani_l, modes:CAM}, "manifold"),
animesh: newSelect(LANG.op_anim_s, {title: LANG.op_anim_l, action: aniMeshSave, modes:CAM}, "animesh"),
units: newSelect(LANG.op_unit_s, {title: LANG.op_unit_l, action: unitsSave, modes:CAM}, "units"),
edgeangle: newInput(LANG.op_spoa_s, {title:LANG.op_spoa_l, convert:toFloat, size:3}),
@ -1639,6 +1641,7 @@ function init_two() {
ui.devel.checked = control.devel;
ui.freeLayout.checked = control.freeLayout;
ui.healMesh.checked = control.healMesh;
ui.manifold.checked = control.manifold;
ui.ortho.checked = control.ortho;
ui.reverseZoom.checked = control.reverseZoom;
ui.showOrigin.checked = control.showOrigin;

View file

@ -21,7 +21,6 @@ let nextMeshID = 1,
toolMesh,
toolRadius,
toolUpdateMsg,
showStock = false,
animateClear = false,
animating = false,
renderDone = false,
@ -36,11 +35,11 @@ export function init(worker) {
dispatch.animate_setup2 = function (data, send) {
const { settings } = data;
const { process } = settings;
const { controller, process } = settings;
const print = worker.current.print;
const density = parseInt(settings.controller.animesh) * 1000;
const isIndexed = process.camStockIndexed;
console.log({ controller });
pathIndex = 0;
path = print.output.flat();
tools = settings.tools;
@ -61,14 +60,14 @@ export function init(worker) {
const sliceCount = parseInt(settings.controller.animesh || 2000) / 100;
const sliceWidth = stock.x / sliceCount;
if (showStock)
if (controller.manifold)
for (let i = 0; i < sliceCount; i++) {
let xmin = -(x / 2) + (i * sliceWidth) + sliceWidth / 2;
let slice = new Stock(sliceWidth, y, z).translate(xmin, 0, 0);
stockSlices.push(slice);
slice.updateMesh([]);
slice.send(send);
// send({ mesh_move: { id: slice.id, pos: { x:0, y:0, z: stock.z/2} } });
// send.data({ mesh_move: { id: slice.id, pos: { x:0, y:0, z: stock.z/2} } });
}
send.done();
@ -175,7 +174,7 @@ function renderPath(send) {
const sp = next.speed;
const moves = [];
for (let i = 0, x = lp.x, y = lp.y, z = lp.z, a = lp.a; i < st; i++) {
moves.push({ x, y, z, a, md: sd, dx, dy, dz, sp });
moves.push({ x, y, z, a, md: sd, dx, dy, dz, da, sp });
x += mx;
y += my;
z += mz;
@ -202,11 +201,11 @@ function renderMoves(id, moves, send, seed = 0) {
if (!pos) {
throw `no pos @ ${index} of ${moves.length}`;
}
const { dx, dy, dz, sp, md } = pos;
const { dx, dy, dz, da, sp, md } = pos;
toolMove(pos);
// console.log('renderMoves', {id, moves, seed});
let subs = 0;
if (dx || dy || dz < 0)
if (dx || dy || dz < 0 || da)
for (let slice of stockSlices) {
if (slice.bounds.intersectsBox(toolMesh.bounds)) {
slice.subtractTool(toolMesh);

View file

@ -319,6 +319,8 @@ self.lang['en-us'] = {
op_unit_l: ["workspace units affects","speeds and distances"],
op_anim_s: "animate",
op_anim_l: ["animation mesh density","higher is more dense","takes more memory","and is slower"],
op_mani_s: "manifold",
op_mani_l: ["in stock indexed mode","use boolean visualiation","this is very expensive","and likely very slow"],
op_exgl_l: ["show Grid:Local devices in export dialog","includes Grid:Bots and OctoPrint plugins"],
op_exgh_l: ["legacy Grid:Host local network support"],
op_exop_l: ["legacy OctoPrint local network support","Grid:Space OctoPrint plugin recommended"],