1
This commit is contained in:
52
index.html
52
index.html
@ -512,6 +512,7 @@
|
||||
if (enable_placement_zone) {
|
||||
sku = currentText;
|
||||
await placementWall(divisions);
|
||||
//await initPlacementZoneConfig(divisions);
|
||||
}
|
||||
}
|
||||
|
||||
@ -793,50 +794,49 @@
|
||||
}
|
||||
});
|
||||
|
||||
const placementWall = (divisions) => {
|
||||
// 初始化放置区域配置数据(只需设置一次)
|
||||
const initPlacementZoneConfig = (divisions) => {
|
||||
|
||||
// 只清除旧的放置区域网格,不清除模型
|
||||
kernel.dropZone.clearZones();
|
||||
|
||||
// 生成新的放置区域(使用新的墙面参数化API)
|
||||
// 调整 baseY 来控制整体高度(正数向上,负数向下)
|
||||
const baseY = 0.08; // 修改这个值来调整整体高度
|
||||
|
||||
const baseY = 0.09; // 修改这个值来调整整体高度
|
||||
const height = 2.27;
|
||||
// 调整 offset 来控制每个面向外或向内的偏移
|
||||
// 正数 = 向外移动,负数 = 向内移动
|
||||
const wallOffset = -0.07; // 修改这个值来调整墙面偏移
|
||||
|
||||
kernel.dropZone.generate({
|
||||
kernel.dropZone.setData({
|
||||
walls: [
|
||||
{
|
||||
name: 'front',
|
||||
startPoint: [-1.43, baseY, -1.4],
|
||||
endPoint: [1.37, baseY, -1.4],
|
||||
height: 2.2,
|
||||
startPoint: [-1.82, baseY, -1.37],
|
||||
endPoint: [1.87, baseY, -1.37],
|
||||
height: height,
|
||||
divisions: divisions,
|
||||
offset: wallOffset // 向外或向内偏移
|
||||
},
|
||||
{
|
||||
name: 'back',
|
||||
startPoint: [1.37, baseY, 1.4],
|
||||
endPoint: [-1.43, baseY, 1.4],
|
||||
height: 2.2,
|
||||
startPoint: [1.87, baseY, 1.4],
|
||||
endPoint: [-1.82, baseY, 1.4],
|
||||
height: height,
|
||||
divisions: divisions,
|
||||
offset: wallOffset
|
||||
},
|
||||
{
|
||||
name: 'left',
|
||||
startPoint: [-1.43, baseY, 1.4],
|
||||
endPoint: [-1.43, baseY, -1.43],
|
||||
height: 2.2,
|
||||
startPoint: [-1.82, baseY, 1.4],
|
||||
endPoint: [-1.82, baseY, -1.37],
|
||||
height: height,
|
||||
divisions: divisions,
|
||||
offset: wallOffset
|
||||
},
|
||||
{
|
||||
name: 'right',
|
||||
startPoint: [1.37, baseY, -1.43],
|
||||
endPoint: [1.37, baseY, 1.4],
|
||||
height: 2.2,
|
||||
startPoint: [1.82, baseY, -1.37],
|
||||
endPoint: [1.82, baseY, 1.4],
|
||||
height: height,
|
||||
divisions: divisions,
|
||||
offset: wallOffset
|
||||
}
|
||||
@ -848,8 +848,22 @@
|
||||
borderColor: "#ffffff"
|
||||
});
|
||||
|
||||
kernel.dropZone.generateDropZones(divisions);
|
||||
// 显示放置区域
|
||||
kernel.dropZone.showAll();
|
||||
kernel.dropZone.show();
|
||||
dropZoneVisible = true;
|
||||
};
|
||||
|
||||
|
||||
const placementWall = (divisions) => {
|
||||
// 只清除旧的放置区域网格,不清除模型
|
||||
kernel.dropZone.clearZones();
|
||||
|
||||
// 使用新的 API:只传入分割数量
|
||||
kernel.dropZone.generateDropZones(divisions);
|
||||
|
||||
// 显示放置区域
|
||||
kernel.dropZone.show();
|
||||
dropZoneVisible = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user