 |
CLIP Score: 28.28
from AIDL import *
def stained_glass_window(radius: float = 10 * inches):
"""
Creates a model of a circular stained glass window with a simple geometric pattern inside.
"""
# Define the main structure of the stained glass window
window = Solid()
# Define the main circular window
window.frame = Circle((0,0), radius)
# Add geometric shapes within the window
# Let's create a simple pattern with a smaller circle and some lines (you can customize the pattern)
window.inner_circle = Circle((0, 0), radius / 2)
window.diagonal1 = Line((-radius/sqrt(2), radius/sqrt(2)), (radius/sqrt(2), -radius/sqrt(2)))
window.diagonal2 = Line((-radius/sqrt(2), -radius/sqrt(2)), (radius/sqrt(2), radius/sqrt(2)))
window.vertical_line = Line((0, radius), (0, -radius))
window.horizontal_line = Line((radius, 0), (-radius, 0))
# Add smaller geometric details (could be more intricate, depending on the design)
window.quadrants = []
for angle in [45, 135, 225, 315]:
quadrant = Solid(shift=(radius/4*cos(angle*pi/180), radius/4*sin(angle*pi/180)))
quadrant.piece = Triangle((0,0), radius/4, radius/4)
window.quadrants.append(quadrant)
return window
with AIDL_2D:
model = stained_glass_window()
print(model.Solve())
model.Render()
|
Please write an AIDL program to generate a stained glass window
Creating a stained glass window is a fascinating project. Since stained glass windows often consist of intricate patterns and multiple pieces of colored glass, we'll define a simplified version in AIDL. For this example, we can create a circular stained glass window with a few geometric shapes within it.
Let's follow these steps:
1. **Define the main circular window**.
2. **Add several geometric shapes** inside the main circle to represent different pieces of colored glass.
3. **Generate the AIDL model.**
Here's the step-by-step AIDL code for generating a simplified stained glass window:
```python
from AIDL import *
def stained_glass_window(radius: float = 10 * inches):
"""
Creates a model of a circular stained glass window with a simple geometric pattern inside.
"""
# Define the main structure of the stained glass window
window = Solid()
# Define the main circular window
window.frame = Circle((0,0), radius)
# Add geometric shapes within the window
# Let's create a simple pattern with a smaller circle and some lines (you can customize the pattern)
window.inner_circle = Circle((0, 0), radius / 2)
window.diagonal1 = Line((-radius/sqrt(2), radius/sqrt(2)), (radius/sqrt(2), -radius/sqrt(2)))
window.diagonal2 = Line((-radius/sqrt(2), -radius/sqrt(2)), (radius/sqrt(2), radius/sqrt(2)))
window.vertical_line = Line((0, radius), (0, -radius))
window.horizontal_line = Line((radius, 0), (-radius, 0))
# Add smaller geometric details (could be more intricate, depending on the design)
window.quadrants = []
for angle in [45, 135, 225, 315]:
quadrant = Solid(shift=(radius/4*cos(angle*pi/180), radius/4*sin(angle*pi/180)))
quadrant.piece = Triangle((0,0), radius/4, radius/4)
window.quadrants.append(quadrant)
return window
with AIDL_2D:
model = stained_glass_window()
print(model.Solve())
model.Render()
```
In this simplified program, we:
1. **Created the main window structure**: `window`.
2. **Added a circular frame** with a specified radius.
3. **Added internal geometric shapes**: an inner circle, a few lines (diagonals, vertical, and horizontal), and smaller triangular shapes in the quadrants.
Feel free to modify the geometric pattern inside the window to better match your vision for the stained glass. If you have additional features or details you want to add, please let me know and we can further refine the design.
|