From ec42dfba6682c75675710046d48c5a3010ea720b Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Fri, 12 Jul 2024 11:00:21 +0300 Subject: [PATCH] calc fix --- components/calcModels.vue | 9 +----- components/calcValues.vue | 68 ++++++++++++++++++--------------------- composables/useCalc.ts | 2 +- 3 files changed, 34 insertions(+), 45 deletions(-) diff --git a/components/calcModels.vue b/components/calcModels.vue index 7e5d45a..f19a2f5 100644 --- a/components/calcModels.vue +++ b/components/calcModels.vue @@ -23,14 +23,7 @@ const cameraStat = reactive({ }) const pointLight = ref() - -const groundMaterial = ref({ - color: "#555", - roughness: 0.7, - metalness: 0, - side: FrontSide, - precision: 'lowp', -}) +const pointLight2 = ref() const loadAll = async () => { const { scene: light } = await useGLTF('/models_light/zabor_so_svetom.glb') pointLight.value = light.children[2] diff --git a/components/calcValues.vue b/components/calcValues.vue index 3aab477..9195f72 100644 --- a/components/calcValues.vue +++ b/components/calcValues.vue @@ -78,11 +78,11 @@ const changeParametres = () => { if (auto_length) { let w = parametric.length.min 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.floor((total_length_mm - fence_length) / (parametric.length.max + fence_length)) for (let index = min_sections; index <= max_sections; index++) { full_sections = index - w = (total_length_mm - fence_length * (index - 1)) / index + w = (total_length_mm - fence_length - fence_length * index) / index if ( w >= parametric.length.min && w <= parametric.length.max @@ -99,7 +99,7 @@ const changeParametres = () => { } } - 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) { form_state.extra_section = Math.floor((total_length_mm - fence_length) % length) } else { form_state.extra_section = 0 @@ -160,19 +160,6 @@ const goal = (target: string, params: object) => { -
- - -
-
- - -
-
- - -
@@ -183,27 +170,40 @@ const goal = (target: string, params: object) => { disabled />
-
- -
+ + +
+
- + + +
+
+

+ Внимание! Дополнительная секция приводит к увеличению стоимости. + Рекомендуем вам изменить длину забора или длину секции! +

+
+
+
+
+ + +
+
+ +
-
+
.

-

- Окрашивается по технологии порошковой окраски:
- ламели: {{ getColorNameFromRal(lamelle_color)?.toLowerCase() }}; - столбы: {{ getColorNameFromRal(pillar_color)?.toLowerCase() }}. -

-
-

- Внимание! Дополнительная секция приводит к увеличению стоимости. - Рекомендуем вам изменить длину забора или длину секции! +

+

+ Окрашивается по технологии порошковой окраски:
+ ламели: {{ getColorNameFromRal(lamelle_color)?.toLowerCase() }}; + столбы: {{ getColorNameFromRal(pillar_color)?.toLowerCase() }}.

diff --git a/composables/useCalc.ts b/composables/useCalc.ts index 5feb052..ea19ae6 100644 --- a/composables/useCalc.ts +++ b/composables/useCalc.ts @@ -13,7 +13,7 @@ export const use_pillar_color = () => useState('pillar_color', () => p export const use_lamelle_color = () => useState('lamelle_color', () => predefLamelleColors[Math.floor(Math.random() * predefLamelleColors.length)] as ralTypes) export const use_section_count = () => useState('section_count', () => n) export const use_extra_section = () => useState('extra_section', () => 0) -export const use_total_length = () => useState('total_length', () => ((min * n) - 100) * 0.001) +export const use_total_length = () => useState('total_length', () => (((min + 104) * n) + 104) * 0.001) export const use_min_length = () => useState('min_length', () => 700) export const use_max_size = () => useState('max_size', () => 13) export const use_explosion_state = () => useState('explosion_state', () => false) \ No newline at end of file