造型处理器接口 (#9)
Reviewed-on: #9 Reviewed-by: 谢凡 <xief@163.com> Co-authored-by: lixiang <504331699@qq.com> Co-committed-by: lixiang <504331699@qq.com>
This commit is contained in:
59
src/models/processors/cutPoint.ts
Normal file
59
src/models/processors/cutPoint.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { ConfigBase } from "../config"
|
||||
import { IProcessingItem } from "../processItem"
|
||||
|
||||
/**
|
||||
* 下刀点 入参
|
||||
*/
|
||||
export type CutPointInput = {
|
||||
|
||||
/** (余料板异形点) 开料大板的开料轮廓数据 若没有则需要传 开料大板宽、高*/
|
||||
boardPointInfo?: IProcessingItem,
|
||||
/** 开料大板宽 若有 boardPointInfo 则不需要传 */
|
||||
boardWidth?: number,
|
||||
/** 开料大板长 若有 boardPointInfo 则不需要传 */
|
||||
boardLength?: number
|
||||
/** 小板数据集 */
|
||||
blocks?: CutPointInputBlock[]
|
||||
}
|
||||
/** 处理器输出---下刀点 */
|
||||
export type CutPointOutput = {
|
||||
blocks: CutPointOutputBlock[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 小板类型 输入
|
||||
*/
|
||||
export type CutPointInputBlock = {
|
||||
/** 小板唯一标识 */
|
||||
id: string | number;
|
||||
/** 排版长 */
|
||||
length: number;
|
||||
/** 排版宽 */
|
||||
width: number;
|
||||
/** 板件坐标X */
|
||||
x: number;
|
||||
/** 板件坐标y */
|
||||
y: number;
|
||||
/** 开料顺序 */
|
||||
cutOrder: number;
|
||||
/**
|
||||
* 板件轮廓
|
||||
* 用以分析下刀点的板件轮廓
|
||||
* */
|
||||
blockPoints: IProcessingItem
|
||||
/** 是否异形 true 是异形 false 矩形 */
|
||||
isUnRegular: boolean
|
||||
};
|
||||
|
||||
/** 小板类型 输出 */
|
||||
export type CutPointOutputBlock = CutPointInputBlock & {
|
||||
/** 下刀点 板件轮廓的下标 */
|
||||
cutPointId?: number,
|
||||
}
|
||||
|
||||
/** 下刀点配置
|
||||
*
|
||||
* 注:暂时没有配置项
|
||||
*/
|
||||
export declare class CutPointConfig extends ConfigBase {
|
||||
}
|
38
src/models/processors/holeToModel.ts
Normal file
38
src/models/processors/holeToModel.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { ConfigBase } from "../config"
|
||||
import { IProcessingItem } from "../processItem"
|
||||
|
||||
/** 处理器输入 -孔转造型*/
|
||||
export type HoleToModelInput = {
|
||||
/** 孔信息 */
|
||||
holeData: HoleToModelProcessingItem[],
|
||||
/** 孔所在板件的优化后的坐标 X (可选)*/
|
||||
placeX?: number,
|
||||
/** 孔所在板件的优化后的坐标 Y (可选)*/
|
||||
placeY?: number,
|
||||
/** 孔所在板件的 厚度 */
|
||||
thickness: number
|
||||
}
|
||||
/** 处理器输出-- 获取造型在大板的刀路 */
|
||||
export type HoleToModelOutput = {
|
||||
/** 孔转造型 后的 造型数据 */
|
||||
modelData: HoleToModelProcessingItem[],
|
||||
/** 未处理的孔数据 以及信息 */
|
||||
noHandleItem: noHandleItemType[]
|
||||
}
|
||||
export type noHandleItemType = {
|
||||
/** 未处理的孔信息 */
|
||||
holeData: HoleToModelProcessingItem,
|
||||
/** 未处理 说明 */
|
||||
info: string
|
||||
}
|
||||
/** 处理器配置-- 获取造型在大板的刀路 */
|
||||
export declare class HoleToModelProcConfig extends ConfigBase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** 加工项的类型 */
|
||||
export type HoleToModelProcessingItem = IProcessingItem & {
|
||||
/** 使用刀具的刀半径 */
|
||||
knifeRadius: number
|
||||
}
|
113
src/models/processors/modelProcessPoints.ts
Normal file
113
src/models/processors/modelProcessPoints.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import { ConfigBase } from "../config"
|
||||
import { IPoint } from "../processItem"
|
||||
|
||||
/** 处理器输入-- 获取造型在大板的刀路 */
|
||||
export type ModelProcessPointsInput = {
|
||||
/** 小板数据 */
|
||||
block: ModelProcessPointsInputBlock,
|
||||
/** 小板的最终的放置位置 */
|
||||
targetPosition: PositionType
|
||||
}
|
||||
/** 处理器输入--小板 -- 获取造型在大板的刀路 */
|
||||
export type ModelProcessPointsInputBlock = {
|
||||
/** 板件唯一标识 */
|
||||
id: string | number,
|
||||
/** 板件基于大板的 坐标X */
|
||||
x: number,
|
||||
/** 板件基于大板的 坐标y */
|
||||
y: number,
|
||||
/** 板件(小板)长 */
|
||||
length: number,
|
||||
/** 板件(小板)宽 */
|
||||
width: number,
|
||||
/** 造型数据 依据放置方式positionType 下的造型数据 默认为 依据放置方式positionType.FRONT 的造型数据 */
|
||||
models: ModelProcessItem[],
|
||||
/** 板件的原放置方式 默认为正面(0) 不传则为正面 原 placestyle*/
|
||||
positionType?: PositionType,
|
||||
/** 偏移值 */
|
||||
offsetInfo: OffsetInfo
|
||||
|
||||
}
|
||||
/** 板件 上下左右 偏移值信息 */
|
||||
export type OffsetInfo = {
|
||||
top: number,
|
||||
bottom: number,
|
||||
left: number,
|
||||
right: number,
|
||||
}
|
||||
/** 处理器输出--小板 -- 获取造型在大板的刀路 */
|
||||
export type ModelProcessPointsOutputBlock = {
|
||||
/** 板件唯一标识 */
|
||||
id: string | number
|
||||
/** 放置方式 */
|
||||
positionType: PositionType
|
||||
/** 造型数据 */
|
||||
models: ModelProcessItem[]
|
||||
/** 板件(小板)长 */
|
||||
length: number,
|
||||
/** 板件(小板)宽 */
|
||||
width: number,
|
||||
/** 偏移值 */
|
||||
offsetInfo: OffsetInfo
|
||||
}
|
||||
/** 处理器输出-- 获取造型在大板的刀路 */
|
||||
export type ModelProcessPointsOutput = {
|
||||
block: ModelProcessPointsOutputBlock
|
||||
}
|
||||
|
||||
/** 处理器配置-- 获取造型在大板的刀路 暂无 */
|
||||
export declare class ModelProcessPointsProcConfig extends ConfigBase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** 造型类 */
|
||||
export interface ModelProcessItem {
|
||||
/** 加工项唯一标识 */
|
||||
id?: string | number
|
||||
/**
|
||||
* 加工点数组
|
||||
*/
|
||||
pts: IPoint[];
|
||||
/**
|
||||
* 凸度数组
|
||||
*/
|
||||
buls: number[];
|
||||
/** 加工面 */
|
||||
face: FaceType
|
||||
|
||||
}
|
||||
|
||||
/** 加工面 */
|
||||
export enum FaceType {
|
||||
/** 正面 */
|
||||
FRONT = 0,
|
||||
/** 反面 */
|
||||
BACK = 1,
|
||||
}
|
||||
|
||||
|
||||
/** 小板的放置方式 */
|
||||
export enum PositionType {
|
||||
/** 正面 */
|
||||
FRONT = 0,
|
||||
/** 正面右转 */
|
||||
FRONT_TURN_RIGHT = 1,
|
||||
/** 正面后转 */
|
||||
FRONT_TURN_BACK = 2,
|
||||
/** 正面左转 */
|
||||
FRONT_TURN_LEFT = 3,
|
||||
/** 反面 */
|
||||
BACK = 4,
|
||||
/** 反面右转 */
|
||||
BACK_TURN_RIGHT = 5,
|
||||
/** 反面后转 */
|
||||
BACK_TURN_BACK = 6,
|
||||
/** 反面左转 */
|
||||
BACK_TURN_LEFT = 7,
|
||||
}
|
||||
|
||||
|
||||
/** 行为类型 */
|
||||
export type RotationAction = 'doNothing' | 'turnLeft' | 'turnRight' | 'turnAround'
|
||||
|
Reference in New Issue
Block a user