mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 21:44:01 -06:00
Calculating time of travel for each line segment
CURA-7647
This commit is contained in:
parent
f873a94ef8
commit
6301926885
3 changed files with 16 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
import math
|
||||
import numpy
|
||||
|
||||
from typing import Optional, cast
|
||||
|
@ -186,6 +187,11 @@ class LayerPolygon:
|
|||
def types(self):
|
||||
return self._types
|
||||
|
||||
@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)]
|
||||
|
||||
@property
|
||||
def data(self):
|
||||
return self._data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue