slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.35k stars 1.29k forks source link

Plater with visual export history of first layers to aid wearing surfaced print beds more evenly #4713

Open jammi opened 5 years ago

jammi commented 5 years ago

Problem to solve Since many of us use disposable surfacing on our print beds, be it tape, hairspray on glass or whatever. It's almost impossible to place new models to print in areas of pristine or least worn surfaces.

Description of minimum viable solution I'd like slic3r to have a rough accumulating bitmap model of where the area covered by the first sliced layer of previous export to gcode / send to printer went. There'd be a reset button or menu item somewhere, if the feature is enabled (once bed is resurfaced etc). There'd be another checkbox in preferences to enable it.

Rough mockup by combining several 1st layer screenshots of sliced output vs object placement

Guesstimates of further development

jammi commented 5 years ago

Some implementation suggestions

Output index

Rendering

supermerill commented 5 years ago

Problem 1: storing this information

Have the bed history associated with either printer settings or have a concept of different printer profiles vs different printer, for people with many printers and therefore many print beds.

I have multiple printers with the same profile. When i open slic3r on my desktop and i have printed something from my laptop yesterday, i have to get the "save file" from my laptop anyway, even if you create an overly complicated system. So I think we can leave the information in a good old save file.

Problem 2 : what to save

We can create some piece of code to save only the first layer, like cutting at 0.1mm. Anyway, the simplest way if we didn't want to spend months re-coding slic3r is to store & load a 3d model.

Problem 3 : updating the save

How to say "hey, i just printed that, please keep track of it". imo, it's loading the plater to update, add the current model to it and save it.

The workflow:

In the chat, you say that you forgot everything and the current workflow of "load slice print" shouldn't be altered.

But you have to also load the current state of the printer because slic3r can't know it.

But you have to also save the new state because slic3r can't know for sure if the print has been really printed.

The best workflow i can see (for you) is:

The step1 is the one we don't have. (and maybe a cut-and-save option)

The current workflow is:

So if someone add the missing step (step1 of the first workflow), it should resolve your issue?

jammi commented 5 years ago

I have multiple printers with the same profile.

Since the feature would be optional to begin with, and most users have a single printer, and most users with multiple printers use different profiles, I'd vote for a simple 80/20 rule there; this feature doesn't apply to your niche use case of Slic3r.

Anyway, the simplest way if we didn't want to spend months re-coding slic3r is to store & load a 3d model.

There's a 2D renderer in place as is and the image doesn't have to be large resolution, 1mm per px should be pretty reasonable, simply include the pixel if there's been any extrusion overlap within it. The typical bed would therefore be a 32bit 200x200px; 160kB raw bitmap and would be usable as the surface texture of the bed in the Plater. There's only an STL option for custom beds as-is, but I don't think it'd be a major effort to include.

The workflow I'm after is a preparation of:

Usage would be like:

When exporting to a gcode file:

supermerill commented 5 years ago

For such extensives changes designed for your specific workflow, i think it's best for you to code it yourself in your branch, we can merge it when it's stable (and if it won't clutter the gui too much). We can help you getting started.

But it may be better to wait for the gui stuff to be moved into c++ before. @lordofhyphens ?

jammi commented 5 years ago

The hardest thing to PoC this would be to include a surface texture image selection option to the Printer → General → Bed section. Then it'd need rendering the contents of that image as the bed surface texture. Lastly, it'd need checking if the file is changed and reload and re-render, if it is.

The rest could be done by external means such as an OctoPrint plugin and somehow fetching that image to the Slic3r machine in case they're separate (my hunch of the 80/20 says they usually are).

supermerill commented 5 years ago

The hardest thing to PoC this would be to include a surface texture image selection option to the Printer → General → Bed section. Then it'd need rendering the contents of that image as the bed surface texture. Lastly, it'd need checking if the file is changed and reload and re-render, if it is.

you can try to use the commit from slic3rPE where they added their surface bed image.

lordofhyphens commented 5 years ago

It is feasible to update the bed draw code to put a texture on the bed plane.

ledvinap commented 5 years ago

IMO this can be all emulated outside slic3r. Only bed texture is necessary ...

Postprocessing script can generate picture with first layer and blend it with current state ...

jammi commented 5 years ago

@ledvinap Yes, I agree. At least for a PoC that'd be feasible as long as there's bed texture support in slic3r itself.

@lordofhyphens Would it be feasible to implement so that it either looks for a file defined in the printer config, or something based on the printer settings profile name?

lordofhyphens commented 5 years ago

I am unwilling to implement pointers like that for security reasons. People tend to share config files and external files like that are rife for abuse

jammi commented 5 years ago

@lordofhyphens Ok, so what do you suggest as an alternative to it?

lordofhyphens commented 5 years ago

@jammi I was mentally over in another issue.