public void Circulation() { var roomRow = new RoomRow(Vector3.Origin, new Vector3(10.0, 0.0)) { CirculationWidth = 2.0 }; for (int i = 0; i < 3; i++) { Assert.True(roomRow.AddRoom(new Room() { DesignArea = 9.0 })); } Assert.Contains(new Vector3(0.0, 5.0), roomRow.Circulation.Vertices); Assert.Contains(new Vector3(9.0, 5.0), roomRow.Circulation.Vertices); }
public void SetColor() { var roomRow = new RoomRow(Vector3.Origin, new Vector3(10.0, 0.0)); for (int i = 0; i < 3; i++) { Assert.True(roomRow.AddRoom(new Room() { DesignArea = 9.0 })); } roomRow.SetColor(Palette.Blue); foreach (Room room in roomRow.Rooms) { Assert.Equal(Palette.Blue, room.Color); } }
public void SetHeight() { var roomRow = new RoomRow(Vector3.Origin, new Vector3(10.0, 0.0)); for (int i = 0; i < 3; i++) { Assert.True(roomRow.AddRoom(new Room() { DesignArea = 9.0 })); } roomRow.SetHeight(10.0); foreach (Room room in roomRow.Rooms) { Assert.Equal(10.0, room.Height); } }
public void SetElevation() { var roomRow = new RoomRow(Vector3.Origin, new Vector3(10.0, 0.0)); for (int i = 0; i < 3; i++) { Assert.True(roomRow.AddRoom(new Room() { DesignArea = 9.0 })); } roomRow.Elevation = 20.0; foreach (Room room in roomRow.Rooms) { Assert.Equal(20.0, room.Elevation); } }
public void LengthAvailable() { var roomRow = new RoomRow(Polygon.Rectangle(9.0, 3.0)); for (int i = 0; i < 2; i++) { roomRow.AddRoom(new Room(new Vector3(3.0, 3.0, 3.0))); } var model = new Model(); foreach (Room room in roomRow.Rooms) { model.AddElement(new Space(room.PerimeterAsProfile, room.Height, room.ColorAsMaterial)); } model.AddElement(new Space(new Profile(roomRow.Perimeter), 0.2, new Material(Colors.Aqua, 0.0, 0.0, false, null, false, Guid.NewGuid(), Guid.NewGuid().ToString()))); model.ToGlTF("../../../../RoomKitTest/output/RoomRowLengthAvailable.glb"); Assert.Equal(3.0, roomRow.LengthAvailable, 10); }
public void Footprint() { var roomRow = new RoomRow(Polygon.Rectangle(9.0, 3.0)); for (int i = 0; i < 3; i++) { Assert.True(roomRow.AddRoom(new Room(new Vector3(3.0, 3.0, 3.0)))); } var footprint = roomRow.Footprint; Assert.Equal(27.0, footprint.Area(), 10); var model = new Model(); foreach (Room room in roomRow.Rooms) { model.AddElement(new Space(room.PerimeterAsProfile, room.Height, room.ColorAsMaterial)); } model.AddElement(new Space(new Profile(footprint), 0.5, BuiltInMaterials.Concrete)); model.ToGlTF("../../../../RoomKitTest/output/RoomRowFootprint.glb"); }
public void MoveFromTo() { var roomRow = new RoomRow(Vector3.Origin, new Vector3(10.0, 0.0)); for (int i = 0; i < 3; i++) { Assert.True(roomRow.AddRoom(new Room() { DesignArea = 9.0 })); } roomRow.MoveFromTo(Vector3.Origin, new Vector3(20.0, 20.0, 20.0)); Assert.Equal(20.0, roomRow.Elevation); Assert.Equal(20.0, roomRow.Row.Start.X); Assert.Equal(20.0, roomRow.Row.Start.Y); Assert.Equal(0.0, roomRow.Row.Start.Z); Assert.Equal(30.0, roomRow.Row.End.X); Assert.Equal(20.0, roomRow.Row.Start.Y); Assert.Equal(0.0, roomRow.Row.Start.Z); }
public void JoinTriangleEndRooms() { var roomRow = new RoomRow( new Polygon ( new[] { Vector3.Origin, new Vector3(10.0, 0.0), new Vector3(8.0, 2.0), new Vector3(2.0, 2.0) } )); for (var i = 0; i < 5; i++) { roomRow.AddRoom( new Room(new Vector3(2.0, 2.0)) { Color = Palette.Aqua, Height = 1.0 }); } Assert.Equal(5, roomRow.Rooms.Count); Assert.Equal(3, roomRow.Rooms.First().Perimeter.Vertices.Count); Assert.Equal(3, roomRow.Rooms.Last().Perimeter.Vertices.Count); roomRow.JoinTriangleEndRooms(); Assert.Equal(3, roomRow.Rooms.Count); var model = new Model(); foreach (Room room in roomRow.Rooms) { model.AddElement(new Space(room.PerimeterAsProfile, room.Height, room.ColorAsMaterial)); } model.ToGlTF("../../../../RoomKitTest/output/RoomRowJoinTriangleEndRooms.glb"); }
public void Rotate() { var roomRow = new RoomRow(Vector3.Origin, new Vector3(10.0, 0.0)); for (int i = 0; i < 3; i++) { Assert.True(roomRow.AddRoom(new Room() { DesignArea = 9.0 })); } var model = new Model(); foreach (Room room in roomRow.Rooms) { model.AddElement(room.AsSpace); } roomRow.Rotate(Vector3.Origin, 180); foreach (Room room in roomRow.Rooms) { model.AddElement(room.AsSpace); } model.SaveGlb("../../../../RoomRowRotate.glb"); }
public void RoomRow() { var rooms = new List <Room>(); for (int i = 0; i < 1; i++) { var room = new Room() { Name = "Office Large", ResourceID = 7, DesignX = 4.25, DesignY = 3.65, Color = Palette.Green }; rooms.Add(room); } for (int i = 0; i < 1; i++) { var room = new Room() { Name = "Office Medium", ResourceID = 8, DesignX = 4.25, DesignY = 3.35, Color = Palette.Lime }; rooms.Add(room); } for (int i = 0; i < 1; i++) { var room = new Room() { Name = "Office Small", ResourceID = 9, DesignX = 3.65, DesignY = 2.75, Color = Palette.Mint }; rooms.Add(room); } for (int i = 0; i < 1; i++) { var room = new Room() { Name = "Conference Large", ResourceID = 10, DesignX = 9.5, DesignY = 4.5, Color = Palette.Purple }; rooms.Add(room); } for (int i = 0; i < 1; i++) { var room = new Room() { Name = "Conference Medium", ResourceID = 11, DesignX = 6.0, DesignY = 4.25, Color = Palette.Magenta }; rooms.Add(room); } for (int i = 0; i < 1; i++) { var room = new Room() { Name = "Conference Small", ResourceID = 12, DesignX = 5.0, DesignY = 4.5, Color = Palette.Lavender }; rooms.Add(room); } var line = new Line(new Vector3(30.0, 30.0), new Vector3(60.0, 40.0)); var roomRow = new RoomRow(line); foreach (Room room in rooms) { roomRow.AddRoom(room, null, null, 10.0); } var model = new Model(); foreach (Room room in roomRow.Rooms) { model.AddElement(room.AsSpace); } model.AddElement(new Space(roomRow.Circulation, 0.1, 0.01, BuiltInMaterials.Concrete)); model.SaveGlb("../../../../RoomRow.glb"); }
public void AddRoom() { var rooms = new List <Room>(); for (int i = 0; i < 3; i++) { var room = new Room(new Vector3(5.0, 4.0, 3.0)) { Color = Palette.Green, }; rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room(new Vector3(6.0, 6.0, 3.0)) { Color = Palette.Lime, }; rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room(new Vector3(5.0, 4.0, 3.0)) { Color = Palette.Mint, }; rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room(new Vector3(6.0, 6.0, 3.0)) { Color = Palette.Purple, }; rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room(new Vector3(5.0, 4.0, 3.0)) { Color = Palette.Magenta, }; rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room(new Vector3(6.0, 6.0, 3.0)) { Color = Palette.Lavender, }; rooms.Add(room); } var polygon = new Polygon ( new[] { new Vector3(10.0, 10.0), new Vector3(200.0, 30.0), new Vector3(200.0, 33.0), new Vector3(10.0, 13.0) } ); var roomRow = new RoomRow(polygon); foreach (Room room in rooms) { roomRow.AddRoom(room); } Assert.Equal(18, roomRow.Rooms.Count); var model = new Model(); foreach (Room room in roomRow.Rooms) { model.AddElement(new Space(room.PerimeterAsProfile, room.Height, room.ColorAsMaterial)); } model.AddElement(new Space(new Profile(polygon), 0.2, new Material(Colors.Aqua, 0.0, 0.0, false, null, false, Guid.NewGuid(), Guid.NewGuid().ToString()))); model.ToGlTF("../../../../RoomKitTest/output/RoomRow.glb"); }
public void AddRoom() { var rooms = new List <Room>(); for (int i = 0; i < 3; i++) { var room = new Room() { Color = Palette.Green, DesignXYZ = new Vector3(5.0, 4.0, 3.0), Height = 3.0, }; room.SetPerimeter(); rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room() { Color = Palette.Lime, DesignArea = 12.0, Height = 3.0, }; room.SetPerimeter(); rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room() { Color = Palette.Mint, DesignXYZ = new Vector3(4.0, 3.0, 3.0) }; room.SetPerimeter(); rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room() { Color = Palette.Purple, DesignArea = 16.0, Height = 5.0, }; room.SetPerimeter(); rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room() { Color = Palette.Magenta, DesignXYZ = new Vector3(6.0, 4.0, 5.0) }; room.SetPerimeter(); rooms.Add(room); } for (int i = 0; i < 3; i++) { var room = new Room() { Color = Palette.Lavender, DesignXYZ = new Vector3(5.0, 4.5, 5.0) }; room.SetPerimeter(); rooms.Add(room); } var line = new Line(new Vector3(30.0, 30.0), new Vector3(200.0, 40.0)); var roomRow = new RoomRow(line) { CirculationWidth = 2.0 }; foreach (Room room in rooms) { roomRow.AddRoom(room, null, null); } Assert.Equal(18, roomRow.Rooms.Count); var model = new Model(); foreach (Room room in roomRow.Rooms) { model.AddElement(room.AsSpace); } model.AddElement(new Floor(roomRow.Circulation, new FloorType("slab", 0.05))); model.SaveGlb("../../../../RoomRow.glb"); }