Files
cut-abstractions/src/models/processors/modelProcessPoints.ts
lixiang a430d40f14 造型处理器接口 (#9)
Reviewed-on: #9
Reviewed-by: 谢凡 <xief@163.com>
Co-authored-by: lixiang <504331699@qq.com>
Co-committed-by: lixiang <504331699@qq.com>
2025-08-13 15:41:20 +08:00

114 lines
2.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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'