Skip to content

Avery320/fdm_branch_slicer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fdm-slicer

COMPAS 生態為主的 FDM 切片研究專案。現階段已完成 planarinterpolation 兩種方法,並採用明確分工:

  • 方法入口直接呼叫對應演算法
  • cli.py 只負責共用模型讀取與 information 輸出
  • viewer.py 只負責共用 slice_output 顯示
  • 幾何輸出統一走標準 slice_output

目前架構

  • src/fdm_slicer/
    • planar_slicing.py planar 演算法本體,讀取方法綁定的 inputinformation
    • interpolation_slicing.py interpolation 演算法本體,讀取方法綁定的 inputinformation
    • slice_output.py 標準切片幾何輸出格式
    • cli.py 共用模型讀取與 information 列印
    • viewer.py 共用 slice_output 顯示
    • paths.py 共用路徑規則
  • config/
    • planar.default.json planar 的輸入參數 目前包含 layer_heightslice_height_range 與切片前 target_edge_length
    • planar.information.json planarinformation 欄位順序
    • interpolation.default.json interpolation 的輸入參數 目前包含 avg_layer_heighttarget_edge_lengthboundary_axis
    • interpolation.information.json interpolationinformation 欄位順序
    • slice_output.json 全方法共用的標準幾何輸出契約
  • scripts/
    • planar_slicer.py planar 方法入口
    • interpolation_slicer.py interpolation 方法入口
    • viewer.py 單純模型 viewer 入口
  • gh/
    • planar_component.py Rhino 8 Grasshopper Python 3 component 的正式腳本

目前 planar 已輸出:

  • information
  • model
  • slicing_plane
  • point_set
  • polyline
  • frame_set

開發環境

conda env create -f environment.yml
conda activate fdm-slicer
python -m pip install -e . --no-deps

更新環境:

conda env update -f environment.yml --prune

啟動方式

本機腳本:

python scripts/viewer.py --model stl/zero_branch.stl
python scripts/viewer.py --model stl/zero_branch.stl --no-show
python scripts/planar_slicer.py --model stl/zero_branch.stl
python scripts/planar_slicer.py --model stl/zero_branch.stl --no-show
python scripts/interpolation_slicer.py --model stl/zero_branch.stl
python scripts/interpolation_slicer.py --model stl/zero_branch.stl --no-show

editable install 後的命令:

fdm-viewer --model stl/zero_branch.stl
fdm-planar-slicer --model stl/zero_branch.stl
fdm-interpolation-slicer --model stl/zero_branch.stl

Grasshopper

  • gh/planar_component.py 可直接貼入 Rhino 8 的 Grasshopper Python 3 component
  • component 會直接呼叫:
    • src/fdm_slicer/planar_grasshopper.py
    • src/fdm_slicer/planar_slicing.py
  • 建議輸入:
    • modelMesh / Item
    • layer_heightNumber / Item
    • slice_height_rangeNumber / List
    • target_edge_lengthNumber / Item
    • model_nameText / Item
    • runBoolean / Item
  • 輸出對應:
    • information
    • model
    • slicing_plane
    • polyline
    • point_set
    • frame_set

About

fem_branch_slicer

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages