 |
CLIP Score: 32.28
from AIDL import *
def residential_house(
house_width: float = 40 * feet,
house_height: float = 25 * feet,
garage_width: float = 15 * feet,
garage_height: float = 10 * feet,
window_width: float = 3 * feet,
window_height: float = 5 * feet,
):
"""
Architectural elevation of a residential house with garage and windows.
"""
# Define the overall house structure
house = Solid()
# Define the garage structure and its shift (attached to the right side of the house)
garage = Solid(shift=(house_width / 2 + garage_width / 2, 0))
house.garage = garage
# Define the windows (use a list for multiple windows)
windows = []
# Example: two windows on the front of the house
for i in range(2):
window = Solid(shift=(-house_width / 4 + i * house_width / 2, house_height / 8))
windows.append(window)
# Attach windows to the house
house.windows = windows
# Define the geometry of the house (a simple rectangle for the elevation view)
house.body = Rectangle((0, 0), house_width, house_height)
# Define the geometry of the garage
garage.body = Rectangle((0, 0), garage_width, garage_height)
garage.door = Rectangle((0, 0), garage_width - 2 * feet, garage_height - 1 * foot) # garage door slightly smaller than garage
# Define the geometry of each window
for i, window in enumerate(windows):
window.frame = Rectangle((0, 0), window_width, window_height)
# Set up constraints
# Ensure the garage and house share the same bottom plane
house.AddConstraint(garage.bb.bottom == house.bb.bottom)
# Align windows neatly within the house
for window in windows:
house.AddConstraint(window.bb.bottom == house.bb.bottom + window_height + 2 * feet) # windows start 2 feet from the ground
return house
with AIDL_2D:
model = residential_house()
print(model.Solve())
model.Render()
|
Please write an AIDL program to generate a architect's elevation of a residential house with garage and windows
Sure! To generate an architect's elevation of a residential house with a garage and windows, we'll consider the following steps:
1. Define the overall structure of the house, garage, and windows.
2. Determine and define the geometry for each component (e.g., walls, doors, roof, windows).
3. Use constraints to maintain the relative positions and dimensions.
4. Make use of `Drawing` for the details (e.g., window panes, door panels).
Here's an initial attempt to make this architect's elevation. For simplicity, we'll focus on a elevation view:
```python
from AIDL import *
def residential_house(
house_width: float = 40 * feet,
house_height: float = 25 * feet,
garage_width: float = 15 * feet,
garage_height: float = 10 * feet,
window_width: float = 3 * feet,
window_height: float = 5 * feet,
):
"""
Architectural elevation of a residential house with garage and windows.
"""
# Define the overall house structure
house = Solid()
# Define the garage structure and its shift (attached to the right side of the house)
garage = Solid(shift=(house_width / 2 + garage_width / 2, 0))
house.garage = garage
# Define the windows (use a list for multiple windows)
windows = []
# Example: two windows on the front of the house
for i in range(2):
window = Solid(shift=(-house_width / 4 + i * house_width / 2, house_height / 8))
windows.append(window)
# Attach windows to the house
house.windows = windows
# Define the geometry of the house (a simple rectangle for the elevation view)
house.body = Rectangle((0, 0), house_width, house_height)
# Define the geometry of the garage
garage.body = Rectangle((0, 0), garage_width, garage_height)
garage.door = Rectangle((0, 0), garage_width - 2 * feet, garage_height - 1 * foot) # garage door slightly smaller than garage
# Define the geometry of each window
for i, window in enumerate(windows):
window.frame = Rectangle((0, 0), window_width, window_height)
# Set up constraints
# Ensure the garage and house share the same bottom plane
house.AddConstraint(garage.bb.bottom == house.bb.bottom)
# Align windows neatly within the house
for window in windows:
house.AddConstraint(window.bb.bottom == house.bb.bottom + window_height + 2 * feet) # windows start 2 feet from the ground
return house
with AIDL_2D:
model = residential_house()
print(model.Solve())
model.Render()
```
In this code:
- We define the main structure (`house`) and attach a garage to its right-hand side.
- The garage has geometry defined as a rectangle, with a slightly smaller door.
- Two windows are added as separate `Solid` structures and given specific positions relative to the house.
- Constraints are used to align the bottoms of the house and garage, and to position the windows within the house.
Please take a look and let me know if there are any specific details or adjustments you'd like to make.
|