-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] DLP Projector -> Export SVG produces incomplete SVG #4311
Comments
I know that the slicing setup for dlp/sla crashes if you use infll less than 100%. DLP is more experimental with Slic3r unfortunately. @alexrj knows it best at this point. Q: does it still have a problem when sliced from the command line? |
Here is my source file (3MF): Slicing to SVG through the CLI only version (slic3r.exe Train_Engine.3mf --export-svg --layer-height 0.2) produces another bug: The created svg has only empty 'dummy' layers, except for the very last layer, which is seems to be generated correctly. This happens for STL and 3MF alike. Here's an example: Slicing through the normal console version via The way I understood it is that slicing to SVG via What I want to achieve is slicing a multimaterial 3MF file to SVG while being able to distinguish different materials in the SVG. If that distinction is by the color of each shape in the svg or by some id doesn't really matter. What's important though is that Slic3r produces a complete SVG and that the positioning is correct. So to even start, I either have to fix #4311 or fix #4310, because atm neither does both right. Can you give an indication on what could be easier to correct? Unfortunately I still couldn't find a good way to debug the C++ Code that's initiated by Perl. The eclipse (with EPIC plugin) debugger doesn't step into any C++ function calls. |
I'd much rather fix it in SLAPrint.cpp. |
There an unrelated bug in which if the loaded config is set to auto infill width (which is the default) the infill generation crashes Slic3r with a division by 0. I've hotfixed that (defaults min spacing in that situation to 0.3mm instead). |
So there's a UI deficiency here I think at minimum. In my testing it is generating the entire SVG just not when you think it would (aka the UI lets you do stuff). |
With some further experimentation, if you close Slic3r it finishes writing the file (probably because the buffers aren't being flushed). |
Actually closing the file handle was left out during write_svg(). I've added a fflush() and a fclose(). While I'd usually rather do the IO in a C++ iostreams manner, the fprintf() method used here is easier to see what is going on. |
Thanks @lordofhyphens! Seriously, the work you do for this community is exceptional. Kudos for helping everybody out! |
Version
1.2.9-1272-gdc9d7ed7
Operating system type + version
Windows 10 Pro
Description
When slicing any filetype to SVG via
Window -> DLP Projector -> Export SVG
the generated SVG is always missing the last two or three lines of xml text.Reproduce
Taking this example STL file: Train Engine wheels.zip
Slicing it as stated above produces the following svg:
Train Engine wheels_svg.zip
The incompleteness is only at the very bottom of the file. When we open it with an editor we see the following in the last section:
Notice that in the last layer, the last entry is incomplete. The file is also lacking the
</g></svg>
that should be there.I tried with different file sizes and formats, which gave me the same results.
I noticed that in the DLP / SLA Preview window (where we hit
Export SVG
), the whole file is displayed correctly, including the last layer. This indicates that this isn't an issue with the Slicing process itself, but with how the file is saved.When I try to load the saved SVG into SVG Viewer it doesn't work. Only after I delete the incomplete path and add closing tags it is displayed - but then obviously lacking the last shape in the last layer.
Any ideas on what could cause this and how to fix it are appreciated.
The text was updated successfully, but these errors were encountered: