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

网站案例展示怎么做桂电做网站的毕设容易过嘛

网站案例展示怎么做,桂电做网站的毕设容易过嘛,网站建设技术总结,自己建网站需要备案吗2025-05-08 09-05-06 llm画线 页面布置 expand有自己的格式 删了就会按照子元素格式 不加px无效 没有指定尺寸设置100%无效 怎么把线条导出dxf command({name: "file.export",display: "command.export",icon: "icon-export", }) export class…

2025-05-08 09-05-06 llm画线

页面布置

 

 

 

 expand有自己的格式

删了就会按照子元素格式 

 

不加px无效

没有指定尺寸设置100%无效

怎么把线条导出dxf

@command({name: "file.export",display: "command.export",icon: "icon-export",
})
export class Export extends CancelableCommand {@Property.define("file.format")public get formats() {return this.getPrivateValue("formats", this.initCombobox());}public set formats(value: Combobox<string>) {this.setProperty("formats", value);}private initCombobox() {const box = new Combobox<string>();box.items.push(...this.application.dataExchange.exportFormats());return box;}protected async executeAsync() {const nodes = await this.selectNodesAsync();if (!nodes || nodes.length === 0) {PubSub.default.pub("showToast", "toast.select.noSelected");return;}PubSub.default.pub("showPermanent",async () => {const format = this.formats.selectedItem;if (format === undefined) return;const data = await this.application.dataExchange.export(format, nodes);if (!data) return;PubSub.default.pub("showToast", "toast.downloading");download(data, `${nodes[0].name}${format}`);},"toast.excuting{0}",I18n.translate("command.export"),);}

 

 

❓ 问题 3:缺少 TABLES 段定义图层等信息

如果你没有定义图层(Layer),某些软件可能会忽略你的图形。


✅ 推荐解决方案:补充 HEADER 和 TABLES 段落

下面是一个 完整且经过验证可以在 FreeCAD 中正常打开的 DXF 示例,基于你提供的线条数据:

 

dxf模板            不能用

0
SECTION
2
HEADER
9
$ACADVER
1
AC1027
9
$INSUNITS
70
4
0
ENDSEC0
SECTION
2
TABLES
0
TABLE
2
LAYER
701
0
LAYER
2
0
700
627
6
CONTINUOUS
0
ENDTAB
0
TABLE
2
LTYPE
701
0
LTYPE
2
CONTINUOUS
700
3
Solid line
7265
730
40
0.0
0
ENDTAB
0
ENDSEC0
SECTION
2
BLOCKS
0
BLOCK
8
0
2
*MODEL_SPACE
700
10
0.0
20
0.0
30
0.0
100
AcDbBlockBegin
3
*MODEL_SPACE
10
ENDBLK
100
AcDbBlockEnd
0
ENDSEC0
SECTION
2
ENTITIES
{{entities}}
0
ENDSEC0
SECTION
2
OBJECTS
0
DICTIONARY
5
F000
330
0
100
AcDbDictionary
3
ACAD_GROUP
350
F001
0
DICTIONARY
5
F001
330
F000
100
AcDbDictionary
0
ENDSEC0
EOF

让ai打工 

放弃了,用三方库

cnpm install three-dxf

// three-dxf.d.ts
declare module 'three-dxf' {class Point3D {x: number;y: number;z: number;constructor(x: number, y: number, z?: number);}class Drawing {header: {setVersion(version: string): void;setUnit(unit: string): void;};addLayer(name: string, options?: any): void;addLine(start: Point3D, end: Point3D): void;toString(): string;}export { Drawing, Point3D };
}

 

freecad打不开别的打开了

cnpm install @tarikjabiri/dxf

@tarikjabiri/dxf CDN by jsDelivr - A CDN for npm and GitHub

   private async  handleDxfExport(nodes: VisualNode[]): Promise<string[]> {// 创建一个新的 DXF 文档const d = new DxfDocument();for (const node of nodes) {if (node instanceof LineNode) {const start = node.start;const end = node.end;// 创建线段并设置起点和终点const line = new Line({ x: start.x, y: start.y, z: Math.abs(start.z) < 1e-9 ? 0 : start.z },{ x: end.x, y: end.y, z: Math.abs(end.z) < 1e-9 ? 0 : end.z });// 添加到文档的实体集合中d.entities.modelSpace.addEntity(line);}}const fullDxfContent= d.stringify(); // 转换为字符串// 返回分割成行的数组,每行后加上换行符return fullDxfContent.split('\n').map(line => line + '\n');}

 

2年前的了,用python写吧

python直接写本地freecad可以打得开发回网页就打不开

import ezdxf
import tempfile
import osdef draw_lines_and_get_dxf(lines):"""根据给定的线段列表绘制直线,并返回 DXF 文档的字符串格式。:param lines: 线段列表,每个线段由起点和终点组成,格式为 [{"start": {"x": x1, "y": y1, "z": z1}, "end": {"x": x2, "y": y2, "z": z2}}, ...]:return: DXF 文档的字符串表示"""# 创建一个新的 DXF 文档doc = ezdxf.new('R2010')msp = doc.modelspace()# 遍历每条线段并绘制直线for line in lines:print(line)start = (line["start"]["x"], line["start"]["y"], line["start"]["z"])end = (line["end"]["x"], line["end"]["y"], line["end"]["z"])msp.add_line(start, end)# 保存到临时文件with tempfile.NamedTemporaryFile(suffix=".dxf", delete=False) as temp_file:doc.saveas(temp_file.name)temp_file_path = temp_file.name# 创建保存目录save_dir = './run/dxf'os.makedirs(save_dir, exist_ok=True)# 另存为指定路径save_path = os.path.join(save_dir, 'output.dxf')doc.saveas(save_path)# 读取文件内容with open(temp_file_path, "r") as file:dxf_content = file.read()# 删除临时文件os.remove(temp_file_path)return dxf_content

打不开的:

打得开的

浪费了一下午发现是freecad打不开中文命名的文档

不是卡中文可能@tarikjabiri/dxf包就能用了

2025-05-08 16-59-41 linenode导出dxf

http://www.dtcms.com/a/453554.html

相关文章:

  • QT-常用控件(一)
  • 网站开发选asp还是hph网站域名解析步骤
  • AI行业应用深度解析:从理论到实践的跨越
  • DeepMind 和罗光记团队 推出“帧链”概念:视频模型或将实现全面视觉理解
  • 外贸圈阿里巴巴微信seo什么意思
  • 【专业词汇】元认知
  • 有什么网站开发软件网页棋牌开发
  • Flutter与Dart结合AI开发实战
  • Easyx使用(数据可视化)
  • 基于单片机的大货车防偷油系统设计
  • JavaScript:神奇的ES6之旅
  • 延吉网站开发公司特别好的企业网站程序
  • Avalonia:现代跨平台UI开发的卓越之选
  • gta5网站正在建设阿里云网站建设与发布题库
  • 网页制作的网站淘宝页面设计的网站
  • 【STM32项目开源】STM32单片机人体健康监测系统
  • 车载诊断架构 --- 车载ECU故障类型详解(上)
  • 房产中介做网站wordpress 下载插件xydown
  • 廊坊自助建站设计自己开发的软件如何赚钱
  • 【Redis学习】Redis常用数据类型的万字详解
  • 探讨生成式AI在代码评审与重构中的决策权重分配
  • 【LeetCode380题】和【LeetCode238题】题解
  • The “Launch”_2 - 价值交付与灰度发布的系统实现方案
  • 做的网站怎么打开是白板静态网站 价格
  • JavaScript Boolean(布尔)
  • CentOS 7.6 系统源码部署 HivisionIDPhotos
  • 电子电气架构 --- 汽车座舱行业发展现状分析
  • 李建忠 电子商务网站建设与管理 pptwordpress百度不收录文章
  • 算法入门:专题攻克一---双指针(3)有效三角形的个数
  • 怎么做才能提高网站权重360建筑网证书估价