 |
CLIP Score: 21.31
from AIDL import *
def macbook_chair(base_width: float = 10*inches, base_depth: float = 6*inches, backrest_height: float = 6*inches, hole_diameter: float = 1*inch, num_holes: int = 3):
"""
Creates a simple MacBook chair stand with a base panel and a backrest panel,
including cutout holes for aesthetic and weight reduction.
"""
chair = Assembly()
# Define the base panel
base = Solid()
chair.base = base
# Define the backrest panel with a shift to represent the angle (adjust for desired angle)
backrest = Solid(shift=(base_depth / 3, base_width / 2))
chair.backrest = backrest
# Base panel geometry
base.panel = Rectangle((0, 0), base_width, base_depth)
# Backrest panel geometry
backrest.panel = Rectangle((0, 0), base_width, backrest_height)
# Cut-out holes in the base panel
base.cutout = Hole()
base.cutout.holes = [Circle((i * (base_width / (num_holes + 1)), 0), hole_diameter / 2) for i in range(1, num_holes + 1)]
# Cut-out holes in the backrest panel
backrest.cutout = Hole()
backrest.cutout.holes = [Circle((0,i * (backrest_height / (num_holes + 1))), hole_diameter / 2) for i in range(1, num_holes + 1)]
return chair
with AIDL_2D:
model = macbook_chair()
print(model.Solve())
model.Render()
|
Please write an AIDL program to generate a macbook chair
Great! Let's create an AIDL program to generate a MacBook chair step-by-step. A MacBook chair is typically designed as a simple, angled stand that supports a MacBook at a comfortable viewing angle.
We'll start with the basic dimensions and features of the MacBook chair. Here's how we can break it down:
1. **Base panel**: The main support that sits flat on the table.
2. **Backrest panel**: Angled piece that supports the back of the MacBook.
3. **Cut-out holes**: Cut-outs in the panels for weight reduction and aesthetic purposes.
To begin, let's define the main structure and dimensions for the MacBook chair.
### Step 1: Define the Basic Model Layout
First, we'll set up the basic structure of our AIDL program by defining the main components:
1. **Base Panel**: A rectangular solid.
2. **Backrest Panel**: A rectangular solid tilted at an angle.
3. **Cut-out Holes**: Circular holes on both panels.
Here is an outline of the AIDL program:
```python
from AIDL import *
def macbook_chair(base_width: float = 10*inches, base_depth: float = 6*inches, backrest_height: float = 6*inches, hole_diameter: float = 1*inch):
"""
Creates a simple MacBook chair stand with a base panel and a backrest panel
"""
# Define the main structure of the MacBook chair
chair = Assembly()
# Define the base panel
base = Solid()
chair.base = base
# Define the backrest panel with a shift to represent the angle
backrest = Solid(shift=(float(base_depth/2), float(base_width/2))) # Adjust shift as appropriate for desired angle
chair.backrest = backrest
# Define the geometry for the base panel
base.panel = Rectangle((0, 0), base_width, base_depth)
# Define the geometry for the backrest panel
backrest.panel = Rectangle((0, backrest_height/2), base_width, backrest_height)
# Define cut-out holes in the base panel (example with one hole)
base.cutout = Hole()
base.cutout.hole = Circle((0, 0), hole_diameter/2)
# Define cut-out holes in the backrest panel (example with one hole)
backrest.cutout = Hole()
backrest.cutout.hole = Circle((0, backrest_height/2), hole_diameter/2)
return chair
with AIDL_2D:
model = macbook_chair()
print(model.Solve())
model.Render()
```
### Step 2: Add Multiple Cut-out Holes and Adjust Details
We can enhance the model by adding multiple cut-out holes and ensuring the backrest is tilted correctly. We will also align the holes symmetrically.
Here is the complete enhanced program:
```python
from AIDL import *
def macbook_chair(base_width: float = 10*inches, base_depth: float = 6*inches, backrest_height: float = 6*inches, hole_diameter: float = 1*inch, num_holes: int = 3):
"""
Creates a simple MacBook chair stand with a base panel and a backrest panel,
including cutout holes for aesthetic and weight reduction.
"""
chair = Assembly()
# Define the base panel
base = Solid()
chair.base = base
# Define the backrest panel with a shift to represent the angle (adjust for desired angle)
backrest = Solid(shift=(base_depth / 3, base_width / 2))
chair.backrest = backrest
# Base panel geometry
base.panel = Rectangle((0, 0), base_width, base_depth)
# Backrest panel geometry
backrest.panel = Rectangle((0, 0), base_width, backrest_height)
# Cut-out holes in the base panel
base.cutout = Hole()
base.cutout.holes = [Circle((i * (base_width / (num_holes + 1)), 0), hole_diameter / 2) for i in range(1, num_holes + 1)]
# Cut-out holes in the backrest panel
backrest.cutout = Hole()
backrest.cutout.holes = [Circle((0,i * (backrest_height / (num_holes + 1))), hole_diameter / 2) for i in range(1, num_holes + 1)]
return chair
with AIDL_2D:
model = macbook_chair()
print(model.Solve())
model.Render()
```
This program defines a MacBook chair with a base panel and a backrest panel, both containing symmetric cut-out holes. The backrest is shifted to provide an angled support, making it a simple yet effective stand for a MacBook.
Feel free to modify the parameters and add more details as needed! If you have any further specific requirements or need additional features, let me know, and we can refine the program further.
|