107 Commits

Author SHA1 Message Date
Remco Burema
8bb57ac0e6
Reword the nonmanifold message, add link.
UX found that users where confused by the word nonmanifold. Reword the message and add an explanatory link.

CURA-7820
2021-03-03 17:13:08 +01:00
Jaime van Kessel
440474b1e8
Pass the cached normal transformation to the rendere
CURA-7106
2020-06-30 13:39:32 +02:00
Jaime van Kessel
ae6e78f5ed
Add a don't show me again option to x-ray message 2020-06-29 13:43:19 +02:00
Jaime van Kessel
d2280b9afb
Fix disabling show_xray_warning 2020-06-29 13:31:08 +02:00
Jaime van Kessel
b1fe4793e4
Put all objects normal models in a single render batch
THis speeds things up a fair bit for build plates with multiple models

CURA-7106
2020-06-24 10:42:35 +02:00
Jaime van Kessel
03e66beafd
Re-use some render batches
This prevents us from having to re-create them everytime

CURA-7106
2020-06-23 17:12:47 +02:00
Jaime van Kessel
ba34fb6e35
Decrease amount of nested if statements
Wont add anything to speed, but it will make it easier to read

CURA-7106
2020-06-23 10:05:05 +02:00
Jaime van Kessel
ac7f27fddc
Remove another unneded call in the solidview
The check is called a lot, especially if there are a ton of models.

CURA-7106
2020-06-22 17:32:30 +02:00
Jaime van Kessel
333b2959cd
Decrease the frequency of the non-manifold check
CURA-7106
2020-06-22 17:27:46 +02:00
Jaime van Kessel
f4cc8b4870
Remove another check from rendering code
CURA-7106
2020-06-22 17:22:47 +02:00
Jaime van Kessel
570efc8310
Remove unneeded checks in convex hull node
CURA-7106
2020-06-22 17:18:22 +02:00
Jaime van Kessel
16bc2071ee
Cache values to speed up the rendering
CURA-7106
2020-06-22 16:49:42 +02:00
Jaime van Kessel
1b973b3f3c
Remove bit of code duplication
CURA-7106
2020-06-22 16:31:37 +02:00
Nino van Hooff
58e43c0a07 Convert doxygen to rst for SentryLogger, SimulationView, SliceInfo,
SolidView
2020-05-15 13:34:58 +02:00
Remco Burema
4c4e611629
Fix x-ray error color.
X-ray errors showed as green and translucent instead of read and solid. Now fixed.
CURA-7407
2020-04-29 12:06:20 +02:00
Ghostkeeper
75aafa1e5c
Don't crash if rendering without any window
Probably it'll still crash somewhere else then, but we'll rely on Sentry to find that for us.

Fixes Sentry issue CURA-KW.
2020-04-23 13:41:06 +02:00
Jaime van Kessel
9a2d2d32bf
Remove code that prevents Cura from starting on MAC
The renderer isn't active when the view is activated. As such,
no opengl context *ever* exists. In some cases this might cause it to get
stuck in an indefinate loop.

The comments around it are explaining a situation that can't occur. The activateView
event of SolidView isn't triggered when switching to another view...
2020-04-20 13:52:40 +02:00
Remco Burema
b7e6b2888a
Actually remove xray error image (because colors).
part of CURA-7262
2020-04-07 12:57:07 +02:00
fieldOfView
ccc0589495 Remove the checkbox option to set the preference to hide the messagebox 2020-03-31 11:50:16 +02:00
fieldOfView
b7898b5a97 Change preference to only hide the xray message, not the visualization 2020-03-31 11:39:05 +02:00
fieldOfView
a2f9eac23b Remove unused import 2020-03-31 11:29:34 +02:00
fieldOfView
0794766644 Fix xray composite shader for opengl 2.1
textureSize() is not available in opengl 2.1, so we calculate the xray error image scale outside the shader (which is also a theoretical performance improvement because now the scale does not get computed over and over for each pixel)
2020-03-27 23:24:20 +01:00
Ghostkeeper
986284052d
Show warning on any invalid pixel, not just 10
Now that we have no noise any more we can do this.
Possibly cuts the processing time in half, too.

Contributes to issue CURA-7262.
2020-03-25 18:57:30 +01:00
Ghostkeeper
4c770587e2
Fix getting additional bytes from QImage
QImage's bytes are aligned to memory words per column of pixels. That means that one of these columns contains 99% valid image data, but with several bytes of unassigned noise at the end. How many of these padding bytes there are would depend on the image size, i.e. Cura's window size. In the end, the total number of bytes in the image ends up slightly more than w*h*3. As a result, Cura would crash because it couldn't reshape the image. Reshaping was completely unnecessary anyway, but this random noise was giving false positives also.
But how do you then get only the actual pixels from each column of data? We can't just go iterating over this array, as that would be an iteration of thousands of columns which is prohibitively slow in Python. No, we're going to do some Numpy magic. We're going to create a class that pretends to be a Numpy array. Give this class some data and say that this data has a certain pixel size but also a certain STRIDE LENGTH. This stride length can be the length of the actual pixel data. As a result when Numpy sees this object it will read out the data using these strides, all done efficiently within the C code of Numpy.

Framerate is fantastic on my computer. No problems at all. Pretty powerful computer though. But also a big 5k screen. Still no problem for Numpy. Seems to be decently efficient.

Took me quite a while to figure all of this out.

Contributes to issue CURA-7262.
2020-03-25 18:00:14 +01:00
Ghostkeeper
a4fbf3c613
Move X-ray set-up code into _checkSetup
That's what that function is meant for. It's executing essentially the same, since before it was executed right after the call to _checkSetup() and now it's at the end inside that function.

Contributes to issue CURA-7262.
2020-03-25 15:13:33 +01:00
Tim Kuipers
3919b1292e fix cooldown for xray warning 2020-02-27 20:39:19 +01:00
Tim Kuipers
42a1b02d4c use transparency in xray view and merge shader duplication 2020-02-27 20:29:58 +01:00
Tim Kuipers
0e633a0dfa allow immediate change of preference for showing xray errors in solid view 2020-02-27 16:41:20 +01:00
Tim Kuipers
643b27e160 add xray error warning message 2020-02-27 16:41:20 +01:00
Tim Kuipers
b4c3703dc4 Check xray overlay for badness in model every 1.0 second 2020-02-27 16:41:20 +01:00
Tim Kuipers
c16f677bf0 make a new xray error image
includes SVG source file
2020-02-27 16:41:20 +01:00
Tim Kuipers
28abf6ff8c fix xray error image scaling 2020-02-27 16:41:20 +01:00
Tim Kuipers
0f184219e6 use tiled image for xray error instead of a uniform color
temporarily use the cura logo as placeholder image
didn't correctly determine window size yet
2020-02-27 16:41:20 +01:00
Tim Kuipers
82b2f23689 make xray solid color depending on what it occludes 2020-02-27 16:41:20 +01:00
Tim Kuipers
4a8385e3e8 make xray counting color hardcoded value
Somewhere between the xray.shader and the xray_composite.shader the colors are stored as unsigned int.
Since we want to count the integer number of faces behind a pixel in the red channel, we simply use a color with an r value of 1/255.
2020-02-27 16:41:20 +01:00
Tim Kuipers
fc4c66b62a show xray errors in solid view 2020-02-27 16:41:13 +01:00
Jaime van Kessel
4ce086d5c3
Cut op beginRendering of solidView 2019-12-20 16:44:12 +01:00
Jaime van Kessel
0ff9d72c4c
Remove use of deprecated extruders property 2019-09-13 17:27:16 +02:00
Remco Burema
e5a690e605 Wrap up 'lay flat by face' feature for 4.3-BETA.
Icon thanks to Yi-An Lai.
part of CURA-6754
2019-09-10 12:37:59 +02:00
Remco Burema
d9b10e7180 Merge branch 'feature_bottom_face' of https://github.com/Ultimaker/Cura into feature_bottom_face 2019-09-03 16:04:38 +02:00
Remco Burema
70332978fd Less cryptic max face-id.
part of CURA-6745
2019-09-03 15:48:31 +02:00
Lipu Fei
44db4216bc Rename to getEndFaceSelectionId()
CURA-6745
2019-09-03 15:44:43 +02:00
Remco Burema
503a24f7a1 Make magic value into funtion (max face-id).
part of CURA-6745
2019-09-03 15:08:41 +02:00
Remco Burema
b97015a354 Added 'align selected face with buildplate' feature.
Alt-click to select a face. See the (identically named) 'feature_bottom_face' branch in Uranium for more indepth information.
2019-09-02 00:17:14 +02:00
Lipu Fei
905889214a Fix typing 2019-04-23 10:31:13 +02:00
Lipu Fei
4423fc82b0 Fix typing 2019-04-23 09:39:46 +02:00
Jaime van Kessel
50ad4e4d4e Speed up the rendering of the solid view by caching support_angle property 2019-04-19 14:55:28 +02:00
Jaime van Kessel
d53bac6eb8 Simplify the expensive call to the validation state
Since the support angle needs to be between 0 and 90, we don't have to rely on the (expensive)
validator. We can just check that ourselves.
2019-02-19 15:42:51 +01:00
Lipu Fei
620790ae3d Reduce the creations of ExtrudersModels
CURA-6015
2018-12-13 14:12:23 +01:00
Diego Prado Gesto
43657010ba CURA-5164 The Preferences is not a singleton class anymore since in some point
several instances need to be created.

- In the ThreeMFWorkspaceReader we need to create some temporal
instances of Preferences that makes it not singleton anymore.

- The current preferences are kept in the Application class and so all
the calls to the preferences are changed to get the preferences from
Application.

- The method getInstance in Preferences is kept as deprecated since some
external plugins.
2018-05-11 08:50:42 +02:00