<script setup lang="ts">
import Item from './item.vue';
const lSize = 0.1
const lamelles_count = useState('lamelles_count')

</script>
<template>
    <TresMesh :position="[0, 0, 0]" :rotate-x="Math.PI * -0.5" receive-shadow cast-shadow>
        <TresBoxGeometry :args="[8, 8, 0.05]" />
        <TresMeshStandardMaterial color="pink" />
    </TresMesh>
    <Suspense>
        <TresGroup :rotate-y="Math.PI * -0.5" :position-x="-0.5">
            <Item model-url="/models/kosynka.glb" />
            <Item model-url="/models/kreplaniye_planok.glb" />
            <Item model-url="/models/planki.glb" />
            <Item model-url="/models/stolb.glb" />
            <Item model-url="/models/verh.glb" />
            <Item model-url="/models/zakliopki.glb" />
        </TresGroup>
    </Suspense>
    <Suspense>
        <TresGroup :position="[1, 0, 1]">
            <template v-for="i in lamelles_count">
                <Item model-url="/models_one/planka.glb" :position="[0, (lSize * i), 0]" :remove-pos="true" />
            </template>
            <Item model-url="/models_one/verh.glb" :position="[0, (lamelles_count + 1) * lSize, 0]" :remove-pos="true" />
        </TresGroup>
    </Suspense>
</template>