mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Removed unused option in LayerPolygon, added comments
This commit is contained in:
parent
6c19bc1c16
commit
50ba236e66
3 changed files with 15 additions and 7 deletions
|
@ -48,8 +48,10 @@ class LayerDataBuilder(MeshBuilder):
|
||||||
|
|
||||||
self._layers[layer].setThickness(thickness)
|
self._layers[layer].setThickness(thickness)
|
||||||
|
|
||||||
# material color map: [r, g, b, a] for each extruder row.
|
## Return the layer data as LayerData.
|
||||||
# line_type_brightness: compatibility layer view uses line type brightness of 0.5
|
#
|
||||||
|
# \param material_color_map: [r, g, b, a] for each extruder row.
|
||||||
|
# \param line_type_brightness: compatibility layer view uses line type brightness of 0.5
|
||||||
def build(self, material_color_map, line_type_brightness = 1.0):
|
def build(self, material_color_map, line_type_brightness = 1.0):
|
||||||
vertex_count = 0
|
vertex_count = 0
|
||||||
index_count = 0
|
index_count = 0
|
||||||
|
@ -75,9 +77,12 @@ class LayerDataBuilder(MeshBuilder):
|
||||||
self.addColors(colors)
|
self.addColors(colors)
|
||||||
self.addIndices(indices.flatten())
|
self.addIndices(indices.flatten())
|
||||||
|
|
||||||
|
# Note: we're using numpy indexing here.
|
||||||
|
# See also: https://docs.scipy.org/doc/numpy/reference/arrays.indexing.html
|
||||||
material_colors = numpy.zeros((line_dimensions.shape[0], 4), dtype=numpy.float32)
|
material_colors = numpy.zeros((line_dimensions.shape[0], 4), dtype=numpy.float32)
|
||||||
for extruder_nr in range(material_color_map.shape[0]):
|
for extruder_nr in range(material_color_map.shape[0]):
|
||||||
material_colors[extruders == extruder_nr] = material_color_map[extruder_nr]
|
material_colors[extruders == extruder_nr] = material_color_map[extruder_nr]
|
||||||
|
# Set material_colors with indices where line_types (also numpy array) == MoveCombingType
|
||||||
material_colors[line_types == LayerPolygon.MoveCombingType] = colors[line_types == LayerPolygon.MoveCombingType]
|
material_colors[line_types == LayerPolygon.MoveCombingType] = colors[line_types == LayerPolygon.MoveCombingType]
|
||||||
material_colors[line_types == LayerPolygon.MoveRetractionType] = colors[line_types == LayerPolygon.MoveRetractionType]
|
material_colors[line_types == LayerPolygon.MoveRetractionType] = colors[line_types == LayerPolygon.MoveRetractionType]
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,13 @@ class LayerPolygon:
|
||||||
|
|
||||||
__jump_map = numpy.logical_or(numpy.logical_or(numpy.arange(11) == NoneType, numpy.arange(11) == MoveCombingType), numpy.arange(11) == MoveRetractionType)
|
__jump_map = numpy.logical_or(numpy.logical_or(numpy.arange(11) == NoneType, numpy.arange(11) == MoveCombingType), numpy.arange(11) == MoveRetractionType)
|
||||||
|
|
||||||
## LayerPolygon
|
## LayerPolygon, used in ProcessSlicedLayersJob
|
||||||
# line_thicknesses: array with type as index and thickness as value
|
# \param extruder
|
||||||
def __init__(self, mesh, extruder, line_types, data, line_widths, line_thicknesses):
|
# \param line_types array with line_types
|
||||||
self._mesh = mesh
|
# \param data new_points
|
||||||
|
# \param line_widths array with line widths
|
||||||
|
# \param line_thicknesses: array with type as index and thickness as value
|
||||||
|
def __init__(self, extruder, line_types, data, line_widths, line_thicknesses):
|
||||||
self._extruder = extruder
|
self._extruder = extruder
|
||||||
self._types = line_types
|
self._types = line_types
|
||||||
self._data = data
|
self._data = data
|
||||||
|
|
|
@ -139,7 +139,7 @@ class ProcessSlicedLayersJob(Job):
|
||||||
new_points[:, 1] = points[:, 2]
|
new_points[:, 1] = points[:, 2]
|
||||||
new_points[:, 2] = -points[:, 1]
|
new_points[:, 2] = -points[:, 1]
|
||||||
|
|
||||||
this_poly = LayerPolygon.LayerPolygon(layer_data, extruder, line_types, new_points, line_widths, line_thicknesses)
|
this_poly = LayerPolygon.LayerPolygon(extruder, line_types, new_points, line_widths, line_thicknesses)
|
||||||
this_poly.buildCache()
|
this_poly.buildCache()
|
||||||
|
|
||||||
this_layer.polygons.append(this_poly)
|
this_layer.polygons.append(this_poly)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue