Skip to content

Fix divide by zero exception in InterlockingGenerator.#9925

Open
mpaperno wants to merge 1 commit intobambulab:masterfrom
mpaperno:mp/fix_interlock_divzero
Open

Fix divide by zero exception in InterlockingGenerator.#9925
mpaperno wants to merge 1 commit intobambulab:masterfrom
mpaperno:mp/fix_interlock_divzero

Conversation

@mpaperno
Copy link
Contributor

@mpaperno mpaperno commented Mar 9, 2026

Fixes #9910

There's a more fundamental issue in that the current config option minimum/maximum value types are int, so setting a minimum of something like 0.1 doesn't work (minimum becomes zero). The GUI validation then doesn't work as expected. Some of the code seems to completely ignore that fact, like for this interlocking beam width option:

def->min = 0.01;

I'll likely submit a PR for that fix next, unless it turns into a bigger deal than it appears so far.

Thanks,
-Max

@mpaperno
Copy link
Contributor Author

mpaperno commented Mar 9, 2026

Somewhat related:

The generator hangs during slicing when the beam width gets "too small". I'm not clear on what defines the actual practical lower limit. For example on an arbitrary test object (some text on bottom of a cube), using .4 nozzle with .2 layer height and .42 line width, reducing the beam width to 0.1 caused a hang. With 0.2 width it took a long time but completed (though generated "garbage"). After switching to .6 nozzle w/ .3/.62 height/width, it no longer hangs with a beam width of 0.1, but will with 0.01 (the currently configured minimum value).

@Noisyfox Perhaps you can take a look? (I think you originally ported this? If not, sorry and NVM!) It's probably preferable not to impose some arbitrary minimum, if it could be calculated. Or maybe the algorithm could be improved to skip unworkable cells?

There's no way to exit gracefully after a hang, the "stop" button in the status bar window is ineffective. Which is likely a separate issue in general (haven't looked).

-Max

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Divide by zero - Beam

1 participant