Conversion math library update

* Now inputs diameter instead of radius to prevent confusion
* Added length_from_weight
This commit is contained in:
Donkie
2023-07-10 11:02:22 +02:00
parent 6afbdb17f3
commit f995662f05
2 changed files with 20 additions and 4 deletions

View File

@@ -213,7 +213,7 @@ async def use_length(db: AsyncSession, spool_id: int, length: float) -> models.S
# Calculate and use weight
weight = weight_from_length(
length=length,
radius=filament_info[0] / 2,
diameter=filament_info[0],
density=filament_info[1],
)
await use_weight_safe(db, spool_id, weight)