dev #84

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

View File

@ -44,7 +44,7 @@ watch(fence_section, ()=>{
</template>
<Loader />
<Stats />
<TresCanvas shadows>
<TresCanvas>
<TresPerspectiveCamera v-bind="cameraStat" ref="camera" />
<OrbitControls v-bind="controlsState" make-default />
<TresGroup :position-y="-0.5">

View File

@ -148,7 +148,6 @@ const goal = (target: string, params: object) => {
(nuxtApp.$metrika as any).reachGoal(target, params || {})
}
}
const show_extra = ref(false)
const calc_table = computed(() => {
return [
{
@ -233,16 +232,10 @@ const calc_table = computed(() => {
<div class="col-span-12 xl:col-span-6 xl:col-start-4 grid calc_table">
<div class="grid grid-cols-4 relative">
<template v-for="item in calc_table">
<div class="col-span-3 calc_table-maincell">{{ show_extra && item.extra_name ? item.extra_name :
<div class="col-span-3 calc_table-maincell">{{
item.name }}</div>
<div class="col-span-1 calc_table-maincell">{{ show_extra ? item.extra : item.value }}</div>
<div class="col-span-1 calc_table-maincell">{{ item.value }}</div>
</template>
<span class="text-ioprim absolute top-0 right-0 text-2xl cursor-pointer"
v-if="form_state.extra_section" title="Дополнительная секция"
@click="() => show_extra = !show_extra">
<Icon name="mdi:page-first" v-if="show_extra" />
<Icon name="mdi:page-last" v-else />
</span>
</div>
<button @click.prevent="toggleModal">Рассчитать</button>
</div>

View File

@ -34,7 +34,6 @@ const { scene: model_fence_bottom } = await useGLTF('/fence_one/bottom.glb')
const { scene: model_fence_inner } = await useGLTF('/fence_one/inner.glb')
const { scene: fastening_model } = await useGLTF('/models_one/krepleniye_planok (1).glb', { draco: true });
const { scene: lamelle_model } = await useGLTF('/models_one/lamel_100.glb', { draco: true });
const { scene: point_model } = await useGLTF('/models_one/pointer.glb');
[model_fence_top, model_fence_bottom].map((sc: Object3D) =>
sc.traverse((child: Object3D) => {
@ -43,7 +42,6 @@ const { scene: point_model } = await useGLTF('/models_one/pointer.glb');
}
})
)
point_model.traverse((el: Object3D) => el.position.set(0, 0, 0))
const top = ref(top_model)
const fence = ref(model_fence_center)
@ -52,7 +50,6 @@ const fence_bottom = ref(model_fence_bottom)
const fence_inner = ref(model_fence_inner)
const fastening = ref(fastening_model)
const lamelle = ref(lamelle_model)
const pointer = ref(point_model)
if (!pillar_color.value) {
const r = Math.floor(Math.random() * predefPillarColors.length)
@ -67,8 +64,6 @@ set_material(lamelle.value, getColorHexFromRal(lamelle_color.value));
(el: Ref) => { set_material(el.value, getColorHexFromRal(pillar_color.value)) });
[fence_inner].map(
(el: Ref) => { set_material(el.value, getColorHexFromRal(pillar_color.value), lamelle_count.value) });
set_material(pointer.value, getColorHexFromRal('5012'));
const { seek, seekAll } = useSeek()
watch(lamelle_color, () => {
@ -159,7 +154,7 @@ onMounted(async () => {
<template>
<TresGroup name="base">
<template v-for="line in (total >= 4) ? 4 : 1" :key="`${line}_${count}`">
<ModelLine :models="{ top, fence, fence_top, fence_bottom, fence_inner, fastening, lamelle, pointer }"
<ModelLine :models="{ top, fence, fence_top, fence_bottom, fence_inner, fastening, lamelle }"
:number="line" :count="count" />
</template>
</TresGroup>

View File

@ -1,8 +1,8 @@
<template>
<div class="siteblock siteblock_calc bg-white">
<LazyCalcValues />
<CalcValues />
<Suspense>
<LazyCalcModels />
<CalcModels />
</Suspense>
</div>
</template>

Binary file not shown.

Binary file not shown.

View File

@ -12,24 +12,24 @@ const set_metaril_func = (scene: any, material: any) => {
})
}
// const texture = await useLoader(TextureLoader, '/fence_one/svg_tile1.svg');
const get_texture = async () => {
const texture = await useLoader(TextureLoader, '/fence_one/tile1.png');
return texture
}
const texture = await get_texture()
texture.wrapT = RepeatWrapping;
// const get_texture = async () => {
// const texture = await useLoader(TextureLoader, '/fence_one/tile1.png');
// return texture
// }
// const texture = await get_texture()
// texture.wrapT = RepeatWrapping;
export const set_material = (scene: any, color: any, count: number | undefined = undefined) => {
let c = color
if (count) {
// console.log(texture)
texture.repeat.set(1, count);
texture.needsUpdate = true
}
// if (count) {
// // console.log(texture)
// texture.repeat.set(1, count);
// texture.needsUpdate = true
// }
const material = new MeshStandardMaterial({
color: new Color(c || '#9c9c00'),
alphaMap: count ? texture : null,
// alphaMap: count ? texture : null,
transparent: true,
opacity: 1,
roughness: 0.2,