Compare commits
1 Commits
604bd0910e
...
e7a26ae602
Author | SHA1 | Date | |
---|---|---|---|
e7a26ae602 |
@@ -1,96 +0,0 @@
|
||||
/**
|
||||
* @file 优化布局相关的数据模型,包含优化输入、输出、大板、小板以及各类枚举
|
||||
* @todo 目前仅适配了矩形优化,后续还需要对数据结构进行扩展
|
||||
* @author CZY
|
||||
* @since 0.1.8
|
||||
*/
|
||||
|
||||
/** 优化小板输入 */
|
||||
export interface LayoutBlock {
|
||||
/** 小板ID */
|
||||
id: number;
|
||||
/** 长 */
|
||||
length: number;
|
||||
/** 宽 */
|
||||
width: number;
|
||||
/** 纹路类型 */
|
||||
waveType: WaveType;
|
||||
/** 排版面类型 */
|
||||
composingType: ComposingType;
|
||||
/** 孔洞类型 */
|
||||
holeType: HoleType;
|
||||
/** 是否为矩形板 */
|
||||
isRect?: boolean;
|
||||
/** 是否需要双面加工 */
|
||||
isdtwosided?: boolean;
|
||||
}
|
||||
|
||||
/** 优化大板输入 */
|
||||
export interface LayoutBoard {
|
||||
length: number;
|
||||
width: number;
|
||||
}
|
||||
|
||||
/** 纹路类型 */
|
||||
export enum WaveType {
|
||||
/** 正纹 */
|
||||
Positive = 0,
|
||||
/** 反纹 */
|
||||
Reverse = 1,
|
||||
/** 可翻转 */
|
||||
CanReversal = 2,
|
||||
}
|
||||
|
||||
/** 排版面 */
|
||||
export enum ComposingType {
|
||||
/** 正面 */
|
||||
Positive = 0,
|
||||
Reverse = 1, //反面
|
||||
Arbitrary = 2 //任意
|
||||
}
|
||||
|
||||
/** 孔类型 */
|
||||
export enum HoleType {
|
||||
/** 没有孔 */
|
||||
None = 0,
|
||||
/** 正面 */
|
||||
Positive = 1,
|
||||
/** 反面 */
|
||||
Reverse = 2,
|
||||
/** 正反皆有 */
|
||||
Two = 3
|
||||
}
|
||||
|
||||
/** 布局大板 */
|
||||
export interface LayoutResultBoard {
|
||||
id: string;
|
||||
/** 大板宽度 */
|
||||
boardWidth: number;
|
||||
/** 大板高度 */
|
||||
boardHeight: number;
|
||||
}
|
||||
|
||||
/** 布局小板 */
|
||||
export interface LayoutResultBlock {
|
||||
id: string;
|
||||
/** x坐标 */
|
||||
x: number;
|
||||
/** y坐标 */
|
||||
y: number;
|
||||
/** 宽度 */
|
||||
width: number;
|
||||
/** 高度 */
|
||||
height: number;
|
||||
/** 纹路类型 */
|
||||
waveType: WaveType;
|
||||
}
|
||||
|
||||
/** 优化布局结果 */
|
||||
export type LayoutResult = {
|
||||
/** 大板列表 */
|
||||
boards: LayoutResultBoard[],
|
||||
/** 小板列表,其一维与boards长度对应,二维为小板列表 */
|
||||
blocks: LayoutResultBlock[][],
|
||||
/** 优化中被使用的余料大板,这个列表中的每一个元素代表使用了一片该规格的大板 */
|
||||
usedScrapBoard: LayoutResultBoard[];
|
||||
};
|
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file 矩形板件布局优化处理器使用的数据模型
|
||||
* @file 矩形板件布局优化处理器使用的数据模型,包含优化输入、输出、大板、小板以及各类枚举
|
||||
* @todo 目前仅适配了矩形优化,后续还需要对数据结构进行扩展
|
||||
* @since 0.1.8
|
||||
* @author CZY
|
||||
*/
|
||||
|
||||
import { ConfigBase } from "../config";
|
||||
import { LayoutBlock, LayoutBoard, LayoutResult } from "../layout";
|
||||
|
||||
export interface RectLayoutProcInput {
|
||||
/** 小板列表 */
|
||||
@@ -32,4 +32,94 @@ export class RectLayoutProcConfig extends ConfigBase {
|
||||
gap: number = 0;
|
||||
}
|
||||
|
||||
export type RectLayoutProcOutput = LayoutResult;
|
||||
export type RectLayoutProcOutput = LayoutResult;
|
||||
|
||||
/** 优化小板输入 */
|
||||
export interface LayoutBlock {
|
||||
/** 小板ID */
|
||||
id: number;
|
||||
/** 长 */
|
||||
length: number;
|
||||
/** 宽 */
|
||||
width: number;
|
||||
/** 纹路类型 */
|
||||
waveType: WaveType;
|
||||
/** 排版面类型 */
|
||||
composingType: ComposingType;
|
||||
/** 孔洞类型 */
|
||||
holeType: HoleType;
|
||||
/** 是否为矩形板 */
|
||||
isRect?: boolean;
|
||||
/** 是否需要双面加工 */
|
||||
isdtwosided?: boolean;
|
||||
}
|
||||
|
||||
/** 优化大板输入 */
|
||||
export interface LayoutBoard {
|
||||
length: number;
|
||||
width: number;
|
||||
}
|
||||
|
||||
/** 纹路类型 */
|
||||
export enum WaveType {
|
||||
/** 正纹 */
|
||||
Positive = 0,
|
||||
/** 反纹 */
|
||||
Reverse = 1,
|
||||
/** 可翻转 */
|
||||
CanReversal = 2,
|
||||
}
|
||||
|
||||
/** 排版面 */
|
||||
export enum ComposingType {
|
||||
/** 正面 */
|
||||
Positive = 0,
|
||||
Reverse = 1, //反面
|
||||
Arbitrary = 2 //任意
|
||||
}
|
||||
|
||||
/** 孔类型 */
|
||||
export enum HoleType {
|
||||
/** 没有孔 */
|
||||
None = 0,
|
||||
/** 正面 */
|
||||
Positive = 1,
|
||||
/** 反面 */
|
||||
Reverse = 2,
|
||||
/** 正反皆有 */
|
||||
Two = 3
|
||||
}
|
||||
|
||||
/** 布局大板 */
|
||||
export interface LayoutResultBoard {
|
||||
id: string;
|
||||
/** 大板宽度 */
|
||||
boardWidth: number;
|
||||
/** 大板高度 */
|
||||
boardHeight: number;
|
||||
}
|
||||
|
||||
/** 布局小板 */
|
||||
export interface LayoutResultBlock {
|
||||
id: string;
|
||||
/** x坐标 */
|
||||
x: number;
|
||||
/** y坐标 */
|
||||
y: number;
|
||||
/** 宽度 */
|
||||
width: number;
|
||||
/** 高度 */
|
||||
height: number;
|
||||
/** 纹路类型 */
|
||||
waveType: WaveType;
|
||||
}
|
||||
|
||||
/** 优化布局结果 */
|
||||
export type LayoutResult = {
|
||||
/** 大板列表 */
|
||||
boards: LayoutResultBoard[],
|
||||
/** 小板列表,其一维与boards长度对应,二维为小板列表 */
|
||||
blocks: LayoutResultBlock[][],
|
||||
/** 优化中被使用的余料大板,这个列表中的每一个元素代表使用了一片该规格的大板 */
|
||||
usedScrapBoard: LayoutResultBoard[];
|
||||
};
|
Reference in New Issue
Block a user