dev #26
|
@ -23,14 +23,7 @@ const cameraStat = reactive({
|
||||||
})
|
})
|
||||||
|
|
||||||
const pointLight = ref()
|
const pointLight = ref()
|
||||||
|
const pointLight2 = ref()
|
||||||
const groundMaterial = ref({
|
|
||||||
color: "#555",
|
|
||||||
roughness: 0.7,
|
|
||||||
metalness: 0,
|
|
||||||
side: FrontSide,
|
|
||||||
precision: 'lowp',
|
|
||||||
})
|
|
||||||
const loadAll = async () => {
|
const loadAll = async () => {
|
||||||
const { scene: light } = await useGLTF('/models_light/zabor_so_svetom.glb')
|
const { scene: light } = await useGLTF('/models_light/zabor_so_svetom.glb')
|
||||||
pointLight.value = light.children[2]
|
pointLight.value = light.children[2]
|
||||||
|
|
|
@ -78,11 +78,11 @@ const changeParametres = () => {
|
||||||
if (auto_length) {
|
if (auto_length) {
|
||||||
let w = parametric.length.min
|
let w = parametric.length.min
|
||||||
const max_sections = Math.floor((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.floor((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++) {
|
||||||
full_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 (
|
if (
|
||||||
w >= parametric.length.min
|
w >= parametric.length.min
|
||||||
&& w <= parametric.length.max
|
&& 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)
|
form_state.extra_section = Math.floor((total_length_mm - fence_length) % length)
|
||||||
} else {
|
} else {
|
||||||
form_state.extra_section = 0
|
form_state.extra_section = 0
|
||||||
|
@ -160,19 +160,6 @@ const goal = (target: string, params: object) => {
|
||||||
<input id="height" type="range" class="w-full" v-bind="parametric.height"
|
<input id="height" type="range" class="w-full" v-bind="parametric.height"
|
||||||
v-model="form_state.height" :ref="form_refs.height" />
|
v-model="form_state.height" :ref="form_refs.height" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-item">
|
|
||||||
<label for="total_length">Общая длина забора, м</label>
|
|
||||||
<input type="number" id="total_length" v-bind="parametric.total_length"
|
|
||||||
v-model="form_state.total_length" :ref="form_refs.total_length" />
|
|
||||||
</div>
|
|
||||||
<div class="form-item form-item_checkbox">
|
|
||||||
<input id="auto_length" type="checkbox" v-model="form_state.auto_length" />
|
|
||||||
<label for="auto_length">Автоматический подбор секции</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-item form-item_checkbox">
|
|
||||||
<input id="remove_pillar" type="checkbox" v-model="form_state.remove_pillar" />
|
|
||||||
<label for="remove_pillar">Без столбов</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12 lg:col-span-6">
|
<div class="col-span-12 lg:col-span-6">
|
||||||
|
@ -183,27 +170,40 @@ const goal = (target: string, params: object) => {
|
||||||
disabled />
|
disabled />
|
||||||
<ColorPicker :cb="setLamelleColor" />
|
<ColorPicker :cb="setLamelleColor" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-item">
|
|
||||||
<template v-for="item in predefLamelleColors">
|
|
||||||
<ColorPicker :color="item" :cb="setLamelleColor" :open="false"
|
|
||||||
:active="lamelle_color == item" />
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<div class="form-item">
|
<div class="form-item">
|
||||||
<label for="pillar_color">Цвет столба</label>
|
<label for="pillar_color">Цвет столба</label>
|
||||||
<input id="pillar_color" type="text" :value="getColorNameFromRal(pillar_color)" class="w-60"
|
<input id="pillar_color" type="text" :value="getColorNameFromRal(pillar_color)" class="w-60"
|
||||||
disabled />
|
disabled />
|
||||||
<ColorPicker :cb="setPillarColor" />
|
<ColorPicker :cb="setPillarColor" />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-span-12">
|
||||||
|
<div class="form-row">
|
||||||
<div class="form-item">
|
<div class="form-item">
|
||||||
<template v-for="item in predefPillarColors">
|
<label for="total_length">Общая длина забора, м</label>
|
||||||
<ColorPicker :color="item" :cb="setPillarColor" :open="false"
|
<input type="number" id="total_length" v-bind="parametric.total_length"
|
||||||
:active="pillar_color == item" />
|
v-model="form_state.total_length" :ref="form_refs.total_length" />
|
||||||
</template>
|
</div>
|
||||||
|
<div class="form-item w-full lg:w-2/4">
|
||||||
|
<p v-if="form_state.extra_section" class="text-ioprim">
|
||||||
|
Внимание! Дополнительная секция приводит к увеличению стоимости.
|
||||||
|
Рекомендуем вам изменить длину забора или длину секции!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-row min-h-12">
|
||||||
|
<div class="form-item form-item_checkbox">
|
||||||
|
<input id="auto_length" type="checkbox" v-model="form_state.auto_length" />
|
||||||
|
<label for="auto_length">Автоматический подбор секции</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-item form-item_checkbox">
|
||||||
|
<input id="remove_pillar" type="checkbox" v-model="form_state.remove_pillar" />
|
||||||
|
<label for="remove_pillar">Без столбов</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12 lg:col-span-8 prose min-w-full">
|
<div class="col-span-12 lg:col-span-6 prose min-w-full">
|
||||||
<template v-if="(form_state.total_length * 1000) >= parametric.length.min">
|
<template v-if="(form_state.total_length * 1000) >= parametric.length.min">
|
||||||
<p>
|
<p>
|
||||||
Забор общей длиной {{ form_state.total_length }}{{ '\xa0' }}м,
|
Забор общей длиной {{ form_state.total_length }}{{ '\xa0' }}м,
|
||||||
|
@ -227,17 +227,13 @@ const goal = (target: string, params: object) => {
|
||||||
{{ `длиной ${form_state.extra_section}\xa0мм` }}
|
{{ `длиной ${form_state.extra_section}\xa0мм` }}
|
||||||
</template>.
|
</template>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
Окрашивается по технологии порошковой окраски: <br />
|
|
||||||
ламели: {{ getColorNameFromRal(lamelle_color)?.toLowerCase() }};
|
|
||||||
столбы: {{ getColorNameFromRal(pillar_color)?.toLowerCase() }}.
|
|
||||||
</p>
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div class="prose col-span-12 lg:col-span-4">
|
<div class="prose col-span-12 lg:col-span-6">
|
||||||
<p v-if="form_state.extra_section" class="text-ioprim">
|
<p>
|
||||||
Внимание! Дополнительная секция приводит к увеличению стоимости.
|
Окрашивается по технологии порошковой окраски: <br />
|
||||||
Рекомендуем вам изменить длину забора или длину секции!
|
ламели: {{ getColorNameFromRal(lamelle_color)?.toLowerCase() }};
|
||||||
|
столбы: {{ getColorNameFromRal(pillar_color)?.toLowerCase() }}.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row justify-center">
|
<div class="form-row justify-center">
|
||||||
|
|
|
@ -13,7 +13,7 @@ export const use_pillar_color = () => useState<ralTypes>('pillar_color', () => p
|
||||||
export const use_lamelle_color = () => useState<ralTypes>('lamelle_color', () => predefLamelleColors[Math.floor(Math.random() * predefLamelleColors.length)] as ralTypes)
|
export const use_lamelle_color = () => useState<ralTypes>('lamelle_color', () => predefLamelleColors[Math.floor(Math.random() * predefLamelleColors.length)] as ralTypes)
|
||||||
export const use_section_count = () => useState('section_count', () => n)
|
export const use_section_count = () => useState('section_count', () => n)
|
||||||
export const use_extra_section = () => useState('extra_section', () => 0)
|
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_min_length = () => useState('min_length', () => 700)
|
||||||
export const use_max_size = () => useState<number>('max_size', () => 13)
|
export const use_max_size = () => useState<number>('max_size', () => 13)
|
||||||
export const use_explosion_state = () => useState<boolean>('explosion_state', () => false)
|
export const use_explosion_state = () => useState<boolean>('explosion_state', () => false)
|
Loading…
Reference in New Issue