Model/backend/magic_plan/xml_schema.py
2026-04-28 14:55:55 +00:00

48 lines
2 KiB
Python

# MagicPlan Exchange XML Schema Reference
# Derived from xml_example.xml and https://apidocs.magicplan.app/guide/basic-concepts/plan-exchange-xml-format
#
# <plan>
# attrs: name, id, uid, type, interiorWallWidth (m), exteriorWallWidth (m),
# schematic, hasLandSurveyAddress, lastPatchIdentifier, lastRollIdentifier
# children: <values>, <floor>+, <interiorRoomPoints>
#
# <values> (plan-level metadata)
# children: <value key="...">text</value>
# known keys: date, statistics.areaOfHeight, statistics.basement.account,
# statistics.exteriorWalls, statistics.interiorWalls
#
# <floor>
# attrs: uid, floorType (0=ground 1=upper), rotation, compassAngle,
# areaWithoutWalls (m²), areaWithInteriorWallsOnly (m²), areaWithWalls (m²)
# children: <name>, <symbolInstance>, <floorRoom>+, <exploded>
#
# <floorRoom>
# attrs: type (room label e.g. "Kitchen"), uid, x, y, rotation,
# wasModified, linkedRoom0, linkedRoom1, area (m²), perimeter (m)
# children: <values> (key: ceilingHeight m), <point>+, <door>*, <window>*, <furniture>*, <mainDimension>*
#
# <point> (room corner polygon)
# attrs: snappedX (m), snappedY (m), height (m), uid
#
# <door>
# attrs: point, type, u, width (m), depth (m), height (m), orientation,
# snappedType, snappedPosition, snappedWidth, snappedDepth, snappedHeight, snappedOrientation,
# insetX, insetY, insetZ, twinWallItemUid, symbolInstance
#
# <window>
# attrs: point, type, u, width (m), depth (m), height (m), orientation,
# snappedType, snappedPosition, snappedWidth, snappedDepth, snappedHeight, snappedOrientation,
# insetX, insetY, insetZ, symbolInstance
#
# <exploded> (wall geometry per floor)
# children: <wall>, <door>, <window>, <furniture>
# <wall> children: <point x y height>, <type> (text: "exterior" | "interior")
#
# <interiorRoomPoints>
# children: <floor> (same structure as top-level floor, interior wall room shapes)
#
# All distances in metres. All areas in m².
FLOOR_TYPE_GROUND = "0"
FLOOR_TYPE_UPPER = "1"
FLOOR_TYPE_BASEMENT = "2"