从产品新建:为产品规划包装
POST /pack-first 为一种产品或混装的多种产品规划包装,与 ParametrIQ 的文件 › 从产品新建相同(从产品新建):列出产品在箱内直立或平放的每种方式,每种方式配上库规则推荐的附件和外箱(或收缩膜底托),按所需尺寸生成,计算成本并适配托盘,最优的排在前面;如有要求,还返回其中一种方案的图纸及从中导出的文件。无需发送模板:所用设计均来自库本身。
请求
| 字段 | 含义 |
|---|---|
product |
产品:shape(Round 或 Boxed),以 mm 为单位的尺寸(diameter,或 length 和 width;height),material(Glass、Pet、Can、Carton 或 Other),每箱数量(count),以及已知时的单个重量(weight,kg)。 |
products |
代替 product,用于混装:上述产品的列表,每种有自己的 count。产品按顺序分组放入格子,每种产品占用整行(或整列),附件允许时每个格子按其产品确定尺寸(混装)。 |
play |
每个产品周围的间隙:格子的内尺寸为产品尺寸加上此值(省略时为 2 mm)。 |
clearance |
附件外尺寸与外箱内尺寸之间的间隙(省略时为 3 mm)。 |
rankBy |
Cheapest(默认)、LeastBoard 或 BestPalletFit。 |
twoLayers |
是否提供中间垫层垫的多层方案:直立时数量为偶数可分两层;平放时可分二至四层(省略时为 true)。 |
orientation |
Upright(默认)、Lying(产品平放,其高度沿箱长或箱宽方向)或 Either(两者都有,一起排序)。规则规定永不平放的材料仍保持直立。 |
style |
Case(默认)或 ShrinkTray:浅底托内放产品,外面整体裹上收缩膜。 |
trayWallHeight |
收缩膜底托的侧壁高度,mm(省略时为产品高度的四分之一,至少 25)。 |
make |
方案在列表中的位置(从 0 开始):同时返回其图纸。 |
exports |
要返回的图纸文件(该方案的图纸;省略 make 时为第一个方案的图纸):每项为 /formats 中的一种 format,对于只写一页的格式,再加一个 page(参见导出)。 |
options |
导出方式,与 /export 的 options 相同(边距、专色、外观等)。 |
应答
plans,最优的排在前面:每种排列(长向、宽向的格子数和层数,格子内尺寸,lying:None、AlongLength 或 AlongWidth),其附件(null:无;其 quantity:每层一个)及其他适用附件(包括 "None"),其外箱及其他外箱,层垫(及其 quantity:每两层之间一块),每个部件的设计、生成时所用的值、外尺寸、纸板、面积(m²)和成本(均按一个计);外箱所装内容、外箱内外尺寸(mm),纸板总面积和总成本,是否每种纸板在价目表中都有价格,以及 1200 × 800(EUR)和 1200 × 1000(UK)托盘每层可放箱数;products,每种产品的名称和数量。混装时按产品确定尺寸的格子还给出 cellLengths 和 cellWidths(每列和每行格子的内尺寸,mm;全部与格子相同时为 null)以及 byColumns(产品是否逐列放入)。收缩膜底托还有 trayWall(侧壁高度,mm)和 film:其 area(m²,包装外表面加 10% 的搭接)、cost(按价目表中 Film: shrink 的每 m² 价格计算,已计入方案成本)以及是否有价格(priced)。给出 make(或 exports)时,drawing 为该方案的 ParametrIQ 图纸文本(每个部件一页、装配页、图纸页和 3D 页),title 为其标题。
产品缺少尺寸、make 不是有效的方案位置、格式不存在,或图纸没有所请求的页面时,请求将被拒绝(400)。
导出
exports 中的每一项都按请求的顺序在 exports 中返回,附带其 format、所属页面 page、媒体类型(contentType)、fileName、文件本身(content,base64)及其 warnings:
| 格式 | 写出的内容 |
|---|---|
pdf |
除 3D 页外的每一页,每页一个 PDF 页面(给出 page 时只写该页)。 |
glb、usdz、step |
3D 页:外箱折叠后包住附件和产品,与 3D 视图所做的相同。 |
其他任何格式(dxf、svg、cf2、dielinepdf 等) |
一页:page(Outer、Fitment、Pad、Assembly、Sheet 1),省略时为外箱页。 |
示例
POST /pack-first
X-API-KEY: your-api-key
Content-Type: application/json
{
"product": { "shape": "Round", "diameter": 65, "height": 250, "material": "Glass", "count": 6 },
"rankBy": "Cheapest",
"make": 0
}
{
"plans": [
{
"arrangement": "3 × 2", "across": 3, "down": 2, "layers": 1, "turned": false, "lying": "None",
"cell": { "length": 67, "width": 67, "height": 252 },
"fitment": { "design": "Bottle shipper partitions", "values": { "L": 67, "W": 67, "D": 250, "CELLSL": 3, "CELLSW": 2 },
"outside": { "length": 207, "width": 137, "height": 250 }, "board": "B flute (3 mm)",
"boardArea": 0.149, "cost": 0.07, "priced": true, "printed": [ "Long partitions: 1 of 207 × 250; …" ],
"quantity": 1 },
"fitments": [ "Bottle shipper partitions", "Bottle platform insert with hole grid", "Case insert grid", "None" ],
"outer": { "design": "FEFCO 0201 Regular slotted container", "values": { "L": 210, "W": 140, "D": 255 }, "…": "…" },
"outers": [ "FEFCO 0201 Regular slotted container", "Shipping case with carry handle", "…" ],
"pad": null,
"contents": { "length": 207, "width": 137, "height": 252 },
"inside": { "length": 210, "width": 140, "height": 255 },
"outside": { "length": 216, "width": 146, "height": 267 },
"boardArea": 0.414, "cost": 0.19, "priced": true,
"pallets": [ { "pallet": "EUR", "length": 1200, "width": 800, "perLayer": 29, "layers": 6, "total": 174 }, "…" ],
"weight": null, "problems": [], "film": null, "trayWall": null,
"products": [ { "name": "", "count": 6 } ]
}
],
"drawing": "//Product// ParametrIQ …",
"title": "6 × Bottle in a FEFCO 0201 Regular slotted container",
"exports": []
}
示例:混装、收缩膜包装并导出文件
POST /pack-first
X-API-KEY: your-api-key
Content-Type: application/json
{
"products": [
{ "name": "Tomatoes", "shape": "Round", "diameter": 73, "height": 110, "material": "Can", "count": 4 },
{ "name": "Beans", "shape": "Round", "diameter": 66, "height": 115, "material": "Can", "count": 2 }
],
"style": "ShrinkTray",
"trayWallHeight": 30,
"exports": [ { "format": "pdf" }, { "format": "dxf", "page": "Outer" }, { "format": "glb" } ]
}
{
"plans": [
{
"arrangement": "3 × 2", "lying": "None", "cell": { "length": 75, "width": 75, "height": 117 },
"fitment": null, "fitments": [ "None" ],
"outer": { "design": "Tray with glued corners", "values": { "L": 228, "W": 153, "D": 30 }, "…": "…" },
"trayWall": 30,
"film": { "area": 0.218, "cost": 0.02, "priced": true },
"products": [ { "name": "Tomatoes", "count": 4 }, { "name": "Beans", "count": 2 } ],
"…": "…"
}
],
"drawing": "//Product// ParametrIQ …",
"title": "6 × Tomatoes + Beans in a Tray with glued corners",
"exports": [
{ "format": "Pdf", "page": null, "contentType": "application/pdf", "fileName": "pack.pdf", "content": "JVBERi0xLjc…", "warnings": [] },
{ "format": "Dxf", "page": "Outer", "contentType": "image/vnd.dxf", "fileName": "pack-outer.dxf", "content": "…", "warnings": [] },
{ "format": "Glb", "page": "3D", "contentType": "model/gltf-binary", "fileName": "pack-3d.glb", "content": "Z2xURg…", "warnings": [] }
]
}