@inneranimalmedia/primetech-procedures 0.0.0-stage → 2.6.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +39 -0
- package/LICENSE +110 -0
- package/README.md +181 -2
- package/agents/openai.yaml +6 -0
- package/agentsam.package.json +80 -0
- package/assets/architect-icon.svg +10 -0
- package/assets/primetech-design-studio.svg +7 -0
- package/companion.json +40 -0
- package/package.json +56 -4
- package/plugin.README.md +37 -0
- package/plugin.json +43 -0
- package/procedures/arch.assembly.calculate/procedure.json +83 -0
- package/procedures/cad.motor-bearing-end-plate/README.md +21 -0
- package/procedures/cad.motor-bearing-end-plate/build_freecad.py +514 -0
- package/procedures/cad.motor-bearing-end-plate/finalize_bundle.py +26 -0
- package/procedures/cad.motor-bearing-end-plate/generate_assets.py +284 -0
- package/procedures/cad.motor-bearing-end-plate/generate_toolpaths.py +715 -0
- package/procedures/cad.motor-bearing-end-plate/package_artifacts.py +154 -0
- package/procedures/cad.motor-bearing-end-plate/parameters.json +51 -0
- package/procedures/cad.motor-bearing-end-plate/procedure.json +101 -0
- package/procedures/cad.motor-bearing-end-plate/render_preview.py +98 -0
- package/procedures/cad.motor-bearing-end-plate/run.py +214 -0
- package/procedures/cad.motor-bearing-end-plate/test_generate_toolpaths.py +50 -0
- package/procedures/media.asset.preflight/procedure.json +85 -0
- package/procedures/media.image.optimize-asset/procedure.json +102 -0
- package/procedures/primetech.assets.package/procedure.json +63 -0
- package/procedures/primetech.design-system.package/procedure.json +58 -0
- package/procedures/primetech.ebook.package/procedure.json +53 -0
- package/procedures/primetech.icon-family.build/procedure.json +101 -0
- package/procedures/primetech.production-board.manage/procedure.json +156 -0
- package/procedures/primetech.sprite-atlas.build/procedure.json +86 -0
- package/procedures/primetech.typeface.package/procedure.json +61 -0
- package/procedures/primetech.visuals.compare/procedure.json +74 -0
- package/procedures/repo.asset.inventory/procedure.json +65 -0
- package/procedures/repo.asset.inventory/run.py +116 -0
- package/procedures/repo.asset.inventory/run.sh +11 -0
- package/procedures/repo.git.status/procedure.json +58 -0
- package/procedures/repo.git.status/run.sh +10 -0
- package/profiles/PRIMETECH_PROCEDURE_ENGINEER.md +25 -0
- package/scripts/generate-procedures.py +112 -0
- package/scripts/generate-skills.py +425 -0
- package/scripts/package-openai-plugin.py +94 -0
- package/skills/primetech-brand-kit/SKILL.md +40 -0
- package/skills/primetech-brand-kit/agentsam.skill.json +64 -0
- package/skills/primetech-character-sprites/SKILL.md +40 -0
- package/skills/primetech-character-sprites/agentsam.skill.json +64 -0
- package/skills/primetech-creative-delivery/SKILL.md +39 -0
- package/skills/primetech-creative-delivery/agentsam.skill.json +57 -0
- package/skills/primetech-design-systems/SKILL.md +43 -0
- package/skills/primetech-design-systems/agentsam.skill.json +57 -0
- package/skills/primetech-digital-publishing/SKILL.md +39 -0
- package/skills/primetech-digital-publishing/agentsam.skill.json +52 -0
- package/skills/primetech-iconography/SKILL.md +40 -0
- package/skills/primetech-iconography/agentsam.skill.json +53 -0
- package/skills/primetech-type-design/SKILL.md +40 -0
- package/skills/primetech-type-design/agentsam.skill.json +53 -0
- package/skills/primetech-ui-ux-prototypes/SKILL.md +43 -0
- package/skills/primetech-ui-ux-prototypes/agentsam.skill.json +64 -0
- package/skills/primetech-visual-qa/SKILL.md +39 -0
- package/skills/primetech-visual-qa/agentsam.skill.json +56 -0
- package/src/creative/asset-package.js +42 -0
- package/src/creative/design-system.js +107 -0
- package/src/creative/ebook.js +88 -0
- package/src/creative/icon-family.js +125 -0
- package/src/creative/index.d.ts +157 -0
- package/src/creative/index.js +7 -0
- package/src/creative/paths.js +64 -0
- package/src/creative/sprite-atlas.js +100 -0
- package/src/creative/typeface.js +154 -0
- package/src/creative/visual-qa.js +88 -0
- package/src/index.d.ts +160 -0
- package/src/index.js +656 -0
- package/src/production-board.d.ts +103 -0
- package/src/production-board.js +181 -0
- package/src/skills.d.ts +48 -0
- package/src/skills.js +101 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Generate dimensioned drawing source, simulation-only CAM plan, toolpath visual, and a seven-slide story deck."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
import html
|
|
5
|
+
import json
|
|
6
|
+
import math
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
def esc(value):
|
|
11
|
+
return html.escape(str(value), quote=True)
|
|
12
|
+
|
|
13
|
+
def svg_header(width, height, title, background="#f7f5ef"):
|
|
14
|
+
return f'''<svg xmlns="http://www.w3.org/2000/svg" width="{width}" height="{height}" viewBox="0 0 {width} {height}" role="img" aria-label="{esc(title)}">
|
|
15
|
+
<defs>
|
|
16
|
+
<marker id="arrow" markerWidth="8" markerHeight="8" refX="4" refY="4" orient="auto-start-reverse"><path d="M0,0 L8,4 L0,8 Z" fill="#314b45"/></marker>
|
|
17
|
+
<pattern id="hatch" width="8" height="8" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><line x1="0" y1="0" x2="0" y2="8" stroke="#9ca9a0" stroke-width="1"/></pattern>
|
|
18
|
+
</defs>
|
|
19
|
+
<rect width="100%" height="100%" fill="{background}"/>
|
|
20
|
+
'''
|
|
21
|
+
|
|
22
|
+
def text(x, y, content, size=20, fill="#243b35", weight=400, anchor="start", tracking=0, family="Arial, Helvetica, sans-serif"):
|
|
23
|
+
return f'<text x="{x}" y="{y}" font-family="{family}" font-size="{size}" font-weight="{weight}" fill="{fill}" text-anchor="{anchor}" letter-spacing="{tracking}">{esc(content)}</text>'
|
|
24
|
+
|
|
25
|
+
def line(x1,y1,x2,y2,stroke="#314b45",width=2,dash=None,marker=None):
|
|
26
|
+
attrs=f'x1="{x1:.2f}" y1="{y1:.2f}" x2="{x2:.2f}" y2="{y2:.2f}" stroke="{stroke}" stroke-width="{width}" fill="none"'
|
|
27
|
+
if dash: attrs+=f' stroke-dasharray="{dash}"'
|
|
28
|
+
if marker: attrs+=f' marker-start="url(#{marker})" marker-end="url(#{marker})"'
|
|
29
|
+
return f'<line {attrs}/>'
|
|
30
|
+
|
|
31
|
+
def rounded_rect_path(cx,cy,length,width,r,angle_deg,scale=1):
|
|
32
|
+
L=length*scale; W=width*scale; R=r*scale
|
|
33
|
+
return f'<rect x="{-L/2:.2f}" y="{-W/2:.2f}" width="{L:.2f}" height="{W:.2f}" rx="{R:.2f}" fill="none" stroke="#2d7771" stroke-width="2.6" transform="translate({cx:.2f} {cy:.2f}) rotate({angle_deg:.2f})"/>'
|
|
34
|
+
|
|
35
|
+
def generate_drawing(params, verification, out):
|
|
36
|
+
p=params["candidate"]
|
|
37
|
+
W,H=1600,1100
|
|
38
|
+
s=2.2
|
|
39
|
+
cx,cy=360,355
|
|
40
|
+
R=p["outer_diameter_mm"]/2*s
|
|
41
|
+
bore=p["bore_diameter_mm"]/2*s
|
|
42
|
+
cb=p["counterbore_diameter_mm"]/2*s
|
|
43
|
+
hole=p["hole_diameter_mm"]/2*s
|
|
44
|
+
pcd=p["bolt_circle_diameter_mm"]/2*s
|
|
45
|
+
pocket_r=p["pocket_center_radius_mm"]/math.sqrt(2)*s
|
|
46
|
+
px,py=cx+pocket_r,cy-pocket_r
|
|
47
|
+
bits=[svg_header(W,H,"Motor bearing end plate engineering drawing")]
|
|
48
|
+
bits.append(text(72,70,"ENGINEERING STUDY / CAM MODEL 01",16,"#547268",700,tracking=3))
|
|
49
|
+
bits.append(text(72,118,"Motor / bearing end plate",42,"#203b34",700))
|
|
50
|
+
bits.append(text(72,153,"Candidate B — parametric B-rep, dimensioned review drawing",19,"#61736c",400))
|
|
51
|
+
bits.append('<rect x="72" y="185" width="690" height="510" rx="2" fill="#fffdfa" stroke="#d4dcd5" stroke-width="1.5"/>')
|
|
52
|
+
bits.append(text(98,220,"FRONT / PLAN VIEW",15,"#547268",700,tracking=2))
|
|
53
|
+
bits.append(f'<circle cx="{cx}" cy="{cy}" r="{R}" fill="none" stroke="#203b34" stroke-width="3"/>')
|
|
54
|
+
bits.append(f'<circle cx="{cx}" cy="{cy}" r="{cb}" fill="none" stroke="#203b34" stroke-width="2.5"/>')
|
|
55
|
+
bits.append(f'<circle cx="{cx}" cy="{cy}" r="{bore}" fill="none" stroke="#203b34" stroke-width="2.5"/>')
|
|
56
|
+
# Bolt circle is a construction reference, not a physical edge.
|
|
57
|
+
bits.append(f'<circle cx="{cx}" cy="{cy}" r="{pcd}" fill="none" stroke="#8c9c92" stroke-width="1.5" stroke-dasharray="7 6"/>')
|
|
58
|
+
for ang in p["bolt_hole_angles_deg"]:
|
|
59
|
+
x=cx+pcd*math.cos(math.radians(ang))
|
|
60
|
+
y=cy-pcd*math.sin(math.radians(ang))
|
|
61
|
+
bits.append(f'<circle cx="{x:.2f}" cy="{y:.2f}" r="{hole:.2f}" fill="#f7f5ef" stroke="#203b34" stroke-width="2.2"/>')
|
|
62
|
+
bits.append(rounded_rect_path(px,py,p["pocket_length_mm"],p["pocket_width_mm"],p["pocket_corner_radius_mm"],45,s))
|
|
63
|
+
# Outer diameter dimension.
|
|
64
|
+
dim_y=568
|
|
65
|
+
bits.append(line(cx-R,cy+R+14,cx-R,dim_y-8,"#64776e",1.2))
|
|
66
|
+
bits.append(line(cx+R,cy+R+14,cx+R,dim_y-8,"#64776e",1.2))
|
|
67
|
+
bits.append(line(cx-R,dim_y,cx+R,dim_y,"#314b45",1.6,marker="arrow"))
|
|
68
|
+
bits.append(text(cx,dim_y-10,"Ø150",18,"#203b34",700,"middle"))
|
|
69
|
+
# PCD and hole note.
|
|
70
|
+
bits.append(line(cx+pcd*.7,cy-pcd*.7,cx+R+50,cy-R-24,"#64776e",1.4))
|
|
71
|
+
bits.append(text(cx+R+56,cy-R-30,"4 × Ø6.6 THRU",17,"#203b34",700))
|
|
72
|
+
bits.append(text(cx+R+56,cy-R-6,"on Ø90 PCD",16,"#61736c"))
|
|
73
|
+
# Bore and counterbore leaders.
|
|
74
|
+
bits.append(line(cx-4,cy+4,cx-84,cy+76,"#64776e",1.4))
|
|
75
|
+
bits.append(text(cx-92,cy+98,"Ø40 H7",17,"#203b34",700,"end"))
|
|
76
|
+
bits.append(line(cx+14,cy-10,cx+70,cy-75,"#64776e",1.4))
|
|
77
|
+
bits.append(text(cx+78,cy-82,"Ø52 × 4 deep",16,"#203b34",700))
|
|
78
|
+
# Pocket callout.
|
|
79
|
+
bits.append(line(px+12,py+20,px+100,py+58,"#2d7771",1.5))
|
|
80
|
+
bits.append(text(px+106,py+62,"60 × 30 × 4",16,"#2d7771",700))
|
|
81
|
+
bits.append(text(px+106,py+84,"R4 corners",15,"#2d7771"))
|
|
82
|
+
bits.append(text(98,653,"PCD shown dashed for reference. Pocket position is a proposed layout.",14,"#7b8980"))
|
|
83
|
+
# Section view.
|
|
84
|
+
bits.append('<rect x="795" y="185" width="735" height="510" rx="2" fill="#fffdfa" stroke="#d4dcd5" stroke-width="1.5"/>')
|
|
85
|
+
bits.append(text(825,220,"SECTION A—A",15,"#547268",700,tracking=2))
|
|
86
|
+
# Horizontally proportional, vertically exaggerated cross-section.
|
|
87
|
+
xscale=1.62; yscale=6.5
|
|
88
|
+
x0=880; x1=x0+p["outer_diameter_mm"]*xscale
|
|
89
|
+
yt=315; yb=yt+p["thickness_mm"]*yscale
|
|
90
|
+
chamfer_px=max(4,p["outer_chamfer_mm"]*xscale)
|
|
91
|
+
bits.append(f'<path d="M {x0+chamfer_px} {yt} L {x1-chamfer_px} {yt} L {x1} {yt+chamfer_px} L {x1} {yb} L {x0} {yb} L {x0} {yt+chamfer_px} Z" fill="url(#hatch)" stroke="#203b34" stroke-width="2.5"/>')
|
|
92
|
+
# Through bore, counterbore, and the two holes cut by the section plane.
|
|
93
|
+
bore_w=p["bore_diameter_mm"]*xscale
|
|
94
|
+
cb_w=p["counterbore_diameter_mm"]*xscale
|
|
95
|
+
bx=(x0+x1)/2
|
|
96
|
+
bits.append(f'<rect x="{bx-bore_w/2}" y="{yt}" width="{bore_w}" height="{yb-yt}" fill="#fffdfa" stroke="#203b34" stroke-width="1.7"/>')
|
|
97
|
+
bits.append(f'<rect x="{bx-cb_w/2}" y="{yt}" width="{cb_w}" height="{p["counterbore_depth_mm"]*yscale}" fill="#fffdfa" stroke="#203b34" stroke-width="1.7"/>')
|
|
98
|
+
hr=p["hole_diameter_mm"]*xscale
|
|
99
|
+
for x in (bx-p["bolt_circle_diameter_mm"]/2*xscale,bx+p["bolt_circle_diameter_mm"]/2*xscale):
|
|
100
|
+
bits.append(f'<rect x="{x-hr/2}" y="{yt}" width="{hr}" height="{yb-yt}" fill="#fffdfa" stroke="#203b34" stroke-width="1.4"/>')
|
|
101
|
+
bits.append(line(bx-cb_w/2,yt-24,bx+cb_w/2,yt-24,"#64776e",1.3,marker="arrow"))
|
|
102
|
+
bits.append(text(bx,yt-34,"Ø52 counterbore",15,"#203b34",700,"middle"))
|
|
103
|
+
bits.append(line(x0, yb+24, x1, yb+24, "#314b45",1.5,marker="arrow"))
|
|
104
|
+
bits.append(text((x0+x1)/2,yb+16,"150 overall",15,"#203b34",700,"middle"))
|
|
105
|
+
bits.append(text(825,520,"12 mm plate",16,"#203b34",700))
|
|
106
|
+
bits.append(text(825,548,"0.5 mm chamfer on top outside edge",15,"#61736c"))
|
|
107
|
+
bits.append(text(825,576,"Vertical scale exaggerated for legibility.",14,"#7b8980"))
|
|
108
|
+
# Title block.
|
|
109
|
+
bits.append('<rect x="72" y="735" width="1458" height="290" fill="#fffdfa" stroke="#bfcac1" stroke-width="1.5"/>')
|
|
110
|
+
bits.append(line(72,802,1530,802,"#bfcac1",1.2))
|
|
111
|
+
bits.append(line(1000,735,1000,1025,"#bfcac1",1.2))
|
|
112
|
+
bits.append(line(72,875,1530,875,"#bfcac1",1.2))
|
|
113
|
+
bits.append(line(72,950,1530,950,"#bfcac1",1.2))
|
|
114
|
+
bits.append(text(98,772,"PART",13,"#708078",700,tracking=1.6))
|
|
115
|
+
bits.append(text(98,844,"Motor / bearing end plate",23,"#203b34",700))
|
|
116
|
+
bits.append(text(1025,772,"REVISION / STATUS",13,"#708078",700,tracking=1.6))
|
|
117
|
+
bits.append(text(1025,844,"Candidate B — 150 mm OD",20,"#203b34",700))
|
|
118
|
+
bits.append(text(98,843+62,"MATERIAL",13,"#708078",700,tracking=1.6))
|
|
119
|
+
bits.append(text(98,930,"6061-T6 aluminum",18,"#203b34",700))
|
|
120
|
+
bits.append(text(1025,843+62,"UNITS / DEFAULT TOLERANCE",13,"#708078",700,tracking=1.6))
|
|
121
|
+
bits.append(text(1025,930,"mm / ±0.1 mm / bore H7",18,"#203b34",700))
|
|
122
|
+
bits.append(text(98,920+70,"DESIGN REVIEW COPY — NOT FOR MANUFACTURE",16,"#9b593c",700,tracking=1))
|
|
123
|
+
bits.append(text(1025,920+70,"Model basis: parameters.json + FreeCAD feature history",15,"#61736c"))
|
|
124
|
+
bits.append(text(98,1000,"Original 120 mm OD request retained in spec-feasibility.json; this candidate changes OD to clear the specified pocket.",14,"#61736c"))
|
|
125
|
+
bits.append('</svg>')
|
|
126
|
+
(out/"drawing.svg").write_text("\n".join(bits),encoding="utf-8")
|
|
127
|
+
(out/"drawing.html").write_text(f'''<!doctype html><html><head><meta charset="utf-8"><title>Motor bearing end plate drawing</title><style>@page{{size:A3 landscape;margin:0}}html,body{{margin:0;padding:0;background:#f7f5ef}}img{{width:420mm;height:288.75mm;display:block}}@media print{{body{{-webkit-print-color-adjust:exact;print-color-adjust:exact}}}}</style></head><body><img src="drawing.svg"></body></html>''',encoding="utf-8")
|
|
128
|
+
|
|
129
|
+
def generate_cam_plan(params, verification, out):
|
|
130
|
+
p=params["candidate"]
|
|
131
|
+
plan={
|
|
132
|
+
"schema":"inneranimalmedia.cam.plan.v1",
|
|
133
|
+
"part_id":params["part_id"],
|
|
134
|
+
"revision":params["revision"],
|
|
135
|
+
"design_status":"proposal_not_approved",
|
|
136
|
+
"execution_mode":"simulation_only",
|
|
137
|
+
"machine_ready":False,
|
|
138
|
+
"controller_output":{"generated":False,"reason":"No machine-specific post, fixture, tool library, controller dialect, or qualified operator verification has been supplied."},
|
|
139
|
+
"material":{"designation":params["material"],"status":"assumed_for_design_review"},
|
|
140
|
+
"geometry_reference":{"native_model":"motor-bearing-end-plate-candidate-150mm.FCStd","step":"motor-bearing-end-plate-candidate-150mm.step","verification":"verification.json"},
|
|
141
|
+
"wcs_concept":{"origin":"stock top center","axes":{"X":"part horizontal datum","Y":"part vertical datum","Z":"normal to top face"},"status":"conceptual; fixture datum and stock orientation require review"},
|
|
142
|
+
"stock_concept":{"envelope_mm":{"x":p["outer_diameter_mm"]+4,"y":p["outer_diameter_mm"]+4,"z":p["thickness_mm"]+2},"material":params["material"],"status":"stock envelope only; not a purchasing or setup instruction"},
|
|
143
|
+
"setups":[{"id":"setup-01","access":"top face","purpose":"Conceptual access to bore, counterbore, bolt holes, service pocket, and outside top edge","status":"simulation_only"}],
|
|
144
|
+
"operation_sequence":[
|
|
145
|
+
{"order":1,"name":"Face stock","intent":"Establish a clean top reference plane","geometry_reference":"top planar face","tool_class":"facing tool","parameters":"not specified"},
|
|
146
|
+
{"order":2,"name":"Pocket roughing","intent":"Remove bulk material from the rounded service pocket","geometry_reference":"ServicePocket feature","tool_class":"end mill","parameters":"not specified"},
|
|
147
|
+
{"order":3,"name":"Pocket finishing","intent":"Finish the pocket walls and floor","geometry_reference":"ServicePocket feature","tool_class":"end mill","parameters":"not specified"},
|
|
148
|
+
{"order":4,"name":"Drill clearance holes","intent":"Create four through holes on the 90 mm bolt circle","geometry_reference":"BoltCircleProfile sketch","tool_class":"drill or qualified interpolation strategy","parameters":"not specified"},
|
|
149
|
+
{"order":5,"name":"Bore","intent":"Finish the 40 mm through bore to the specified H7 requirement","geometry_reference":"ThroughBore feature","tool_class":"qualified boring or interpolation tool","parameters":"not specified"},
|
|
150
|
+
{"order":6,"name":"Counterbore","intent":"Create the 52 mm bearing seat to 4 mm depth","geometry_reference":"Counterbore feature","tool_class":"qualified boring or interpolation tool","parameters":"not specified"},
|
|
151
|
+
{"order":7,"name":"Edge chamfer","intent":"Break the top outside edge by 0.5 mm","geometry_reference":"OuterEdgeChamfer feature","tool_class":"chamfer tool or qualified contour strategy","parameters":"not specified"}
|
|
152
|
+
],
|
|
153
|
+
"verification":{"geometry_checks_pass":verification["all_checks_pass"],"minimum_pocket_to_hole_clearance_mm":min(verification["clearance_checks_mm"]["bolt_hole_to_pocket"]),"pocket_to_counterbore_clearance_mm":verification["clearance_checks_mm"]["counterbore_to_pocket"],"minimum_pocket_to_outer_edge_clearance_after_chamfer_mm":verification["clearance_checks_mm"]["pocket_to_outer_edge_after_chamfer_minimum"]},
|
|
154
|
+
"excluded":{"feeds_and_speeds":"not specified","machine-specific toolpath":"not generated","G-code":"not generated","cycle_time":"not estimated"},
|
|
155
|
+
"review_required":["Confirm candidate 150 mm OD or approve a different pocket/plate layout.","Confirm the intended M6 clearance fit and bore H7 tolerance limits.","Select machine, workholding, tooling, stock, and post in a qualified CAM environment.","Simulate collisions and validate all cutting parameters before any physical machining."]
|
|
156
|
+
}
|
|
157
|
+
(out/"cam-plan.json").write_text(json.dumps(plan,indent=2,sort_keys=True)+"\n",encoding="utf-8")
|
|
158
|
+
return plan
|
|
159
|
+
|
|
160
|
+
def generate_toolpath_visual(params, out):
|
|
161
|
+
p=params["candidate"]
|
|
162
|
+
W,H=1400,980
|
|
163
|
+
cx,cy=450,430
|
|
164
|
+
s=3.1
|
|
165
|
+
R=p["outer_diameter_mm"]/2*s
|
|
166
|
+
cb=p["counterbore_diameter_mm"]/2*s
|
|
167
|
+
bore=p["bore_diameter_mm"]/2*s
|
|
168
|
+
hole=p["hole_diameter_mm"]/2*s
|
|
169
|
+
pcd=p["bolt_circle_diameter_mm"]/2*s
|
|
170
|
+
d=p["pocket_center_radius_mm"]/math.sqrt(2)*s
|
|
171
|
+
px,py=cx+d,cy-d
|
|
172
|
+
b=[svg_header(W,H,"Simulation-only CAM path concept","#f3f5f2")]
|
|
173
|
+
b.append(text(55,65,"CAM PATH STUDY",16,"#547268",700,tracking=3))
|
|
174
|
+
b.append(text(55,112,"From solid geometry to an operation sequence",32,"#203b34",700))
|
|
175
|
+
b.append(text(55,145,"Illustrative path layers only — no controller coordinates or executable code",17,"#61736c"))
|
|
176
|
+
b.append(f'<circle cx="{cx}" cy="{cy}" r="{R}" fill="#fffdfa" stroke="#314b45" stroke-width="3"/>')
|
|
177
|
+
b.append(f'<circle cx="{cx}" cy="{cy}" r="{cb}" fill="none" stroke="#7c8e85" stroke-width="2" stroke-dasharray="8 6"/>')
|
|
178
|
+
b.append(f'<circle cx="{cx}" cy="{cy}" r="{bore}" fill="none" stroke="#7c8e85" stroke-width="2"/>')
|
|
179
|
+
b.append(f'<circle cx="{cx}" cy="{cy}" r="{pcd}" fill="none" stroke="#a9b5ad" stroke-width="1.5" stroke-dasharray="5 7"/>')
|
|
180
|
+
# Schematic contours: deliberately not exported as cutter-center geometry.
|
|
181
|
+
for k in range(4):
|
|
182
|
+
inset=3+k*5
|
|
183
|
+
b.append(f'<ellipse cx="{cx}" cy="{cy}" rx="{bore+inset:.2f}" ry="{bore+inset:.2f}" fill="none" stroke="#2b7a78" stroke-width="2" opacity="{0.88-k*.12}"/>')
|
|
184
|
+
for angle in p["bolt_hole_angles_deg"]:
|
|
185
|
+
x=cx+pcd*math.cos(math.radians(angle)); y=cy-pcd*math.sin(math.radians(angle))
|
|
186
|
+
b.append(f'<circle cx="{x:.2f}" cy="{y:.2f}" r="{hole:.2f}" fill="#fffdfa" stroke="#314b45" stroke-width="2"/>')
|
|
187
|
+
b.append(f'<circle cx="{x:.2f}" cy="{y:.2f}" r="{hole+8:.2f}" fill="none" stroke="#c08b45" stroke-width="2" stroke-dasharray="5 5"/>')
|
|
188
|
+
# Pocket perimeter and abstract inward contours.
|
|
189
|
+
b.append(rounded_rect_path(px,py,p["pocket_length_mm"],p["pocket_width_mm"],p["pocket_corner_radius_mm"],45,s))
|
|
190
|
+
for inset in (3,6,9):
|
|
191
|
+
b.append(rounded_rect_path(px,py,p["pocket_length_mm"]-2*inset,p["pocket_width_mm"]-2*inset,max(1,p["pocket_corner_radius_mm"]-inset/2),45,s))
|
|
192
|
+
# Outer-edge finishing trace.
|
|
193
|
+
b.append(f'<circle cx="{cx}" cy="{cy}" r="{R-4}" fill="none" stroke="#2b7a78" stroke-width="2.2" stroke-dasharray="9 5"/>')
|
|
194
|
+
# Legend and sequencing.
|
|
195
|
+
b.append('<rect x="920" y="220" width="410" height="550" rx="3" fill="#fffdfa" stroke="#d4dcd5" stroke-width="1.5"/>')
|
|
196
|
+
b.append(text(950,265,"OPERATION LAYERS",16,"#547268",700,tracking=2))
|
|
197
|
+
legend=[
|
|
198
|
+
("01","Face reference","Top plane / datum establishment","#2b7a78"),
|
|
199
|
+
("02","Pocket roughing","Bulk-removal intent","#2b7a78"),
|
|
200
|
+
("03","Pocket finishing","Wall and floor finish intent","#2b7a78"),
|
|
201
|
+
("04","Drilling","Four hole locations","#c08b45"),
|
|
202
|
+
("05","Bore + counterbore","Concentric bearing features","#7c8e85"),
|
|
203
|
+
("06","Outer chamfer","Perimeter finishing intent","#2b7a78"),
|
|
204
|
+
]
|
|
205
|
+
y=320
|
|
206
|
+
for num,title,sub,color in legend:
|
|
207
|
+
b.append(f'<circle cx="965" cy="{y-5}" r="7" fill="{color}"/>')
|
|
208
|
+
b.append(text(990,y,num,15,"#61736c",700))
|
|
209
|
+
b.append(text(1030,y,title,17,"#203b34",700))
|
|
210
|
+
b.append(text(1030,y+24,sub,14,"#61736c"))
|
|
211
|
+
y+=70
|
|
212
|
+
b.append(text(950,730,"SIMULATION ONLY",15,"#9b593c",700,tracking=1.6))
|
|
213
|
+
b.append(text(950,755,"No G-code or machine settings emitted.",14,"#61736c"))
|
|
214
|
+
b.append(text(55,925,"The paths communicate sequence and geometry relationships, not a machine-ready toolpath.",15,"#61736c"))
|
|
215
|
+
b.append('</svg>')
|
|
216
|
+
(out/"toolpath-preview.svg").write_text("\n".join(b),encoding="utf-8")
|
|
217
|
+
(out/"toolpath-preview.html").write_text(f'''<!doctype html><html><head><meta charset="utf-8"><title>CAM path concept</title><style>@page{{size:A3 landscape;margin:0}}html,body{{margin:0;padding:0;background:#f3f5f2}}img{{width:420mm;height:294mm;display:block}}@media print{{body{{-webkit-print-color-adjust:exact;print-color-adjust:exact}}}}</style></head><body><img src="toolpath-preview.svg"></body></html>''',encoding="utf-8")
|
|
218
|
+
|
|
219
|
+
def generate_deck(params, verification, plan, out):
|
|
220
|
+
p=params["candidate"]
|
|
221
|
+
slides=[]
|
|
222
|
+
def slide(title, eyebrow, body, visual="", note=""):
|
|
223
|
+
slides.append(f'''<section class="slide"><div class="eyebrow">{esc(eyebrow)}</div><h1>{esc(title)}</h1><div class="body">{body}</div>{visual}<div class="foot">{esc(note)}</div></section>''')
|
|
224
|
+
slide("From geometry to a process you can inspect","CAM MODEL 01 · MOTOR / BEARING END PLATE",
|
|
225
|
+
'<p class="lead">A single component becomes a connected engineering artifact: editable solid, verified dimensions, drawing, and a simulation-only process story.</p><div class="metric-row"><div><b>150 mm</b><span>candidate OD</span></div><div><b>12 mm</b><span>plate thickness</span></div><div><b>1</b><span>valid solid</span></div></div>',
|
|
226
|
+
'<div class="hero"><img src="part-preview.png" alt="Rendered end plate model"></div>',
|
|
227
|
+
"Candidate B is a proposed geometry revision, not an approved design or manufacturing release.")
|
|
228
|
+
slide("One parameter source. One geometry authority.","01 · PARAMETRIC CAD",
|
|
229
|
+
'<p class="lead">The named parameter file drives a native FreeCAD feature history. STEP carries the exact boundary representation; STL is the mesh preview.</p><ul><li>Base profile and pad</li><li>Counterbore and through bore</li><li>Four clearance holes on the bolt circle</li><li>Rounded service pocket and outer chamfer</li></ul>',
|
|
230
|
+
'<div class="visual"><img src="part-preview.png" alt="Candidate model"></div>',
|
|
231
|
+
"The model is regenerated from parameters.json; no hand-edited mesh is treated as design authority.")
|
|
232
|
+
slide("Geometry gets a receipt.","02 · VERIFICATION",
|
|
233
|
+
f'<div class="metric-row"><div><b>{verification["native_metrics"]["bounding_box_mm"]["x"]:.0f} × {verification["native_metrics"]["bounding_box_mm"]["y"]:.0f} × {verification["native_metrics"]["bounding_box_mm"]["z"]:.0f}</b><span>verified B-Rep envelope, mm</span></div><div><b>{verification["native_metrics"]["volume_mm3"]:,.2f}</b><span>volume, mm³</span></div><div><b>{len(verification["checks"])}/{len(verification["checks"])}</b><span>checks passed</span></div></div><p>STEP was re-imported and compared with the native solid. The STL mesh was checked for facets and envelope.</p>',
|
|
234
|
+
'<div class="visual small"><img src="drawing.svg" alt="Dimensioned drawing"></div>',
|
|
235
|
+
"Verification is computational evidence for this candidate, not an engineering seal.")
|
|
236
|
+
slide("The first specification exposed a real constraint.","03 · DESIGN REVIEW",
|
|
237
|
+
'<p class="lead">A 120 mm plate cannot contain a separate 60 × 30 mm rounded pocket while clearing the 52 mm counterbore and staying within the outer boundary.</p><div class="callout"><b>Original request</b><span>120 mm OD · pocket 60 × 30 × 4 mm</span></div><div class="callout proposal"><b>Candidate B</b><span>150 mm OD · pocket centered 51 mm radially, tangent at 45°</span></div><p>The requested dimensions remain recorded. The larger plate is an explicit proposal, not a silent substitution.</p>',
|
|
238
|
+
'<div class="visual"><img src="drawing.svg" alt="Drawing showing candidate layout"></div>',
|
|
239
|
+
"Owner decision required before treating Candidate B as the intended part.")
|
|
240
|
+
slide("The drawing follows the solid.","04 · DIMENSIONED REVIEW",
|
|
241
|
+
'<p class="lead">Front/plan and section views communicate the bore, bearing seat, bolt circle, thickness, pocket, and edge treatment.</p><ul><li>Default tolerance: ±0.1 mm</li><li>Bore requirement: Ø40 H7</li><li>Material assumption: 6061-T6 aluminum</li><li>Fit-standard and H7 limit values require confirmation</li></ul>',
|
|
242
|
+
'<div class="visual"><img src="drawing.svg" alt="Dimensioned drawing"></div>',
|
|
243
|
+
"Design review copy — not for manufacture.")
|
|
244
|
+
slide("The CAM view explains sequence, not machine commands.","05 · SIMULATION-ONLY CAM",
|
|
245
|
+
'<p class="lead">The operation map connects each intent to a named CAD feature. It is useful for review without pretending that a machine, fixture, tool library, or post has been validated.</p><ul><li>Reference face</li><li>Pocket roughing and finishing intent</li><li>Hole, bore, and counterbore feature sequence</li><li>Outside-edge chamfer intent</li></ul>',
|
|
246
|
+
'<div class="visual"><img src="toolpath-preview.png" alt="Illustrative toolpath layers"></div>',
|
|
247
|
+
"No executable G-code, machine-specific feeds/speeds, or cycle-time estimate is included.")
|
|
248
|
+
slide("Verified geometry is the start, not the finish.","06 · NEXT ENGINEERING GATE",
|
|
249
|
+
'<div class="two-col"><div><h2>Verified</h2><ul><li>Native solid and STEP round-trip</li><li>Bounding box and volume</li><li>Hole layout and pocket clearances</li><li>STL mesh exists and is readable</li></ul></div><div><h2>Still requires review</h2><ul><li>Approve the 150 mm OD or revise pocket/layout</li><li>Confirm material and tolerances</li><li>Fixture, machine, tooling, and post selection</li><li>Qualified CAM simulation and sign-off</li></ul></div></div>',
|
|
250
|
+
'<div class="final-line">From a parametric idea to evidence that can be inspected, revised, and handed to the next specialist.</div>',
|
|
251
|
+
"Slice 2: fixture concept, second setup if needed, rest-machining analysis, and a machine-agnostic validated simulation.")
|
|
252
|
+
html_doc='''<!doctype html><html><head><meta charset="utf-8"><title>CAM Model 01 — Motor / Bearing End Plate</title><style>
|
|
253
|
+
@page{size:13.333in 7.5in;margin:0}
|
|
254
|
+
*{box-sizing:border-box}html,body{margin:0;padding:0;background:#f5f3ed;color:#203b34;font-family:Arial,Helvetica,sans-serif}
|
|
255
|
+
.slide{width:13.333in;height:7.5in;padding:.55in .68in .45in;position:relative;overflow:hidden;page-break-after:always;background:#f7f5ef}
|
|
256
|
+
.slide:last-child{page-break-after:auto}.eyebrow{font-size:10pt;letter-spacing:2.2px;color:#547268;font-weight:700;text-transform:uppercase;margin-bottom:15px}
|
|
257
|
+
h1{font-size:30pt;line-height:1.08;max-width:8.5in;margin:0 0 18px;font-weight:700;letter-spacing:-.7px}
|
|
258
|
+
.body{position:relative;z-index:2;width:52%;font-size:14pt;line-height:1.42}.lead{font-size:17pt;line-height:1.35;color:#314b45;margin:0 0 18px}
|
|
259
|
+
ul{padding-left:22px;margin:14px 0}li{margin:6px 0} .hero,.visual{position:absolute;right:.55in;top:1.2in;width:5.2in;height:4.85in;display:flex;align-items:center;justify-content:center}
|
|
260
|
+
.hero img,.visual img{max-width:100%;max-height:100%;object-fit:contain}.visual.small{width:5.2in;height:4.1in;top:1.65in}
|
|
261
|
+
.metric-row{display:flex;gap:20px;margin-top:24px;flex-wrap:wrap}.metric-row>div{border-top:1px solid #bfcac1;padding-top:10px;min-width:1.5in;max-width:3.3in}.metric-row b{display:block;font-size:22pt;line-height:1.1}.metric-row span{display:block;font-size:10pt;color:#61736c;margin-top:5px}
|
|
262
|
+
.callout{border-left:4px solid #8e9d8e;background:#fffdfa;padding:12px 15px;margin:12px 0;display:flex;flex-direction:column;gap:4px}.callout.proposal{border-left-color:#2d7771}.callout b{font-size:13pt}.callout span{font-size:11pt;color:#61736c}
|
|
263
|
+
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:24px;width:100%;font-size:12pt}.two-col h2{font-size:16pt;margin:0 0 8px}.two-col ul{margin-top:0}.final-line{border-top:1px solid #bfcac1;margin-top:28px;padding-top:18px;font-size:20pt;font-weight:600;max-width:8.2in}
|
|
264
|
+
.foot{position:absolute;bottom:.25in;left:.68in;right:.68in;border-top:1px solid #d4dcd5;padding-top:7px;font-size:8.5pt;color:#728078}
|
|
265
|
+
</style></head><body>'''+''.join(slides)+'''</body></html>'''
|
|
266
|
+
(out/"presentation.html").write_text(html_doc,encoding="utf-8")
|
|
267
|
+
|
|
268
|
+
def main():
|
|
269
|
+
if len(sys.argv) != 4:
|
|
270
|
+
raise SystemExit("usage: generate_assets.py parameters.json verification.json output_dir")
|
|
271
|
+
params=Path(sys.argv[1]).resolve(strict=True)
|
|
272
|
+
verification=Path(sys.argv[2]).resolve(strict=True)
|
|
273
|
+
out=Path(sys.argv[3]).resolve()
|
|
274
|
+
out.mkdir(parents=True,exist_ok=True)
|
|
275
|
+
source=json.loads(params.read_text(encoding="utf-8"))
|
|
276
|
+
verified=json.loads(verification.read_text(encoding="utf-8"))
|
|
277
|
+
generate_drawing(source,verified,out)
|
|
278
|
+
plan=generate_cam_plan(source,verified,out)
|
|
279
|
+
generate_toolpath_visual(source,out)
|
|
280
|
+
generate_deck(source,verified,plan,out)
|
|
281
|
+
print(json.dumps({"ok":True,"files":["drawing.svg","drawing.html","cam-plan.json","toolpath-preview.svg","toolpath-preview.html","presentation.html"],"operation_count":len(plan["operation_sequence"]),"controller_output_generated":False},sort_keys=True))
|
|
282
|
+
|
|
283
|
+
if __name__=="__main__":
|
|
284
|
+
main()
|