Members
WMeshGms
- Description:
讀寫GMS的ASCII檔檔
- Source:
讀寫GMS的ASCII檔檔
Example
Methods
(async) readGms(fp) → {Promise}
- Description:
讀取GMS的ASCII檔
- Source:
Example
let fpXyz = './_mesh/YiLan_xyz.txt'
let fpTop = './_mesh/YiLan_top.txt'
let fpBot = './_mesh/YiLan_bot.txt'
let fpMat = './_mesh/YiLan_mat.txt'
wmg.readGms(fpXyz, fpTop, fpBot, fpMat)
.then((res) => {
console.log(res)
console.log('finish.')
})
.catch((err) => {
console.log(err)
})
Parameters:
Name | Type | Description |
---|---|---|
fp |
String | 輸入檔案位置字串 |
Returns:
回傳Promise,resolve回傳ltdt(各數據列為物件陣列),reject回傳錯誤訊息
- Type
- Promise
(async) writeGms(mnes, fpOut, optopt) → {Promise}
- Description:
輸出數據至GMS檔案
- Source:
Example
let name = 'abc'
let cols = [...]
let fpOut = '{path of file}'
console.log('writing...')
writeGms({ name, cols }, fpOut)
.then((r) => {
console.log('finish.')
})
.catch((err) => {
console.log(err)
})
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mnes |
Object | Array | 輸入數據物件或陣列,輸入物件須包含name、cols,輸入陣列時則各元素為物件(name、cols) |
||||||||||||
fpOut |
String | 輸入儲存檔案位置字串 |
||||||||||||
opt |
Object |
<optional> |
{}
|
輸入設定物件,預設{} Properties
|
Returns:
回傳Promise,resolve回傳成功訊息,reject回傳錯誤訊息
- Type
- Promise