 |
CLIP Score: 25.53
from AIDL import *
def macbook_chair(
base_length: float = 10 * inches,
base_width: float = 6 * inches,
support_height: float = 8 * inches,
support_thickness: float = 0.5 * inches,
back_support_height: float = 2 * inches,
cutout_radius: float = 1 * inches
):
"""
Construct a MacBook chair with a flat rectangular base, two vertical supports, and a back support.
"""
# Define the main macbook chair structure as an assembly
macbook_chair = Assembly()
# Define the base plate as a solid with a rectangular shape
base_plate = Solid()
base_plate.shape = Rectangle((0, 0), base_length, base_width)
macbook_chair.base_plate = base_plate
# Define the vertical supports as solids
supports = []
support_positions = [(-base_length / 4, 0), (base_length / 4, 0)]
for pos in support_positions:
support = Solid(shift=pos)
support.shape = Rectangle((0, support_height / 2), support_thickness, support_height)
# Add a circular cutout to the support
support.cutout = Hole()
support.cutout.hole = Circle((0, support_height / 2), cutout_radius)
supports.append(support)
macbook_chair.supports = supports
# Define the back support as a solid with a rectangular shape
back_support = Solid(shift=(0, base_width / 2 - back_support_height / 2))
back_support.shape = Rectangle((0, 0), support_thickness, back_support_height)
macbook_chair.back_support = back_support
return macbook_chair
with AIDL_2D:
model = macbook_chair()
print(model.Solve())
model.Render()
|
Please write an AIDL program to generate a macbook chair
Creating a macbook chair using AIDL involves designing a structure that securely holds a MacBook at a comfortable viewing angle. Let's assume the following conceptual design:
1. **Base Plate**: A flat rectangular base.
2. **Main Support**: Two vertical supports that hold the MacBook.
3. **Back Support**: A back support piece to keep the MacBook from sliding backward.
4. **Cutouts**: Holes in the supports to reduce material and weight.
Let's write the AIDL program to achieve the design:
```python
from AIDL import *
def macbook_chair(
base_length: float = 10 * inches,
base_width: float = 6 * inches,
support_height: float = 8 * inches,
support_thickness: float = 0.5 * inches,
back_support_height: float = 2 * inches,
cutout_radius: float = 1 * inches
):
"""
Construct a MacBook chair with a flat rectangular base, two vertical supports, and a back support.
"""
# Define the main macbook chair structure as an assembly
macbook_chair = Assembly()
# Define the base plate as a solid with a rectangular shape
base_plate = Solid()
base_plate.shape = Rectangle((0, 0), base_length, base_width)
macbook_chair.base_plate = base_plate
# Define the vertical supports as solids
supports = []
support_positions = [(-base_length / 4, 0), (base_length / 4, 0)]
for pos in support_positions:
support = Solid(shift=pos)
support.shape = Rectangle((0, support_height / 2), support_thickness, support_height)
# Add a circular cutout to the support
support.cutout = Hole()
support.cutout.hole = Circle((0, support_height / 2), cutout_radius)
supports.append(support)
macbook_chair.supports = supports
# Define the back support as a solid with a rectangular shape
back_support = Solid(shift=(0, base_width / 2 - back_support_height / 2))
back_support.shape = Rectangle((0, 0), support_thickness, back_support_height)
macbook_chair.back_support = back_support
return macbook_chair
with AIDL_2D:
model = macbook_chair()
print(model.Solve())
model.Render()
```
Explanation:
1. **Base Plate**: Utilizes a `Rectangle` to represent the flat base.
2. **Vertical Supports**: Two `Solid` components positioned symmetrically on the base with `Rectangle` shapes. Each support has a `Hole` with a `Circle` for the cutout.
3. **Back Support**: Another `Solid` with a `Rectangle` shape, placed at the back of the base.
This should produce a simple but functional macbook chair ready for laser cutting. Please provide feedback if any adjustments are necessary.
|