# Edge Banding Editor **Repository Path**: manycore/edge-banding-editor ## Basic Information - **Project Name**: Edge Banding Editor - **Description**: 封边配置的酷家乐工具小程序示例。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-27 - **Last Updated**: 2022-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 封边编辑 实现了从酷家乐获取板件轮廓,并编辑封边厚度。 ## 功能介绍 **一、加载数据** 通过调用 `IDP.Custom.Design.Export.getDesignJsonAsync` 接口,获得相应数据。在获得数据后,使用 `IDP.Math` 下相关 2D 几何运算的函数处理数据,返回给页面。这部分逻辑主要实现在 `src/main.ts` 文件中。 **二、编辑封边** * 显示板件轮廓。 * 在输入框设置单条封边时,会加粗显示该封边。 * 不同封边使用不用颜色显示。 * 提示需要设置相同封边的边,鼠标悬浮提示文本时,会加粗高亮显示这些边。 这部分逻辑主要实现在 `src/components/EdgeEditor.tsx` 和 `src/components/Edges.tsx` 中。 **三、计算下料轮廓** 主要使用 `IDP.Math.KGeomLib.offsetPath2dWithDistances` 接口计算轮廓偏移,相关代码在 `src/main.ts` 文件中。 ## 使用方式 本项目是标准的[酷家乐工具小程序](https://open.kujiale.com/pub/saas/open-platform/doc-detail?app_id=15),需要在酷家乐云设计工具上运行才能使用完整功能。为了能正常获取数据,请确保设计方案中有定制模型,并且工具处于该模型对应的定制模式中。 为了方便开发和演示,本项目自带测试数据,可以在启动服务后直接访问页面。在这种情况下,只能使用封边编辑的功能。 通过下面命令启动服务: ```bash npm install npm start ``` 要在酷家乐中运行,请参考[启动小程序](https://open.kujiale.com/pub/saas/open-platform/doc-detail?app_id=15&doc_tab=doc&tab_id=15&node_id=1367&node_type=1)。