当前位置: 首页 > news >正文

chili调试笔记13 工程图模块 mesh渲染 mesh共享边显示实现

把模型投影到工程图要用什么模块当工程图的画板,最后要导出dxf的

three是怎么读取他的3d数据的

mesh不是三角形吗怎么渲染出四边形面的

我想看到三角形的边怎么设置

ai让我干嘛我就干嘛

    static getAllEdges(face: { positions: Float32Array; indices: Uint16Array | Uint32Array }) {const pointsMap = new Map<string, { count: number; points: number[] }>();for (let i = 0; i < face.indices.length; i += 3) {this.addEdge(pointsMap, face, face.indices[i], face.indices[i + 1]);this.addEdge(pointsMap, face, face.indices[i + 1], face.indices[i + 2]);this.addEdge(pointsMap, face, face.indices[i + 2], face.indices[i]);}return {outlineEdges: new Float32Array(Array.from(pointsMap.values()).filter((v) => v.count === 1).flatMap((entry) => entry.points),),sharedEdges: new Float32Array(Array.from(pointsMap.values()).filter((v) => v.count > 1).flatMap((entry) => entry.points),),};}

    private generateShape() {const mesh = this.geometryNode.mesh;if (mesh?.faces?.positions.length) {this.initFaces(mesh.faces);// 获取所有边const allEdges = MeshUtils.getAllEdges(mesh.faces);// 创建并添加共享边if (allEdges.sharedEdges.length > 0) {const sharedEdgesMeshData: EdgeMeshData = {positions: allEdges.sharedEdges,groups: [],lineType: LineType.Solid,lineWidth: 0.5,color: 0x888888,};const buff = ThreeGeometryFactory.createEdgeBufferGeometry(sharedEdgesMeshData);const sharedEdgesMaterial = new LineMaterial({linewidth: sharedEdgesMeshData.lineWidth,color: 0xff0000,polygonOffset: true,polygonOffsetFactor: -3,polygonOffsetUnits: -3,});const sharedEdges = new LineSegments2(buff, sharedEdgesMaterial);this.add(sharedEdges);}}if (mesh?.edges?.positions.length) this.initEdges(mesh.edges);}

nb,这个deepwikiai在我认识的ai里面排名能排前三

 

能做布尔切除的mesh就是brep 

相关文章:

  • 藏文智能输入入门实践-简单拼写纠错
  • 【Agent】使用 Python 结合 OpenAI 的 API 实现一个支持 Function Call 的程序,修改本机的 txt 文件
  • 光伏“531”政策倒逼下,光储充一体化系统如何破解分布式光伏收益困局?
  • VMware更改语言设置
  • 使用Go语言对接全球股票数据源API实践指南
  • 【C++进阶】第1课—继承
  • 【软件设计师:数据结构】1.数据结构基础(一)
  • 【Bootstrap V4系列】学习入门教程之 组件-轮播(Carousel)高级用法
  • linux基础学习--linux磁盘与文件管理系统
  • OC的实例对象,类对象,元类对象
  • 外包团队协作效率低,如何优化
  • python打卡day18
  • 【一篇详解】深入浅出RabbtiMQ消息队列
  • openstack的网络
  • 第十六次博客打卡
  • Qt开发经验 --- 避坑指南(6)
  • Java中字符转数字的原理解析 - 为什么char x - ‘0‘能得到对应数字
  • C++回顾 Day4
  • Web前端入门及基础代码
  • 创建虚拟服务时实现持久连接。
  • “上海之帆”巡展在日本大阪开幕,松江区组织企业集体出展
  • 正荣地产:前4个月销售14.96亿元,控股股东已获委任联合清盘人
  • 公示!17个新职业、42个新工种亮相
  • 苹果Safari浏览器上的搜索量首次下降
  • 商务部再回应中美经贸高层会谈:美方要拿出诚意、拿出行动
  • 成都公积金新政征求意见:购买保障性住房最高贷款额度上浮50%