Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

IFC tutorial scripts broken with compas_ifc 1.7.0 and compas_viewer 2.x

オープン
#4 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
documentation

調査の方向性

まず viewer.py、spatial_tree.py、attribute_tree.py を読み、これらの import、viewer の呼び出し、Treeform のセットアップ、ジオメトリの処理を、記載されている現在の API と比較します。IFC の単位スケールを含め、3 つすべてのスクリプトを compas_ifc 1.7.0 および compas_viewer 2.x 向けに更新し、チュートリアルが指定された環境で実行できることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Environment

  • OS: Windows 11
  • Python: 3.12
  • compas_ifc: 1.7.0
  • compas_viewer: 2.0.2
  • ifcopenshell: 0.8.5

Problem

The tutorial scripts viewer.py, spatial_tree.py, and attribute_tree.py
use outdated APIs that no longer work with current package versions.

Fixes required

viewer.py / spatial_tree.py / attribute_tree.py

1. body_with_opening no longer exists

# OLD
viewer.add(entity.body_with_opening, name=entity.name)
# NEW
geom = entity.geometry
if geom:
    viewer.scene.add(geom, name=entity.name)

2. viewer.add() no longer exists → use viewer.scene.add()

3. from compas_viewer.layout import Treeform no longer exists

# OLD
from compas_viewer.layout import Treeform
# NEW
from compas_viewer.components.treeform import Treeform

4. from compas_ifc.entities import Entity no longer exists

# OLD
from compas_ifc.entities import Entity
# NEW
from compas_ifc.entities.base import Base as Entity

5. viewer.layout.sidedock.add_element() no longer exists

# OLD
viewer.layout.sidedock.add_element(Treeform(...))
# NEW
treeform = Treeform(...)
treeform.update()  # required to populate the widget
viewer.ui.sidedock.add(treeform)

6. Treeform columns API changed

# OLD
Treeform(tree, {"Name": ".name", "Value": ".attributes['value']"})
# NEW
Treeform(tree, columns={"Name": lambda n: n.name, 
                         "Value": lambda n: n.attributes.get("value", "")})

7. Scale needed for correct geometry size (IFC units are in mm)

from compas.geometry import Scale
S = Scale.from_factors([0.001, 0.001, 0.001])
geom.transform(S)
主要言語
Python
スター
1
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。