 |
CLIP Score: 29.91
from AIDL import *
def macbook_stand(
base_width: float = 12*inches,
base_height: float = 0.5*inch,
base_depth: float = 8*inches,
back_height: float = 10*inches,
top_radius: float = 2*inches,
slot_width: float = 0.75*inch,
slot_depth: float = 6*inches):
# Define the main structure
stand = Solid()
# Define the base as a rectangle
base = Solid()
base.rect = Rectangle((0,0), base_width, base_height)
# Define the back support with a rounded top
back = Solid(shift=(0, base_height + back_height/2))
back.rect = Rectangle((0,0), base_width, back_height - top_radius)
back.rounded_top = Arc((0, back_height/2 - top_radius), 180, 0, top_radius)
# Define the left and right side supports
side_support_left = Solid(shift=(-base_width/2 + slot_width, base_height/2))
side_support_right = Solid(shift=(base_width/2 - slot_width, base_height/2))
# Side supports with slots
side_support_left.slot = Rectangle((0,0), slot_width, slot_depth, axis_aligned=False)
side_support_right.slot = Rectangle((0,0), slot_width, slot_depth, axis_aligned=False)
# Decorative engraving on the base
decorations = Drawing(shift=(0, -base_height/2))
decorations.pattern = [
Arc((i * base_width/5 - base_width/2.5, 0), 0, 360, base_height/6)
for i in range(1, 6)
]
# Add everything to the main stand structure
stand.base = base
stand.back = back
stand.side_support_left = side_support_left
stand.side_support_right = side_support_right
stand.decorations = decorations
return stand
with AIDL_2D:
model = macbook_stand()
print(model.Solve())
model.Render()
|
Please write an AIDL program to generate a macbook chair
Sure, let's design a simple MacBook stand. For this design, we'll create a basic structure that includes a base, a back support, and two side supports. The back support will have a rounded top, and the side supports will have slots to hold the MacBook securely. We'll also engrave some decorative details on the base to make it look nice.
Here's a step-by-step guide to creating the MacBook stand:
1. Define the dimensions of the MacBook stand: base width, height, depth, and the radius of the rounded top on the back support.
2. Create the base structure as a rectangle.
3. Create the back support structure, which includes a rounded top.
4. Create the side support structures, which have slots for the MacBook.
5. Add decorative engraving on the base.
Here's what the AIDL program looks like:
```python
from AIDL import *
def macbook_stand(
base_width: float = 12*inches,
base_height: float = 0.5*inch,
base_depth: float = 8*inches,
back_height: float = 10*inches,
top_radius: float = 2*inches,
slot_width: float = 0.75*inch,
slot_depth: float = 6*inches):
# Define the main structure
stand = Solid()
# Define the base as a rectangle
base = Solid()
base.rect = Rectangle((0,0), base_width, base_height)
# Define the back support with a rounded top
back = Solid(shift=(0, base_height + back_height/2))
back.rect = Rectangle((0,0), base_width, back_height - top_radius)
back.rounded_top = Arc((0, back_height/2 - top_radius), 180, 0, top_radius)
# Define the left and right side supports
side_support_left = Solid(shift=(-base_width/2 + slot_width, base_height/2))
side_support_right = Solid(shift=(base_width/2 - slot_width, base_height/2))
# Side supports with slots
side_support_left.slot = Rectangle((0,0), slot_width, slot_depth, axis_aligned=False)
side_support_right.slot = Rectangle((0,0), slot_width, slot_depth, axis_aligned=False)
# Decorative engraving on the base
decorations = Drawing(shift=(0, -base_height/2))
decorations.pattern = [
Arc((i * base_width/5 - base_width/2.5, 0), 0, 360, base_height/6)
for i in range(1, 6)
]
# Add everything to the main stand structure
stand.base = base
stand.back = back
stand.side_support_left = side_support_left
stand.side_support_right = side_support_right
stand.decorations = decorations
return stand
with AIDL_2D:
model = macbook_stand()
print(model.Solve())
model.Render()
```
### Explanation:
1. **Base:** A simple rectangle representing the base of the stand.
2. **Back support:** A rectangle with a circular arc at the top to give it a rounded shape.
3. **Side supports:** Two rectangles with slots for holding the MacBook.
4. **Decorative Engraving:** Arcs on the base, added as a `Drawing`.
This program should give you a basic MacBook stand. Feel free to modify any parameters or add more features as needed! If you have any specific requirements or would like to add more details, please let me know, and I can adjust the program accordingly.
|