Previously the icons were organized according to "size" which could prove to be confusing.
This commit fixes that by organizing them according to "detail_level".
CURA-8010
Subdivided the new icons in 3 size categories. As requested by UX
Used the company naming scheme for uniformity and easy recognition.
Known issues:
- Top/Bottom category wasn't taken into account by UX at the time. Since
this is a recent addition. Both the Walls and Top/Bottom will be updated.
- Cloud/Network connection icons 12px don't render correctly. Due to the
theme-ing.
- Extruder Icons do not render correctly.
CURA-8010_new_icons
The Cura 4.9 release will have expanded functionality. If you have a plug-in that uses this functionality, marking it as using SDK 7.5.0 will notify older Cura releases that they can't use that plug-in.
If the range of the colour spectrum is 0, i.e. there is only one value for the current colour spectrum, then this would previously give a division by 0 in the shader, causing the final colour to become black. This is unexpected and makes the layer view hard to read. Instead, we'll now use the middle of the range then.
This was likely a problem for a long time but only really became visible due to the colour spectrum now showing only the range of values for the visible structures. Previously it was a problem e.g. for layer thickness if all layers had the same thickness (i.e. initial layer height == layer height).
The input array here is 2D, but always 1 by N long. The output of where then gives a tuple of two arrays, one indicating the Y positions and the other the X positions. The X positions were therefore always 0. The amin and amax functions were then always taking this index 0 along in their results, regardless of whether the line at that index was visible at all or not.
This will also improve performance since it's checking the limits now only for half as many indices.
This prevents previous measurements from influencing the colour scheme. Essentially previously it was showing the colour scheme based on all lines you had ever seen, rather than just the line types you were currently seeing.
If the user makes certain structures visible or invisible, and this then causes the limits of the colour scheme to change, this now triggers the layer view to be re-rendered and updates the legend in the simulation view menu component.
This is just a refactor that shouldn't have any influence on the behaviour.
It is a necessary prerequisite to be able to trigger the updating of the layer view colour spectrum more frequently, i.e. if the visible line types change.
This way, if travel moves are not currently visible in the layer view, the travel moves don't get counted with the limits to determine the colour spectrum to grade each line with. Quite often, travel moves had a much greater speed than other moves, like 120mm/s instead of the fastest printed line 60mm/s. This caused all of the layer view to be pushed into the lower end of the spectrum. It makes it hard to distinguish the differences in speed and line width because travel moves influence the spectrum so much. This way, the travel moves only influence the spectrum if they are visible. If they are visible, it might be relevant to the user. Otherwise, the user gets the full spectrum to differentiate between all the line widths and speeds.
This currently doesn't update correctly yet. That is something we'll need to fix.
All of our current layer view colour schemes are properties of a line, not of a vertex. The line has a single feedrate, a single line type, a single layer thickness, a single material colour and a single width. This is even limited by the g-code specification itself, which is unable to represent lines with varying line width. However, we store this information in the vertices, the vertex data being the only data sent to layer view since layer view is sent as polylines to the shader.
This change makes the entire line take on the colour scheme of the vertex where its representative data is stored. This data is intended for the line, not just for that vertex, so it makes sense that the entire line listens to the data of the correct vertex, not just the nearest vertex of the line's endpoint.
Encountered as I made a failed attempt at solving the issue with rendering transparent support. I tried to order vertices appropriately but failed miserably.
This fixes a very old bug in Cura where sometimes after re-slicing it would display the layer as if you've been going horizontal through the path slider, even if you never touched the horizontal path slider.
This was caused by a tracking flag in the SimulationPass, _switching_layers. This bit of state in the SimulationPass was tracking whether the user is going through the vertical layer slider (True) or the horizontal path slider (False). If False, the nozzle mesh is drawn and lower layers get drawn in a shadowy shader. The state of this flag was being updated on every render by looking at whether the previous render has the same current layer number but a different path index. If so, it changed to False, meaning that it assumes you're going through the paths on a layer and things get shadowy.
However if you slice a different object such that the number of layers stay the same (or at least the current layer) but the number of paths on a layer change (e.g. by reducing Maximum Resolution, or by loading a different model that happens to be equally tall) then it would falsely think you were going through the horizontal path slider.
This change effectively resets this state flag when any layer data is changed in the scene. So if you re-slice, it always goes back to _switching_layers = True.
The side effect is that if you were going through the paths of a layer and you re-slice, you won't end up on the same path even if the number of paths on your current layer didn't change due to the reslice. But I think that is more towards what the user would accept a re-slice to do anyway.
I decided to take a look into this bug because I'm making a script to automatically refresh the screenshots of the Settings Guide plug-in. This script frequently hits cases like this, and it's easier to fix this bug than to work around it in my script.
Just a few calls to min() or max() do the trick, rather than if statements.
I consider this more semantic, because we just intend to clamp values here, and min() and max() are commonly used to do that.
It should also be slightly faster because it's less Python and more internal in CPython, but considering that this happens at best like 60 times per second the performance impact of this will be practically nil.
This was probably copy-pasted wrongly years ago.
The Cura interface currently doesn't allow changing the minimum path anyway, so this doesn't have any effect on the actual behaviour of Cura. Still, can't hurt to fix this, for posterity.
Also adds a "show starts" option to the SimulationViewMenuComponent and corresponding logic
SimulationPass.py adds a prev_line_types attribute to the shader, which the shader uses to compare with its line_type to detect starts.
This reverts commit 28f4d8513db7efce17bfd8b80fa7c8b237fd1c18.
The original revert was to revert an accidental merge from master to 4.7. This now reverts the revert on Master, so that we still have those changes on Master.