Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#4 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu bằng cách đọc viewer.py, spatial_tree.py và attribute_tree.py, sau đó so sánh các import, các lệnh gọi viewer, thiết lập Treeform và cách xử lý hình học của chúng với các API hiện tại được liệt kê. Cập nhật cả ba script cho compas_ifc 1.7.0 và compas_viewer 2.x, bao gồm cả tỷ lệ đơn vị IFC, và xác nhận rằng các tutorial chạy được với môi trường đã nêu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)
Ngôn ngữ chính
Python
Star
1
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.