mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Layer shader now uses own attribute for line dimensions instead of misusing uvs.
This commit is contained in:
parent
8d2b3654a4
commit
0f2fb86cd9
6 changed files with 22 additions and 40 deletions
|
|
@ -67,7 +67,7 @@ class LayerPolygon:
|
|||
|
||||
## build
|
||||
# line_thicknesses: array with type as index and thickness as value
|
||||
def build(self, vertex_offset, index_offset, vertices, colors, line_dimensions, indices, thickness):
|
||||
def build(self, vertex_offset, index_offset, vertices, colors, line_dimensions, indices):
|
||||
if (self._build_cache_line_mesh_mask is None) or (self._build_cache_needed_points is None ):
|
||||
self.buildCache()
|
||||
|
||||
|
|
@ -85,6 +85,7 @@ class LayerPolygon:
|
|||
|
||||
# Points are picked based on the index list to get the vertices needed.
|
||||
vertices[self._vertex_begin:self._vertex_end, :] = self._data[index_list, :]
|
||||
|
||||
# Create an array with colors for each vertex and remove the color data for the points that has been thrown away.
|
||||
colors[self._vertex_begin:self._vertex_end, :] = numpy.tile(self._colors, (1, 2)).reshape((-1, 4))[needed_points_list.ravel()]
|
||||
colors[self._vertex_begin:self._vertex_end, :] *= numpy.array([[0.5, 0.5, 0.5, 1.0]], numpy.float32)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue