add support point compensation for belt anchors
This commit is contained in:
parent
60c14cf08a
commit
c5e4bac1cb
2 changed files with 17 additions and 6 deletions
|
|
@ -48,7 +48,8 @@ const BELT = {
|
|||
* @returns {void} Modifies slices array in place
|
||||
*/
|
||||
export function generateBeltAnchor({ slices, widget, process, lineWidth, sliceHeight, sliceHeightBase, extruder }) {
|
||||
let { cosf, slope } = widget.belt;
|
||||
let { belt } = widget;
|
||||
let { cosf, slope } = belt;
|
||||
|
||||
// find adjusted zero point from slices
|
||||
let smin = Infinity;
|
||||
|
|
@ -100,6 +101,12 @@ export function generateBeltAnchor({ slices, widget, process, lineWidth, sliceHe
|
|||
let step = sliceHeight;
|
||||
let anchorlen = (process.beltAnchor || process.firstLayerBeltLead) * cosf;
|
||||
|
||||
// offset used in support generation
|
||||
belt.anchor = {
|
||||
added: adds,
|
||||
len: anchorlen
|
||||
};
|
||||
|
||||
while (anchorlen && start && anchorlen >= sliceHeight) {
|
||||
let addto = start.down;
|
||||
if (!addto) {
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ export function sliceOne(settings, widget, onupdate, ondone) {
|
|||
let { belt } = widget;
|
||||
// apply belt transformations, if needed
|
||||
if (belt && paint) {
|
||||
let { dy, angle } = belt;
|
||||
let { anchor, angle, dy, slope } = belt;
|
||||
// make a copy we can modify
|
||||
paint = structuredClone(paint);
|
||||
for (let rec of paint) {
|
||||
|
|
@ -490,6 +490,10 @@ export function sliceOne(settings, widget, onupdate, ondone) {
|
|||
let np = newPoint(point.y + dy, point.z, 0).rotate(angle * (Math.PI/180));
|
||||
point.y = np.x;
|
||||
point.z = np.y;
|
||||
if (anchor) {
|
||||
point.y += anchor.len;
|
||||
point.z += anchor.len;
|
||||
}
|
||||
}
|
||||
}
|
||||
// convert paint points to circles on matching slices
|
||||
|
|
@ -837,10 +841,6 @@ export function sliceOne(settings, widget, onupdate, ondone) {
|
|||
slice.widget = widget;
|
||||
}
|
||||
|
||||
// support generation using either
|
||||
// enclosed shadow or manual painted supports
|
||||
await processSupports();
|
||||
|
||||
// process solid layers (top/bottom)
|
||||
await processSolidLayers();
|
||||
|
||||
|
|
@ -875,6 +875,10 @@ export function sliceOne(settings, widget, onupdate, ondone) {
|
|||
});
|
||||
}
|
||||
|
||||
// support generation using either
|
||||
// enclosed shadow or manual painted supports
|
||||
await processSupports();
|
||||
|
||||
// calculations only relevant when solid layers are used
|
||||
// layer boolean diffs need to be computed to find flat areas to fill
|
||||
// and overhangs that need to be supported. these are stored in flats
|
||||
|
|
|
|||
Loading…
Reference in a new issue