 |
CLIP Score: 30.36
from AIDL import *
def stained_glass_window(
frame_width: float = 24 * inches,
frame_height: float = 36 * inches,
border_width: float = 1 * inch,
pattern_radius: float = 4 * inches
):
"""
Creates a simple stained glass window with a rectangular frame,
geometric patterns inside, and a few engraved details.
"""
# Define the main structure of the window
window = Solid()
# Define the border frame as a Solid
frame = Solid()
window.frame = frame
# Define the interior patterns as a Solid
patterns = Solid()
window.patterns = patterns
# Define engravings as a Drawing
engravings = Drawing()
window.engravings = engravings
# Define the frame geometry (with some cutouts for the glass)
frame.outer_border = Rectangle((0, 0), frame_width, frame_height)
frame.inner_border = Hole()
frame.inner_border.cutout = Rectangle((0, 0), frame_width - 2*border_width, frame_height - 2*border_width)
# Define a circular pattern in the middle of the window
patterns.central_circle = Circle((0, 0), pattern_radius)
# Define some rectangular patterns symmetrically around the circle
pattern_width = 3 * inches
pattern_height = 6 * inches
patterns.rectangles = [
Rectangle((pattern_radius * 1.5, 0), pattern_width, pattern_height),
Rectangle((-pattern_radius * 1.5, 0), pattern_width, pattern_height),
Rectangle((0, pattern_radius * 1.5), pattern_width, pattern_height),
Rectangle((0, -pattern_radius * 1.5), pattern_width, pattern_height)
]
# Define some engraving details
engravings.details = [
Line((-frame_width/3, frame_height/4), (frame_width/3, frame_height/4)),
Line((-frame_width/3, -frame_height/4), (frame_width/3, -frame_height/4)),
Line((-frame_width/4, frame_height/3), (-frame_width/4, -frame_height/3)),
Line((frame_width/4, frame_height/3), (frame_width/4, -frame_height/3))
]
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 model involves combining different shapes and patterns, which could be represented as different Solids and Holes. For simplicity, let's design a window with a rectangular frame, some geometric patterns inside (such as circles and rectangles), and a few engraved details.
Here's a step-by-step AIDL program to generate a simple stained glass window:
```python
from AIDL import *
def stained_glass_window(
frame_width: float = 24 * inches,
frame_height: float = 36 * inches,
border_width: float = 1 * inch,
pattern_radius: float = 4 * inches
):
"""
Creates a simple stained glass window with a rectangular frame,
geometric patterns inside, and a few engraved details.
"""
# Define the main structure of the window
window = Solid()
# Define the border frame as a Solid
frame = Solid()
window.frame = frame
# Define the interior patterns as a Solid
patterns = Solid()
window.patterns = patterns
# Define engravings as a Drawing
engravings = Drawing()
window.engravings = engravings
# Define the frame geometry (with some cutouts for the glass)
frame.outer_border = Rectangle((0, 0), frame_width, frame_height)
frame.inner_border = Hole()
frame.inner_border.cutout = Rectangle((0, 0), frame_width - 2*border_width, frame_height - 2*border_width)
# Define a circular pattern in the middle of the window
patterns.central_circle = Circle((0, 0), pattern_radius)
# Define some rectangular patterns symmetrically around the circle
pattern_width = 3 * inches
pattern_height = 6 * inches
patterns.rectangles = [
Rectangle((pattern_radius * 1.5, 0), pattern_width, pattern_height),
Rectangle((-pattern_radius * 1.5, 0), pattern_width, pattern_height),
Rectangle((0, pattern_radius * 1.5), pattern_width, pattern_height),
Rectangle((0, -pattern_radius * 1.5), pattern_width, pattern_height)
]
# Define some engraving details
engravings.details = [
Line((-frame_width/3, frame_height/4), (frame_width/3, frame_height/4)),
Line((-frame_width/3, -frame_height/4), (frame_width/3, -frame_height/4)),
Line((-frame_width/4, frame_height/3), (-frame_width/4, -frame_height/3)),
Line((frame_width/4, frame_height/3), (frame_width/4, -frame_height/3))
]
return window
with AIDL_2D:
model = stained_glass_window()
print(model.Solve())
model.Render()
```
This program creates a stained glass window with a rectangular frame, some geometric patterns inside (a central circle surrounded by rectangles), and some engraved details. You can adjust the dimensions and pattern properties by changing the input parameters. Feel free to add more patterns and details to customize the window further. If you have more specific design requirements or additional features you'd like to include, please let me know!
|