dev #84

Merged
ksenia_mikhailova merged 141 commits from dev into main 2024-10-03 15:30:24 +03:00
4 changed files with 9 additions and 7 deletions
Showing only changes of commit b5c87e0b6e - Show all commits

View File

@ -233,7 +233,7 @@ const calc_table = computed(() => {
v-model="form_state.total_length" :ref="form_refs.total_length" />
</div>
<div class="form-item text-sm xl:text-base">
<p v-if="form_state.total_length_mm < parametric.length.min" class="text-ioprim">
<p v-if="form_state.total_length_mm < parametric.length.min" class="text-ioprim test-sm">
Выбранный размер забора слишком мал для расчета стоимости. Пожалуйста, выберите больший
размер, чтобы продолжить.
</p>

View File

@ -48,7 +48,7 @@ const count_pos = () => {
new Box3().expandByObject(line1).getSize(line1_size)
line1.getWorldPosition(line1_pos)
}
const k = ((line1_size.x / props.count) - line1_size.z) * 0.5
const k = (line1_size.x / props.count) * 0.5 + 0.05
switch (props.number) {
case 1: break;
case 2:
@ -80,7 +80,7 @@ watch(() => [props.count, fence_section.value, section_count.value, extra_sectio
:position-z="position.z">
<TresGroup :name="`line_${props.number}_inner`">
<template v-for="i in props.count">
<template v-if="(i + (props.number - 1) * props.count) <= 1"
<template v-if="(i + (props.number - 1) * props.count) <= Math.min(total, max_size)"
:key="(i + (props.number - 1) * props.count)">
<ModelFence :index="i" :models="props.models"
:last_element="(i + (props.number - 1) * props.count) == total"

View File

@ -74,8 +74,9 @@ watch(() => [section_count.value, extra_section.value], () => {
});
})
const setTarget = (smooth = false) => {
let f = fence_section.value * lamelles_count.value * lamelle_height.value * 0.75
if (f < 3) f = 3
let f = fence_section.value * lamelles_count.value * lamelle_height.value * 0.75;
const max = 2.25
if (f < max) f = max
const target = new Vector3(0, lamelles_count.value * lamelle_height.value * 0.5, 0);
if (smooth) {
goto_target.value = target
@ -96,10 +97,11 @@ watch(open_calc, () => {
setTarget(true)
}
})
const min_for_square = 12
</script>
<template>
<TresGroup name="base">
<template v-for="line in (total >= 4) ? 4 : 1" :key="`${line}_${count}`">
<template v-for="line in (total >= min_for_square) ? 4 : 1" :key="`${line}_${count}`">
<ModelLine :models="{
top,
pillar_center, pillar_top, pillar_bottom, pillar_inner,

View File

@ -19,7 +19,7 @@ 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 + 104) * n) + 104) * 0.001)
export const use_min_length = () => useState('min_length', () => 700)
export const use_max_size = () => useState<number>('max_size', () => 20)
export const use_max_size = () => useState<number>('max_size', () => 2)
export const use_explosion_state = () => useState<boolean>('explosion_state', () => false)
export const use_goto_camera = () => useState<Vector3 | undefined>('gotocam', () => undefined)