[= Personal - Plan of House This was an experiment - I would not recommend this approach. Command: =] [= All measurement in centimetres =] [= LIVING_ROOM =] Const Number Living_NorthLeft = 113; [= north wall left of chimney =] Const Number Living_NorthCentre = 96; [= width of north chimney =] Const Number Living_NorthRight = 112; [= north wall right of chimney =] Const Number Living_NorthChimney = 36; [= depth of north chimney =] Const Number Living_EastLeft1 = 182; [= east wall left - part to left of door =] Const Number Living_EastLeftDoor = 82; [= east wall left door ( to hall ) =] Const Number Living_EastLeft2 = 35; [= east wall left - part to right of door =] Const Number Living_EastRecess = 44; [= east wall recess to right half =] Const Number Living_EastCentre1 = 102; [= east wall centre - part to left of door =] Const Number Living_EastCentreDoor = 76; [= east wall centre door ( to kitchen ) =] Const Number Living_EastCentre2 = 20; [= east wall centre - part to right of door =] Const Number Living_EastRight1 = 140; [= the width of the chimney =] Const Number Living_EastChimney = 61; [= depth of east chimney =] Const Number Living_EastRight2 = 69; [= width of recess right of chimney =] Const Number Living_WestRight = 78; Const Number Living_WestWindow = 109; Const Number Living_PatioDoors = 176; Const Number Living_WestLeft = 124; [= derived lengths =] Const Number Living_NorthWidth = Living_NorthLeft + Living_NorthCentre + Living_NorthRight; Const Number Living_SouthWidth = Living_NorthWidth + Living_EastRecess; Const Number Living_FullLength = Living_EastLeft1 + Living_EastLeftDoor + Living_EastLeft2 + Living_EastCentre1 + Living_EastCentreDoor + Living_EastCentre2 + Living_EastRight1 + Living_EastRight2; [= KITCHEN =] Const Number Kitchen_FullWidth = 303; [= south wall is single length =] Const Number Kitchen_WestLeft = 136; [= west wall to left of door =] Const Number Kitchen_WestCentre = Living_EastCentreDoor; [= door to living room =] Const Number Kitchen_WestRight = 116; [= west wall to right of door =] Const Number Kitchen_SouthRight = 182; [= south wall to right of door =] Const Number Kitchen_SouthCentre = 85; [= south door so side entranceway =] Const Number Kitchen_SouthLeft = 36; [= south wall to left of door =] Const Number Kitchen_NorthLeft = 212; Const Number Kitchen_NorthWindow = 61; Const Number Kitchen_EastLeft = 162; Const Number Kitchen_EastWindow = 111; [= derived lengths =] Const Number Kitchen_FullLength = Kitchen_WestLeft + Kitchen_WestCentre + Kitchen_WestRight; [= TOILET =] Const Number Toilet_NorthLeft = 25; [= pillar width =] Const Number Toilet_NorthRight = 134; [= main section of north wall =] Const Number Toilet_WestLeft = 68; [= west wall main section =] Const Number Toilet_WestRight = 12; [= [pillar length =] Const Number Toilet_SouthLeft = 38; Const Number Toilet_SouthWindow = 60; [= derived lengths =] Const Number Toilet_FullWidth = Toilet_NorthLeft + Toilet_NorthRight; Const Number Toilet_FullLength = Toilet_WestLeft + Toilet_WestRight; [= VESTIBULE =] Const Number Vest_NorthLeft = 12; Const Number Vest_NorthCentre = Kitchen_SouthCentre; Const Number Vest_NorthRight = Kitchen_SouthLeft; Const Number Vest_SouthDoor = 86; Const Number Vest_SouthRight = 16; Const Number Vest_FullWidth = Vest_NorthLeft + Vest_NorthCentre + Vest_NorthRight; Const Number Vest_FullLength = Toilet_FullLength; [= HALLWAY =] Const Number Hall_SouthRight = 22; [= piller width in hall =] Const Number Hall_SouthLeft = 140; [= main part of south wall =] Const Number Hall_WestLeft = 9; [= pillar =] Const Number Hall_WestCentre = Living_EastLeftDoor; Const Number Hall_WestRight = Living_EastLeft1; Const Number Hall_EastLeft = 158; Const Number Hall_EastDoor = 83; [= derived lengths =] Const Number Hall_FullWidth = Hall_SouthLeft + Hall_SouthRight; Const Number Hall_FullLength = Hall_WestLeft + Hall_WestCentre + Hall_WestRight; [= NORTH BEDROOM =] Const Number BRNorth_NorthLeft = 107; [= north wall left of chimney =] Const Number BRNorth_NorthCentre = 108; [= north wall width of chimney =] Const Number BRNorth_NorthRight = 106; [= north wall right of chimney =] Const Number BRNorth_NorthChimney = 35; [= north wall depth of chimney =] Const Number BRNorth_EastLeft = 169; [= east wall left section =] Const Number BRNorth_EastRecess = 63; [= recess depth of east wall =] Const Number BRNorth_EastRight1 = 24; [= east wall right section left of door =] Const Number BRNorth_EastDoor = 77; [= east wall width of door =] Const Number BRNorth_EastRight2 = 2; [= east wall right section right of door =] Const Number BRNorth_WestRight = 77; Const Number BRNorth_WestWindow = 109; [= derived lengths =] Const Number BRNorth_EastRight = BRNorth_EastRight1 + BRNorth_EastDoor + BRNorth_EastRight2; Const Number BRNorth_FullWidth = BRNorth_NorthLeft + BRNorth_NorthCentre + BRNorth_NorthRight; Const Number BRNorth_SouthWidth = BRNorth_FullWidth - BRNorth_EastRecess; Const Number BRNorth_FullLength = BRNorth_EastLeft + BRNorth_EastRight; [= MASTER BEDROOM =] Const Number BRMaster_NorthLeft = 282; [= north wall left of door =] Const Number BRMaster_NorthDoor = 76; [= north wall width of door =] Const Number BRMaster_NorthRight = 7; [= north wall right of door =] Const Number BRMaster_EastLeft = 219; [= east wall left of chimney =] Const Number BRMaster_EastCentre = 134; [= east wall width of chimney =] Const Number BRMaster_EastRight = 71; [= east wall rigth of chimney =] Const Number BRMaster_EastChimney = 48; [= depth of chimney =] Const Number BRMaster_WestRight = 103; [= west wall to right of window =] Const Number BRMaster_WestWindow = 213; [= width of window =] [= derived lengths =] Const Number BRMaster_FullWidth = BRMaster_NorthLeft + BRMaster_NorthDoor + BRMaster_NorthRight; Const Number BRMaster_FullLength = BRMaster_EastLeft + BRMaster_EastCentre + BRMaster_EastRight; [= EAST BEDROOM =] Const Number BREast_NorthLeft1 = 8; [= north wall left of door =] Const Number BREast_NorthDoor = 76; [= north wall width of door =] Const Number BREast_NorthLeft2 = 5; [= north wall right of door =] Const Number BREast_NorthRight = 214; [= north wall right of door recess =] Const Number BREast_NorthRecess = 25; [= north wall recess for door =] Const Number BREast_West = 271; [= long west wall =] Const Number BREast_EastLeft = 38; Const Number BREast_EastWindow = 143; [= derived lengths =] Const Number BREast_NorthLeft = BREast_NorthLeft1 + BREast_NorthDoor + BREast_NorthLeft2; Const Number BREast_FullWidth = BREast_NorthLeft + BREast_NorthRight; Const Number BREast_FullLength = BREast_West; [= BATHROOM =] Const Number Bathroom_WestLeft = 90; [= west side left of door =] Const Number Bathroom_WestDoor = 58; [= width of door =] Const Number Bathroom_WestRight = 17; [= west side right of door =] Const Number Bathroom_EastLeft = 39; Const Number Bathroom_EastWindow = 62; Const Number Bathroom_FullWidth = 206; [= actaully not consistant =] Const Number Bathroom_FullLength = Bathroom_WestLeft + Bathroom_WestDoor + Bathroom_WestRight; [= LANDING =] Const Number Landing_EastSection = 28; [= section of wall by bathroom =] Const Number Landing_WellWidth = Hall_FullWidth; Const Number Landing_PassWidth = 89; [= width of passage outside bathroom =] Const Number Landing_PassLength = 157; [= passage outside bathroom =] Const Number Landing_EastLeft = 82; Const Number Landing_EastWindow = 111; [= WALL THICKNESSES =] Const Number WallOuter = 29; Const Number WallParty = 20; [= with neighbour - total guess =] Const Number WallMasterNorth = 10; Const Number WallMasterEast = 15; Const Number WallNorthLanding = 14; [= all three section are the same =] Const Number WallEastLanding = 6; [= wall around door for east bedroom =] Const Number WallBathPassage = 8; [= between the bathroom and the passage =] Const Number WallBathNorth = 13; [= north interior wall of the bathroom =] Const Number WallBathSouth = 10; [= south wall of bathroom to east bedroom =] Const Number WallLivingHall = 14; [= between living room and hall/stairwell =] Const Number WallLivingKitchen = 15; [= living room to kitchen =] Const Number WallKitchenToilet = 13; [= kitchen and to downstairs toilet =] Const Number WallToiletVest = 11; [= downstairs toilet and vestibule =] [= DERIVED ROOM OFFSETS =] Const Number Living_X = 0; Const Number Living_Y = 0; Const Number Hall_X = Living_NorthWidth + WallLivingHall; Const Number Hall_Y = 0; Const Number Kitchen_X = Living_SouthWidth + WallLivingKitchen; Const Number Kitchen_Y = Living_Y + Living_EastLeft1 + Living_EastLeftDoor + Living_EastLeft2 + Living_EastCentre1 - Kitchen_WestRight; Const Number Toilet_X = Living_SouthWidth + WallLivingKitchen; Const Number Toilet_Y = Kitchen_Y + Kitchen_FullLength + WallKitchenToilet; Const Number Vest_X = Kitchen_X + Kitchen_SouthRight - Vest_NorthLeft; Const Number Vest_Y = Toilet_Y; Const Number BRNorth_X = 0; [= whole house internal origin =] Const Number BRNorth_Y = 0; Const Number BRMaster_X = BRNorth_X; Const Number BRMaster_Y = BRNorth_Y + BRNorth_FullLength + WallMasterNorth; Const Number BREast_X = BRMaster_FullWidth + WallMasterEast; Const Number BREast_Y = BRMaster_Y + BRMaster_FullLength - BREast_West; Const Number Bathroom_X = BRMaster_FullWidth + WallMasterEast + Landing_PassWidth + WallBathPassage; Const Number Bathroom_Y = BRNorth_FullLength + WallBathNorth; Const Number UpperVoid_X = BRNorth_FullWidth + WallNorthLanding; Const Number UpperVoid_Y = 0; [= total internal sizes =] Const Number House_NorthWidth = Living_NorthWidth + WallLivingHall + Hall_FullWidth; Const Number House_SouthWidth = Living_SouthWidth + WallLivingKitchen + Kitchen_FullWidth; Const Number House_FullLength = Living_FullLength; [= Miscellaneous =] Const Number MeasShift = 16; [= PENS AND BRUSHES =] Const TPen LowerPen = Pen { width -> 3, colour -> {80, 80, 80, 100} }; Const TPen MeasurePen = Pen { colour -> {30, 30, 30, 100} }; Const TBrush PartyBrush = Brush { colour -> { 60, 60, 60, 100 } }; Const TBrush BrushInnerWall = Brush { colour -> { 80, 80, 80 } }; Const TBrush BrushChimney = Brush { colour -> { 90, 90, 90 } }; Const TBrush BrushOpening = Brush { colour -> { 95, 95, 95 } }; Program() TFont titlefont = Font { size -> 36 }; Begin TextBlock("Plan for My House", 0, Centre, Top) => { Canvas.width / 2, 20 }, titlefont; Plan() => {40,100}; TextBlock("All dimensions in centimetres", 0, Left, Bottom) => {40, Canvas.height - 10 }; End; Shape Plan() Begin LowerFloor(); [= shift the upper floor =] With { House_SouthWidth + 3 * WallOuter, 0 } Do OuterWall(); UpperFloor(); EndWith; End; [= OUTER WALL ---------- =] Shape OuterWall() PointArray wall = [ { 0,-WallParty}, {-WallOuter, -WallParty}, {-WallOuter, Living_FullLength + WallOuter}, { Kitchen_X + Kitchen_FullWidth + WallOuter, Living_FullLength + WallOuter}, { Kitchen_X + Kitchen_FullWidth + WallOuter, Kitchen_Y - WallOuter}, { House_NorthWidth + WallOuter, Kitchen_Y - WallOuter}, { House_NorthWidth + WallOuter, -WallParty}, { House_NorthWidth, -WallParty}, { House_NorthWidth, Kitchen_Y}, { Kitchen_X + Kitchen_FullWidth, Kitchen_Y}, { Kitchen_X + Kitchen_FullWidth, Living_FullLength}, {0, Living_FullLength} ]; Begin [= do the main wall =] Polygon(wall, Filled); [= do the pary wall =] Rectangle(House_NorthWidth, WallParty, Filled) => { 0, -WallParty }, PartyBrush; End; [= LOWER FLOOR ----------- =] Shape LowerFloor() Number y = 0; Begin TextBlock("Ground Floor", 0, Centre, Top) => { House_SouthWidth / 2, House_FullLength + 10 }; OuterWall(); LivingRoom() => {Living_X, Living_Y}; Hall() => {Hall_X, Hall_Y }; Kitchen() => { Kitchen_X, Kitchen_Y }; Toilet() => { Toilet_X, Toilet_Y }; Vestible() => { Vest_X, Vest_Y }; With BrushInnerWall Do WallLowerNorth() => { Living_NorthWidth, 0 }; [= move down past the hall door =] y += Living_EastLeft1 + Living_EastLeftDoor; WallLowerMiddle() => { Living_NorthWidth, y }; [= move down past the kitchen door =] y += Living_EastLeft2 + Living_EastCentre1 + Living_EastCentreDoor; WallLowerSouth() => {Living_SouthWidth, y }; EndWith; TextBlock("Ground Floor", 0, Centre, Top) => { House_SouthWidth / 2, House_FullLength + WallOuter + 10 }; End; [= LIVING ROOM ----------- =] Shape LivingRoom() [= coordinate array for living room =] PointArray room = [ {0,0}, { Living_NorthWidth, 0 }, { Living_NorthWidth, Living_EastLeft1 + Living_EastLeftDoor+ Living_EastLeft2}, { Living_NorthWidth + Living_EastRecess, Living_EastLeft1 + Living_EastLeftDoor + Living_EastLeft2}, { Living_NorthWidth + Living_EastRecess, Living_FullLength }, { 0, Living_FullLength } ]; Begin [= draw the room outline =] Polygon(room); [= north chimney =] Chimney(Living_NorthCentre, Living_NorthChimney) => {Living_NorthLeft, 0}; [= east chimney =] Chimney(Living_EastChimney, Living_EastRight1 ) => {Living_SouthWidth - Living_EastChimney, Living_FullLength - (Living_EastRight1 + Living_EastRight2) }; [= door to hall =] Door(76, 180, 225) => { Living_NorthWidth + 4, Living_EastLeft1 + 3}; [= Window=] Opening(-WallOuter, Living_WestWindow, "Window", -90) => { 0, Living_WestRight }; Opening(-WallOuter, Living_PatioDoors, "Patio Doors", -90) => { 0, Living_FullLength - Living_WestRight - Living_PatioDoors }; [= label the room =] TextBlock("Living Room", valign -> Centre, halign -> Centre ) => { ( Living_NorthWidth + Living_SouthWidth ) / 4, Living_FullLength / 2 }; MeasureHorz(Living_NorthWidth) => {0, Living_NorthChimney + MeasShift}; MeasureHorz(Living_SouthWidth) => {0, Living_FullLength - MeasShift}; MeasureVert(Living_FullLength) => {MeasShift, 0}; [= the suppert post =] Rectangle(10, 15, Filled) => { 321-46-10, 166 }, BrushInnerWall; TextBlock("Post", halign -> Centre, valign -> Bottom) => {321-46-10+5, 166 - 4}; End; [= HALL ---- =] Shape Hall() PointArray room = [ {0,0}, {0, Hall_WestRight + Hall_WestCentre}, { Hall_SouthRight, Hall_WestRight + Hall_WestCentre}, { Hall_SouthRight, Hall_FullLength}, { Hall_FullWidth, Hall_FullLength}, { Hall_FullWidth, 0} ]; Begin [= draw the room outline =] Polygon(room); Opening(WallOuter, Hall_EastDoor, "Door", 90) => { Hall_FullWidth, Hall_EastLeft }; Door(Hall_EastDoor, 360, 315) => { Hall_FullWidth, Hall_EastLeft + Hall_EastDoor }; [= label the room =] TextBlock("Hall / Stairwell", valign -> Centre, halign -> Centre ) => { Hall_FullWidth / 2, Hall_FullLength / 2 }; [= MeasureHorz(Hall_FullWidth) => {0, MeasShift}; =] End; [= KITCHEN ------- =] Shape Kitchen() Begin [= just a rectangle =] Rectangle(Kitchen_FullWidth, Kitchen_FullLength); [= North Window =] Opening(Kitchen_NorthWindow, -WallOuter, "Window", 0) => { Kitchen_NorthLeft, 0 }; [= East Window =] Opening(WallOuter, Kitchen_EastWindow, "Window", 90) => { Kitchen_FullWidth, Kitchen_EastLeft }; [= label the room =] TextBlock("Kitchen", valign -> Centre, halign -> Centre ) => { ( Kitchen_FullWidth ) / 2, Kitchen_FullLength / 2 }; MeasureHorz(Kitchen_FullWidth) => {0, MeasShift}; MeasureVert(Kitchen_FullLength, True) => {Kitchen_FullWidth - MeasShift, 0}; End; [= TOILET ------ =] Shape Toilet() PointArray room = [ { 0, Toilet_WestRight}, { Toilet_NorthLeft, Toilet_WestRight}, { Toilet_NorthLeft, 0}, { Toilet_FullWidth, 0}, { Toilet_FullWidth, Toilet_FullLength}, { 0, Toilet_FullLength} ]; Begin [= draw the room outline =] Polygon(room); [= draw the door =] Door(61, 0, -45) => { Toilet_FullWidth, Toilet_FullLength - 4}; Opening(Toilet_SouthWindow, WallOuter, "Window", 0) => { Toilet_FullWidth - Toilet_SouthLeft - Toilet_SouthWindow, Toilet_FullLength }; [= label the room =] TextBlock("Toilet", valign -> Centre, halign -> Centre ) => { ( Toilet_FullWidth ) / 2, Toilet_FullLength / 2 }; MeasureHorz(Toilet_FullWidth) => {0, Toilet_FullLength - MeasShift}; MeasureVert(Toilet_FullLength) => {Toilet_NorthLeft + MeasShift, 0 }; End; [= VESTIBLE -------- =] Shape Vestible() Begin [= just a rectangle =] Rectangle(Vest_FullWidth, Vest_FullLength); [= label the room =] TextBlock("Vestibule", valign -> Centre, halign -> Centre ) => { ( Vest_FullWidth ) / 2, Vest_FullLength / 4 }; Opening(Vest_SouthDoor, WallOuter, "Door", 0) => { Vest_SouthRight, Vest_FullLength }; Door(76, 270, 315) => { Vest_SouthRight + Vest_SouthDoor - 4, Vest_FullLength + 13}; MeasureHorz(Vest_FullWidth) => {0, Vest_FullLength - MeasShift}; MeasureVert(Vest_FullLength, True) => { Vest_FullWidth - MeasShift, 0}; End; [= WALL LOWER NORTH ---------------- North section between living room and stairwell/hallway. Origin: north east corner of living room. =] Shape WallLowerNorth() Begin [= this is just a rectangle =] Rectangle(WallLivingHall, Living_EastLeft1, Filled); End; [= WALL LOWER MIDDLE ----------------- Middle section of ground floor interior walls. Origin: right side on door to hall - living room side. =] Shape WallLowerMiddle() PointArray wall = [ { 0, 0 }, { 0, Living_EastLeft2 }, { Living_EastRecess, Living_EastLeft2 }, { Living_EastRecess, Living_EastLeft2 + Living_EastCentre1 }, { Living_EastRecess + WallLivingKitchen, Living_EastLeft2 + Living_EastCentre1}, { Living_EastRecess + WallLivingKitchen, Living_EastLeft2 + Living_EastCentre1 - Kitchen_WestRight}, { WallLivingHall + Hall_FullWidth, Living_EastLeft2 + Living_EastCentre1 - Kitchen_WestRight}, { WallLivingHall + Hall_FullWidth, Hall_WestLeft}, { WallLivingHall + Hall_SouthRight, Hall_WestLeft}, { WallLivingHall + Hall_SouthRight, 0} ] ; Begin Polygon(wall, Filled); End; [= WALL LOWER SOUTH ---------------- =] Shape WallLowerSouth() PointArray wall = [ { 0, 0 }, { 0, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2}, { WallLivingKitchen , Living_EastCentre2 + Living_EastRight1 + Living_EastRight2}, { WallLivingKitchen, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft}, { WallLivingKitchen + Toilet_NorthLeft, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft}, { WallLivingKitchen + Toilet_NorthLeft, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft - Toilet_WestRight}, { WallLivingKitchen + Toilet_FullWidth, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft - Toilet_WestRight}, { WallLivingKitchen + Toilet_FullWidth, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft - Toilet_WestRight + 16}, { WallLivingKitchen + Toilet_FullWidth + 11, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft - Toilet_WestRight + 16}, { WallLivingKitchen + Toilet_FullWidth + 11, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft - Toilet_WestRight}, { WallLivingKitchen + Kitchen_SouthRight, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft - Toilet_WestRight}, { WallLivingKitchen + Kitchen_SouthRight, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft - Toilet_WestRight - WallKitchenToilet}, { WallLivingKitchen, Living_EastCentre2 + Living_EastRight1 + Living_EastRight2 - Toilet_WestLeft - Toilet_WestRight - WallKitchenToilet}, { WallLivingKitchen, 0} ] ; Begin Polygon(wall, Filled); [= do the extra bit here =] Rectangle(Kitchen_SouthLeft, WallKitchenToilet, Filled) => { WallLivingKitchen + Kitchen_SouthRight + Kitchen_SouthCentre, Kitchen_WestLeft}; End; [= UPPER FLOOR ----------- =] Shape UpperFloor() Begin With BrushInnerWall Do [= draw the walls =] WallUpperMasterEast() => { BRMaster_X + BRMaster_FullWidth, BRMaster_Y + BRMaster_FullLength}; WallUpperMasterNorth() => { 0, BRNorth_FullLength }; WallUpperNorthLanding() => { BRNorth_FullWidth, 0}; WallUpperBathroomCorner() => { Bathroom_X - WallBathPassage, Bathroom_Y - WallBathNorth}; WallUpperBathroomSouth() => {Bathroom_X - WallBathPassage, Bathroom_Y + Bathroom_WestDoor + Bathroom_WestRight}; EndWith; [= draw the rooms =] NorthBedroom(); MasterBedroom() => {BRMaster_X, BRMaster_Y}; EastBedroom() => {BREast_X, BREast_Y}; Bathroom() => { Bathroom_X, Bathroom_Y}; UpperVoid() => { UpperVoid_X, UpperVoid_Y}; TextBlock("First Floor", 0, Centre, Top) => { House_SouthWidth / 2, House_FullLength + WallOuter + 10 }; End; [= NORTH BEDROOM ------------- Draw the north bedroom. =] Shape NorthBedroom() [= coordinate array for bedroom =] PointArray room = [ {0,0}, { BRNorth_FullWidth, 0 }, { BRNorth_FullWidth, BRNorth_EastLeft }, { BRNorth_FullWidth - BRNorth_EastRecess, BRNorth_EastLeft }, { BRNorth_FullWidth - BRNorth_EastRecess, BRNorth_FullLength }, { 0, BRNorth_FullLength } ]; Begin [= draw the room outline =] Polygon(room); Chimney(BRNorth_NorthCentre, BRNorth_NorthChimney) => { BRNorth_NorthLeft, 0}; Door(76, 180, 225) => { BRNorth_SouthWidth, BRNorth_EastLeft + BRNorth_EastRight1 }; [= label the room =] TextBlock("North Bedroom", valign -> Centre, halign -> Centre ) => { BRNorth_FullWidth / 2, BRNorth_FullLength / 2 }; Opening(-WallOuter, BRNorth_WestWindow, "Window", -90) => { 0, BRNorth_WestRight }; MeasureHorz(BRNorth_FullWidth) => {0, BRNorth_NorthChimney + MeasShift}; MeasureHorz(BRNorth_SouthWidth) => {0, BRNorth_EastLeft + MeasShift}; MeasureVert(BRNorth_FullLength) => {MeasShift, 0}; End; [= MASTER BEDROOM -------------- Draw the master bedroom. =] Shape MasterBedroom() [= coordinate array for bedroom - actually just a rectangle =] PointArray room = [ {0,0}, { BRMaster_FullWidth, 0 }, { BRMaster_FullWidth, BRMaster_FullLength }, { 0, BRMaster_FullLength } ]; Begin [= draw the room outline =] Polygon(room); Chimney(BRMaster_EastChimney, BRMaster_EastCentre) => { BRMaster_FullWidth - BRMaster_EastChimney, BRMaster_EastLeft}; Door(76, 270, 225) => { BRMaster_FullWidth - 7, 0}; [= label the room =] TextBlock("Master Bedroom", valign -> Centre, halign -> Centre ) => { BRMaster_FullWidth / 2, BRMaster_FullLength / 2 }; Opening(-WallOuter, BRMaster_WestWindow, "Window", -90) => { 0, BRMaster_WestRight }; MeasureHorz(BRMaster_FullWidth) => {0, BRMaster_FullLength - MeasShift}; MeasureVert(BRMaster_FullLength) => {MeasShift, 0}; End; [= EAST BEDROOM ------------ Draw the east bedroom. =] Shape EastBedroom() [= coordinate array for bedroom =] PointArray room = [ {0,0}, { BREast_NorthLeft, 0 }, { BREast_NorthLeft, BREast_NorthRecess}, { BREast_FullWidth, BREast_NorthRecess}, { BREast_FullWidth, BREast_FullLength }, { 0, BREast_FullLength } ]; Begin [= draw the room outline =] Polygon(room); Door(75, 90, 45) => { 7, -6}; Opening(WallOuter, BREast_EastWindow, "Window", 90) => { BREast_FullWidth, BREast_NorthRecess + BREast_EastLeft }; [= label the room =] TextBlock("East Bedroom", valign -> Centre, halign -> Centre ) => { BREast_FullWidth / 2, BREast_FullLength / 2 }; MeasureHorz(BREast_FullWidth) => {0, BREast_FullLength - MeasShift}; MeasureVert(BREast_FullLength - BREast_NorthRecess, True) => { BREast_FullWidth - MeasShift, BREast_NorthRecess }; End; [= BATHROOM -------- =] Shape Bathroom() Begin [= just a rectangle =] Rectangle(Bathroom_FullWidth, Bathroom_FullLength); [= door =] Door(59, 180, 135) => {0, 16}; Opening(WallOuter, Bathroom_EastWindow, "Window", 90) => { Bathroom_FullWidth, Bathroom_EastLeft }; [= label the room =] TextBlock("Bathroom", valign -> Centre, halign -> Centre ) => { Bathroom_FullWidth / 2, Bathroom_FullLength / 2 }; MeasureHorz(Bathroom_FullWidth) => {0, Bathroom_FullLength - MeasShift}; MeasureVert(Bathroom_FullLength, True) => { Bathroom_FullWidth - MeasShift, 0 }; End; [= UPPER VOID ---------- Whole upper floor outside rooms. Stair well, landing passage. =] Shape UpperVoid() PointArray area = [ { 0, 0}, { Hall_FullWidth, 0}, { Hall_FullWidth, BRNorth_FullLength}, { Hall_FullWidth - Landing_EastSection, BRNorth_FullLength}, { Hall_FullWidth - Landing_EastSection, BRNorth_FullLength + Landing_PassLength}, { Hall_FullWidth - Landing_EastSection - Landing_PassWidth, BRNorth_FullLength + Landing_PassLength}, { Hall_FullWidth - Landing_EastSection - Landing_PassWidth, BRNorth_FullLength}, { -BRNorth_EastRecess, BRNorth_FullLength}, { -BRNorth_EastRecess, BRNorth_EastLeft + WallNorthLanding}, { 0, BRNorth_EastLeft + WallNorthLanding} ] ; Begin Polygon(area); Opening(WallOuter, Landing_EastWindow, "Window", 90) => { Hall_FullWidth, Landing_EastLeft }; TextBlock("Stairs/Landing/Passage", valign -> Centre, halign -> Centre ) => { ( Hall_FullWidth - BRNorth_EastRecess ) / 2, (Hall_FullLength + Landing_PassLength ) / 2 }; End; [= WALL UPPER NORTH LANDING ------------------------ Wall between the north bedroom and the landing/stairwell. =] Shape WallUpperNorthLanding() PointArray wall = [ { 0, 0}, { WallNorthLanding, 0}, { WallNorthLanding, BRNorth_EastLeft + WallNorthLanding }, { WallNorthLanding - BRNorth_EastRecess, BRNorth_EastLeft + WallNorthLanding }, { WallNorthLanding - BRNorth_EastRecess, BRNorth_EastLeft + BRNorth_EastRight1 }, { -BRNorth_EastRecess, BRNorth_EastLeft + BRNorth_EastRight1 }, { -BRNorth_EastRecess, BRNorth_EastLeft }, { 0, BRNorth_EastLeft } ] ; Begin Polygon(wall, Filled); End; [= WALL UPPER MASTER EAST ---------------------- Wall between main bedroom and east bedroom, extends to landing. =] Shape WallUpperMasterEast() PointArray wall = [ {0,0} , {0, -BRMaster_FullLength}, {-7, -BRMaster_FullLength}, {-7, -BRMaster_FullLength -WallMasterNorth }, {WallMasterEast, -BRMaster_FullLength-WallMasterNorth }, { WallMasterEast, 0 } ] ; Begin Polygon(wall, Filled); End; [= WALL UPPER MASTER NORTH ----------------------- Wall between the master bedroom and the north bedroom. =] Shape WallUpperMasterNorth() PointArray wall = [ {0,0} , { BRNorth_SouthWidth, 0}, { BRNorth_SouthWidth, -BRNorth_EastRight2}, { BRNorth_SouthWidth + WallNorthLanding, -BRNorth_EastRight2}, { BRNorth_SouthWidth + WallNorthLanding, 0}, { BRMaster_NorthLeft, 0}, { BRMaster_NorthLeft, WallMasterNorth}, { 0, WallMasterNorth} ] ; Begin Polygon(wall, Filled); End; [= WALL UPPER BATHROOM CORNER -------------------------- The odd north west corner of bathroom. =] Shape WallUpperBathroomCorner() PointArray wall = [ {0,0}, { 28, 0}, { 28, WallBathNorth }, { WallBathPassage, WallBathNorth }, { WallBathPassage, 30}, { 0, 30} ] ; Begin Polygon(wall, Filled); End; Shape WallUpperBathroomSouth() PointArray wall = [ {0,0}, { WallBathPassage, 0}, { WallBathPassage, Bathroom_WestLeft }, { WallBathPassage + Bathroom_FullWidth, Bathroom_WestLeft }, { WallBathPassage + Bathroom_FullWidth, Bathroom_WestLeft + 10}, { 0, Bathroom_WestLeft + 10} ] ; Begin Polygon(wall, Filled); End; [= CHIMNEY ------- Support routine for drawing the chimney breasts. Simple version for now. The width and height are based of main coord system. =] Shape Chimney(Number width, Number height) Begin Rectangle(width, height, Filled) => BrushChimney; If height > width Then TextRotate("Chimney", 90, Centre, Centre) => { width / 2, height / 2 }; Else TextBlock("Chimney", 0, Centre, Centre) => { width / 2, height / 2 }; EndIf; End; [= DOOR ---- =] Shape Door(Number width, Number start, Number end) Begin [= draw the hinge =] Circle(3, Solid); LineTo( {width * Sin(end), width * -Cos(end)}); If start < end Then Arc(width, start, end); Else Arc(width, end, start); EndIf; End; [= OPENING ======= Opening in the exterior wall. =] Shape Opening(Number width, Number height, Text label, Number orient) Begin [= do the main rectangle =] Rectangle(width, height, Filled) => BrushOpening; [= write the label =] TextRotate(label, orient, Centre, Centre) => { width/2, height / 2 }; End; [= MEASURE HORZ ------------ Horizontal measure. =] Shape MeasureHorz(Number length) Const Number margin = 10; Text label; Point textlen; Begin label := Format(length); textlen := TextSize(label, Font); With MeasurePen Do [= draw the actual number =] TextBlock(label, 0, Centre, Centre) => {length / 2, 0}; LineTo({(length - textlen.x - margin)/2,0}); LineTo( { 10, -2} ); LineTo( { 10, +2} ); With { length, 0 } Do LineTo( { -(length - textlen.x - margin)/2 ,0} ); LineTo( { -10, -2} ); LineTo( { -10, +2} ); EndWith; EndWith; End; [= MEASURE VERT ------------ Vertical measure. =] Shape MeasureVert(Number length, Logical invert = False) Const Number margin = 10; Text label; Point textlen; Number orient = 270; Begin label := Format(length); textlen := TextSize(label, Font); If invert Then orient := 90; EndIf; With MeasurePen Do [= draw the actual number =] TextRotate(label, orient, Centre, Centre) => {0, length / 2}; LineTo( {0, (length - textlen.x - margin)/2} ); LineTo( { -2, 10} ); LineTo( { +2, 10} ); With { 0, length } Do LineTo( { 0, -(length - textlen.x - margin)/2 } ); LineTo( { -2, -10} ); LineTo( { +2, -10} ); EndWith; EndWith; End; [= other measurment not yet used Main Bedroom -------------- Door width = 76; Door offset from east wall = 7; window width = 213; window offset for north wall = 103; =]