From 5344804e074a5c872b1e0c38afa8855043efaef9 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Tue, 23 Jul 2024 15:22:33 +0300 Subject: [PATCH] test calc --- components/calcModels.vue | 2 +- components/calcValues.vue | 18 ++++++++++-------- components/expDiagram.vue | 2 +- components/model/parametric.vue | 3 ++- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/components/calcModels.vue b/components/calcModels.vue index f19a2f5..30b8192 100644 --- a/components/calcModels.vue +++ b/components/calcModels.vue @@ -62,7 +62,7 @@ watch([section_count, extra_section], () => { - + diff --git a/components/calcValues.vue b/components/calcValues.vue index ff1ed06..7ea9c6e 100644 --- a/components/calcValues.vue +++ b/components/calcValues.vue @@ -43,6 +43,7 @@ const form_state = reactive({ auto_length: true, remove_pillar: false }) +let copy_form_state = Object.assign({}, form_state) const form_refs = { length: ref(), height: ref(), @@ -50,9 +51,13 @@ const form_refs = { } const changeParametres = () => { - if (form_state.total_length * 1000 < parametric.length.min) { + // console.log(form_state.total_length * 1000, copy_form_state.total_length * 1000) + + if ((form_state.total_length * 1000) <= (parametric.length.min + parametric.height.step)) { + form_state.total_length = (parametric.length.min + parametric.height.step) / 1000 return } + const lamelles = Math.floor(form_state.height / parametric.height.step) for (const key in form_state) { @@ -68,7 +73,7 @@ const changeParametres = () => { } if (form_state.total_length_mm < form_state.length) { - form_state.length = form_state.total_length_mm + // form_state.length = form_state.total_length_mm } form_state.total_length_mm = form_state.total_length * 1000 @@ -109,6 +114,8 @@ const changeParametres = () => { form_state.length = length form_state.fence_length = fence_length + copy_form_state = Object.assign({}, form_state) + total_length.value = form_state.total_length lamelles_count.value = lamelles fence_section.value = form_state.length * 0.001 @@ -125,17 +132,12 @@ const setLamelleColor = (color: ralTypes) => { const setPillarColor = (color: ralTypes) => { pillar_color.value = color } -watch(form_state, changeParametres, { deep: true }) +watch(() => form_state, changeParametres, { deep: true }) const isModalOpen = useState('modal_open', () => false) const toggleModal = () => { isModalOpen.value = !isModalOpen.value } -const plurals = { - lamelle: { one: 'ламель', few: 'ламели', many: 'ламелей' }, - fence: { one: 'cтолб', few: 'столба', many: 'столбов' }, - section: { one: 'секция', few: 'секции', many: 'секций' }, -} const goal = (target: string, params: object) => { const nuxtApp = useNuxtApp() if (nuxtApp.$metrika) { diff --git a/components/expDiagram.vue b/components/expDiagram.vue index f6fc334..9f12a2f 100644 --- a/components/expDiagram.vue +++ b/components/expDiagram.vue @@ -63,7 +63,7 @@ onMounted(() => { Загрузка 3D модели - + diff --git a/components/model/parametric.vue b/components/model/parametric.vue index 6e6cb6b..9f5fb1f 100644 --- a/components/model/parametric.vue +++ b/components/model/parametric.vue @@ -15,7 +15,7 @@ const section_count = use_section_count() const extra_section = use_extra_section() const max_size = use_max_size() -const { scene, renderer } = useTresContext() +const { scene, renderer, camera } = useTresContext() renderer.value.toneMapping = CineonToneMapping renderer.value.toneMappingExposure = 0.5 // renderer.value.gammaOutput = true @@ -72,6 +72,7 @@ onMounted(async () => { 'hdrmaps/hdr-gainmap.webp', 'hdrmaps/hdr.json', ]) + renderer.value.render(scene.value, camera.value) scene.value.environment = result.renderTarget.texture scene.value.background = result.renderTarget.texture scene.value.background.mapping = EquirectangularReflectionMapping -- 2.40.1