pillow-technical-drawing
Creating technical diagrams and exploded-view illustrations using Python Pillow with geometric primitives and text annotations.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 93
- Forks
- 8
01 前言 Front Matter
- name
- pillow-technical-drawing
- description
- Creating technical diagrams and exploded-view illustrations using Python Pillow with geometric primitives and text annotations.
03 SKILL.md 正文
Technical Drawing with Pillow
Setup
pip install Pillow
Key Patterns
Rounded Rectangles (component layers)
from PIL import Image, ImageDraw, ImageFont
img = Image.new('RGB', (1800, 2400), '#F5F4ED')
draw = ImageDraw.Draw(img)
# Rounded rectangle for a component layer
draw.rounded_rectangle([x1, y1, x2, y2], radius=12, fill='#D97757', outline='#141413', width=2)
Exploded-View Layout
- Stack layers vertically with consistent vertical gaps (60-100px)
- Offset each layer slightly on the X-axis for 3D depth illusion
- Use isometric-style parallelogram shapes for depth perception
Annotation Leader Lines
# Thin annotation line from component to label
draw.line([(comp_x, comp_y), (label_x, label_y)], fill='#B0ADA5', width=1)
# Small circle at the component end
draw.ellipse([comp_x-3, comp_y-3, comp_x+3, comp_y+3], fill='#B0ADA5')
Text Labels
font_heading = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", 72)
font_label = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 24)
draw.text((x, y), "NOVA", fill='#141413', font=font_heading)
Isometric 3D Effect with Polygons
# Create parallelogram for isometric top face
top_face = [(x, y), (x+w, y-skew), (x+w+d, y-skew+d), (x+d, y+d)]
draw.polygon(top_face, fill=color, outline='#141413', width=1)
Saving
img.save('output.png', dpi=(300, 300))
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.