Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**.

Expand Down
Loading