d5bcee2157
Pill-basierte Toolbar-Primitiven aus OberleisteApp extrahiert nach src/components/BarControls.jsx — BarCombo (Dropdown), BarButton (Icon-Button), BarToggle (Label/Icon mit Active-State), BAR_H=22. OberleisteApp nutzt jetzt die geteilten Komponenten (Verhalten unveraendert). EbenenManager + GeschossManager: - Sichtbarkeits-Toolbar: native <select> + btn-icon-sm → BarCombo (mit visibility-Icon links) + BarButton add/settings. - GeschossManager Stift-Icon (edit) → Settings-Icon. - Zeilen-Layout: eckig statt Pill (margin 0, borderRadius 0, 3px Accent-Strip links fuer aktive Zeile), minHeight 24, gap 4, kompaktere Padding/Icon-Sizes — Vectorworks-naeher. DimensionenApp: - Welt/CPlane: 2x BarToggle statt btn-contained/outlined - Z-Selektor: 3x BarToggle (icon-only) - Drehen-Apply + 90°-CCW/CW: BarButton mit rotate_*-Icons (4 Preset-Buttons -90/-45/45/90 ersetzt durch 2 schnelle 90°-Buttons — passt besser in die schmale Sidebar) README aktualisiert: Runtime jetzt CPython 3.9, TextEntity-RTF-Limit dokumentiert, BarControls + text_editor/text_create erwaehnt. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
142 lines
5.8 KiB
Markdown
142 lines
5.8 KiB
Markdown
# Dossier
|
|
|
|
Rhino-8 Plugin für architektonisches Entwerfen mit smarten Bauteilen — Geschosse, Wände, Decken, Dächer, Öffnungen (Fenster/Türen), Treppen (gerade · L · Wendel). Teil der **OpenStudio-Suite** (mit Rapport als Schwestertool).
|
|
|
|
Die React-UI wird in Rhinos Eto.Forms-WebView über `LoadHtml` (inline) eingebettet — die Plugin-Logik läuft in **CPython 3.9** (Rhino 8 Script-Editor-Engine, Mac).
|
|
|
|
## Voraussetzungen
|
|
|
|
| Tool | Version |
|
|
|---|---|
|
|
| Rhino | 8 (Mac · Windows untestet) |
|
|
| Node.js | ≥ 20 (für Vite 8) |
|
|
| npm | ≥ 10 |
|
|
| Python | CPython 3.9 (Rhino 8 Script-Editor-Engine) |
|
|
|
|
Optional — für den Standalone-Launcher:
|
|
|
|
| Tool | Version |
|
|
|---|---|
|
|
| Rust toolchain | ≥ 1.77 (`rustup`) |
|
|
| Plattform-Build-Tools | siehe [Tauri Prerequisites](https://v2.tauri.app/start/prerequisites/) |
|
|
|
|
## Setup
|
|
|
|
```bash
|
|
git clone http://192.168.1.247:3000/karim/DOSSIER.git
|
|
cd DOSSIER
|
|
npm install
|
|
```
|
|
|
|
## Entwicklung
|
|
|
|
**React-UI bauen** (nach jeder UI-Änderung):
|
|
|
|
```bash
|
|
npm run build # → dist/index.html (inline-fähig)
|
|
```
|
|
|
|
**Im Browser entwickeln** (HMR, ohne Rhino — für reine UI-Arbeit):
|
|
|
|
```bash
|
|
npm run dev # http://localhost:5173
|
|
```
|
|
|
|
**Plugin in Rhino starten:**
|
|
|
|
In Rhino 8 das Hauptpanel über `_RunPythonScript` öffnen:
|
|
|
|
```python
|
|
# Hauptmenu
|
|
_RunPythonScript "/Users/karim/STUDIO/DOSSIER/rhino/rhinopanel.py"
|
|
```
|
|
|
|
Bei Änderungen am Python-Code Panels neu laden:
|
|
|
|
```python
|
|
import importlib, sys, scriptcontext as sc
|
|
# Bridges zuruecksetzen
|
|
for k in list(sc.sticky.keys()):
|
|
if any(p in k.lower() for p in ['elemente','gestaltung','oberleiste','massstab','ausschnitte','layouts','overrides','werkzeuge','dimensionen']):
|
|
sc.sticky[k] = None
|
|
# Module neu laden
|
|
for m in list(sys.modules):
|
|
if any(p in m for p in ['elemente','gestaltung','oberleiste','massstab','ausschnitte','layouts','overrides','werkzeuge','dimensionen','panel_base']):
|
|
importlib.reload(sys.modules[m])
|
|
```
|
|
|
|
## Architektur
|
|
|
|
### Kommunikation React ↔ Python
|
|
|
|
- **React → Python**: `document.title = "RHINOMSG::{json}"` (queue-basiert, 80 ms delay)
|
|
- **Python → React**: `webview.ExecuteScript("window.onRhinoMessage({...})")`
|
|
|
|
### Datenmodell
|
|
|
|
- **Geschosse** in `doc.Strings["dossier_ebenen"]` als JSON (Name, Höhe, OKFF, Typ).
|
|
- **Smart-Elemente** (Wand, Decke, Dach, Öffnung, Treppe) als Rhino-Objekte mit UserStrings — `dossier_element_id`, `dossier_element_type`, etc.
|
|
- **Source ↔ Volume Pattern**: jedes Element hat eine *Source-Geometrie* (Achse/Outline/Punkt) + ein generiertes *Volume* (Brep). Source-Änderungen triggern automatische Regeneration.
|
|
|
|
### Layer-Hierarchie
|
|
|
|
```
|
|
10_GRUNDRISSE
|
|
└── EG
|
|
├── 20_WÄNDE
|
|
├── 30_DECKEN
|
|
├── 31_DÄCHER
|
|
└── 40_TREPPEN
|
|
└── 1OG (gleiche Sublayer)
|
|
20_SCHNITTE
|
|
30_ANSICHTEN
|
|
00_RASTER · 01_VERMESSUNG · 40_SITUATION · 90_REFERENZEN · 99_KONSTRUKTION
|
|
```
|
|
|
|
## Projektstruktur
|
|
|
|
```
|
|
.
|
|
├── src/ Frontend (React)
|
|
│ ├── App.jsx Hauptpanel (Geschosse + Ebenen)
|
|
│ ├── ElementeApp.jsx Smart-Elemente Panel
|
|
│ ├── AusschnitteApp.jsx Ausschnitte (Detail-Views)
|
|
│ ├── LayoutsApp.jsx Layouts + PDF-Export
|
|
│ ├── MassstabApp.jsx Massstab/Display-Modes
|
|
│ ├── DimensionenApp.jsx Objekt-Info (Position/Abmessungen)
|
|
│ ├── OverridePanel.jsx Override-Regeln + Kombinationen
|
|
│ ├── TextEditorApp.jsx DOSSIER-Text WYSIWYG-Editor (Rich-Text via RTF)
|
|
│ ├── components/ EbenenManager, GeschossManager, BarControls (shared Pill-UI), ...
|
|
│ └── lib/rhinoBridge.js React↔Python Bridge
|
|
├── rhino/ Backend (IronPython 3)
|
|
│ ├── rhinopanel.py Haupt-Entry, Bridge-Pattern
|
|
│ ├── panel_base.py BaseBridge + Panel-Registration
|
|
│ ├── elemente.py Smart-Elemente (Wand/Decke/Dach/Oeffnung/Treppe)
|
|
│ ├── ausschnitte.py Ausschnitte (Detail-Views)
|
|
│ ├── layouts.py Layouts + PDF-Generierung
|
|
│ ├── massstab.py Massstab/Display-Modes
|
|
│ ├── overrides_panel.py Override-Regeln
|
|
│ ├── dimensionen.py Objekt-Info Panel
|
|
│ ├── gestaltung.py Gestaltung (Override-Editor)
|
|
│ ├── werkzeuge.py Werkzeug-Sammlung
|
|
│ ├── text_editor.py DOSSIER-Text Backend (Frame-Pick + Rich-Text-RTF)
|
|
│ ├── text_create.py Text-Styles, Font-Apply, Selection-Settings
|
|
│ └── oberleiste.py Top-Menue (verbindet alle Panels)
|
|
├── launcher/ Tauri-2 Standalone-Launcher (optional)
|
|
├── dist/ Gebaute React-App (npm run build)
|
|
├── public/ Statische Assets
|
|
├── icons_export/ Material-Icons als SVG
|
|
└── vite.config.js `base: './'` (wichtig fuer file:// inline)
|
|
```
|
|
|
|
## Bekannte Limitierungen
|
|
|
|
- **Python-Identifier ohne Umlaute** (`ue/oe/ae` statt `ü/ö/ä`) — UI-Strings dürfen Umlaute, Code-Bezeichner / Layer-Codes / UserString-Keys nicht. Konvention seit der Py3-Migration.
|
|
- **Kein Docking** der Panels (Rhinos `RegisterPanel` schlägt fehl: `"constructor must accept uint, RhinoDoc or no params"`). Panels laufen daher als schwebende `forms.Form`-Fenster.
|
|
- **`LoadHtml`-inline** statt `file://`-URL — Rhinos WKWebView blockiert sonst `<script type="module">` durch CORS-Restrictions.
|
|
- **TextEntity-RTF**: Rhinos eingebauter Parser unterstützt nur `\b \i \ul \strike \fN \tab {}` plus Newline-via-`\par`-zwischen-Groups. **Kein `\fs`** (= eine TextEntity hat global eine Schriftgröße, keine per-Segment-Sizes). Newlines/Replace-Quirks siehe `_runs_to_rtf` in `rhino/text_editor.py`.
|
|
|
|
## Lizenz
|
|
|
|
[GNU AGPL-3.0-or-later](https://www.gnu.org/licenses/agpl-3.0.html)
|