bx-935-calc #1

Merged
ksenia_mikhailova merged 15 commits from bx-935-calc into main 2024-07-03 14:57:08 +03:00
1 changed files with 3 additions and 1 deletions
Showing only changes of commit 58b26e4030 - Show all commits

View File

@ -77,7 +77,7 @@ const changeParametres = () => {
if (auto_length) { if (auto_length) {
let w = parametric.length.min let w = parametric.length.min
const max_sections = Math.ceil((total_length_mm - fence_length) / (parametric.length.min + fence_length)) const max_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.min + fence_length))
const min_sections = Math.ceil((total_length_mm - fence_length) / (parametric.length.max + fence_length)) const min_sections = Math.ceil((total_length_mm - fence_length) / (parametric.length.max + fence_length))
for (let index = min_sections; index <= max_sections; index++) { for (let index = min_sections; index <= max_sections; index++) {
@ -92,6 +92,8 @@ const changeParametres = () => {
} }
} }
length = w length = w
} else {
full_sections = Math.floor((total_length_mm - fence_length) / (length + fence_length))
} }
if (((full_sections * length) + (full_sections * fence_length) + fence_length) <= total_length_mm) { if (((full_sections * length) + (full_sections * fence_length) + fence_length) <= total_length_mm) {