Logo vun Bonsai Impl Drawing

Bonsai Impl Drawing

Organisatioun
Impertio-Studio
bonsai-impl-drawing

Use when generating 2D drawings from IFC models in Bonsai -- plans, sections, elevations, annotations, or sheet layouts. Prevents the common mistake of creating views without proper drawing style configuration (getting empty or unfiltered output). Covers the complete documentation pipeline from model views through annotations to printable SVG sheet output. Keywords: drawing, plan, section, elevation, annotation, sheet, SVG, titleblock, documentation, 2D drawing, Bonsai drawing, create floor plan, generate section view, print drawings.

Iwwersiicht

EditeurImpertio-Studio
RepositoryBlender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package
Skill-Nummbonsai-impl-drawing
Stären
44
Forks
5
Matgeliwwert Fichieren
3
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum Impertio-Studio op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Bonsai Impl Drawing an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package/tree/main/skills/bonsai/impl/bonsai-impl-drawing
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package.git /tmp/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package
mkdir -p .claude/skills
cp -r /tmp/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package/skills/bonsai/impl/bonsai-impl-drawing .claude/skills/bonsai-impl-drawing
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Bonsai Impl Drawing an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Bonsai Impl Drawing automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Bonsai Impl Drawing net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Bonsai Drawing and Documentation: Implementation Guide

Version: Bonsai v0.8.x | Blender 4.2+ | Python 3.11 Module path: bonsai.bim.module.drawing — NEVER blenderbim.bim.module.drawing Dependencies: bonsai-core-architecture (Bonsai tool/core/operator pattern)

1. Critical Warnings

  • ALWAYS use bonsai.bim.module.drawing — NEVER use blenderbim.bim.module.drawing (legacy name)
  • ALWAYS activate a drawing camera before calling bim.create_drawing
  • NEVER edit generated SVG files directly — ALWAYS modify annotations in Blender and regenerate
  • ALWAYS install InkScape before using sheet composition or PDF export
  • Annotations are ONLY generated for orthographic camera views — NEVER for perspective views
  • ALWAYS sync IFC data before generating drawings (sync=True or save first)
  • ALWAYS use project-relative paths for titleblock SVG templates

2. Architecture Overview

The drawing module follows Bonsai's core/tool/operator pattern:

bonsai/core/drawing.py        → Pure logic (no Blender imports)
bonsai/tool/drawing.py         → Blender-specific implementation
bonsai/bim/module/drawing/
├── operator.py                → 40+ Blender operators
├── prop.py                    → Property definitions
├── ui.py                      → Panel UI
├── annotation.py              → Annotator class (geometry creation)
├── svgwriter.py               → SvgWriter class (SVG engine)
├── sheeter.py                 → SheetBuilder class (sheet composition)
├── decoration.py              → Viewport decorations
├── gizmos.py                  → Interactive annotation gizmos
├── handler.py                 → Event handlers
├── helper.py                  → Utilities (format_distance, BoundingBox)
├── scheduler.py               → Schedule/table generation
├── shaders.py                 → GPU shaders for viewport
├── workspace.py               → AnnotationTool workspace + keymaps
└── data.py                    → Data loading and caching

3. Drawing Types Decision Tree

What type of drawing do you need?
│
├─ Floor plan (top-down view)        → target_view="PLAN_VIEW"
├─ Vertical section (cut through)    → target_view="SECTION_VIEW"
├─ Facade/external view              → target_view="ELEVATION_VIEW"
├─ Reflected ceiling plan            → target_view="REFLECTED_PLAN_VIEW"
└─ 3D perspective/axonometric        → target_view="MODEL_VIEW"

Each drawing is backed by:

  • An IfcAnnotation entity in an IfcGroup
  • Properties in EPset_Drawing property set:
    • TargetView — one of the five view types
    • Scale — diagram scale (e.g., "1:100")
    • HumanScale — display string for scale
    • HasUnderlay — render-based background image toggle
    • HasLinework — vector line drawing toggle
    • HasAnnotation — annotation overlay toggle

4. Complete Drawing Pipeline

4.1 Step 1: Create a Drawing

python
# Bonsai v0.8.x: Add a plan view drawing
import bpy

bpy.ops.bim.add_drawing(
    target_view="PLAN_VIEW",
    location_hint=0  # 0 = auto-detect from active storey
)

Location hint rules:

  • PLAN_VIEW / REFLECTED_PLAN_VIEW: location_hint maps to building storey index
  • SECTION_VIEW / ELEVATION_VIEW: location_hint represents direction (N/S/E/W)
  • MODEL_VIEW: location_hint is ignored

Core function (bonsai/core/drawing.py):

python
# Bonsai v0.8.x: add_drawing creates:
# 1. Unique drawing name from target_view
# 2. Camera matrix from target_view + location_hint
# 3. IfcAnnotation via ifcopenshell.api.run("root.create_entity")
# 4. IfcGroup for annotations
# 5. IfcDocumentReference to SVG output path
# 6. EPset_Drawing properties (TargetView, Scale, etc.)
# 7. Blender camera object assigned to collection

4.2 Step 2: Configure Camera Properties

python
# Bonsai v0.8.x: Camera/drawing configuration
# Access via camera object's BIMCameraProperties

# Scale options (metric):
#   1:5000, 1:2000, 1:1000, 1:500, 1:200, 1:100, 1:50,
#   1:20, 1:10, 1:5, 1:2, 1:1, CUSTOM
# Custom scale: custom_scale_numerator / custom_scale_denominator

# Camera type: ORTHO (orthographic) | PERSP (perspective)
# Raster resolution: raster_x, raster_y (default 1000 px each)
# DPI: default 75
# View dimensions: width, height (default 50 m each)
# NTS flag: is_nts (Not To Scale)

Layer toggles (control what the drawing contains):

  • has_underlay — render-based background image
  • has_linework — vector line drawing
  • has_annotation — annotation overlays

Filter mode: NONE or include/exclude filter groups for element visibility control.

4.3 Step 3: Add Annotations

python
# Bonsai v0.8.x: Add annotations to the active drawing
import bpy

# PREREQUISITE: MUST have active drawing (camera view)

# Add a text annotation
bpy.ops.bim.add_annotation(object_type="TEXT")

# Add a dimension with type reference
bpy.ops.bim.add_annotation(
    object_type="DIMENSION",
    relating_type_id=42  # IFC ID of annotation type
)

Supported annotation types:

TypeDescriptionBlender Data
TEXTText labelsMesh
TEXT_LEADERText with leader lineCurve
DIMENSIONLinear dimensionsMesh
ANGLEAngular dimensionsMesh
SECTION_LEVELSection cut markersMesh
PLAN_LEVELLevel indicatorsMesh
ELEVATIONElevation markers (SVG symbols)Mesh
GRIDGrid line referencesMesh
FILL_AREAHatching and fillsMesh
STAIR_ARROWStair direction indicatorsMesh
HIDDEN_LINEHidden/dashed linesMesh
BREAKLINEBreak line symbolsMesh

Text properties (BIMTextProperties):

  • Font sizes (mm): 1.8, 2.5, 3.5, 5.0, 7.0
  • Horizontal alignment: left, middle, right
  • Vertical alignment: top, middle, bottom
  • Literals support 16 categories: Basic, Attributes, Property Sets, Material, Task, Cost, etc.
  • SVG output supports markdown: bold, italic, links, bullet points

4.4 Step 4: Generate SVG Drawing

python
# Bonsai v0.8.x: Generate SVG from active drawing
bpy.ops.bim.create_drawing(
    sync=True,         # Pre-sync IFC data (ALWAYS recommended)
    print_all=False,   # False = active drawing only; True = all checked drawings
    open_viewer=False  # Launch viewer after generation
)

SVG generation pipeline:

CreateDrawing Pipeline (bim.create_drawing):
1. Initialize camera and drawing metadata
2. Sync IFC file (if sync=True)
3. Generate UNDERLAY (raster render → PNG → embedded in SVG)
4. Generate LINEWORK (vector):
   ├─ OPENCASCADE mode → HLR via OCC library (precise, slower)
   └─ FREESTYLE mode → Blender Freestyle SVG Exporter (artistic, faster)
5. Generate ANNOTATIONS (via SvgWriter, orthographic only)
6. Combine all SVG layers into final output

Linework mode decision:

SituationUse
Precise hidden-line removal neededOPENCASCADE mode
Artistic line styles preferredFREESTYLE mode
FREESTYLE mode selectedALWAYS verify Freestyle SVG Exporter add-on is enabled

Fill modes (fill_mode): NONE, SHAPELY (polygon fills), SVGFILL (SVG-native patterns)

Cut modes (cut_mode): BISECT (Blender mesh bisect), OPENCASCADE (OCC section cutting)

4.5 Step 5: Compose Sheets

python
# Bonsai v0.8.x: Sheet composition pipeline

# Step 1: Create sheet with titleblock
bpy.ops.bim.add_sheet()
# Creates IfcDocumentInformation + IfcDocumentReference
# Generates base SVG layout from titleblock template

# Step 2: Add drawings to sheet
bpy.ops.bim.add_drawing_to_sheet()
# Links drawing (IfcDocumentReference) to the sheet

# Step 3: Build final sheet
bpy.ops.bim.create_sheets()
# Composes all drawings into sheet SVG
# Optionally exports to PDF/DXF (requires InkScape)

SheetBuilder (sheeter.py) composition process:

  1. Titleblock Processing: embeds titleblock SVG, applies geolocation data
  2. Drawing Integration: embeds drawing SVGs with style isolation via ensure_drawing_unique_styles() (prefixes CSS classes), applies clipping paths
  3. Document Assembly: incorporates schedules, resolves mustache-syntax template variables

Auto-layout (next_drawing_location()):

  • Default start: (30, 30) mm
  • Padding: 10 mm between drawings
  • Horizontal placement within rows, new row when exceeding titleblock width
  • Default titleblock width: 840 mm

4.6 Step 6: Export and Open

python
# Bonsai v0.8.x: Open generated outputs
bpy.ops.bim.open_drawing()   # Open SVG with system viewer
bpy.ops.bim.open_sheet()     # Open sheet with system viewer
bpy.ops.bim.open_layout()    # Open SVG layout file

5. SVG Coordinate Pipeline

The SvgWriter converts 3D model coordinates to SVG canvas:

3D world coordinates
    → project_point_onto_camera() (plane intersection)
    → camera-space coordinates
    → offset to canvas center, scale by (diagram_scale × 1000)
    → SVG canvas coordinates (millimeters)

Unit conversion: IFC meters → SVG millimeters.

convert_to_mm() normalizes CSS length units (cm, in, pt, px, Q, pc) to millimeters for positioning.

6. Key Operator Reference

Operatorbl_idnamePurpose
AddDrawingbim.add_drawingCreate new drawing view with camera
CreateDrawingbim.create_drawingGenerate/refresh SVG
DuplicateDrawingbim.duplicate_drawingCopy drawing (optional annotation copy)
AddAnnotationbim.add_annotationAdd annotation to active drawing
AddAnnotationTypebim.add_annotation_typeCreate annotation type template
AddSheetbim.add_sheetCreate new sheet document
CreateSheetsbim.create_sheetsBuild sheets with PDF/DXF export
AddDrawingToSheetbim.add_drawing_to_sheetLink drawing to sheet
OpenSheetbim.open_sheetOpen sheet with viewer
OpenDrawingbim.open_drawingOpen SVG with viewer
OpenLayoutbim.open_layoutOpen SVG layout file
ActivateModelbim.activate_modelSwitch to 3D model view
SelectAllDrawingsbim.select_all_drawingsBatch select drawings
SelectAllSheetsbim.select_all_sheetsBatch select sheets

7. Annotation Workspace

The AnnotationTool workspace provides dedicated annotation editing:

ShortcutAction
Shift+AAdd new annotation
Shift+TBulk tag (auto-adjust to selected objects)
Shift+GReadjust tags based on assigned products
Shift+EEdit text annotations

8. Drawing Style Configuration

DrawingStyle PropertyGroup controls rendering appearance:

  • render_type: DEFAULT (Blender render settings) or VIEWPORT (viewport shading)
  • raster_style: JSON-formatted render configuration string

9. Reference Files

10. Dependencies

  • InkScape: REQUIRED for sheet composition and PDF/DXF export
  • OpenCASCADE (via ifcopenshell): REQUIRED for OPENCASCADE linework/cut modes
  • Shapely: REQUIRED for SHAPELY fill mode and polygon operations
  • Freestyle SVG Exporter: REQUIRED when using FREESTYLE linework mode (Blender add-on)

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Bonsai Impl Drawing?

Use when generating 2D drawings from IFC models in Bonsai -- plans, sections, elevations, annotations, or sheet layouts. Prevents the common mistake of creating views without proper drawing style configuration (getting empty or unfiltered output). Covers the complete documentation pipeline from model views through annotations to printable SVG sheet output. Keywords: drawing, plan, section, elevation, annotation, sheet, SVG, titleblock, documentation, 2D drawing, Bonsai drawing, create floor plan, generate section view, print drawings.

Firwat Bonsai Impl Drawing op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Bonsai Impl Drawing besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Bonsai Impl Drawing an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package/tree/main/skills/bonsai/impl/bonsai-impl-drawing an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Bonsai Impl Drawing benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Bonsai Impl Drawing benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Bonsai Impl Drawing domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Bonsai Impl Drawing gratis?

Jo. De Skill gëtt vum Impertio-Studio ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇