Upload floorplan/__init__.py
Browse files- floorplan/__init__.py +63 -0
floorplan/__init__.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
floorplan — Parse floor plan images into structured wall/door/window data.
|
| 3 |
+
|
| 4 |
+
Architecture:
|
| 5 |
+
schema.py — Pydantic data models (Wall, Opening, Room, FloorPlan, Corrections)
|
| 6 |
+
geometry.py — Computational geometry (wall polygons, room detection, centerline ops)
|
| 7 |
+
renderer.py — SVG + PIL rendering for visual verification and overlay
|
| 8 |
+
parser.py — VLM-based parsing with iterative correction loop
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from .schema import (
|
| 12 |
+
FloorPlan,
|
| 13 |
+
Wall,
|
| 14 |
+
Opening,
|
| 15 |
+
OpeningType,
|
| 16 |
+
DoorSwing,
|
| 17 |
+
Point2D,
|
| 18 |
+
Room,
|
| 19 |
+
RoomLabel,
|
| 20 |
+
WallFaceRef,
|
| 21 |
+
WallSide,
|
| 22 |
+
Correction,
|
| 23 |
+
CorrectionAction,
|
| 24 |
+
CorrectionResult,
|
| 25 |
+
)
|
| 26 |
+
from .geometry import (
|
| 27 |
+
compute_centerline_length,
|
| 28 |
+
interpolate_along_centerline,
|
| 29 |
+
normal_at_distance,
|
| 30 |
+
wall_to_polygon,
|
| 31 |
+
wall_polygon_with_openings,
|
| 32 |
+
wall_union,
|
| 33 |
+
detect_rooms_from_walls,
|
| 34 |
+
build_rooms,
|
| 35 |
+
compute_floor_plan_geometry,
|
| 36 |
+
)
|
| 37 |
+
from .renderer import (
|
| 38 |
+
render_floorplan_svg,
|
| 39 |
+
render_to_image,
|
| 40 |
+
overlay_on_image,
|
| 41 |
+
)
|
| 42 |
+
from .parser import (
|
| 43 |
+
FloorPlanParser,
|
| 44 |
+
parse_floorplan,
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
__version__ = "0.1.0"
|
| 48 |
+
|
| 49 |
+
__all__ = [
|
| 50 |
+
# Schema
|
| 51 |
+
"FloorPlan", "Wall", "Opening", "OpeningType", "DoorSwing",
|
| 52 |
+
"Point2D", "Room", "RoomLabel", "WallFaceRef", "WallSide",
|
| 53 |
+
"Correction", "CorrectionAction", "CorrectionResult",
|
| 54 |
+
# Geometry
|
| 55 |
+
"compute_centerline_length", "interpolate_along_centerline",
|
| 56 |
+
"normal_at_distance", "wall_to_polygon", "wall_polygon_with_openings",
|
| 57 |
+
"wall_union", "detect_rooms_from_walls", "build_rooms",
|
| 58 |
+
"compute_floor_plan_geometry",
|
| 59 |
+
# Renderer
|
| 60 |
+
"render_floorplan_svg", "render_to_image", "overlay_on_image",
|
| 61 |
+
# Parser
|
| 62 |
+
"FloorPlanParser", "parse_floorplan",
|
| 63 |
+
]
|