mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:45:52 +08:00
using numpy for array calculation
CURA-7647
This commit is contained in:
parent
efda0aaba4
commit
457cecba59
@ -189,8 +189,8 @@ class LayerPolygon:
|
||||
|
||||
@property
|
||||
def lineLengths(self):
|
||||
return [math.sqrt(sum((b - a) ** 2 for a, b in zip(self._data[i], self._data[i + 1])))
|
||||
for i in range(len(self._data) - 1)]
|
||||
data_array = numpy.array(self._data)
|
||||
return numpy.linalg.norm(data_array[1:] - data_array[:-1], axis=1)
|
||||
|
||||
@property
|
||||
def data(self):
|
||||
|
@ -403,7 +403,7 @@ class SimulationView(CuraView):
|
||||
return self._max_feedrate
|
||||
|
||||
def getSimulationTime(self) -> list:
|
||||
return [length / feedrate for length, feedrate in zip(self._visible_lengths[self._current_layer_num], self._current_feedrates[self._current_layer_num])]
|
||||
return self._visible_lengths[self._current_layer_num] / self._current_feedrates[self._current_layer_num]
|
||||
|
||||
def getMinThickness(self) -> float:
|
||||
if abs(self._min_thickness - sys.float_info.max) < 10: # Some lenience due to floating point rounding.
|
||||
|
@ -136,7 +136,7 @@ Item
|
||||
Timer
|
||||
{
|
||||
id: simulationTimer
|
||||
interval: parseFloat(UM.SimulationView.getSimulationTime[pathNumber]).toFixed(2) //10 //dont change
|
||||
interval: parseFloat(UM.SimulationView.getSimulationTime[pathNumber]).toFixed(2)
|
||||
running: false
|
||||
repeat: true
|
||||
property int pathNumber : 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user