From c3631c40e0f7d3fae69258c6e79d76216040874d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 20 Dec 2025 19:42:48 +0000 Subject: [PATCH] Update README with multi-story building generation examples Added a new section to the Quick Start guide in `README.md` to demonstrate how to use `BuildingGenerator` and `PlanRenderer.RenderFloor` for creating and visualizing multi-story buildings. Renumbered subsequent sections. --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1645acb..5d04b61 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,32 @@ foreach (var plan in plans) } ``` -### 5. Serialization +### 5. Multi-Story Building Generation + +You can generate multi-story buildings by stacking compatible floor plans using `BuildingGenerator`. + +```csharp +using ResPlan.Library; + +// 1. Load a pool of plans (load enough to find good matches) +var plans = await PlanLoader.LoadPlansAsync(maxItems: 50, logger: logger); + +// 2. Generate a building +var generator = new BuildingGenerator(); +// Attempt to stack 3 floors using the available plans +Building building = generator.GenerateBuilding(plans, targetFloors: 3); + +Console.WriteLine($"Generated building with {building.Floors.Count} floors."); + +// 3. Render each floor (including generated stairs) +foreach (var floor in building.Floors) +{ + // RenderFloor visualizes the plan plus additional geometries (e.g., stairs) + PlanRenderer.RenderFloor(floor, $"building_floor_{floor.FloorNumber}.png"); +} +``` + +### 6. Serialization To support binary serialization and handle special floating-point values (like `NaN` or `Infinity`) which are not standard in JSON, the library provides a helper class `PlanSerializer` using **MessagePack**.