 |
CLIP Score: 32.65
from AIDL import *
def house_elevation(body_height: float = 10 * feet, body_width: float = 20 * feet, garage_height: float = 8 * feet, garage_width: float = 10 * feet, window_height: float = 2 * feet, window_width: float = 3 * feet, garage_door_height: float = 6 * feet, garage_door_width: float = 8 * feet):
"""
Model the front elevation of a residential house with main body, garage, and windows.
"""
# Define the structure of the house elevation
house = Assembly()
# Main body of the house
main_body = Solid()
house.main_body = main_body
main_body_shape = Rectangle((0, 0), body_width, body_height)
main_body.shape = main_body_shape
# Garage
garage = Solid(shift=(-garage_width / 2 - body_width / 2, garage_height / 2 - body_height / 2))
house.garage = garage
garage_shape = Rectangle((0, 0), garage_width, garage_height)
garage.shape = garage_shape
# Garage Door
garage_door = Drawing(shift=(0, -garage_height/2 + garage_door_height/2))
garage.garage_door = garage_door
garage_door_shape = Rectangle((0, 0), garage_door_width, garage_door_height)
garage_door.shape = garage_door_shape
# Windows
windows = Drawing(shift=(0, 0))
house.windows = windows
window_1 = Rectangle((-5 * feet, 0.5 * body_height), window_width, window_height)
window_2 = Rectangle((5 * feet, 0.5 * body_height), window_width, window_height)
windows.window_list = [window_1, window_2]
return house
with AIDL_2D:
model = house_elevation()
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! Let's start by outlining the basic structure of the house elevation. We can include the following elements:
1. The main body of the house.
2. The garage.
3. Windows.
We will define the entire house as an assembly (so we can further modularize it later if needed), with solids for the main body and garage, and drawings for the windows and other details to be engraved.
I'll begin by setting up the basic structure of the house elevation. Let's do it step-by-step, starting with the outline and then adding the elements.
### Step 1: Create the Main Body of the House
First, let's define a rectangular shape for the main body of the house.
```python
from AIDL import *
def house_elevation(body_height: float = 10 * feet, body_width: float = 20 * feet):
"""
Model the front elevation of a residential house with main body, garage, and windows.
"""
# Define the structure of the house elevation
house = Assembly()
# Main body of the house
main_body = Solid()
house.main_body = main_body
main_body_shape = Rectangle((0, 0), body_width, body_height)
main_body.shape = main_body_shape
return house
with AIDL_2D:
model = house_elevation()
print(model.Solve())
model.Render()
```
### Step 2: Add a Garage
Next, we'll add a garage to one side of the house. We'll use another Solid structure for this.
```python
from AIDL import *
def house_elevation(body_height: float = 10 * feet, body_width: float = 20 * feet, garage_height: float = 8 * feet, garage_width: float = 10 * feet):
"""
Model the front elevation of a residential house with main body, garage, and windows.
”
"""
# Define the structure of the house elevation
house = Assembly()
# Main body of the house
main_body = Solid()
house.main_body = main_body
main_body_shape = Rectangle((0, 0), body_width, body_height)
main_body.shape = main_body_shape
# Garage
garage = Solid(shift=(-garage_width / 2 - body_width / 2, garage_height / 2 - body_height / 2))
house.garage = garage
garage_shape = Rectangle((0, 0), garage_width, garage_height)
garage.shape = garage_shape
return house
with AIDL_2D:
model = house_elevation()
print(model.Solve())
model.Render()
```
### Step 3: Add Windows
We will now add windows to the main body of the house. We'll use the Drawing structure for the windows to indicate that they should be engraved.
```python
from AIDL import *
def house_elevation(body_height: float = 10 * feet, body_width: float = 20 * feet, garage_height: float = 8 * feet, garage_width: float = 10 * feet, window_height: float = 2 * feet, window_width: float = 3 * feet):
"""
Model the front elevation of a residential house with main body, garage, and windows.
"""
# Define the structure of the house elevation
house = Assembly()
# Main body of the house
main_body = Solid()
house.main_body = main_body
main_body_shape = Rectangle((0, 0), body_width, body_height)
main_body.shape = main_body_shape
# Garage
garage = Solid(shift=(-garage_width / 2 - body_width / 2, garage_height / 2 - body_height / 2))
house.garage = garage
garage_shape = Rectangle((0, 0), garage_width, garage_height)
garage.shape = garage_shape
# Windows
windows = Drawing(shift=(0, 0))
house.windows = windows
window_1 = Rectangle((-5*feet,0.5*body_height), window_width, window_height)
window_2 = Rectangle((5*feet, 0.5*body_height), window_width, window_height)
windows.window_list = [window_1, window_2]
return house
with AIDL_2D:
model = house_elevation()
print(model.Solve())
model.Render()
```
### Final Touch: Garage Door
We can further enhance the garage by adding a door on it with Drawing.
```python
from AIDL import *
def house_elevation(body_height: float = 10 * feet, body_width: float = 20 * feet, garage_height: float = 8 * feet, garage_width: float = 10 * feet, window_height: float = 2 * feet, window_width: float = 3 * feet, garage_door_height: float = 6 * feet, garage_door_width: float = 8 * feet):
"""
Model the front elevation of a residential house with main body, garage, and windows.
"""
# Define the structure of the house elevation
house = Assembly()
# Main body of the house
main_body = Solid()
house.main_body = main_body
main_body_shape = Rectangle((0, 0), body_width, body_height)
main_body.shape = main_body_shape
# Garage
garage = Solid(shift=(-garage_width / 2 - body_width / 2, garage_height / 2 - body_height / 2))
house.garage = garage
garage_shape = Rectangle((0, 0), garage_width, garage_height)
garage.shape = garage_shape
# Garage Door
garage_door = Drawing(shift=(0, -garage_height/2 + garage_door_height/2))
garage.garage_door = garage_door
garage_door_shape = Rectangle((0, 0), garage_door_width, garage_door_height)
garage_door.shape = garage_door_shape
# Windows
windows = Drawing(shift=(0, 0))
house.windows = windows
window_1 = Rectangle((-5*feet,0.5*body_height), window_width, window_height)
window_2 = Rectangle((5*feet, 0.5*body_height), window_width, window_height)
windows.window_list = [window_1, window_2]
return house
with AIDL_2D:
model = house_elevation()
print(model!.Solve())
model.Render()
```
This program models an architect's elevation of a residential house with a garage and windows. Please let me know if you want additional features or any adjustments!
Traceback (most recent call last):
File "/net/projects/ranalab/jz/aidl/AIDL/generation/backend.py", line 21, in dumbrun
exec(code, env)
File "", line 41
print(model!.Solve())
^
SyntaxError: invalid syntax
I apologize for the error. It seems there was a typo in the last snippet. The exclamation mark (`!`) should not be there. Let's correct that and review the final version of the AIDL program.
Here is the corrected and complete AIDL program:
```python
from AIDL import *
def house_elevation(body_height: float = 10 * feet, body_width: float = 20 * feet, garage_height: float = 8 * feet, garage_width: float = 10 * feet, window_height: float = 2 * feet, window_width: float = 3 * feet, garage_door_height: float = 6 * feet, garage_door_width: float = 8 * feet):
"""
Model the front elevation of a residential house with main body, garage, and windows.
"""
# Define the structure of the house elevation
house = Assembly()
# Main body of the house
main_body = Solid()
house.main_body = main_body
main_body_shape = Rectangle((0, 0), body_width, body_height)
main_body.shape = main_body_shape
# Garage
garage = Solid(shift=(-garage_width / 2 - body_width / 2, garage_height / 2 - body_height / 2))
house.garage = garage
garage_shape = Rectangle((0, 0), garage_width, garage_height)
garage.shape = garage_shape
# Garage Door
garage_door = Drawing(shift=(0, -garage_height/2 + garage_door_height/2))
garage.garage_door = garage_door
garage_door_shape = Rectangle((0, 0), garage_door_width, garage_door_height)
garage_door.shape = garage_door_shape
# Windows
windows = Drawing(shift=(0, 0))
house.windows = windows
window_1 = Rectangle((-5 * feet, 0.5 * body_height), window_width, window_height)
window_2 = Rectangle((5 * feet, 0.5 * body_height), window_width, window_height)
windows.window_list = [window_1, window_2]
return house
with AIDL_2D:
model = house_elevation()
print(model.Solve())
model.Render()
```
This updated program should work correctly and generate a front elevation of a residential house with a garage, windows, and a garage door.
If you need any further modifications or additions, please let me know!
|