应该先连线再判断线在不在

       if(fx1==tx1&&tx1==tx2){
const A=[fx1, fy1, ty1];const Ahat=[fx1, fy1, ty2];drawlines(A[0], A[1], A[2], Ahat[0], Ahat[1], Ahat[2], lineId, type,2);}if(fx2==tx1&&tx1==tx2){ const B=[fx2, fy2, ty1];const Bhat=[fx2, fy2, ty2];drawlines(B[0], B[1], B[2], Bhat[0], Bhat[1], Bhat[2], lineId, type,3);}

还是得查存在

画线函数删前存档

for (const [fx1, fy1, fx2, fy2, lineId, type] of frontlinelist) {for (const [tx1, ty1, tx2, ty2, lineId2, type2] of toplinelist) {if (fx1==tx1&&fx2==tx2||fx1==tx2&&fx2==tx1||fx1==tx1&&tx1==tx2||fx2==tx1&&tx1==tx2){const A=[fx1, fy1, ty1];const Ahat=[fx1, fy1, ty2];const B=[fx2, fy2, ty1];const Bhat=[fx2, fy2, ty2];drawlines(A[0], A[1], A[2], Ahat[0], Ahat[1], Ahat[2], lineId, type,2);drawlines(B[0], B[1], B[2], Bhat[0], Bhat[1], Bhat[2], lineId, type,3);drawlines(A[0], A[1], A[2], B[0], B[1], B[2], lineId, type,4);drawlines(Ahat[0], Ahat[1], Ahat[2], Bhat[0], Bhat[1], Bhat[2], lineId, type,5);}}
}

先找点在线上,让后在线上的点全部连起来,跑起来贼快 

function isPointOnLineSegment(px: number,py: number,x1: number,y1: number,x2: number,y2: number
): boolean {const crossProduct = (py - y1) * (x2 - x1) - (px - x1) * (y2 - y1);if (Math.abs(crossProduct) > Number.EPSILON) return false;const dotProduct = (px - x1) * (x2 - x1) + (py - y1) * (y2 - y1);if (dotProduct < 0) return false;const squaredLength = (x2 - x1) ** 2 + (y2 - y1) ** 2;return dotProduct <= squaredLength;
}function makemap(lines: [number, number, number, number, number, number][],points: [number, number][],map: Map<string, boolean>
): void {for (const [x1, y1, x2, y2] of lines) {const relevantPoints: [number, number][] = [];for (const [px, py] of points) {if (isPointOnLineSegment(px, py, x1, y1, x2, y2)) {relevantPoints.push([px, py]);const key = `${px},${py},${px},${py}`;map.set(key, true);}}// 两两连接相关点for (let i = 0; i < relevantPoints.length; i++) {for (let j = i + 1; j < relevantPoints.length; j++) {const [p1x, p1y] = relevantPoints[i];const [p2x, p2y] = relevantPoints[j];const key1 = `${p1x},${p1y},${p2x},${p2y}`;const key2 = `${p2x},${p2y},${p1x},${p1y}`;map.set(key1, true);map.set(key2, true);}}}
}const frontmap=new Map<string,boolean>();
makemap(frontlinelist,frontpointlist,frontmap);
Logger.info(`frontmap completed with ${frontmap.size} pairs`);
const toppointmap=new Map<string,boolean>();
makemap(toplinelist,toppointlist,toppointmap);
Logger.info(`toppointmap completed with ${toppointmap.size} pairs`);for (const [x1, y1, z1] of point3dlist)
{
for (const [x2,y2 , z2] of point3dlist)
{ if( x1 === x2 && y1 === y2&&z1===z2)continue;if(frontmap.get(`${x1},${y1},${x2},${y2}`)){drawlines(x1, y1, z1, x2, y2, z2, 0, 0, 1);}}}

加入第二个视图判断 

 加入第3视图判断

.....................

rightpointmap 内容如下:
njsgcs_3drebuild2.ts:350
38.299999999999955,107.8,38.299999999999955,107.8: true
njsgcs_3drebuild2.ts:352
0,107.8,0,107.8: true
njsgcs_3drebuild2.ts:352
27.59999999999991,107.8,27.59999999999991,107.8: true
njsgcs_3drebuild2.ts:352
38.299999999999955,107.8,0,107.8: true
njsgcs_3drebuild2.ts:352
0,107.8,38.299999999999955,107.8: true
njsgcs_3drebuild2.ts:352
38.299999999999955,107.8,27.59999999999991,107.8: true
njsgcs_3drebuild2.ts:352
27.59999999999991,107.8,38.299999999999955,107.8: true
njsgcs_3drebuild2.ts:352
0,107.8,27.59999999999991,107.8: true
njsgcs_3drebuild2.ts:352
27.59999999999991,107.8,0,107.8: true
njsgcs_3drebuild2.ts:352
0,200,0,200: true
njsgcs_3drebuild2.ts:352
0,150,0,150: true
njsgcs_3drebuild2.ts:352
0,190,0,190: true
njsgcs_3drebuild2.ts:352
0,107.8,0,200: true
njsgcs_3drebuild2.ts:352
0,200,0,107.8: true
njsgcs_3drebuild2.ts:352
0,107.8,0,150: true
njsgcs_3drebuild2.ts:352
0,150,0,107.8: true
njsgcs_3drebuild2.ts:352
0,107.8,0,190: true
njsgcs_3drebuild2.ts:352

小数点问题

function makemap(lines: [number, number, number, number, number, number][],points: [number, number][],map: Map<string, boolean>
): void {for (const [x1, y1, x2, y2] of lines) {const relevantPoints: [number, number][] = [];for (const [px, py] of points) {if (isPointOnLineSegment(px, py, x1, y1, x2, y2)) {// 保留一位小数const pxFixed = parseFloat(px.toFixed(1));const pyFixed = parseFloat(py.toFixed(1));relevantPoints.push([pxFixed, pyFixed]);const key = `${pxFixed},${pyFixed},${pxFixed},${pyFixed}`;map.set(key, true);}}// 两两连接相关点for (let i = 0; i < relevantPoints.length; i++) {for (let j = i + 1; j < relevantPoints.length; j++) {const [p1x, p1y] = relevantPoints[i];const [p2x, p2y] = relevantPoints[j];// 保留一位小数const p1xFixed = parseFloat(p1x.toFixed(1));const p1yFixed = parseFloat(p1y.toFixed(1));const p2xFixed = parseFloat(p2x.toFixed(1));const p2yFixed = parseFloat(p2y.toFixed(1));const key1 = `${p1xFixed},${p1yFixed},${p2xFixed},${p2yFixed}`;const key2 = `${p2xFixed},${p2yFixed},${p1xFixed},${p1yFixed}`;map.set(key1, true);map.set(key2, true);}}}
}const frontmap=new Map<string,boolean>();
makemap(frontlinelist,frontpointlist,frontmap);
Logger.info(`frontmap completed with ${frontmap.size} pairs`);
const toppointmap=new Map<string,boolean>();
makemap(toplinelist,toppointlist,toppointmap);
Logger.info(`toppointmap completed with ${toppointmap.size} pairs`);
const rightpointmap=new Map<string,boolean>();
makemap(rightlinelist,rightpointlist,rightpointmap);
Logger.info(`rightpointmap completed with ${rightpointmap.size} pairs`);
Logger.info("rightpointmap 内容如下:");
for (const [key, value] of rightpointmap.entries()) {Logger.info(`${key}: ${value}`);
}
for (const [x1, y1, z1] of point3dlist) {for (const [x2, y2, z2] of point3dlist) {if (x1 === x2 && y1 === y2 && z1 === z2) continue;// 保留一位小数const x1f = parseFloat(x1.toFixed(1));const y1f = parseFloat(y1.toFixed(1));const z1f = parseFloat(z1.toFixed(1));const x2f = parseFloat(x2.toFixed(1));const y2f = parseFloat(y2.toFixed(1));const z2f = parseFloat(z2.toFixed(1));const frontKey = `${x1f},${y1f},${x2f},${y2f}`;const topKey = `${x1f},${z1f},${x2f},${z2f}`;const rightKey = `${z1f},${y1f},${z2f},${y2f}`;if (frontmap.get(frontKey) && toppointmap.get(topKey)&& rightpointmap.get(rightKey)) {drawlines(x1f, y1f, z1f, x2f, y2f, z2f, 0, 0, 1);}}
}

两种视图的投影效果都很好 

import { Logger, PubSub } from "chili-core";
import DxfParser, { IArcEntity, IEntity, ILineEntity } from 'dxf-parser';
class Cluster {lines: [number, number, number, number,number,number][];min_x: number;max_x: number;min_y: number;max_y: number;constructor(lines: [number, number, number, number,number,number][] = []) {this.lines = [...lines];this.min_x = Infinity;this.max_x = -Infinity;this.min_y = Infinity;this.max_y = -Infinity;if (lines.length > 0) {this.updateBounds();}}updateBounds(): void {this.min_x = Math.min(...this.lines.flatMap(line => [line[0], line[2]]));this.max_x = Math.max(...this.lines.flatMap(line => [line[0], line[2]]));this.min_y = Math.min(...this.lines.flatMap(line => [line[1], line[3]]));this.max_y = Math.max(...this.lines.flatMap(line => [line[1], line[3]]));}get lengthX(): number {return parseFloat((this.max_x - this.min_x).toFixed(1));}get lengthY(): number {return parseFloat((this.max_y - this.min_y).toFixed(1));}
}
function clusterLines(lines: [number, number, number, number,number,number][], expandDistance: number = 5): Cluster[] {const clusters: Cluster[] = [];const remainingLines = [...lines];while (remainingLines.length > 0) {const seed = remainingLines.shift()!;const currentCluster = new Cluster([seed]);currentCluster.updateBounds();let changed = true;while (changed) {changed = false;const expandedMinX = currentCluster.min_x - expandDistance;const expandedMaxX = currentCluster.max_x + expandDistance;const expandedMinY = currentCluster.min_y - expandDistance;const expandedMaxY = currentCluster.max_y + expandDistance;const toAdd: [number, number, number, number,number,number][] = [];for (const line of [...remainingLines]) {const [x1, y1, x2, y2,lineId,type] = line;const inBound =(x1 >= expandedMinX && x1 <= expandedMaxX && y1 >= expandedMinY && y1 <= expandedMaxY) ||(x2 >= expandedMinX && x2 <= expandedMaxX && y2 >= expandedMinY && y2 <= expandedMaxY);if (inBound) {toAdd.push(line);changed = true;}}for (const line of toAdd) {currentCluster.lines.push(line);remainingLines.splice(remainingLines.indexOf(line), 1);}currentCluster.updateBounds();}// 合并完全覆盖的聚类for (let i = 0; i < clusters.length; i++) {const cluster = clusters[i];if (currentCluster.min_x <= cluster.min_x &&currentCluster.min_y <= cluster.min_y &&currentCluster.max_x >= cluster.max_x &&currentCluster.max_y >= cluster.max_y) {currentCluster.lines.push(...cluster.lines);clusters.splice(i, 1);break;}}clusters.push(currentCluster);}return clusters;
}
export function rebuild3D2(document: Document) {const fileInput = document.createElement("input");fileInput.type = "file";fileInput.accept = ".dxf";fileInput.style.display = "none";fileInput.addEventListener("change", async (event) => {const target = event.target as HTMLInputElement;if (!target.files || target.files.length === 0) return;const file = target.files[0];Logger.info(`Selected file: ${file.name}`);try {const reader = new FileReader();reader.onload = () => {const dxfText = reader.result as string;const parser = new DxfParser();const dxf = parser.parseSync(dxfText);const inputlines: [number, number, number, number,number,number][] = [];
const lineMap = new Map<number, IEntity>(); 
let lineId = 0;if (dxf && dxf.entities) {dxf.entities.forEach(entity => {if (entity.type === 'LINE') {const lineEntity = entity as ILineEntity;const start = lineEntity.vertices[0];const end = lineEntity.vertices[1];if (start && end) {lineMap.set(lineId, entity);inputlines.push([start.x, start.y, end.x, end.y, lineId,0]);lineId++;}}else if (entity.type === 'Arc') {lineMap.set(lineId, entity);const arcEntity = entity as IArcEntity;const center = arcEntity.center;
const radius = arcEntity.radius;
const startAngle = arcEntity.startAngle;
const endAngle = arcEntity.endAngle;
// 计算起点坐标
const startX = center.x + radius * Math.cos(startAngle);
const startY = center.y + radius * Math.sin(startAngle);// 假设终点角度为 endAngle,则可以类似计算终点const endX = center.x + radius * Math.cos(endAngle);const endY = center.y + radius * Math.sin(endAngle);inputlines.push([startX, startY, endX, endY,lineId,1]);lineId++;}});}// 执行聚类const clusters = clusterLines(inputlines, 5);const { mostMinX, mostMinY } = getMostFrequentMinXY(clusters);const mostFrequentClusters = clusters.filter(cluster => {return cluster.min_x === mostMinX.value && cluster.min_y === mostMinY.value;
});
const topclusters = clusters.filter(cluster => {return cluster.min_x === mostMinX.value && cluster.min_y > mostMinY.value;
});
;
const rightclusters = clusters.filter(cluster => {return cluster.min_x > mostMinX.value && cluster.min_y === mostMinY.value;
});
const bottomclusters = clusters.filter(cluster => {return cluster.min_x === mostMinX.value && cluster.min_y < mostMinY.value;
});
const leftclusters = clusters.filter(cluster => {return cluster.min_x < mostMinX.value && cluster.min_y === mostMinY.value;
});const mostFrequentCluster= mostFrequentClusters[0];const topcluauster= topclusters[0];const rightcluster= rightclusters[0];const bottomcluster= bottomclusters[0];const leftcluster= leftclusters[0];const frontlinelist: [number, number, number,number, number, number][] = [];
const toplinelist: [number, number, number,number, number, number][] = [];
const rightlinelist: [number, number, number,number, number, number][] = [];const frontpointlist: [number, number][] = [];
const toppointlist: [number, number][] = [];
const rightpointlist: [number, number][] = [];
const clusterMinY = topcluauster.min_y;
const clusterMinx= rightcluster.min_x;const fseen = new Set<string>();
const tseen = new Set<string>();
const rseen = new Set<string>();
// 主处理逻辑
for (const [x1, y1, x2, y2,lineId,type] of mostFrequentCluster.lines) {frontlinelist.push([x1, y1, x2, y2,lineId,type]);addUniquePoint(x1, y1, frontpointlist, fseen);
addUniquePoint(x2, y2, frontpointlist, fseen);}
for (const [x1, y1, x2, y2,lineId,type] of topcluauster.lines) {toplinelist.push([x1, y1- clusterMinY, x2, y2- clusterMinY,lineId,type]);addUniquePoint(x1, y1- clusterMinY, toppointlist, tseen);
addUniquePoint(x2, y2- clusterMinY, toppointlist, tseen);}for (const [x1, y1, x2, y2,lineId,type] of rightcluster.lines) {rightlinelist.push([x1-clusterMinx, y1, x2-clusterMinx, y2,lineId,type]);addUniquePoint(x1-clusterMinx, y1, rightpointlist, rseen);addUniquePoint(x2-clusterMinx, y2, rightpointlist, rseen);}
Logger.info("2d线段和点收集完毕" )
Logger.info(frontlinelist)
Logger.info(`主视图有${frontlinelist.length}条线段`, `顶视图有${toplinelist.length}条线段`, `右视图有${rightlinelist.length}条线段`);
Logger.info(`主视图有${frontpointlist.length}个点`, `顶视图有${toppointlist.length}个点`, `右视图有${rightpointlist.length}个点`);function addUniquePoint(x: number,y: number,pointList: [number, number][],seen: Set<string>
): void {const key = `${x},${y}`;if (!seen.has(key)) {seen.add(key);pointList.push([x, y]);}
}const lines3d:[number,number,number,number,number,number,number,number,number][]=[]const seenLinePairs = new Set<string>(); // 用于记录已经添加过的 [lineId, lineId2] 对
function drawlines(x1:number, y1:number, z1:number , x2:number, y2:number, z2:number , lineId:number, type:number,color:number){if([x1, y1, z1].join(',') === [x2, y2, z2].join(','))return;const drawline2=[x1, y1, z1 , x2, y2,z2]const key2 = drawline2.map(v => v.toFixed(2)).join(',');if (!seenLinePairs.has(key2)) {seenLinePairs.add(key2);lines3d.push([x1, y1, z1, x2, y2, z2 , lineId, type,color]);}}
const point3dlist: [number, number, number][] = [];
const seen = new Set<string>(); // 用于去重for (const [fx1, fy1] of frontpointlist) {for (const [tx1, ty1] of toppointlist) {if (fx1 === tx1) {const key = `${fx1},${fy1},${ty1}`;if (!seen.has(key)) {seen.add(key);point3dlist.push([fx1, fy1, ty1]);}}}
}
Logger.info(`3d点生成完毕,个数${point3dlist.length}`)function isPointOnLineSegment(px: number,py: number,x1: number,y1: number,x2: number,y2: number
): boolean {const crossProduct = (py - y1) * (x2 - x1) - (px - x1) * (y2 - y1);if (Math.abs(crossProduct) > Number.EPSILON) return false;const dotProduct = (px - x1) * (x2 - x1) + (py - y1) * (y2 - y1);if (dotProduct < 0) return false;const squaredLength = (x2 - x1) ** 2 + (y2 - y1) ** 2;return dotProduct <= squaredLength;
}
function makemap(lines: [number, number, number, number, number, number][],points: [number, number][],map: Map<string, boolean>
): void {for (const [x1, y1, x2, y2] of lines) {const relevantPoints: [number, number][] = [];for (const [px, py] of points) {if (isPointOnLineSegment(px, py, x1, y1, x2, y2)) {// 保留一位小数const pxFixed = parseFloat(px.toFixed(1));const pyFixed = parseFloat(py.toFixed(1));relevantPoints.push([pxFixed, pyFixed]);const key = `${pxFixed},${pyFixed},${pxFixed},${pyFixed}`;map.set(key, true);}}// 两两连接相关点for (let i = 0; i < relevantPoints.length; i++) {for (let j = i + 1; j < relevantPoints.length; j++) {const [p1x, p1y] = relevantPoints[i];const [p2x, p2y] = relevantPoints[j];// 保留一位小数const p1xFixed = parseFloat(p1x.toFixed(1));const p1yFixed = parseFloat(p1y.toFixed(1));const p2xFixed = parseFloat(p2x.toFixed(1));const p2yFixed = parseFloat(p2y.toFixed(1));const key1 = `${p1xFixed},${p1yFixed},${p2xFixed},${p2yFixed}`;const key2 = `${p2xFixed},${p2yFixed},${p1xFixed},${p1yFixed}`;map.set(key1, true);map.set(key2, true);}}}
}const frontmap=new Map<string,boolean>();
makemap(frontlinelist,frontpointlist,frontmap);
Logger.info(`frontmap completed with ${frontmap.size} pairs`);
const toppointmap=new Map<string,boolean>();
makemap(toplinelist,toppointlist,toppointmap);
Logger.info(`toppointmap completed with ${toppointmap.size} pairs`);
const rightpointmap=new Map<string,boolean>();
makemap(rightlinelist,rightpointlist,rightpointmap);
Logger.info(`rightpointmap completed with ${rightpointmap.size} pairs`);
Logger.info("rightpointmap 内容如下:");
for (const [key, value] of rightpointmap.entries()) {Logger.info(`${key}: ${value}`);
}
for (const [x1, y1, z1] of point3dlist) {for (const [x2, y2, z2] of point3dlist) {if (x1 === x2 && y1 === y2 && z1 === z2) continue;// 保留一位小数const x1f = parseFloat(x1.toFixed(1));const y1f = parseFloat(y1.toFixed(1));const z1f = parseFloat(z1.toFixed(1));const x2f = parseFloat(x2.toFixed(1));const y2f = parseFloat(y2.toFixed(1));const z2f = parseFloat(z2.toFixed(1));const frontKey = `${x1f},${y1f},${x2f},${y2f}`;const topKey = `${x1f},${z1f},${x2f},${z2f}`;const rightKey = `${z1f},${y1f},${z2f},${y2f}`;if (frontmap.get(frontKey) && toppointmap.get(topKey)&& rightpointmap.get(rightKey)) {drawlines(x1f, y1f, z1f, x2f, y2f, z2f, 0, 0, 1);}}
}Logger.info(`lines3d completed with ${lines3d.length} lines3d`);lines3d.forEach(line => {PubSub.default.pub("njsgcs_makeline", line[0], line[1],  line[2], line[3], line[4], line[5], line[8]); })///// let i =0;// // 发送每个线段给 njsgcs_makeline// clusters.forEach(cluster => {//     i++;//     cluster.lines.forEach(line => {//         const [x1, y1, x2, y2] = line;//         PubSub.default.pub("njsgcs_makeline", x1, y1, 0, x2, y2, 0,i); // z=0 假设为俯视图//     });// });///Logger.info(`Clustering completed with ${clusters.length} clusters`);};reader.readAsText(file);} catch (error) {Logger.error("Error reading file:", error);}});fileInput.click();
}
function getMostFrequentMinXY(clusters: Cluster[]) {const minXCounts: Record<number, number> = {};const minYCounts: Record<number, number> = {};let maxXCount = 0, mostX = clusters[0]?.min_x;let maxYCount = 0, mostY = clusters[0]?.min_y;for (const cluster of clusters) {const x = cluster.min_x;const y = cluster.min_y;minXCounts[x] = (minXCounts[x] || 0) + 1;if (minXCounts[x] > maxXCount) {maxXCount = minXCounts[x];mostX = x;}minYCounts[y] = (minYCounts[y] || 0) + 1;if (minYCounts[y] > maxYCount) {maxYCount = minYCounts[y];mostY = y;}}return {mostMinX: { value: mostX, count: maxXCount },mostMinY: { value: mostY, count: maxYCount }};
}

接下来搞圆弧

当前效果

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/news/912635.shtml
繁体地址,请注明出处:http://hk.pswp.cn/news/912635.shtml
英文地址,请注明出处:http://en.pswp.cn/news/912635.shtml

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Hibernate对象生命周期全解析

Hibernate对象生命周期详解 Hibernate作为Java领域主流的ORM框架,其核心机制之一就是对持久化对象生命周期的管理。理解Hibernate对象生命周期对于正确使用Hibernate进行数据持久化操作至关重要。Hibernate将对象分为三种主要状态:瞬时态(Transient)、持久态(Persistent)和游…

MCP 协议使用核心讲解

&#x1f4c4; MCP 协议使用核心讲解 ✅ MCP 协议的核心在于以下几个方面 一、MCP 请求结构&#xff08;MCPRequest&#xff09; {"messages": [{"role": "user","content": "帮我查询一下上海的天气"}],"tools"…

云计算中的几何方法:曲面变形的可视化与动画-AI云计算数值分析和代码验证

着重强调微分方程底层的几何和代数结构&#xff0c;以进行更深入的分析和求解方法。开发结构保持的数值方法&#xff0c;以在计算中保持定性特征。统一符号和数值方法&#xff0c;实现有效的数学建模。利用几何解释&#xff08;如双曲几何&#xff09;求解经典微分方程。利用计…

OpenCV篇——项目(一)OCR识别读取银行卡号码

目录 信用卡数字识别系统&#xff1a;前言与代码解析 前言 项目代码 ​​​​​​结果演示 代码模块解析 1. 参数解析模块 2. 轮廓排序函数 3. 图像预处理模块 4. 输入图像处理流程 5. 卡号区域定位 6. 数字识别与输出 系统优势 信用卡数字识别系统&#xff1a;前言…

Adobe AI高效设计秘籍与创新思维进阶

开篇&#xff1a;十年设计征途&#xff0c;Adobe赋能创意飞翔 作为一名在设计领域耕耘十年的旅居职业设计师&#xff0c;我得益于英国帕维斯经济与音乐学院&#xff08;Parvis School of Economics and Music&#xff09;提供的Adobe正版教育订阅&#xff0c;得以持续探索技术…

vc formal实例

命令&#xff1a; module load gui 方式启动命令&#xff0c; 看一下cc_pinmux.tcl 里面有什么&#xff1a; 工具feature 的设置&#xff0c;不太懂 对特定模块做blackbox, library file, 一般是工具无法识别的模块&#xff0c;例如 IO lib,memory lib,analog lib, 内部有 …

JavaScript取值get的json/url/普通对象参考

dstore.on(datachanged,function(dstore){ for(i0;i<dstore.getCount();i){ var a dstore.getAt(i); var imp_infoa.get(imp_info); 上面这段JS代码&#xff0c;imp_info取到的是一长串KEY和VALUE组成的内容&#xff0c;我怎样可以准确获取其中一…

【C++】侦测按键事件

侦测按键事件可以用C的conio.h头文件&#xff0c;用到的函数&#xff1a; _CRTIMP int __cdecl _getch(void); 输入以下代码&#xff1a; #include <iostream> #include <conio.h> using namespace std;int main() {char key;while (true) {cout << "…

Coremail受邀亮相华为开发者大会

6月20-22日&#xff0c;为期三天的HDC.2025华为开发者大会在东莞举行&#xff0c;全球超过1.2万名开发者汇聚现场&#xff0c;聚焦鸿蒙生态、AI技术及产业合作。Coremail作为鸿蒙生态的核心伙伴和深度参与者受邀出席&#xff0c;并获得“智慧办公最佳产品合作伙伴”奖项。 HDC.…

视频断点续播全栈实现:基于HTML5前端与Spring Boot后端

文章目录 视频断点续播功能实现方案核心思路前端实现HTML结构JavaScript实现Spring Boot后端实现1.依赖配置(pom.xml)2.实体类3.存储库接口4.服务层5. 控制器实现要点视频断点续播功能构思图流程说明用户交互:前端核心功能:后端处理:数据存储:🌐 我的个人网站:乐乐主题创…

华为设备 QoS 流分类与流标记深度解析及实验脚本

一、引言 在复杂网络环境中&#xff0c;不同业务对网络质量需求各异。语音通话要求低时延、视频直播依赖高带宽、普通文件传输对丢包容忍度相对较高 。QoS&#xff08;Quality of Service&#xff0c;服务质量&#xff09;技术通过流分类、流标记等手段&#xff0c;为不同业务…

[论文阅读] 人工智能 + 软件工程 | 从软件工程视角看大语言模型:挑战与未来之路

从软件工程视角看大语言模型&#xff1a;挑战与未来之路 论文标题&#xff1a;Software Engineering for Large Language Models: Research Status, Challenges and the Road Ahead arXiv:2506.23762 Software Engineering for Large Language Models: Research Status, Chall…

【Docker基础】Docker容器管理:docker rm及其参数详解

目录 1 Docker容器生命周期概述 2 docker rm命令基础 2.1 命令基本语法 2.2 命令功能说明 2.3 基本使用示例 3 docker rm参数详解 3.1 -f, --force 3.2 -v, --volumes 3.3 -l, --link 3.4 --time 4 docker rm高级用法 4.1 批量删除容器 4.1.1 删除所有已停止的容器…

鸿蒙进阶——Mindspore Lite AI框架源码解读之模型加载详解(五)

文章大纲 引言一、LiteSession::CompileGraph(Model *model)二、LiteSession::CompileGraph(Model *model) 核心流程1、MindirModel::ConvertTensors1.1、遍历并执行MindirModel::ConvertTensor1.1.1、MindirModel::LoadTensorData 三、LiteSession::InitGraphInputTensors(mod…

WireShark网络取证分析第一集到第五集和dvwa靶场环境分析漏洞

文章目录 一、WireShark网络取证是什么?二、WireShark网络取证1.WireShark网络取证分析第一集Ann的即时通讯好友叫什么名字?在捕获的即时通讯对话中第一条评论是什么?Ann传输的文件叫什么名字?您想提取的文件的魔数是什么(前四个字节)?文件的MD5sum是多少?什么是秘密配方…

【51单片机按下按键1,8位共阴极数码管输出2022-606。按下按键2,8位共阴极数码管输出606-1132。】2022-6-10

缘由单片极的共阴极数码管按下按键1和按键2输出的内容-编程语言-CSDN问答 #include "REG52.h" unsigned char code smgduan[]{0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0,64}; //共阴0~F消隐减号 unsigned char Js0, miao…

HDMI转12G- SDI GS12170+GS12281-富利威方案设计及技术支持

GS12281 是一款低功耗、多速率、重定时电缆驱动器&#xff0c;支持高达 12G UHD-SDI 的速率。它设计用于接收 100Ω 差分输入信号&#xff0c;自动从数字视频信号中恢复嵌入式时钟并重新定时输入数据&#xff0c;并通过 75Ω 同轴电缆传输重新定时的信号。 100Ω 走线输入支持…

自然语言处理:NLP入门

本文目录&#xff1a; 一、概念二、发展史三、核心任务和技术特别分享1&#xff1a;当前挑战和前沿方向特别分享2&#xff1a;大神名言启示 前言&#xff1a;从本章开始讲解自然语言处理&#xff08;NLP&#xff09;&#xff0c;今天先入个门~ 一、概念 自然语言处理&#xff…

用Fiddler中文版抓包工具掌控微服务架构中的接口调试:联合Postman与Charles的高效实践

随着微服务架构在项目中的广泛应用&#xff0c;系统被拆分成多个独立的服务&#xff0c;彼此通过API通信。虽然架构带来了灵活性&#xff0c;但也大幅增加了接口数量和调用链复杂度&#xff1a;一次用户操作可能触发跨多个服务的调用&#xff0c;导致前端调试难度飙升。要精准排…

MongoDB 更新文档指南

MongoDB 更新文档指南 引言 MongoDB 是一款高性能、可扩展的文档存储系统&#xff0c;它为存储和管理大量数据提供了强大的支持。在 MongoDB 中&#xff0c;更新文档是常见操作之一&#xff0c;它允许用户修改现有文档的内容。本文将详细讲解 MongoDB 中更新文档的各种方法&a…