Skip to content

Commit 186da7d

Browse files
committed
v1.3.0: Major update with templates, SVG export, parallel rendering
Features: - Template system for SpinRender, Static, and SVG tabs - SVG layer export with merge options - Parallel multi-core frame rendering - CLI parameter validation - New gradient icon design - Buy Me a Coffee support link Files: - Updated README with all new features - Added metadata.json for KiCad PCM - Added .gitignore (excludes sensitive/dev files) - Refactored tabs into separate modules - Added builtin templates (JSON)
1 parent 675777c commit 186da7d

37 files changed

+7519
-1685
lines changed

.gitignore

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual environments
24+
.env
25+
.venv
26+
env/
27+
venv/
28+
ENV/
29+
env.bak/
30+
venv.bak/
31+
32+
# IDE / Editor
33+
.idea/
34+
.vscode/
35+
*.swp
36+
*.swo
37+
*~
38+
.project
39+
.pydevproject
40+
.settings/
41+
42+
# OS generated
43+
.DS_Store
44+
.DS_Store?
45+
._*
46+
.Spotlight-V100
47+
.Trashes
48+
ehthumbs.db
49+
Thumbs.db
50+
51+
# Markdown files (except README.md)
52+
*.md
53+
!README.md
54+
55+
# KiRender specific - Development/Planning files
56+
Plan.md
57+
projectFlow.md
58+
OPTIMIZATION_GUIDE.md
59+
60+
# Test files
61+
test_*.py
62+
*_test.py
63+
64+
# Temporary files
65+
*.tmp
66+
*.temp
67+
*.bak
68+
*.log
69+
70+
# PCM build artifacts
71+
*.zip
72+
releases/
73+
build_pcm.ps1
74+
release_config.json
75+
76+
# User templates (keep builtin only for distribution)
77+
templates/user/
78+
79+
# Sensitive / local config
80+
*.local
81+
*.secret
82+
config.local.json
83+
kirender_config.json
84+
render_templates.json
85+
86+
# GitHub copilot instructions (development only)
87+
.github/copilot-instructions.md
88+
89+
# Old/backup icons
90+
icon_old.png

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"label": "Copy to KiCad Plugins",
66
"type": "shell",
7-
"command": "$dest = 'C:\\Users\\prami\\OneDrive\\Documents\\KiCad\\9.0\\3rdparty\\plugins\\com_pcbtools_kirender'; Remove-Item \"$dest\\__pycache__\" -Recurse -Force -ErrorAction SilentlyContinue; Remove-Item \"$dest\\KiRender\\__pycache__\" -Recurse -Force -ErrorAction SilentlyContinue; Copy-Item '${workspaceFolder}\\__init__.py' $dest -Force; Copy-Item '${workspaceFolder}\\icon.png' $dest -Force; Copy-Item '${workspaceFolder}\\README.md' $dest -Force; Copy-Item '${workspaceFolder}\\KiRender' $dest -Recurse -Force; Remove-Item \"$dest\\KiRender\\scripts\" -Recurse -Force -ErrorAction SilentlyContinue; Write-Host '✓ Copied to KiCad plugins!' -ForegroundColor Green",
7+
"command": "$dest = 'C:\\Users\\prami\\OneDrive\\Documents\\KiCad\\9.0\\3rdparty\\plugins\\com_pcbtools_kirender'; Remove-Item \"$dest\\__pycache__\" -Recurse -Force -ErrorAction SilentlyContinue; Copy-Item '${workspaceFolder}\\__init__.py' $dest -Force; Copy-Item '${workspaceFolder}\\*.py' $dest -Force; Copy-Item '${workspaceFolder}\\icon.png' $dest -Force; Copy-Item '${workspaceFolder}\\icon.svg' $dest -Force; Copy-Item '${workspaceFolder}\\README.md' $dest -Force; Copy-Item '${workspaceFolder}\\metadata.json' $dest -Force; Copy-Item '${workspaceFolder}\\templates' $dest -Recurse -Force; Remove-Item \"$dest\\test_*.py\" -Force -ErrorAction SilentlyContinue; Write-Host '✓ Copied to KiCad plugins!' -ForegroundColor Green",
88
"problemMatcher": [],
99
"group": {
1010
"kind": "build",

Images.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Images - Static image rendering module for KiRender
3-
Handles static 3D image generation (top, bottom, side views) using kicad-cli
3+
Handles static 3D image generation (top/bottom/side views)
4+
Uses cli_builder for all CLI command construction.
45
"""
56

67
import os
@@ -38,25 +39,27 @@ def _do_render(self):
3839
views = p['views']
3940
total = len(views)
4041

42+
# Import the unified CLI builder
43+
from .cli_builder import build_cli_command
44+
4145
for idx, view in enumerate(views):
4246
wx.CallAfter(self.parent.log, f"Rendering {view} view...")
4347

4448
output_file = p['output_files'][idx]
4549

46-
cmd = [
47-
p['kicad_cli'], "pcb", "render",
48-
"--side", view,
49-
"--zoom", str(p['zoom']),
50-
"--width", str(p['width']),
51-
"--height", str(p['height']),
52-
"--background", p['background'],
53-
"--quality", p['quality'],
54-
"-o", output_file,
55-
p['pcb_path']
56-
]
50+
# Build CLI params for this view
51+
cli_params = {
52+
'side': view,
53+
'width': p['width'],
54+
'height': p['height'],
55+
'zoom': p['zoom'],
56+
'background': p['background'],
57+
'quality': p['quality'],
58+
'perspective': p.get('perspective') != "orthographic",
59+
}
5760

58-
if p['perspective'] == "orthographic":
59-
cmd.insert(3, "--orthographic")
61+
# Use unified CLI builder
62+
cmd = build_cli_command(cli_params, p['kicad_cli'], p['pcb_path'], output_file)
6063

6164
result = subprocess.run(
6265
cmd,

0 commit comments

Comments
 (0)