bx-865-apps #1

Merged
ksenia_mikhailova merged 140 commits from bx-865-apps into main 2024-06-27 15:03:27 +03:00
6 changed files with 258 additions and 197 deletions
Showing only changes of commit 5c538264b2 - Show all commits

View File

@ -1,39 +1,4 @@
[
{
"label": "annotations",
"importPath": "__future__",
"description": "__future__",
"isExtraImport": true,
"detail": "__future__",
"documentation": {}
},
{
"label": "os",
"kind": 6,
"isExtraImport": true,
"importPath": "os",
"description": "os",
"detail": "os",
"documentation": {}
},
{
"label": "site",
"kind": 6,
"isExtraImport": true,
"importPath": "site",
"description": "site",
"detail": "site",
"documentation": {}
},
{
"label": "sys",
"kind": 6,
"isExtraImport": true,
"importPath": "sys",
"description": "sys",
"detail": "sys",
"documentation": {}
},
{
"label": "json",
"kind": 6,
@ -132,6 +97,15 @@
"detail": "gyp.common",
"documentation": {}
},
{
"label": "os",
"kind": 6,
"isExtraImport": true,
"importPath": "os",
"description": "os",
"detail": "os",
"documentation": {}
},
{
"label": "posixpath",
"kind": 6,
@ -275,6 +249,15 @@
"detail": "code",
"documentation": {}
},
{
"label": "sys",
"kind": 6,
"isExtraImport": true,
"importPath": "sys",
"description": "sys",
"detail": "sys",
"documentation": {}
},
{
"label": "hashlib",
"kind": 6,
@ -1534,6 +1517,119 @@
"detail": "time",
"documentation": {}
},
{
"label": "migrations",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "models",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "migrations",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "models",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "migrations",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "models",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "migrations",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "models",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "migrations",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "models",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "migrations",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "models",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "models",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "django.db.models.deletion",
"kind": 6,
"isExtraImport": true,
"importPath": "django.db.models.deletion",
"description": "django.db.models.deletion",
"detail": "django.db.models.deletion",
"documentation": {}
},
{
"label": "admin",
"importPath": "django.contrib",
@ -1558,14 +1654,6 @@
"detail": "django.apps",
"documentation": {}
},
{
"label": "models",
"importPath": "django.db",
"description": "django.db",
"isExtraImport": true,
"detail": "django.db",
"documentation": {}
},
{
"label": "routers",
"importPath": "rest_framework",
@ -1761,87 +1849,6 @@
"detail": "django.core.wsgi",
"documentation": {}
},
{
"label": "bin_dir",
"kind": 5,
"importPath": ".venv.bin.activate_this",
"description": ".venv.bin.activate_this",
"peekOfCode": "bin_dir = os.path.dirname(abs_file)\nbase = bin_dir[: -len(\"bin\") - 1] # strip away the bin part from the __file__, plus the path separator\n# prepend bin to PATH (this file is inside the bin directory)\nos.environ[\"PATH\"] = os.pathsep.join([bin_dir, *os.environ.get(\"PATH\", \"\").split(os.pathsep)])\nos.environ[\"VIRTUAL_ENV\"] = base # virtual env is right above bin directory\nos.environ[\"VIRTUAL_ENV_PROMPT\"] = \"interactive-table-py3.10\" or os.path.basename(base) # noqa: SIM222\n# add the virtual environments libraries to the host python import mechanism\nprev_length = len(sys.path)\nfor lib in \"../lib/python3.10/site-packages\".split(os.pathsep):\n path = os.path.realpath(os.path.join(bin_dir, lib))",
"detail": ".venv.bin.activate_this",
"documentation": {}
},
{
"label": "base",
"kind": 5,
"importPath": ".venv.bin.activate_this",
"description": ".venv.bin.activate_this",
"peekOfCode": "base = bin_dir[: -len(\"bin\") - 1] # strip away the bin part from the __file__, plus the path separator\n# prepend bin to PATH (this file is inside the bin directory)\nos.environ[\"PATH\"] = os.pathsep.join([bin_dir, *os.environ.get(\"PATH\", \"\").split(os.pathsep)])\nos.environ[\"VIRTUAL_ENV\"] = base # virtual env is right above bin directory\nos.environ[\"VIRTUAL_ENV_PROMPT\"] = \"interactive-table-py3.10\" or os.path.basename(base) # noqa: SIM222\n# add the virtual environments libraries to the host python import mechanism\nprev_length = len(sys.path)\nfor lib in \"../lib/python3.10/site-packages\".split(os.pathsep):\n path = os.path.realpath(os.path.join(bin_dir, lib))\n site.addsitedir(path.decode(\"utf-8\") if \"\" else path)",
"detail": ".venv.bin.activate_this",
"documentation": {}
},
{
"label": "os.environ[\"PATH\"]",
"kind": 5,
"importPath": ".venv.bin.activate_this",
"description": ".venv.bin.activate_this",
"peekOfCode": "os.environ[\"PATH\"] = os.pathsep.join([bin_dir, *os.environ.get(\"PATH\", \"\").split(os.pathsep)])\nos.environ[\"VIRTUAL_ENV\"] = base # virtual env is right above bin directory\nos.environ[\"VIRTUAL_ENV_PROMPT\"] = \"interactive-table-py3.10\" or os.path.basename(base) # noqa: SIM222\n# add the virtual environments libraries to the host python import mechanism\nprev_length = len(sys.path)\nfor lib in \"../lib/python3.10/site-packages\".split(os.pathsep):\n path = os.path.realpath(os.path.join(bin_dir, lib))\n site.addsitedir(path.decode(\"utf-8\") if \"\" else path)\nsys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]\nsys.real_prefix = sys.prefix",
"detail": ".venv.bin.activate_this",
"documentation": {}
},
{
"label": "os.environ[\"VIRTUAL_ENV\"]",
"kind": 5,
"importPath": ".venv.bin.activate_this",
"description": ".venv.bin.activate_this",
"peekOfCode": "os.environ[\"VIRTUAL_ENV\"] = base # virtual env is right above bin directory\nos.environ[\"VIRTUAL_ENV_PROMPT\"] = \"interactive-table-py3.10\" or os.path.basename(base) # noqa: SIM222\n# add the virtual environments libraries to the host python import mechanism\nprev_length = len(sys.path)\nfor lib in \"../lib/python3.10/site-packages\".split(os.pathsep):\n path = os.path.realpath(os.path.join(bin_dir, lib))\n site.addsitedir(path.decode(\"utf-8\") if \"\" else path)\nsys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]\nsys.real_prefix = sys.prefix\nsys.prefix = base",
"detail": ".venv.bin.activate_this",
"documentation": {}
},
{
"label": "os.environ[\"VIRTUAL_ENV_PROMPT\"]",
"kind": 5,
"importPath": ".venv.bin.activate_this",
"description": ".venv.bin.activate_this",
"peekOfCode": "os.environ[\"VIRTUAL_ENV_PROMPT\"] = \"interactive-table-py3.10\" or os.path.basename(base) # noqa: SIM222\n# add the virtual environments libraries to the host python import mechanism\nprev_length = len(sys.path)\nfor lib in \"../lib/python3.10/site-packages\".split(os.pathsep):\n path = os.path.realpath(os.path.join(bin_dir, lib))\n site.addsitedir(path.decode(\"utf-8\") if \"\" else path)\nsys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]\nsys.real_prefix = sys.prefix\nsys.prefix = base",
"detail": ".venv.bin.activate_this",
"documentation": {}
},
{
"label": "prev_length",
"kind": 5,
"importPath": ".venv.bin.activate_this",
"description": ".venv.bin.activate_this",
"peekOfCode": "prev_length = len(sys.path)\nfor lib in \"../lib/python3.10/site-packages\".split(os.pathsep):\n path = os.path.realpath(os.path.join(bin_dir, lib))\n site.addsitedir(path.decode(\"utf-8\") if \"\" else path)\nsys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]\nsys.real_prefix = sys.prefix\nsys.prefix = base",
"detail": ".venv.bin.activate_this",
"documentation": {}
},
{
"label": "sys.path[:]",
"kind": 5,
"importPath": ".venv.bin.activate_this",
"description": ".venv.bin.activate_this",
"peekOfCode": "sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]\nsys.real_prefix = sys.prefix\nsys.prefix = base",
"detail": ".venv.bin.activate_this",
"documentation": {}
},
{
"label": "sys.real_prefix",
"kind": 5,
"importPath": ".venv.bin.activate_this",
"description": ".venv.bin.activate_this",
"peekOfCode": "sys.real_prefix = sys.prefix\nsys.prefix = base",
"detail": ".venv.bin.activate_this",
"documentation": {}
},
{
"label": "sys.prefix",
"kind": 5,
"importPath": ".venv.bin.activate_this",
"description": ".venv.bin.activate_this",
"peekOfCode": "sys.prefix = base",
"detail": ".venv.bin.activate_this",
"documentation": {}
},
{
"label": "_Known",
"kind": 6,
@ -8331,6 +8338,60 @@
"detail": "admin_front.node_modules.node-gyp.gyp.test_gyp",
"documentation": {}
},
{
"label": "Migration",
"kind": 6,
"importPath": "back.api.migrations.0001_initial",
"description": "back.api.migrations.0001_initial",
"peekOfCode": "class Migration(migrations.Migration):\n initial = True\n dependencies = [\n ]\n operations = [\n migrations.CreateModel(\n name='Floorplan',\n fields=[\n ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n ('title', models.CharField(max_length=200)),",
"detail": "back.api.migrations.0001_initial",
"documentation": {}
},
{
"label": "Migration",
"kind": 6,
"importPath": "back.api.migrations.0002_floorplan_d_border_floorplan_d_size_floorplan_paths",
"description": "back.api.migrations.0002_floorplan_d_border_floorplan_d_size_floorplan_paths",
"peekOfCode": "class Migration(migrations.Migration):\n dependencies = [\n ('api', '0001_initial'),\n ]\n operations = [\n migrations.AddField(\n model_name='floorplan',\n name='d_border',\n field=models.IntegerField(default=1),\n preserve_default=False,",
"detail": "back.api.migrations.0002_floorplan_d_border_floorplan_d_size_floorplan_paths",
"documentation": {}
},
{
"label": "Migration",
"kind": 6,
"importPath": "back.api.migrations.0003_alter_floorplan_paths",
"description": "back.api.migrations.0003_alter_floorplan_paths",
"peekOfCode": "class Migration(migrations.Migration):\n dependencies = [\n ('api', '0002_floorplan_d_border_floorplan_d_size_floorplan_paths'),\n ]\n operations = [\n migrations.AlterField(\n model_name='floorplan',\n name='paths',\n field=models.TextField(),\n ),",
"detail": "back.api.migrations.0003_alter_floorplan_paths",
"documentation": {}
},
{
"label": "Migration",
"kind": 6,
"importPath": "back.api.migrations.0004_alter_floorplan_d_border_alter_floorplan_d_size",
"description": "back.api.migrations.0004_alter_floorplan_d_border_alter_floorplan_d_size",
"peekOfCode": "class Migration(migrations.Migration):\n dependencies = [\n ('api', '0003_alter_floorplan_paths'),\n ]\n operations = [\n migrations.AlterField(\n model_name='floorplan',\n name='d_border',\n field=models.IntegerField(blank=True, null=True),\n ),",
"detail": "back.api.migrations.0004_alter_floorplan_d_border_alter_floorplan_d_size",
"documentation": {}
},
{
"label": "Migration",
"kind": 6,
"importPath": "back.api.migrations.0005_floorplanpoints",
"description": "back.api.migrations.0005_floorplanpoints",
"peekOfCode": "class Migration(migrations.Migration):\n dependencies = [\n ('api', '0004_alter_floorplan_d_border_alter_floorplan_d_size'),\n ]\n operations = [\n migrations.CreateModel(\n name='FloorplanPoints',\n fields=[\n ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n ('points', models.JSONField()),",
"detail": "back.api.migrations.0005_floorplanpoints",
"documentation": {}
},
{
"label": "Migration",
"kind": 6,
"importPath": "back.api.migrations.0006_remove_floorplanpoints_id_alter_floorplanpoints_plan",
"description": "back.api.migrations.0006_remove_floorplanpoints_id_alter_floorplanpoints_plan",
"peekOfCode": "class Migration(migrations.Migration):\n dependencies = [\n ('api', '0005_floorplanpoints'),\n ]\n operations = [\n migrations.RemoveField(\n model_name='floorplanpoints',\n name='id',\n ),\n migrations.AlterField(",
"detail": "back.api.migrations.0006_remove_floorplanpoints_id_alter_floorplanpoints_plan",
"documentation": {}
},
{
"label": "ApiConfig",
"kind": 6,

6
dev.sh
View File

@ -1,3 +1,3 @@
poetry run task admin_front_dev &
poetry run task front_dev &
poetry run task server
x-terminal-emulator -title "Interactive table Admin FRONT" -e "poetry run task admin_front_dev" &
x-terminal-emulator -title "Interactive table FRONT" -e "poetry run task front_dev" &
x-terminal-emulator -title "Interactive table BACK" -e "poetry run task server"

View File

@ -19,6 +19,9 @@ declare module 'vue' {
IMdiVideo3d: typeof import('~icons/mdi/video3d')['default']
Item: typeof import('./src/components/Floorplan/item.vue')['default']
Main: typeof import('./src/components/Promo/main.vue')['default']
Model: typeof import('./src/components/Promo/model.vue')['default']
ModelItem: typeof import('./src/components/Promo/modelItem.vue')['default']
Models: typeof import('./src/components/Promo/models.vue')['default']
Projects: typeof import('./src/components/Projects.vue')['default']
Promo: typeof import('./src/components/Promo/index.vue')['default']
RandomIcon: typeof import('./src/components/RandomIcon.vue')['default']

View File

@ -1,36 +1,9 @@
<script setup lang="ts">
import { useRouter } from 'vue-router';
import { shallowRef } from 'vue';
import { onUnmounted, reactive, ref } from 'vue';
import { TresCanvas, useRenderLoop } from '@tresjs/core';
import { CameraControls, FBXModel, PositionalAudio, useFBX, useProgress } from '@tresjs/cientos'
import { Sky } from '@tresjs/cientos'
import { reactive, } from 'vue';
import { TresCanvas } from '@tresjs/core';
import { CameraControls, useProgress } from '@tresjs/cientos'
import { Vector3 } from 'three';
import modelUrl from '../../assets/promo/models/sea_fbx/source/Stronghold.fbx'
import jeepUrl from '../../assets/promo/models/jeep.fbx'
import sceneUrl from '../../assets/promo/models/quadro/scene.fbx'
import andreyUrl from '../../assets/promo/models/quadro/andrey.fbx'
const andreyModel = await useFBX(andreyUrl)
import groundUrl from '../../assets/promo/models/quadro/ground.fbx'
const groundModel = await useFBX(groundUrl)
import mangalUrl from '../../assets/promo/models/quadro/mangal.fbx'
const mangalModel = await useFBX(mangalUrl)
import pillarUrl from '../../assets/promo/models/quadro/pillar.fbx'
const pillarModel = await useFBX(pillarUrl)
import pointerUrl from '../../assets/promo/models/quadro/pointer.fbx'
const pointerModel = await useFBX(pointerUrl)
import quadUrl from '../../assets/promo/models/quadro/quad.fbx'
const quadModel = await useFBX(quadUrl)
import skyUrl from '../../assets/promo/models/quadro/sky.fbx'
const skyModel = await useFBX(skyUrl)
import walkbayUrl from '../../assets/promo/models/quadro/walkway.fbx'
const walkbayModel = await useFBX(walkbayUrl)
import audioUrl from '../../assets/promo/sounds/sea.ogg'
const router = useRouter()
const minPan = new Vector3(-10, 1, -5);
const maxPan = new Vector3(5, 1, 5);
const _v = new Vector3();
@ -42,8 +15,8 @@ const onChange = (e: any) => {
e._camera.position.sub(_v);
}
const cameraPosition = [-6, 4, 25]
const lightPosition = [3, 3, 3]
const cameraPosition = [-6, 4, 25] as unknown as Vector3
const lightPosition = [3, 3, 3] as unknown as Vector3
const controlsState = reactive({
minDistance: 1,
@ -55,32 +28,6 @@ const controlsState = reactive({
const { hasFinishLoading, progress } = await useProgress()
const positionalAudioRef = shallowRef()
onUnmounted(() => {
positionalAudioRef?.value?.dispose()
})
const ducks: any[] = []
const ducksRef: any[] = []
const ducksObjectRef: any[] = []
for (let index = 0; index < 4; index++) {
const model = await useFBX(jeepUrl)
ducks.push(model)
ducksRef.push(ref())
ducksObjectRef.push(ref())
}
const { onLoop } = useRenderLoop()
onLoop(() => {
for (let index = 0; index < ducksRef.length; index++) {
const element = ducksRef[index];
if (element.value) {
element.value[0].rotation.y += 0.01 * (index + 1)
}
}
})
console.log(andreyModel)
</script>
<template>
<div :class="[{ 'invisible': !!hasFinishLoading }, 'loader']">
@ -90,18 +37,9 @@ console.log(andreyModel)
<TresCanvas window-size alpha shadows clear-color="#87ceeb">
<TresPerspectiveCamera :position="cameraPosition" />
<CameraControls v-bind="controlsState" @change="onChange" make-default />
<TresMesh :position="[0, 0, 0]" @click="()=>{console.log('dd')}">
<primitive :object="andreyModel" />
</TresMesh>
<primitive :object="mangalModel" />
<primitive :object="pillarModel" />
<primitive :object="pointerModel" />
<primitive :object="quadModel" />
<primitive :object="walkbayModel" />
<primitive :object="groundModel" />
<primitive :object="skyModel" />
<Suspense>
<Models />
</Suspense>
<TresDirectionalLight :position="lightPosition" :intensity="5" />
<TresAmbientLight />
</TresCanvas>

View File

@ -0,0 +1,29 @@
<script setup lang="ts">
import { Box3, Vector3 } from 'three';
import { useFBX, } from '@tresjs/cientos'
const props = defineProps(['modelUrl', 'onClick'])
const model = await useFBX(props.modelUrl)
const box = new Box3();
box.expandByObject(model.children[0]);
let center = new Vector3();
box.getCenter(center)
let size = new Vector3();
box.getSize(size)
const show_alert= ()=>{
alert(props.modelUrl)
}
</script>
<template>
<TresGroup :posiion="[0, 0, 0]">
<TresMesh :position="center"
@click="show_alert">
<TresBoxGeometry :args="size" />
<TresMeshBasicMaterial :opacity="0" :transparent="true" />
</TresMesh>
<TresMesh>
<primitive :object="model" />
</TresMesh>
</TresGroup>
</template>

View File

@ -0,0 +1,30 @@
<script setup lang="ts">
import { useFBX, } from '@tresjs/cientos'
import andreyUrl from '../../assets/promo/models/quadro/andrey.fbx'
import groundUrl from '../../assets/promo/models/quadro/ground.fbx'
import mangalUrl from '../../assets/promo/models/quadro/mangal.fbx'
import pillarUrl from '../../assets/promo/models/quadro/pillar.fbx'
import pointerUrl from '../../assets/promo/models/quadro/pointer.fbx'
import quadUrl from '../../assets/promo/models/quadro/quad.fbx'
import skyUrl from '../../assets/promo/models/quadro/sky.fbx'
import walkbayUrl from '../../assets/promo/models/quadro/walkway.fbx'
const quadModel = await useFBX(quadUrl)
const groundModel = await useFBX(groundUrl)
const skyModel = await useFBX(skyUrl)
</script>
<template>
<TresGroup>
<ModelItem :modelUrl="andreyUrl" />
<ModelItem :modelUrl="mangalUrl" />
<ModelItem :modelUrl="pillarUrl" />
<ModelItem :modelUrl="pointerUrl" />
<!-- <primitive :object="quadModel" /> -->
<ModelItem :modelUrl="walkbayUrl" />
<!-- <primitive :object="groundModel" /> -->
<primitive :object="skyModel" />
</TresGroup>
</template>