關閉
標題:ifcconvert 中文說明
內容:
IfcConvert CLI 選項 中文整理
1️⃣ 基本使用
用法:
IfcConvert [選項] <input.ifc> [<output>]
將 IFC 模型轉成以下格式:
.obj WaveFront OBJ(會同時生成 .mtl 材質檔)
.dae Collada
.glb 二進位 glTF v2.0
.stp STEP
.igs IGES
.xml XML(屬性定義與分解樹)
.rdb RocksDB
.svg 2D 平面圖
.h5 HDF(儲存頂點、法向量、索引)
.ttl RDF Turtle + WKT
.ifc IFC-SPF
如果沒有指定輸出檔名,預設會是 <input>.obj
2️⃣ 基本選項
選項 中文說明
-h, --help 顯示幫助資訊
--version 顯示版本資訊
-v, --verbose 顯示詳細訊息(加 -vv 可 debug)
-q, --quiet 顯示較少訊息
--cache 快取幾何建立
--cache-file arg 指定快取檔案路徑
--stderr-progress 將進度輸出到 stderr
-y, --yes 自動回答「是」 (覆蓋檔案)
--no-progress 隱藏進度列
--log-format arg 設定 log 格式:plain / json
--log-file arg 將 log 輸出到檔案
3️⃣ 幾何選項
選項 中文說明
--kernel arg 幾何核心: opencascade, cgal, cgal-simple, hybrid-cgal-simple-opencascade
-j, --threads arg 平行處理幾何解析的線程數
--center-model 將模型元素中心化(以 placement 中心點)
--center-model-geometry 將模型幾何頂點中心化
--model-offset arg 對模型所有元素加偏移 x;y;z
--model-rotation arg 對模型元素做旋轉 quaternion x;y;z;w
--include arg / --exclude arg 指定要包含或排除的 IFC 實例(可依 entity / layer / attribute)
--include+ / --exclude+ 同上,但會影響其子元素的分解或包含關係
--filter-file arg 用外部檔指定篩選規則
--default-material-file arg 指定默認材質檔案(IFC 無材質時套用)
--exterior-only [arg] 只匯出建築外殼,支援 convex-decomposition、minkowski-triangles、halfspace-snapping
--plan 匯出曲線(Plan / Axis 表示)
--model 匯出 surfaces & solids(Body / Facetation)
4️⃣ Mesh / Triangulation 選項
選項 中文說明
--mesher-linear-deflection arg (=0.001) 線性偏差,控制曲面細分程度(數值越大 → mesh 越疏化)
--mesher-angular-deflection arg (=0.5) 角度偏差(弧度),控制曲面切角精細度
--reorient-shells 重新定向面法線(保證一致,耗時)
--triangulation-type arg 設定平面面 triangulation 類型
--weld-vertices 合併相同頂點(形成流暢 manifold mesh)
--unify-shapes 合併共平面 / 共線 subshapes 以減少 mesh
--surface-colour 優先使用 surface color 而非 diffuse
--no-normals 不計算 normals(可節省時間 / 檔案大小)
--generate-uvs 生成 UV(box projection)
5️⃣ 模型精簡 / 疏化選項
選項 中文說明
--mesher-linear-deflection 線性偏差(控制三角形大小,疏化曲面)
--mesher-angular-deflection 角度偏差(控制切角精細度)
--disable-boolean-result 停用布林運算(可節省運算時間)
--precision-factor 增加線性容差,犧牲細節減少 artifact
--permissive-shape-reuse 允許重用幾何以減少面數
--disable-opening-subtractions 停用孔洞布林減去運算
--exterior-only 只匯出外殼,去除內部細節
⚠️ 這些是 控制 GLB 疏化 / 檔案大小 / Cesium 加載速度的主要參數
6️⃣ 其他選項
選項 中文說明
--center-model / --center-model-geometry 模型中心化
--model-offset / --model-rotation 模型位置 / 旋轉偏移
--apply-default-materials 套用默認材質
--use-world-coords 將局部 placement 應用到 mesh 位置
--element-hierarchy 保留元素分層關係(DAE 適用)
--y-up 改變上軸為 Y,預設 Z UP(OBJ 適用)
--ecef 將 glTF 輸出為地心座標系(需 PROJ 支援)
--digits 設定浮點精度(OBJ / DAE)
--circle-segments 圓形近似細分段數(CGAL 核心)
--cgal-smooth-angle-degrees 平滑相鄰 facets 的角度,-1 表示停用
7️⃣ 建議用法小結
疏化 / 加速 GLB
ifcconvert input.ifc output.glb \
--mesher-linear-deflection 0.01 \
--mesher-angular-deflection 0.5 \
--reorient-shells
拆分樓層 / 系統
ifcconvert input.ifc output_folder/ --split-by-storey
生成輕量 GLB + 保材質
--apply-default-materials
--generate-uvs
--surface-colour