diff --git a/src/assets/images/conveyor/shapes/arrow-right.svg b/src/assets/images/conveyor/shapes/arrow-right.svg
new file mode 100644
index 0000000..1e84bea
--- /dev/null
+++ b/src/assets/images/conveyor/shapes/arrow-right.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/images/conveyor/shapes/move.svg b/src/assets/images/conveyor/shapes/move.svg
new file mode 100644
index 0000000..ca40a24
--- /dev/null
+++ b/src/assets/images/conveyor/shapes/move.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/designer/model3DView/Model3DView.vue b/src/designer/model3DView/Model3DView.vue
index 2adf674..a9fa332 100644
--- a/src/designer/model3DView/Model3DView.vue
+++ b/src/designer/model3DView/Model3DView.vue
@@ -85,6 +85,10 @@ import Split from '@/components/split/split.vue'
import SplitArea from '@/components/split/split-area.vue'
import { renderIcon } from '@/utils/webutils.js'
import textureUrl from '@/assets/images/conveyor/shapes/RibSideSkirtThumbnail.jpg'
+import textureUrl2 from '@/assets/images/conveyor/shapes/logo.png'
+import moveUrl from '@/assets/images/conveyor/shapes/move.svg'
+import arrowRightUrl from '@/assets/images/conveyor/shapes/arrow-right.svg'
+// import pointImg from '@/assets/images/logo.png' arrow-right.svg
// DOM refs
const canvasContainer = ref(null)
@@ -165,7 +169,7 @@ watch(() => restate.mode, (newVal) => {
}
})
-function addConveyor(){
+function addConveyor(){//输送线
// 1. 创建几何体:长 10 米,宽 0.8 米
const length = 20; // 长度 (X轴)
const width = 0.8; // 宽度 (Y轴)
@@ -202,8 +206,11 @@ function addConveyor(){
// 放置到合适的位置(如果需要)
conveyorBelt.position.y = height / 2; // 让底部贴地
+ // // 示例:在输送线不同位置添加多个标记
+ addMarkerAt(-9.5, height,0,moveUrl); // 起点
+ addMarkerAt(0, height,0,arrowRightUrl); // 中间
+ addMarkerAt(9.5, height,0,moveUrl); // 终点
scene.add(conveyorBelt)
-
// 动画函数
let offsetSpeed = 0.01; // 控制滚动速度
function animate() {
@@ -225,8 +232,32 @@ function addConveyor(){
}
animate();
});
+}
-
+function addMarkerAt(x, y,z,textUrl, scale = 1) {
+ const loader = new THREE.TextureLoader();
+ loader.load(textUrl, (texture) => {
+ // 创建一个平面作为标记(大小可以调整)
+ const markerGeometry = new THREE.PlaneGeometry(.6 * scale, 0.5 * scale); // 宽高比例保持一致
+
+ const markerMaterial = new THREE.MeshBasicMaterial({
+ map: texture,
+ transparent: true,
+ opacity: 1,
+ depthWrite: false,
+ side: THREE.DoubleSide
+ });
+
+ const marker = new THREE.Mesh(markerGeometry, markerMaterial);
+ let yHeight=y+0.01
+ // 设置位置:位于输送线表面(Y轴略高于输送线一点)
+ marker.position.set(x, yHeight, z); // Y = 输送线高度 + 一点间距
+
+ // 旋转为 X/Z 平面方向(与输送线一致)
+ marker.rotation.x = -Math.PI / 2; // 和 conveyorBelt 一样旋转角度
+ marker.rotation.z = Math.PI / 2; // 在平面上旋转 90 度
+ scene.add(marker);
+ });
}
function initThree() {