水库大坝三维模型的开发和使用3Dmax篇

成果图
在这里插入图片描述
开发过程

  • 工具插件three.js
  • 先加载模型
  • 做水体衔接
  • 水位测量标尺
  • 水位标记
  • 断面标记
  • 大坝监测点打点

上代码,技术交流+V: bloxed

<template>
  <div class="box w100 h100">
    <el-row :gutter="20"  v-loading="loading"
      element-loading-background="rgba(122, 122, 122, 0.8)"
        element-loading-text="模型加载中...">
      <el-col :span="24" class="h100" ref="boxRef">
        <div id="container" ref="container"></div>
      </el-col>
    </el-row>
        
  </div>
</template>
<script setup lang="ts">
import * as THREE from 'three';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import {OrbitControls} from "three/addons/controls/OrbitControls";
import { Water } from 'three/examples/jsm/objects/Water.js';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
import { FontLoader } from 'three/examples/jsm/loaders/FontLoader';
import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry';
import  TWEEN  from '@tweenjs/tween.js';
import {  CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer.js';
import { instrumentList,waterData,getTooltipData} from "../index.api"
const props = defineProps({
    damId:{
        type:Number,
        default:1
    },
    epcId:{
        type:String,
        default:""
    }
})
const boxRef = ref<any>(null);
const loading = ref(false);
let scene:any;
let textMesh:any;
let textMeshs:any =[];
let rectMeshs:any =[];
const camera = ref<any>(null);
let water:any;
const renderer = ref<any>(null);
const  container = ref<any>(null);
const  controls  = ref<any>(null);
const loaderT = new FontLoader();
import { useAppStore} from "@/store";
import { set } from '@vueuse/core';
const appStore = useAppStore();
//label ref
const dam_top_heightRef = ref<any>(null);
const tooltipData = ref<any>([])
//刻度尺
const acalesText = [
  {id:0,value:"校核洪水位:80.6m",x:-175,y:0,z:-130,color:0xFF0000},
  {id:0,value:"设计洪水位:80.6m",x:-175,y:-10,z:-130,color:0xFFFF00},
  {id:0,value:"正常水位:80.6m",x:-175,y:-20,z:-130,color:0x00FF00},
  {id:0,value:"当前水位:80.6m",x:-175,y:-49,z:-130,color:0xfffffff},
  {id:0,value:"死水位:80.6m",x:-175,y:-39,z:-130,color:0xfffffff},

  {id:1,value:"50",x:-224,y:-100,z:-130,color:0xfffffff},
  {id:2,value:"60",x:-224,y:-80,z:-130,color:0xfffffff},
  {id:3,value:"70",x:-224,y:-60,z:-130,color:0xfffffff},
  {id:4,value:"80",x:-224,y:-40,z:-130,color:0xfffffff},
  {id:5,value:"90",x:-224,y:-20,z:-130,color:0xfffffff},
  {id:6,value:"100m",x:-224,y:-0,z:-130,color:0xfffffff},
];
const  rectangles = [
  //坝顶高程
{id:0,width:48,height:16,x:-20,y:40,z:175,color:0x367DF9 },
//B09
{id:0,width:30,height:10,x:-30,y:0,z:80,color:0x367DF9 },
{id:0,width:30,height:10,x:-30,y:0,z:-30,color:0x367DF9 },
{id:0,width:30,height:10,x:-30,y:0,z:-100,color:0x367DF9 },

//B10
{id:0,width:30,height:10,x:20,y:-20,z:80,color:0x367DF9 },
{id:0,width:30,height:10,x:20,y:-20,z:-30,color:0x367DF9 },
{id:0,width:30,height:10,x:20,y:-20,z:-100,color:0x367DF9 },

//B11
{id:0,width:30,height:10,x:80,y:-30,z:80,color:0x367DF9 },
{id:0,width:30,height:10,x:80,y:-30,z:-30,color:0x367DF9 },
{id:0,width:30,height:10,x:80,y:-30,z:-100,color:0x367DF9 },
];
//label标签
const labels = [
  {id:"damTop",value:"坝顶高程:98.6m",x:-20,y:40,z:175,color:0xfffffff},

  {id:"B09",value:"B09:0mm",x:-30,y:0,z:80,color:0xfffffff},
  {id:"B05",value:"B05:0mm",x:-30,y:0,z:-30,color:0xfffffff},
  {id:"B01",value:"B01:0mm",x:-30,y:0,z:-100,color:0xfffffff},

  {id:"B10",value:"B10:0mm",x:20,y:-20,z:80,color:0xfffffff},
  {id:"B06",value:"B06:0mm",x:20,y:-20,z:-30,color:0xfffffff},
  {id:"B02",value:"B02:0mm",x:20,y:-20,z:-100,color:0xfffffff},

  {id:"B11",value:"B11:0mm",x:80,y:-30,z:80,color:0xfffffff},
  {id:"B07",value:"B7:0mm",x:80,y:-30,z:-30,color:0xfffffff},
  {id:"B03",value:"B3:0mm",x:80,y:-30,z:-100,color:0xfffffff},
  //断面
  {id:3,value:"断面:B0+027",x:-80,y:-30,z:-100,color:0xfffffff},
  {id:3,value:"断面:B0+050",x:-80,y:-30,z:-30,color:0xfffffff},
  {id:3,value:"断面:B0+073",x:-80,y:-30,z:80,color:0xfffffff},
]
//label标签线
const labelsLine = [
  {id:0,x:-10,y:35,z:175, x1:-10,y1:-50,z1:175,  color:0x00FFff},
  // B09
  {id:1,x:-30,y:0,z:80, x1:-30,y1:-50,z1:80,  color:0x00FFff},
  {id:2,x:-30,y:0,z:-30, x1:-30,y1:-50,z1:-30,  color:0x00FFff},
  {id:3,x:-22,y:0,z:-100, x1:-22,y1:-50,z1:-100,  color:0x00FFff},
  //B10
  {id:1,x:20,y:-20,z:80, x1:20,y1:-50,z1:80,  color:0x00FFff},
  {id:2,x:20,y:-20,z:-30, x1:20,y1:-50,z1:-30,  color:0x00FFff},
  {id:3,x:20,y:-20,z:-100, x1:20,y1:-50,z1:-100,  color:0x00FFff},
  //B11
  {id:4,x:80,y:-30,z:80, x1:80,y1:-80,z1:80,  color:0x00FFff},
  {id:5,x:80,y:-30,z:-30, x1:80,y1:-80,z1:-30,  color:0x00FFff},
  {id:6,x:80,y:-30,z:-100, x1:80,y1:-80,z1:-100,  color:0x00FFff},

  //断面
  {id:7,x:-100,y:-34,z:-100, x1:-22,y1:-34,z1:-100,  color:0x00FFff},
  {id:7,x:-100,y:-34,z:-30, x1:-32,y1:-34,z1:-30,  color:0x00FFff},
  {id:7,x:-100,y:-34,z:80, x1:-32,y1:-34,z1:80,  color:0x00FFff},

]
const labelTwoLines =[
{ id:0,
  x:-153,y:-3,z:-130,
  x1:-200,y1:-5,z1:-130,
  x2:-215,y2:-9,z2:-130,
  color:0xFF0000
},
{ id:0,
  x:-153,y:-13,z:-130,
  x1:-200,y1:-14,z1:-130,
  x2:-215,y2:-11,z2:-130,
  color:0xFFFF00
},
]
onMounted(() => {
  
})

  const initPage = async ()=>{
    loading.value = true;
    initScene();
    initCamera();
    initRenderer();
    initControl();
    initWater();
    await initModel();
    await initLine();
    await addText();
    await addLabelLine();
    await addLabelTwoLine();
    initRectangle();
    flyToCamera();
    initAnimate();
    initAddClick();
  }
  // Create the scene
  const initScene = ()=>{
      scene = new THREE.Scene();
    };
// Create the camera
    const initCamera= ()=>{
    camera.value = new THREE.PerspectiveCamera(45,1153 / 819, 0.1, 1000);
    camera.value.position.set(-163,143,-508);
  };
 // Create the renderer
  const initRenderer =()=>{
      renderer.value = new THREE.WebGLRenderer({ antialias: true });
      renderer.value.setSize(container.value.clientWidth, container.value.clientHeight);
      renderer.value.setClearColor('#03243f', 0.1);
      renderer.value.domElement.style.position = "absolute";
      renderer.value.domElement.style.top = "-160px";
      renderer.value.domElement.style.left = "-60px";
      container.value.appendChild(renderer.value.domElement);
    };
    const initControl = ()=>{
      controls.value = new OrbitControls(camera.value, renderer.value.domElement);
      controls.value.enableDamping = true;
      // // 最大角度
      controls.value.maxPolarAngle = Math.PI / 2.2;
    };
    // 创建Raycaster实例
    const raycaster = new THREE.Raycaster();
    const mouse = new THREE.Vector2();
    const initAnimate = ()=> {
      
      water.material.uniforms["time"].value += 1.0 / 60.0;
      requestAnimationFrame(initAnimate);
      renderer.value.render(scene, camera.value);
      controls.value.update();
      textMeshs.forEach((mesh:any)=>{
        mesh.lookAt(camera.value.position)
      })
      rectMeshs.forEach((mesh:any)=>{
        mesh.lookAt(camera.value.position)
      })
      TWEEN.update();
      // console.log('Camera Position:', camera.value.position);
      
    };
    const initWater = ()=>{
      const waterGeometry = new THREE.BoxGeometry(200, 280,35);
      water = new Water(
          waterGeometry,
          {
            textureWidth: 512,
            textureHeight: 512,
            waterNormals: new THREE.TextureLoader().load('/3D/water.jpeg', function (texture:any) {
              texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
            }),
            sunDirection: new THREE.Vector3(),
            sunColor: 0x007FFF,
            waterColor: 0x007FFF,
            distortionScale: 3.7,
          }
      );
      water.rotation.x = - Math.PI / 2;
      water.position.x = -114;
      water.position.y = -81.5;
      water.position.z = 10;
      scene.add(water)
    };
 
 
    const initLine = ()=>{
      const axisMaterial = new THREE.LineBasicMaterial({ color: 0xffffff }); // Blue for X
      const yAxisMaterial = new THREE.LineBasicMaterial({ color: 0xff0000  }); // Red for Y
      const zAxisMaterial = new THREE.LineBasicMaterial({ color: 0xffff }); // Green for Z
      // Create the geometry for the axes
    const axisGeometry = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-110, -140, -182.2),
        new THREE.Vector3(-11, -140, -182.2)
    ]);
    
 
    const yAxisGeometry = new THREE.BufferGeometry().setFromPoints([
    new THREE.Vector3(-215, 0, -130),
    new THREE.Vector3(-215, -100, -130)
    ]);
 
    const zAxisGeometry = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(19, 0, -22.2),
        new THREE.Vector3(19, 0, 5)
    ]);
    //begin 这里用作刻度线
    //水位使用
    const zAxisGeometry0 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-160, -60, -130),
        new THREE.Vector3(-214, -60, -130)
    ]);


    const zAxisGeometry1 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-210, -100, -130),
        new THREE.Vector3(-215, -100, -130)
    ]);
    const zAxisGeometry11 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-210, -90, -130),
        new THREE.Vector3(-215, -90, -130)
    ]);
    const zAxisGeometry2 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-205, -80, -130),
        new THREE.Vector3(-215, -80, -130)
    ]);
    const zAxisGeometry22 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-210, -70, -130),
        new THREE.Vector3(-215, -70, -130)
    ]);
    const zAxisGeometry3 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-205, -50, -130),
        new THREE.Vector3(-215, -50, -130)
    ]);
    const zAxisGeometry33 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-210, -40, -130),
        new THREE.Vector3(-215, -40, -130)
    ]);
    const zAxisGeometry4 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-205, -30, -130),
        new THREE.Vector3(-215, -30, -130)
    ]);
    const zAxisGeometry44 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-210, -20, -130),
        new THREE.Vector3(-215, -20, -130)
    ]);
    const zAxisGeometry5 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-205, -10, -130),
        new THREE.Vector3(-215, -10, -130)
    ]);
    const zAxisGeometry55 = new THREE.BufferGeometry().setFromPoints([
        new THREE.Vector3(-210, 0, -130),
        new THREE.Vector3(-215, 0, -130)
    ]);
    
    //end 
     // Create the line segments for the axes
     const axis = new THREE.Line(axisGeometry, axisMaterial);

     
    const yAxis = new THREE.Line(yAxisGeometry, yAxisMaterial);
    const zAxis = new THREE.Line(zAxisGeometry, zAxisMaterial);
    //begin 这里用作刻度线
    const zAxis0 = new THREE.Line(zAxisGeometry0, axisMaterial);
    const zAxis1 = new THREE.Line(zAxisGeometry1, axisMaterial);
    const zAxis2 = new THREE.Line(zAxisGeometry2, axisMaterial);
    const zAxis3 = new THREE.Line(zAxisGeometry3, axisMaterial);
    const zAxis4 = new THREE.Line(zAxisGeometry4, axisMaterial);
    const zAxis11 = new THREE.Line(zAxisGeometry11, axisMaterial);
    const zAxis22 = new THREE.Line(zAxisGeometry22, axisMaterial);
    const zAxis33 = new THREE.Line(zAxisGeometry33, axisMaterial);
    const zAxis44 = new THREE.Line(zAxisGeometry44, axisMaterial);
    const zAxis5 = new THREE.Line(zAxisGeometry5, axisMaterial);
    const zAxis55 = new THREE.Line(zAxisGeometry55, axisMaterial);
     //end
      // scene.add(axis);
      
      scene.add(yAxis);
      // scene.add(zAxis);
      //begin 这里用作刻度线
      scene.add(zAxis0);

      scene.add(zAxis1);
      scene.add(zAxis2);
      scene.add(zAxis3);
      scene.add(zAxis4);
      scene.add(zAxis5);
      scene.add(zAxis11);
      scene.add(zAxis22);
      scene.add(zAxis33);
      scene.add(zAxis44);
      scene.add(zAxis55);
      //end
    }
  const addText =()=> {
	loaderT.load(
		// font资源URL
		'/3D/HONOR_Sans_CN_Regular.json',
		// onLoad回调
		function (font:any) {
      acalesText.forEach(item=>{
        const textGeometry = new TextGeometry(item.value, {
          font: font,
          size: 3.5, // 字体大小
          height: 10, // 挤出文本的厚度
        })
        textGeometry.center() // 居中文本
        const materials = new THREE.MeshBasicMaterial({
          color: item.color || 0xfffffff,
          transparent: true,
          opacity: 0.9,
        })
        textMesh = new THREE.Mesh(textGeometry, materials)
        textMesh.position.set(item.x,item.y, item.z)
        textMeshs.push(textMesh)
        scene.add(textMesh)
      })

      labels.forEach(item=>{
        const textGeometry = new TextGeometry(item.value, {
          font: font,
          size: 4, // 字体大小
          height: 10, // 挤出文本的厚度
        })
        textGeometry.center() // 居中文本
        const materials = new THREE.MeshBasicMaterial({
          color: item.color || 0xfffffff,
          transparent: true,
          opacity: 0.9,
        })
        textMesh = new THREE.Mesh(textGeometry, materials)
        textMesh.position.set(item.x,item.y, item.z)
        textMeshs.push(textMesh)
        scene.add(textMesh)
      })
			
		}
	)
}
const addLabelLine = ()=>{
  labelsLine.forEach(item=>{
    const lineGeometry = new THREE.BufferGeometry().setFromPoints([
      new THREE.Vector3(item.x,item.y, item.z),
      new THREE.Vector3(item.x1,item.y1, item.z1)
    ]);
    const lineMaterial = new THREE.LineBasicMaterial({ color: item.color || 0xfffffff });
    const line = new THREE.Line(lineGeometry, lineMaterial);
    scene.add(line)
  })
}
//添加拐角线
const addLabelTwoLine = ()=>{
  labelTwoLines.forEach(item=>{
    const lineGeometry = new THREE.BufferGeometry().setFromPoints([
      new THREE.Vector3(item.x,item.y, item.z),
      new THREE.Vector3(item.x1,item.y1, item.z1),
      new THREE.Vector3(item.x2,item.y2, item.z2)
    ]);
    const lineMaterial = new THREE.LineBasicMaterial({ color: item.color || 0xfffffff });
    const line = new THREE.Line(lineGeometry, lineMaterial);
    scene.add(line)
  })
}

const initModel = ()=>{
      // 加载.glb模型
    const loader = new GLTFLoader();
    const dracoLoader = new DRACOLoader();
    dracoLoader.setDecoderPath('/draco/'); // 指定Decoder的路径
    loader.setDRACOLoader(dracoLoader);
    loader.load('/3D/zhuba.glb', (gltf:any) => {
      //解决加载进来为黑色的情况
      const ambientLight = new THREE.AmbientLight(0xffffff, 1); // 白光,强度为1
        scene.add(ambientLight);
        const dirLight = new THREE.DirectionalLight('rgb(253,253,253)', 5);
        dirLight.position.set(10, 10, 5); // 根据需要自行调整位置
        scene.add(dirLight);
        gltf.scene.name = 'dam_model'
      scene.add(gltf.scene);
      setTimeout(()=>{
      loading.value = false;
    },1100)
    }, undefined, (error:any) => {
      console.error(error);
    });
}
const initRectangle =() =>{
  rectangles.forEach(item=>{
    const geometry = new THREE.PlaneGeometry( item.width, item.height );
    const material = new THREE.MeshBasicMaterial( {color: item.color, transparent: true, opacity: 1} );
    const plane = new THREE.Mesh( geometry, material );
    plane.position.set(item.x, item.y, item.z)
    rectMeshs.push(plane)
    scene.add( plane );
  })
} 
const flyToCamera = ()=>{
   
}
const initAddClick = ()=>{
  //点击事件
  renderer.value.domElement.addEventListener('click', function (e:any) {
    //获取点击位置
    const mouse = new THREE.Vector2();
    mouse.x = (e.clientX / window.innerWidth) * 2 - 1;
    mouse.y = -(e.clientY / window.innerHeight) * 2 + 1;
    //创建射线
    const raycaster = new THREE.Raycaster();
    // 更新Raycaster的射线方向
    raycaster.setFromCamera(mouse, camera.value);
     // 假设你想要获取与场景中所有对象的交点
  // 注意:intersectObjects会返回一个包含所有交点的数组
    const intersects = raycaster.intersectObjects(scene.children, true); // 第二个参数为true表示递归检查所有子对象
 
    if (intersects.length > 0) {
      // 获取最近的交点(通常是数组中的第一个元素)
      const intersect = intersects[0];

      // intersect.point就是你在3D空间中点击的位置
      console.log('Clicked point in 3D space:', intersect.point);

      // 如果你想要获取被点击对象的详细信息,可以使用intersect.object
      console.log('Clicked object:', intersect.object);
    } else {
      console.log('No objects intersected by the ray.');
    }
  })
}
const  getwaterInfo = async()=>{
  const res = await waterData({
    epcId:appStore.epc.epcId
  })
  labels[0].value = "坝顶高程:" + res.damTop + 'm';
  acalesText[0].value = "校核洪水位:" + res.checkZ + 'm';
  acalesText[1].value = "设计洪水位:" + res.designZ + 'm';
  acalesText[2].value = "正常水位:" + res.normalZ + 'm';
  acalesText[3].value = "当前水位:" + (res.z ?? 0) + 'm';
  acalesText[4].value = "死水位:" + res.deadZ + 'm';
}
const getItemData = async()=>{
    const res = await getTooltipData({
        damId:props.damId,
        epcId:props.epcId
    })
    tooltipData.value = res;

}
onMounted(async() => {
  
  await getwaterInfo();
  initPage();
})


</script>
<style lang="scss" scoped>
  #container{
    width: 100%;
    height: calc(100vh - 100px);
    background-image: url("./bg.png");
    background-size: cover;
  }
  .box{
    overflow: hidden;
    height: calc(100vh - 100px);
  }
</style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/942613.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Win10提示“缺少fbgemm.dll”怎么办?缺失fbgemm.dll文件的修复方法来啦!

fbgemm.dll文件的作用 fbgemm.dll&#xff08;Facebook GEMM library&#xff09;是一个动态链接库文件&#xff0c;它主要用于优化矩阵乘法运算&#xff0c;提高计算性能。虽然它不是Windows 10系统的核心组件&#xff0c;但在某些应用程序或游戏中&#xff0c;尤其是那些需要…

Petalinux使用QSPI FLASH引导启动

目录 1. 预分配Flash空间 1.1 大小估计 1.2 其他注意事项 2. 配置Flash分区 3. 配置各主要文件在Flash中的地址范围 4. 配置boot.scr的偏移 5. 修改U-Boot环境变量在Flash的偏移量 6. 配置设备树中的Flash 7. 开启对EXT4分区管理的支持(根据需要) 8. 编译u-boot 9.…

Android——自定义按钮button

项目中经常高频使用按钮&#xff0c;要求&#xff1a;可设置颜色&#xff0c;有圆角且有按下效果的Button 一、自定义按钮button button的代码为 package com.fslihua.clickeffectimport android.annotation.SuppressLint import android.content.Context import android.gra…

黑龙江等保测评费用怎么收?

‌黑龙江二级等保测评费用‌&#xff1a;费用区间大致在3万至6万人民币之间&#xff0c;具体费用取决于测评机构的定价策略、所提供的服务内容以及企业的实际需求‌&#xff0c;服务内容包括防火墙、Web应用防火墙(WAF)、堡垒机、日志审计、漏洞扫描以及等保安全整改等‌。 ‌…

中文拼写检测纠正 Read, Listen, and See Leveraging Multimodal Information 论文

拼写纠正系列 NLP 中文拼写检测实现思路 NLP 中文拼写检测纠正算法整理 NLP 英文拼写算法&#xff0c;如果提升 100W 倍的性能&#xff1f; NLP 中文拼写检测纠正 Paper java 实现中英文拼写检查和错误纠正&#xff1f;可我只会写 CRUD 啊&#xff01; 一个提升英文单词拼…

vue2 elementui if导致的rules判断失效

优化目标 和 目标转化出价必填的 切换的时候还会隐藏掉 这时候的if语句会导致rules判断失效 我的办法是把判断拉到外面 别放在el-form-item里 <section v-if"unitForm.baseTarget OCPM && unitForm.cpaTargetOptions ! undefined && unitForm.cpaTa…

前端(Ajax)

1.客户端请求 向https://jsonplaceholder.typicode.com/users发送get请求 const xhr new XMLHttpRequest(); console.log(xhr.readyState); xhr.open(‘get’, ‘https://jsonplaceholder.typicode.com/users’) console.log(xhr.readyState); xhr.send(); console.log(xhr.…

uboot, s5pv210 , main_loop 分析(16)

main_loop 的代码如下&#xff1a; 4443 void main_loop (void)42 {41 #ifndef CONFIG_SYS_HUSH_PARSER E 40 ▎ static char lastcommand[CONFIG_SYS_CBSIZE] { 0, }; ■ Use of undeclared identifier CONFIG_SYS_CBSIZE39 ▎ int len;38 ▎ int rc 1;37 ▎ …

信号强劲,通信清晰:北斗三号多模对讲机TD70——专业通信解决方案

在边防海防等国家安全的关键领域&#xff0c;通信的稳定性和可靠性关乎着任务的成败和战士们的安全。北斗三号多模对讲机TD70&#xff0c;凭借其卓越的性能和全面的功能&#xff0c;成为了边防海防通信的利器&#xff0c;守护着国家安全的前沿哨兵。 一、三网融合&#xff0c;…

Arduino驱动DS18B20测量环境温度

DS18B20是一款高精度的单总线数字温度传感器&#xff0c;具体参数如下表所示&#xff1a; 参数名称 参数特性 测温范围 -55~125℃ 测量精度 在-10~85℃范围内的误差为0.5℃ 分辨率 9~12位数字信号&#xff0c;分辨率分别为0.5℃、0.25℃、0.125℃和0.0625℃ 通信方式 …

vector快慢指针+例题详解

1.快慢指针 例题 给定一个链表&#xff0c;判断链表中是否有环。 如果链表中有某个节点&#xff0c;可以通过连续跟踪 next 指针再次到达&#xff0c;则链表中存在环。 为了表示给定链表中的环&#xff0c;我们使用整数 pos 来表示链表尾连接到链表中的位置&#xff08;索引从…

C++--------效率和表示

C 效率和表示 效率 时间效率&#xff1a;在 C 中&#xff0c;不同的数据结构和算法有着各异的时间复杂度。例如&#xff0c;访问数组元素的时间复杂度是 O ( 1 ) O(1) O(1)&#xff0c;而遍历链表查找元素的时间复杂度最坏情况下是 O ( n ) O(n) O(n)。选择合适的算法与数据…

【Mac】终端改色-让用户名和主机名有颜色

效果图 配置zsh 1.打开终端&#xff0c;进入.zshrc配置 cd ~ vim .zshrc2.添加如下配置并保存 # 启用命令行颜色显示 export CLICOLOR1 ## 加载颜色支持 autoload -U colors && colors # 配置 zsh 提示符 PROMPT"%{$fg_bold[red]%}%n%{$reset_color%}%{$fg_bol…

模拟——郑益慧_笔记1_绪论

B站视频链接 模电是数电的基础&#xff1b;参考书&#xff1a; 模拟电子技术基础&#xff08;第四版&#xff09;华成英、童诗白主编&#xff0c;高等教育出版社&#xff1b;电子技术基础 模拟部分 康华光主编&#xff0c;高等教育出版社&#xff1b; 电子技术的发展史 电子…

YOLOv11模型改进-模块-引入多尺度大核注意力Multi-scale Large Kernel Attention

MLKA 的提出源于图像超分辨率任务的挑战性&#xff0c;该任务需重建低质量图像缺失的高频信息&#xff0c;但因 LR 与 HR 图像对应关系复杂&#xff0c;寻找像素相关性困难。此前模型扩展容量的方法增加了训练负担和数据收集成本&#xff0c;而采用的注意力机制无法同时获取局部…

【gym】给定的强化学习环境简介(二)

文章目录 环境介绍一 box2dbipedal_walkercar_dynamicscar_racinglunar_lander 二、 classic_controlacrobotCartPolecontinuous_mountain_carmountain_carpendulum 三、toy_textblackjackcliffwalkingfrozentaxi 四、mujocoAnt&#xff1a;HalfCheetah&#xff1a;Hopper&…

基于支付宝百宝箱构建自己的Agent的基本简易流程(Datawhale AI冬令营)

一&#xff0c;使用支付宝百宝箱 官网地址&#xff1a;百宝箱 (alipay.com) 二&#xff0c;应用构建 点击左上角的新建应用 然后按自己的需求选择对应的模块 以下是我的示例 点击确认之后&#xff0c;进入模型设置界面 按需设计便可以&#xff0c;以下是我的设计 当你写好…

攻防世界 - Web - Level 1 unseping

关注这个靶场的其它相关笔记&#xff1a;攻防世界&#xff08;XCTF&#xff09; —— 靶场笔记合集-CSDN博客 0x01&#xff1a;Write UP 本关是一个 PHP 代码审计关卡&#xff0c;考察的是 PHP 反序列化漏洞以及命令执行的一些绕过手段&#xff0c;下面笔者将带你一步步过关。…

Java进阶学习笔记|面向对象

第一章.类和对象 1.面向对象的介绍 1.面向过程:自己的事情自己干,代表语言C语言洗衣服:每一步自己要亲力亲为 -> 找个盆,放点水,找个搓衣板,搓搓搓 2.面向对象:自己的事情别人帮忙去干,代表语言Java语言 洗衣服:自己的事情别人干 -> 全自动洗衣机3.为啥要使用面向对…

前端性能优化之大文件上传

大文件上传是前端开发中常见的需求之一&#xff0c;特别是在需要处理较大的Excel表格数据、高清图片、视频或其他大型文件时。优化大文件上传不仅可以提升用户体验&#xff0c;还能有效减轻服务器负担。本文将深入探讨大文件上传的几种常见优化技术&#xff0c;包括文件切片与并…