 |
CLIP Score: 27.72
from AIDL import *
def vintage_camera(body_width: float = 6 * inches, body_height: float = 4 * inches,
lens_radius: float = 1.5 * inches, viewfinder_width: float = 1 * inch,
viewfinder_height: float = 0.5 * inches):
"""
Create a model of a vintage camera with a rectangular body, a circular lens,
and a small rectangular viewfinder.
"""
camera = Solid()
body = Solid()
lens = Solid()
viewfinder = Solid(shift=(0, body_height/2 - viewfinder_height/2)) # Position the viewfinder near the top
details = Drawing()
camera.body = body
camera.lens = lens
camera.viewfinder = viewfinder
camera.details = details
# Define the body geometry
body.shape = Rectangle((0, 0), body_width, body_height)
# Define the lens geometry
lens.shape = Circle((0, 0), lens_radius)
# Define the viewfinder geometry
viewfinder.shape = Rectangle((0, 0), viewfinder_width, viewfinder_height)
# Define some simple detail lines
details.lines = [
Line((-body_width/2 + 0.5*inch, -body_height/4), (body_width/2 - 0.5*inch, -body_height/4)),
Line((-body_width/2 + 0.5*inch, body_height/4), (body_width/2 - 0.5*inch, body_height/4))
]
return camera
with AIDL_2D:
model = vintage_camera()
print(model.Solve())
model.Render()
|
Please write an AIDL program to generate a vintage camera
Creating a vintage camera model can be a fun project. For this exercise, we'll design a simplified representation of a vintage camera, including a main body, lens, and some basic details.
Let's define the major components:
1. **Body**: A rectangular main body.
2. **Lens**: A circular lens in the center.
3. **Viewfinder**: A small rectangular viewfinder at the top.
4. **Details**: Simple lines to represent engravings or details on the body.
Here is the AIDL code to generate a simplified vintage camera:
```python
from AIDL import *
def vintage_camera(body_width: float = 6 * inches, body_height: float = 4 * inches,
lens_radius: float = 1.5 * inches, viewfinder_width: float = 1 * inch,
viewfinder_height: float = 0.5 * inches):
"""
Create a model of a vintage camera with a rectangular body, a circular lens,
and a small rectangular viewfinder.
"""
camera = Solid()
body = Solid()
lens = Solid()
viewfinder = Solid(shift=(0, body_height/2 - viewfinder_height/2)) # Position the viewfinder near the top
details = Drawing()
camera.body = body
camera.lens = lens
camera.viewfinder = viewfinder
camera.details = details
# Define the body geometry
body.shape = Rectangle((0, 0), body_width, body_height)
# Define the lens geometry
lens.shape = Circle((0, 0), lens_radius)
# Define the viewfinder geometry
viewfinder.shape = Rectangle((0, 0), viewfinder_width, viewfinder_height)
# Define some simple detail lines
details.lines = [
Line((-body_width/2 + 0.5*inch, -body_height/4), (body_width/2 - 0.5*inch, -body_height/4)),
Line((-body_width/2 + 0.5*inch, body_height/4), (body_width/2 - 0.5*inch, body_height/4))
]
return camera
with AIDL_2D:
model = vintage_camera()
print(model.Solve())
model.Render()
```
In this model:
- **Body** is a rectangle representing the main part of the camera.
- **Lens** is a circle centered in the middle of the body.
- **Viewfinder** is a small rectangle positioned near the top of the body.
- **Details** are simple horizontal lines added to the body for visual interest.
This should give you a simple but recognizable representation of a vintage camera suitable for laser cutting. If you have any additional requirements or modifications, please let me know!
|