# 系統櫃繪圖資料結構規格
## 模組 JSON
資料儲存的每個模組,以 JSON object 格式儲存。
JSON object 參數包含:
1. module
模組名稱
2. sn
若模組是產品類,可以用 sn 設定對應的產品料號。
3. instance
根據產品定義檔,每個產品有對應的數個屬性,請寫入由 instance 物件中。
範例:
```
{
"module": "cabinet", //系統櫃模組
"sn": "LMF-C-SCTB", //側包頂底一般空櫃
"instance": { //產品屬性
"fit": false, //填滿空間
"size": [300, 300, 300], //尺寸
"position": [0, 150, 0], //座標
"rotation": [0, 0, 0], //旋轉
"offset": [0,0,0], //偏移
}
}
```
### 空間分割巢狀結構
空間類模組有空間分割的功能,包含:area 櫃組施作範圍,cabinet 系統櫃內部空間
參數包含:
1. layout
決定內部空間排列方式
grid 表示格欄排列,具有 html table 類似的排版方式,適合大空間分割,因此建議用在櫃組施作範圍上。
flex 表示彈性順序排列,與 css display flex 有類似的排版方式,適合順序排列的空間分割,因此適合用在櫃內空間。
2. inner
內部空間的實體,以 JSON Array 填入子模組資料。
3. layoutSize 內部空間指定排版大小的需求,建議左右及上下留一個auto格,當覆量校正時,修正施作範圍寬高,即可自適應範圍大小應。
4. layoutRow 垂直方向合併
5. layoutCol 水平方向合併
6. layoutDirection
內部空間使用時,只要指定排列方向。
## 櫃組施作範圍模組 area
instance參數包含:
1. label 用於顯示台灣室內裝修協會制定的圖標。
2. face 面向,從平面圖看,櫃子的正面朝哪個方向,0向前,1向右,2向後,3向左
3. size 以 array 格式儲存寬高深。
4. position 以 array 格式儲存xyz座標。
範例:
設計一個櫃組施作範圍(area),寬度1000mm,高度1600mm,深度400mm,並按照下圖分割,放入一般空櫃。

Step 1. 建立 area 施作範圍模組。
```
{
"module": "area",
"instance": {
"size": [1000,1600,400],
"face": 0, //0向前,1向右,2向後,3向左
"label": "A"
},
"layout": "grid",
"inner": []
}
```
Step 2.
放入橫向空間,順序同 html table 要先放\<tr\>。
```
{
"module": "area",
"instance": {
"size": [1000,1600,400],
"face": 0,
"label": "A"
},
"layout": "grid",
"inner": [
{
"module": "space"
"layoutSize": 300, //第一層櫃子高
},
{
"module": "space"
"layoutSize": "auto", //第二層櫃子高
},
{
"module": "space"
"layoutSize": 300, //第三層櫃子高
},
{
"module": "space"
"layoutSize": "auto", //第四層櫃子高
},
{
"module": "space"
"layoutSize": 300, //第五層櫃子高
},
]
}
```
Step 3.
放入縱向空間,同 html 的 \<td\> 放在 \<tr\> 內。
```
{
"module": "area",
"instance": {
"size": [1000,1600,400],
"face": 0,
"label": "A"
},
"layout": "grid",
"inner": [
{
"module": "space"
"layoutSize": 300,
"inner": [
{ //最上排的櫃子1
"layoutSize": 300, //寬度300
"layoutRow": 3 //佔3格
"module": "cabinet", //櫃子模組
"sn": "LMF-C-SCTB" //產品編號
},
{ //最上排的櫃子2
"layoutSize": "auto", //寬度auto
"layoutCol": 2 //佔3格
"module": "cabinet", //櫃子模組
"sn": "LMF-C-SCTB" //產品編號
}
]
},
{
"module": "space"
"layoutSize": "auto",
"inner": [ //第二層沒有櫃子,但有兩個空間
{
"module": "space"
},
{
"module": "space"
}
]
},
{
"module": "space"
"layoutSize": 300,
"inner": [
{ //第三層櫃子中間
"layoutSize": "auto", //寬度auto
"module": "cabinet", //櫃子模組
"sn": "LMF-C-SCTB" //產品編號
},
{ //第三層櫃子右邊
"layoutSize": "300", //寬度300
"layoutRow": 3 //佔3格
"module": "cabinet", //櫃子模組
"sn": "LMF-C-SCTB" //產品編號
}
]
},
{
"module": "space"
"layoutSize": "auto",
"inner": [ //第四層沒有櫃子,但有兩個空間
{
"module": "space"
},
{
"module": "space"
}
]
},
{
"module": "space"
"layoutSize": 300,
"inner": [
{ //第五層櫃子左
"layoutSize": "auto",//寬度auto
"layoutCol": 2 //佔2格
"module": "cabinet", //櫃子模組
"sn": "LMF-C-SCTB" //產品編號
}
]
},
]
}
```
## 系統櫃模組 cabinet
module 參數包含:
1. sn 代表載入哪一個櫃子的定義檔
instance參數包含:
1. fit 自動適應寬身高
2. size 以 array 格式儲存寬高深。若 fit 是 true,則不需帶入。
3. offset 以 array 格式儲存xyz座標偏移量。
4. 其他參數,根據定義檔 props 中的項目填入,若無則會用預設值。
範例:
以上圖第三層的櫃子當範例

Step 1. 先擺放櫃子模組,使用一般空櫃
```
{ //第三層櫃子右邊
"layoutSize": "300", //寬度300
"layoutRow": 3 //佔3格
"module": "cabinet", //櫃子模組
"sn": "LMF-C-SCTB" //產品編號 一般空櫃
"instance": {
"fit": true, //櫃子佔滿空間
"supportBarType": "M" //中背拉
}
}
```
Step 2. 放置 y 向排列的空間及隔板
```
{ //第三層櫃子右邊
"layoutSize": "300",
"layoutRow": 3
"module": "cabinet",
"sn": "LMF-C-SCTB",
"instance": {
"fit": true,
"supportBarType": "M"
},
"layout": "flex",
"layoutDirection": "y",
"inner": [
{
"layoutSize": 250, // y向空間佔250
"module": "innerSpace", // 內部空間模組
},
{
"layoutSize": 18, // y向空間佔18
"module": "panel", // 板件模組
"sn": "LMF-P-AFP", // 產品料號 活隔板
"instance": {
"fit": true // 填滿空間
}
},
{
"layoutSize": 250, // y向空間佔250
"module": "innerSpace", // 內部空間模組
},
{
"layoutSize": 18, // y向空間佔18
"module": "panel", // 板件模組
"sn": "LMF-P-FFP", // 產品料號 固隔板
"instance": {
"fit": true // 填滿空間
}
},
{
"layoutSize": "auto", // y向剩餘空間
"module": "innerSpace" // 內部空間模組
}
]
}
```
Step 3. 放置 x 向排列的空間及隔板
```
{ //第三層櫃子右邊
"layoutSize": "300",
"layoutRow": 3
"module": "cabinet",
"sn": "LMF-C-SCTB",
"instance": {
"fit": true,
"supportBarType": "M"
},
"layout": "flex",
"layoutDirection": "y",
"inner": [
{
"layoutSize": 250,
"module": "innerSpace",
},
{
"layoutSize": 18,
"module": "panel",
"sn": "LMF-P-AFP",
"instance": {
"fit": true
}
},
{
"layoutSize": 250,
"module": "innerSpace",
},
{
"layoutSize": 18,
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
}
},
{
"layoutSize": "auto",
"module": "innerSpace",
"layout": "flex", //設定內部空間排列方式
"layoutDirection": "x", //排列方向x向由左到右
"inner": [
{
"layoutSize": 120, //第一個空間寬度120
"module": "innerSpace" //屬於內部空間模組
},
{
"layoutSize": 18, //第二個是固隔板寬度18
"module": "panel", //屬於板件模組
"sn": "LMF-P-MSP", //產品料號 中立板
"instance": {
"fit": true //填滿空間
}
},
{
"layoutSize": "auto", //剩餘空間自動寬度
"module": "innerSpace" //屬於內部空間模組
},
]
}
]
}
```
## 抽屜和抽屜群組模組
抽屜群組 drawerGroup
instance參數包含:
1. fit 自動適應寬深高
2. size 以 array 格式儲存寬高深。若 fit 是 true,則不需帶入。
3. marginFront 離前距離,內縮閃避鉸鏈時,指定80,或有其他內縮需求可指定數字。
4. leftPanel 左補版,指定 25 或 40。
5. rightPanel 右補版,指定 25 或 40。
模組的 inner 可放置抽屜模組,由上而下排列,尺寸指定與 layout 功能相同。
抽身模組 drawer
instance參數包含:
1. fit 自動適應寬深高
2. size 以 array 格式儲存寬高深。若 fit 是 true,則不需帶入。
3. height 抽牆高度,正值為指定高度,負值為最的高度往下減少。
4. front 抽頭類別,inside 為內抽,outside 為外蓋抽。
範例:
來一個複雜的例子,第一格抽屜為外抽,第二格抽屜為內抽,第三格抽屜為櫃內2抽。

Step 1. 先擺放櫃子模組,使用一般空櫃
```
{ //第三層櫃子右邊
"module": "cabinet", //櫃子模組
"sn": "LMF-C-SCTB", //產品編號 一般空櫃
"instance": {
"supportBarType": "M", //中背拉
"size": [300, 600, 500]//寬300高600深500
}
}
```
Step 2. 分割空間及抽屜
```
{ //第三層櫃子右邊
"module": "cabinet",
"sn": "LMF-C-SCTB",
"instance": {
"supportBarType": "M",
"size": [300, 600, 500]
},
"layout": "flex",
"layoutDirection": "y", //內部空間y向排列,由上而下
"inner": [
{
"layoutSize": 40, //第一格40mm
"module": "panel", //板件模組
"sn": "LMF-P-FR0", //產品料號 檔板
"instance": {
"fit": true //自動大小
}
},
{
"layoutSize": 100, //第二格 100mm
"module": "drawer", //抽屜模組
"instance": {
"fit": true,
"front": "outside" //外蓋抽
}
},
{
"layoutSize": 18, //第三格 18mm
"module": "panel", //板件模組
"sn": "LMF-P-FFP", //產品料號 固格
"instance": {
"fit": true
}
},
{
"layoutSize": 100, //第四格 100mm
"module": "drawer", //抽屜模組
"instance": {
"fit": true,
"front": "inside" //內抽
}
},
{
"layoutSize": 18, //第五格 18mm
"module": "panel", //板件模組
"sn": "LMF-P-FFP", //產品料號 固格
"instance": {
"fit": true
}
},
{
"layoutSize": auto, //第五格 18mm
"module": "drawerGroup", //內抽兩組使用群組
"instance": {
"fit": true,
"marginFront": 80, //離前距離80
"leftPanel": 25 //左側補版25
},
"inner": [
{
"layoutSize": 100, //第一格100高
"module": "drawer", //抽屜模組
"instance": {
"fit": true,
"front": "inside", //櫃內抽
"height": -40 //抽高減少40
}
},
{
"layoutSize": "auto", //第二格自動高度
"module": "drawer",
"instance": {
"fit": true,
"front": "inside",
"height": -40
}
}
]
}
]
}
```
## 抽頭模組
完成抽屜模組之後,接下來要設置抽頭。
抽屜模組 drawer 的 module 參數可新增 door 物件,以門板模組或板件模組設定抽頭。
door 參數包含:
1. paddingTop 上延伸,外蓋抽預設17,內抽預設-1
2. paddingBottom 下延伸,外蓋抽預設17,內抽預設-1
3. paddingLeft 左延伸,外蓋抽預設17,內抽預設-1
4. paddingRight 右延伸,外蓋抽預設17,內抽預設-1
5. module 指定門板使用的模組,預設 door
6. sn 指定門板模組使用的料號,預設 LMF-D-4E
7. instance 門板模組參數,根據產品描述檔而定
範例:
剛剛的抽屜加上門板,第一格為外蓋門板,上蓋20,左蓋17,又17,下蓋8。
第二格內抽,預設四邊扣1。
第三格櫃內抽群組,皆為內抽,上扣30指縫。

```
{ //第三層櫃子右邊
"module": "cabinet",
"sn": "LMF-C-SCTB",
"instance": {
"supportBarType": "M",
"size": [300, 600, 500]
},
"layout": "flex",
"layoutDirection": "y",
"inner": [
{
"layoutSize": 40,
"module": "panel",
"sn": "LMF-P-FR0",
"instance": {
"fit": true
}
},
{
"layoutSize": 100,
"module": "drawer",
"instance": {
"fit": true,
"front": "outside"
},
"door": {
"paddingTop": 20, //外抽上延20
"paddingBottom": 8, //外抽下延8
"paddingLeft": 17, //外抽左延17
"paddingRight": 17, //外抽右延17
"module": "door",
"sn": "LMF-D-4E",
"instance": {
"fit": true
}
}
},
{
"layoutSize": 18,
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
}
},
{
"layoutSize": 100,
"module": "drawer",
"instance": {
"fit": true,
"front": "inside"
},
"door": { //不帶間距,使用預設值
"module": "door",
"sn": "LMF-D-4E",
"instance": {
"fit": true
}
}
},
{
"layoutSize": 18,
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
}
},
{
"layoutSize": auto,
"module": "drawerGroup",
"instance": {
"fit": true,
"marginFront": 80,
"leftPanel": 25
},
"inner": [
{
"layoutSize": 100,
"module": "drawer",
"instance": {
"fit": true,
"front": "inside",
"height": -40
},
"door": {
"paddingTop": -30, //扣30指縫
"module": "door",
"sn": "LMF-D-4E",
"instance": {
"fit": true
}
}
},
{
"layoutSize": "auto",
"module": "drawer",
"instance": {
"fit": true,
"front": "inside",
"height": -40
},
"door": {
"paddingTop": -30, //扣30指縫
"module": "door",
"sn": "LMF-D-4E",
"instance": {
"fit": true
}
}
}
]
}
]
}
```
## 門板模組
門板模組可附掛在 cabinet 或 innerSpace 模組之下,以空間外推為參考點。
module 的 door 參數有:
1. layout 同空間分割的 layout
2. layoutDirection
3. type 門板類別 inside 入柱門,outside 外蓋門
4. inner 空間分割,內部放門板模組 door 或是留白空間 doorSpace
door module 的參數為:
2. hingeAngel 指定鉸鏈角度,預設值 100,170,-90
3. connect 連結,left 左鉸鏈,right 右鉸鏈,top 上掀鉸鏈,bottom 下掀鉸鏈,fixed 假門
4. paddingTop 上延伸
5. paddingBottom 下延伸
6. paddingLeft 左延伸
7. paddingRight 右延伸
8. module 指定門板使用的模組,預設 door
9. sn 指定門板模組使用的料號,預設 LMF-D-4E
10. instance 門板模組參數,根據產品描述檔而定
範例:
一個500寬1500高櫃子,分四層空間,做不同的門板搭配示範。
左上為入柱門板,右上為上掀門,左中為假門,右中為反向門,固定在左邊。下方為對開門。

Step 1. 先繪製櫃體
```
{
"module": "cabinet", //櫃子模組
"sn": "LMF-C-SCTB", //產品編號 一般空櫃
"instance": {
"supportBarType": "M", //中背拉
"size": [500, 1500, 500]//寬500高1500深500
},
"layout": "flex",
"layoutDirection": "y",
"inner": [
{
"LayoutSize": 300, //上層空間
"module": "innerSpace",
"layout": "flex",
"layoutDirection": "x",
"inner": [
{
"layoutSize": 200,
"module": "innerSpace",
},
{
"layoutSize": 18,
"module": "panel",
"sn": "LMF-P-MSP"
},
{
"layoutSize": "auto",
"module": "innerSpace",
}
]
},
{
"layoutSize": 18
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
},
},
{
"layoutSize": 300,
"module": "innerSpace", //第二層空間
},
{
"layoutSize": 18
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
},
},
{
"layoutSize": auto, //第三層空間
"module": "innerSpace",
},
{
"layoutSize": 18
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
},
},
{
"layoutSize": 400, //第四層空間
"module": "innerSpace",
}
]
}
```
Step 2. 入柱門和上掀門
```
{
"module": "cabinet",
"sn": "LMF-C-SCTB",
"instance": {
"supportBarType": "M",
"size": [500, 1500, 500]
},
"layout": "flex",
"layoutDirection": "y",
"inner": [
{
"LayoutSize": 300,
"module": "innerSpace",
"layout": "flex",
"layoutDirection": "x",
"inner": [
{
"layoutSize": 200,
"module": "innerSpace",
"door": { // door 在 innerSpace 模組
"type": "inside" // 入住門
"layout": "flex",
"inner": [
{
"hingeAngel": 100, // 100度入柱鉸鏈
"connect": "left", // 左邊結合
"paddingTop": -1, // 扣縫 1
"paddingBottom": -1,// 扣縫 1
"paddingLeft": -1, // 扣縫 1
"paddingRight": -1, // 扣縫 1
"module": "door", // 門板模組
"sn": "LMF-D-4E", // 料號
"instance": {
"fit": true // 產品內容
}
}
]
}
},
{
"layoutSize": 18,
"module": "panel",
"sn": "LMF-P-MSP"
},
{
"layoutSize": "auto",
"module": "innerSpace",
"door": { // door 在 innerSpace 模組
"type": "outside" // 外蓋門
"layout": "flex",
"inner": [
{
"hingeAngel": 100, // 100度入柱鉸鏈
"connect": "top", // 左邊結合
"paddingTop": 17, // 外蓋 17
"paddingBottom": 8,// 外蓋 8
"paddingLeft": 17, // 外蓋 17
"paddingRight": 17, // 外蓋 17
"module": "door", // 門板模組
"sn": "LMF-D-4E", // 料號
"instance": {
"fit": true // 產品內容
}
}
]
}
}
]
},
{
"layoutSize": 18
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
},
},
{
"layoutSize": 300,
"module": "innerSpace",
},
{
"layoutSize": 18
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
},
},
{
"layoutSize": auto,
"module": "innerSpace",
},
{
"layoutSize": 18
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
},
},
{
"layoutSize": 400, //第四層空間
"module": "innerSpace",
}
]
}
```
door module 的參數為:
2. hingeAngel 指定鉸鏈角度,預設值 100,170,-90
3. connect 連結,left 左鉸鏈,right 右鉸鏈,top 上掀鉸鏈,bottom 下掀鉸鏈,fixed 假門
4. paddingTop 上延伸
5. paddingBottom 下延伸
6. paddingLeft 左延伸
7. paddingRight 右延伸
8. module 指定門板使用的模組,預設 door
9. sn 指定門板模組使用的料號,預設 LMF-D-4E
10. instance 門板模組參數,根據產品描述檔而定
Step 3. 假門,右側門,下方對開門
```
{
"module": "cabinet",
"sn": "LMF-C-SCTB",
"instance": {
"supportBarType": "M",
"size": [500, 1500, 500]
},
"layout": "flex",
"layoutDirection": "y",
"door": { // 門空間從 cabinet 內部空間開始計算
"type": "outside", // 外蓋
"layout": "flex"
"layoutDirection": "y",
"inner": [
{
"layoutSize": 318, // 中層門離上318
"module": "doorSpace",
},
{
"layoutSize": auto, // 中層門空間
"module": "doorSpace",
"layout": "flex",
"layoutDirection": "x", // 中層門x向排列
"inner": [
{
"layoutSize": 200, // 假門空間200
"module": "door",
"connect": "fixed", // 假門
"paddingTop": 8, // 外蓋上 8
"paddingBottom": 8, // 外蓋下 8
"paddingLeft": 17, // 外蓋左 17
"paddingRight": -1, // 外蓋右 -1
"module": "door", // 門板模組
"sn": "LMF-D-4E", // 料號
"instance": {
"fit": true // 產品內容
}
},
{
"layoutSize": auto, // 反向門使用剩餘空間
"hingeAngel": -90, // -90 度反向鉸鏈
"module": "door",
"connect": "left", // 左連結到假門
"paddingTop": 8, // 外蓋上 8
"paddingBottom": 8, // 外蓋下 8
"paddingLeft": 17, // 外蓋左 -1
"paddingRight": -1, // 外蓋右 17
"module": "door", // 門板模組
"sn": "LMF-D-4E", // 料號
"instance": {
"fit": true // 產品內容
}
}
]
},
{
"layoutSize": 18,
"module": "doorSpace",
},
{
"layoutSize": 400,
"module": "doorSpace",
"layout": "flex",
"layoutDirection": "x", // 對開x向排列
"inner": [
{
"layoutSize": auto, // 自動計算空間
"hingeAngel": 100, // 100度一般鉸鏈
"module": "door",
"connect": "left", // 左側板結合
"paddingTop": 8, // 外蓋上 8
"paddingBottom": 8, // 外蓋下 17
"paddingLeft": 17, // 外蓋左 17
"paddingRight": -1, // 外蓋右 -1
"module": "door", // 門板模組
"sn": "LMF-D-4E", // 料號
"instance": {
"fit": true // 產品內容
}
},
{
"layoutSize": auto, // 動計算空間
"hingeAngel": 100, // 100度一般鉸鏈
"module": "door",
"connect": "right", // 左連結到假門
"paddingTop": 8, // 外蓋上 8
"paddingBottom": 8, // 外蓋下 8
"paddingLeft": -1, // 外蓋左 -1
"paddingRight": 17, // 外蓋右 17
"module": "door", // 門板模組
"sn": "LMF-D-4E", // 料號
"instance": {
"fit": true // 產品內容
}
}
}
]
}
"inner": [
{
"LayoutSize": 300,
"module": "innerSpace",
"layout": "flex",
"layoutDirection": "x",
"inner": [
{
"layoutSize": 200,
"module": "innerSpace",
"door": {
"type": "inside"
"layout": "flex",
"inner": [
{
"hingeAngel": 100,
"connect": "left",
"paddingTop": -1,
"paddingBottom": -1,
"paddingLeft": -1,
"paddingRight": -1,
"module": "door",
"sn": "LMF-D-4E",
"instance": {
"fit": true
}
}
]
}
},
{
"layoutSize": 18,
"module": "panel",
"sn": "LMF-P-MSP"
},
{
"layoutSize": "auto",
"module": "innerSpace",
"door": {
"type": "outside"
"layout": "flex",
"inner": [
{
"hingeAngel": 100,
"connect": "top",
"paddingTop": 17,
"paddingBottom": 8,
"paddingLeft": 17,
"paddingRight": 17,
"module": "door",
"sn": "LMF-D-4E",
"instance": {
"fit": true
}
}
]
}
}
]
},
{
"layoutSize": 18
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
},
},
{
"layoutSize": 300,
"module": "innerSpace",
},
{
"layoutSize": 18
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
},
},
{
"layoutSize": auto,
"module": "innerSpace",
},
{
"layoutSize": 18
"module": "panel",
"sn": "LMF-P-FFP",
"instance": {
"fit": true
},
},
{
"layoutSize": 400, //第四層空間
"module": "innerSpace",
}
]
}
```