feat: 点云数据修改

main
JINGYJ 2 weeks ago
parent 663bbeb2a6
commit 6256295c81

@ -103,6 +103,11 @@ const activeIndex = ref(-1);
const swiperRef = ref(null); const swiperRef = ref(null);
const isPointOpen = ref<Boolean>(false); // const isPointOpen = ref<Boolean>(false); //
const columns = [ const columns = [
{
label: "站点",
property: "is_reviewed",
width: 60,
},
{ {
label: "车号", label: "车号",
property: "train_number", property: "train_number",
@ -133,16 +138,16 @@ const columns = [
property: "level", property: "level",
width: 60, width: 60,
}, },
{ // {
label: "复核", // label: "",
property: "is_reviewed", // property: "is_reviewed",
formatter: ({ is_reviewed }) => { // formatter: ({ is_reviewed }) => {
return is_reviewed === true // return is_reviewed === true
? "是" // ? ""
: "否"; // : "";
}, // },
width: 60, // width: 60,
}, // },
{ {
label: "时间", label: "时间",
property: "created_at", property: "created_at",

@ -120,7 +120,7 @@ const onDialogOpened = () => {
// false // false
loading.value = false; loading.value = false;
// //
pointCloud.position.set(0, 300, 0); pointCloud.position.set(0, 100, 0);
// //
const geometry = pointCloud.geometry; const geometry = pointCloud.geometry;
@ -131,8 +131,9 @@ const onDialogOpened = () => {
const numPoints = positions.length / 3; const numPoints = positions.length / 3;
// //
const startColor = new THREE.Color(0x00ff00); // 绿 const startColor = new THREE.Color(0x0000ff); //
const midColor = new THREE.Color(0xffff00); // const midColor1 = new THREE.Color(0x00ff00); // 绿
const midColor2 = new THREE.Color(0xffff00); //
const endColor = new THREE.Color(0xff0000); // const endColor = new THREE.Color(0xff0000); //
// z // z
@ -150,20 +151,23 @@ const onDialogOpened = () => {
const factor = (z - minZ) / (maxZ - minZ); const factor = (z - minZ) / (maxZ - minZ);
let color; let color;
if (factor < 0.5) { if (factor < 0.33) {
// 绿
const subFactor = factor / 0.33;
color = startColor.clone().lerp(midColor1, subFactor);
} else if (factor < 0.66) {
// 绿 // 绿
const subFactor = factor * 2; const subFactor = (factor - 0.33) / 0.33;
color = startColor.clone().lerp(midColor, subFactor); color = midColor1.clone().lerp(midColor2, subFactor);
} else { } else {
// //
const subFactor = (factor - 0.5) * 2; const subFactor = (factor - 0.66) / 0.34;
color = midColor.clone().lerp(endColor, subFactor); color = midColor2.clone().lerp(endColor, subFactor);
} }
// //
colors.push(color.r, color.g, color.b); colors.push(color.r, color.g, color.b);
} }
// //
const colorAttribute = new THREE.Float32BufferAttribute(colors, 3); const colorAttribute = new THREE.Float32BufferAttribute(colors, 3);
geometry.setAttribute('color', colorAttribute); geometry.setAttribute('color', colorAttribute);

Loading…
Cancel
Save