 |
CLIP Score: 28.02
from AIDL import *
def macbook_chair(
base_width: float = 12 * inches,
base_length: float = 8 * inches,
support_height: float = 4 * inches,
support_thickness: float = 0.25 * inches,
back_support_height: float = 6 * inches,
feet_height: float = 0.5 * inches
):
"""
Creates a simple MacBook chair with a base, support arms, back support, and optional feet.
"""
chair = Assembly()
# Base structure
base = Solid()
base.geometry = Rectangle((0, 0), base_width, base_length)
chair.base = base
# Support arms (left and right)
support_arms = []
for i in [-1, 1]: # Two arms, mirrored
support = Solid(shift=(i * (base_width / 2 - support_thickness), support_height / 2))
support.geometry = Rectangle((0, 0), support_thickness, support_height)
support_arms.append(support)
chair.support_arms = support_arms
# Back support
back_support = Solid(shift=(0, support_height + back_support_height / 2 - 0.1*support_height))
back_support.geometry = Rectangle((0, 0), support_thickness, back_support_height)
chair.back_support = back_support
# Optional feet (front and back)
feet = []
for x_shift in [-4*inches, 4*inches]: # Two feet, front and back
foot = Solid(shift=(x_shift, -support_height / 2))
foot.geometry = Rectangle((0, 0), support_thickness, feet_height)
feet.append(foot)
chair.feet = feet
return chair
with AIDL_2D:
model = macbook_chair()
print(model.Solve())
model.Render()
|
Please write an AIDL program to generate a macbook chair
Sure, let's break down the creation of a MacBook chair (a simple stand to hold a MacBook). Please guide me through the design and specific dimensions or features you envision for the chair.
Here are some typical components that could make up the chair:
1. **Base**: A rectangular or shaped base that the MacBook can sit on.
2. **Support Arms**: Two or more support arms to hold the MacBook in place.
3. **Back Support**: A back piece to support the MacBook from behind.
4. **Feet**: Optional feet or supports to raise the base slightly.
Let's start by defining a basic structure and then refine the design according to your specifications.
### Basic Structure for MacBook Chair
```python
from AIDL import *
def macbook_chair(
base_width: float = 12 * inches,
base_length: float = 8 * inches,
support_height: float = 4 * inches,
support_thickness: float = 0.25 * inches,
back_support_height: float = 6 * inches,
feet_height: float = 0.5 * inches
):
"""
Creates a simple MacBook chair with a base, support arms, back support, and optional feet.
"""
chair = Assembly()
# Base structure
base = Solid()
base.geometry = Rectangle((0, 0), base_width, base_length)
chair.base = base
# Support arms (left and right)
support_arms = []
for i in [-1, 1]: # Two arms, mirrored
support = Solid(shift=(i * (base_width / 2 - support_thickness), support_height / 2))
support.geometry = Rectangle((0, 0), support_thickness, support_height)
support_arms.append(support)
chair.support_arms = support_arms
# Back support
back_support = Solid(shift=(0, support_height + back_support_height / 2 - 0.1*support_height))
back_support.geometry = Rectangle((0, 0), support_thickness, back_support_height)
chair.back_support = back_support
# Optional feet (front and back)
feet = []
for x_shift in [-4*inches, 4*inches]: # Two feet, front and back
foot = Solid(shift=(x_shift, -support_height / 2))
foot.geometry = Rectangle((0, 0), support_thickness, feet_height)
feet.append(foot)
chair.feet = feet
return chair
with AIDL_2D:
model = macbook_chair()
print(model.Solve())
model.Render()
```
### Explanation:
- **Base**: A rectangle forms the base.
- **Support Arms**: Two rectangles form the vertical support arms, positioned symmetrically on each side of the base.
- **Back Support**: A rectangle to support the back of the MacBook, positioned above the base.
- **Feet**: Optional rectangles acting as feet to raise the base.
Please provide any additional features or adjustments you'd like to add to this design, and we can refine it further. For instance, do you want the support arms angled, or should the back support be curved? Let me know any specific changes or enhancements.
|