Calculating time of travel for each line segment

CURA-7647
This commit is contained in:
saumya.jain 2023-11-07 18:08:08 +05:30
parent f873a94ef8
commit 6301926885
3 changed files with 16 additions and 1 deletions

View file

@ -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