diff --git a/assets/main.scss b/assets/main.scss
index 4657e46..deb8dd6 100644
--- a/assets/main.scss
+++ b/assets/main.scss
@@ -386,7 +386,7 @@ button {
@apply h-10 overflow-hidden rounded border-gray-300 shadow flex leading-none grow justify-center items-center px-4;
span {
- @apply grow text-center;
+ @apply grow text-left;
}
}
diff --git a/components/calc/values.vue b/components/calc/values.vue
index be90612..c997d3b 100644
--- a/components/calc/values.vue
+++ b/components/calc/values.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/components/dropdown/picker.vue b/components/dropdown/picker.vue
index 670eacf..5702aa0 100644
--- a/components/dropdown/picker.vue
+++ b/components/dropdown/picker.vue
@@ -46,10 +46,10 @@ watch(open_calc, () => {
{{ getColorNameFromRal(props.color) }}
-
+
-
+
+
@@ -67,8 +67,8 @@ watch(open_calc, () => {
-
-
+
+
diff --git a/components/model/fence.vue b/components/model/fence.vue
index b05d4e4..e83c744 100644
--- a/components/model/fence.vue
+++ b/components/model/fence.vue
@@ -13,6 +13,7 @@ const remove_pillar = use_remove_pillar()
const pillar_color = use_pillar_color()
const pillar_pattern = use_pattern()
+const pillar_topper = use_topper()
const lamelle_color = use_lamelle_color()
const lSize = lamelle_height.value
diff --git a/components/model/parametric.vue b/components/model/parametric.vue
index 354784b..76254eb 100644
--- a/components/model/parametric.vue
+++ b/components/model/parametric.vue
@@ -3,20 +3,24 @@ import { Vector3 } from 'three';
//@ts-ignore
import { useGLTF, } from '@tresjs/cientos'
import type { OrbitControlsProps } from '@tresjs/cientos/dist/core/controls/OrbitControls.vue.js';
+import { getModel } from '../topper';
const section_count = use_section_count()
const extra_section = use_extra_section()
const lamelles_count = use_lamelles_count()
const lamelle_height = use_lamelle_height()
const fence_section = use_fence_section()
+
+const pillar_topper = use_topper()
+
const open_calc = use_open_calc()
const goto_cam = use_goto_camera()
const goto_target = use_goto_target()
-const { scene, controls, camera } = useTresContext()
+const { scene, controls } = useTresContext()
const { seek, seekAll } = useSeek()
-const { scene: model_pillar_top } = await useGLTF('/models_one/pillar/decor1.glb')
+const { scene: model_pillar_top } = await useGLTF(getModel(pillar_topper.value))
const { scene: model_pillar_center } = await useGLTF('/models_one/pillar/center.glb')
const { scene: model_pillar_bottom } = await useGLTF('/models_one/pillar/bottom.glb')
const { scene: model_pillar_inner } = await useGLTF('/models_one/pillar/inner.glb')
diff --git a/components/pattern.ts b/components/pattern.ts
index 43974c7..2c51bba 100644
--- a/components/pattern.ts
+++ b/components/pattern.ts
@@ -2,11 +2,18 @@ export const patterns = [
{ name: 'Без узора', },
{ name: 'Узор 1', filename: 'tile1.png' },
{ name: 'А это узор 2', filename: 'tile2.jpg' },
-]
-export const getFilename = (name: patternTypes) => {
- const el = patterns.find(el => el.name == name)
+].map((el, i) => Object.assign(el, { id: i }))
+
+export const getName = (id: patternIds) => {
+ const el = patterns.find(el => el.id == id)
+ if (!el) return undefined
+ return el.name
+}
+
+export const getFilename = (id: patternIds) => {
+ const el = patterns.find(el => el.id == id)
if (!el || !el.filename) return undefined
return `/pattern/${el?.filename}`
}
-export type patternTypes = typeof patterns[number]['name']
\ No newline at end of file
+export type patternIds = typeof patterns[number]['id']
\ No newline at end of file
diff --git a/components/topper.ts b/components/topper.ts
new file mode 100644
index 0000000..69fef66
--- /dev/null
+++ b/components/topper.ts
@@ -0,0 +1,25 @@
+export const toppers = [
+ { name: 'Ровный', filename: 'icon_stolb_verh_1.svg', model: 'top' },
+ { name: 'Вершина 1', filename: 'icon_stolb_verh_2.svg', model: 'decor1' },
+ { name: 'Вершина 2', filename: 'icon_stolb_verh_3.svg', model: 'decor2' },
+ { name: 'Вершина 3', filename: 'icon_stolb_verh_3.svg', model: 'decor3' },
+].map((el, i) => Object.assign(el, { id: i }))
+
+export const getFilename = (id: toppersIds) => {
+ const el = toppers.find(el => el.id == id)
+ if (!el || !el.filename) return undefined
+ return `/topper/${el?.filename}`
+}
+
+export const getName = (id: toppersIds) => {
+ const el = toppers.find(el => el.id == id)
+ if (!el || !el.filename) return undefined
+ return el.name
+}
+export const getModel = (id: toppersIds) => {
+ const el = toppers.find(el => el.id == id)
+ if (!el || !el.filename) return undefined
+ return `/models_one/pillar/topper/${el?.model}.glb`
+}
+
+export type toppersIds = typeof toppers[number]['id']
\ No newline at end of file
diff --git a/composables/useCalc.ts b/composables/useCalc.ts
index a045c5e..d5390b2 100644
--- a/composables/useCalc.ts
+++ b/composables/useCalc.ts
@@ -1,6 +1,7 @@
import type { ralTypes } from '@/components/ral'
import { Vector3 } from 'three'
-import { type patternTypes } from '~/components/pattern'
+import { type patternIds } from '~/components/pattern'
+import { type toppersIds } from '~/components/topper'
export const predefPillarColors = ['3004', '7043', '6028', '5013', '8016', '1020', '3005', '4009']
export const predefLamelleColors = ['3009', '9003', '6027', '5024', '9001', '1012', '3007', '4007']
@@ -11,10 +12,13 @@ const min = 1370
export const use_lamelle_height = () => useState('lamelle_height', () => 0.115)
export const use_lamelles_count = () => useState('lamelles_count', () => 14)
export const use_fence_section = () => useState('fence_section', () => min * 0.001)
+
export const use_remove_pillar = () => useState('remove_pillar', () => false)
export const use_pillar_color = () => useState('pillar_color')
export const use_lamelle_color = () => useState('lamelle_color')
-export const use_pattern = () => useState('pattern', () => 'Без узора')
+export const use_pattern = () => useState('pattern', () => 0)
+export const use_topper = () => useState('topper', () => 0)
+
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)
diff --git a/public/models_one/pillar/decor1.glb b/public/models_one/pillar/topper/decor1.glb
similarity index 100%
rename from public/models_one/pillar/decor1.glb
rename to public/models_one/pillar/topper/decor1.glb
diff --git a/public/models_one/pillar/decor2.glb b/public/models_one/pillar/topper/decor2.glb
similarity index 100%
rename from public/models_one/pillar/decor2.glb
rename to public/models_one/pillar/topper/decor2.glb
diff --git a/public/models_one/pillar/topper/decor3.glb b/public/models_one/pillar/topper/decor3.glb
new file mode 100644
index 0000000..065b960
Binary files /dev/null and b/public/models_one/pillar/topper/decor3.glb differ
diff --git a/public/models_one/pillar/top.glb b/public/models_one/pillar/topper/top.glb
similarity index 100%
rename from public/models_one/pillar/top.glb
rename to public/models_one/pillar/topper/top.glb
diff --git a/public/topper/icon_stolb_verh_1.svg b/public/topper/icon_stolb_verh_1.svg
new file mode 100644
index 0000000..38eb476
--- /dev/null
+++ b/public/topper/icon_stolb_verh_1.svg
@@ -0,0 +1,3 @@
+
diff --git a/public/topper/icon_stolb_verh_2.svg b/public/topper/icon_stolb_verh_2.svg
new file mode 100644
index 0000000..a07e8f9
--- /dev/null
+++ b/public/topper/icon_stolb_verh_2.svg
@@ -0,0 +1,3 @@
+
diff --git a/public/topper/icon_stolb_verh_3.svg b/public/topper/icon_stolb_verh_3.svg
new file mode 100644
index 0000000..df48c07
--- /dev/null
+++ b/public/topper/icon_stolb_verh_3.svg
@@ -0,0 +1,3 @@
+
diff --git a/utils/material.ts b/utils/material.ts
index 133bfa6..e8c072b 100644
--- a/utils/material.ts
+++ b/utils/material.ts
@@ -21,7 +21,7 @@ const noiseTexturePromise = useLoader(TextureLoader, '/texture/images.jpeg')
const loaded_patterns: { [key: string]: any } = {}
for (let index = 0; index < patterns.length; index++) {
const element = patterns[index];
- const filename = getFilename(element.name)
+ const filename = getFilename(element.id)
if (filename) {
loaded_patterns[filename] = useLoader(TextureLoader, filename)
}