from pathlib import Path
from PIL import Image,ImageDraw,ImageFont
import textwrap
ROOT=Path(__file__).resolve().parents[1]
def write(rel,body):
    (ROOT/rel).write_text(body.strip()+'\n',encoding='utf-8')

write('00_READ_FIRST_Engineering_Handoff.txt','''
EN LIGHT - REV B ENGINEERING HANDOFF - ENGLISH EDITION
Design revision: 2026-11-02 | English issue: 2026-11-03

PURPOSE AND REVISION CONTROL
Factory-feedback revision: raised lid, single-colour enamel and leg frames that flip up as the carry handle.
The user confirmed the dual-use leg arrangement on 2026-11-02. There is no separate bucket-style carry bail.
This edition translates the Chinese Rev B package. The design geometry and nominal parameters are unchanged.
Use the drawings, model and parameters in this English folder together. Rev A is historical reference.

1. DESIGN CHANGES ALREADY INCLUDED
1.1 Bowl: OD330, nominal depth 80. Lid: OD332; rise increased from 32 to 85.
    Closed height with deployed frames is about 240, compared with 235 including the old fixed handle.
    Nominal lid headroom above the food grate: 89.3 at the centre and 60.3 at radius 140.
    A D280 x H50 cylindrical food-space example has about 10.3 minimum vertical space above it.
    These values exclude enamel, thermal deformation, fit tolerances and food-shape variation.
    This example is not a rated food size or cooking capacity. All dimensions are millimetres.
1.2 Bowl and lid use the same white enamel on both inner and outer surfaces; approve the factory colour sample.
    Stainless hardware, grates and heat-rated foot/grip sleeves are outside the single-colour enamel scope.
1.3 The fixed lid-top handle and large separate carry bail are removed.
    Two D6 U-frames deploy as legs and flip upwards to meet as the carrying grip.
    Pivot axis: X direction, Z112. Front half-span: 170; rear half-span: 178.
    Coaxial short-pin stack is provisional. There is no long shaft through the firebox.
    Deployed rail centres: Y +/-148, Z7.
    At about 122.2 degrees up, central grip sleeves lie at Y +/-10, Z293.2.
    Raised grip centre spacing: 20. Each sleeve: OD14 x L80. Underside-to-lid-crown gap: about 46.2.
    Compact stow angle: about 11.3 degrees. Stowed envelope: about 372 x 346 x 209.
    The raised-frame view is suspended carrying, not a resting configuration.
    About 300 is the frame-top height relative to deployed Z0, not the suspended assembly's own height.
1.4 The lower ash cup supplies intake air; the lid vent is the exhaust.
    Grates, ash cup and local heat reflector retain their previous nominal arrangement.
1.5 With no fixed lid-top handle, provide a purchased rim-clamp lid lifter and test its grip, temperature and rim compatibility.
    The vent is not a handle for lifting the lid.

2. FACTORY ENGINEERING STILL REQUIRED
2.1 Rigid deployed stops and independent anti-fold locks on both U-frames. Pivot friction alone is insufficient.
2.2 Stowed/carry position retention; a coupling to hold the two grips together; an operating sequence that prevents pinching or accidental release.
    Model lock blocks only identify required locations. Support the cold body while moving each frame.
    Validate whether one person can safely perform the complete operation on a sample.
    Cool completely, remove ash and latch the lid before flipping the legs for carrying.
    Restore deployed support and lock both frames before resting the grill on a table.
2.3 Inner reinforcement at side mounts, welding before enamelling, short coaxial pin stack, fits, anti-loosening and transport lid clips.
2.4 Deep-lid draw radii, draft and springback; rolled-rim fit; enamel allowance; grate and food clearance.
2.5 Ash-cup removal path; all fastener, vent and lock interferences; thermal distortion, tipping, temperature rise and durability.
    Frames are longer and the lid is taller. Unchanged product weight is not claimed; calculate part and assembled masses.

3. COMPLETED CHECKS AND THEIR LIMITS
The native file has been reopened. Four pose envelopes, three closed-shell meshes and uniform enamel have been checked.
At 61 angles from 0 to 122.2 degrees, frame tubes, central sleeves and foot pads were checked against the main bowl/lid surfaces; no surface intersections were found.
This sample check excludes a complete assembly check, continuous minimum clearance, locks, coating/thermal expansion, tolerances, loads, centre of gravity and temperature.
The DXF contains ten editable views in millimetre modelspace. Geometry, arrows and text are separate entities, not associative parametric dimensions.
Blender is editable mesh/curve visualization. It is not STEP, parametric mechanical CAD or approved tooling geometry.
English localization preserves the native mesh/curve geometry and four pose transforms; the stored signature comparison matches.

4. TOOLING AND COST
The supplier's approximate RMB 40,000 figure is an initial estimate from the chat, not a confirmed quotation.
First obtain existing bowl/deep-lid mould diameters, inner sections, depths, rim fit, usable sheet gauges and available hole/mount positions.
Discuss reuse only if food clearance and assembly fit can be maintained. A matching factory mould has not been established.
Clarify new-tool, reuse, alteration and trial charges, taxes, freight, lead time and price differences.

5. FILE INDEX
01_Engineering_Drawings: five A3 landscape sheets as PDF and PNG; print at 100% actual size.
02_CAD_and_Parameters: millimetre DXF, unified nominal parameters, lid-clearance data and coordinate guide.
03_Blender_Model: native BLEND, closed-pose static GLB, four actual Cycles renders, build/check scripts and verification.
04_Design_Overview: English support/carry comparison board.
05_Factory_Feedback: clearly labelled English transcription of the supplied chat and factory response form.
90_Package_Tools: English document and package generation scripts.

The original Chinese chat image is preserved in the earlier Chinese source package, outside this English deliverable.
This folder and ZIP do not contain approved production CAD, STEP, mould design or a mass-production release.
''')
write('01_Engineering_Drawings/Printing_and_Revision_Notes.txt','''
EN LIGHT - REV B - ENGLISH DRAWINGS
Design: 2026-11-02 | English issue: 2026-11-03

Five A3 landscape sheets: general arrangement; food clearance; dual-use frames and carrying; support/stowage; factory actions and BOM.
Print A3 landscape at 100% / actual size. View scales appear in the footer. Do not measure dimensions from renders.
Dimensions are nominal factory-review targets. Production tolerances, mould surfaces, cutting developments and tooling approval are not supplied.
Both leg frames flip up as the carry handle, as confirmed by the user. No separate carry bail or fixed lid-top handle is specified.
The English edition retains the Chinese Rev B nominal geometry and dimensions.
''')
write('02_CAD_and_Parameters/Coordinates_and_CAD_Guide.txt','''
EN LIGHT - REV B - COORDINATES AND CAD
Design: 2026-11-02 | English issue: 2026-11-03

All dimensions are millimetres. Deployed support plane: Z0. Bowl rim: Z155. Food grate top: Z150. Charcoal grate top: Z95.
Short coaxial side pins run along X. There is no continuous shaft through the firebox.
Front and rear U-frames are separate parts, rotating in positive/negative X-axis directions.
design_parameters.json contains this revision's unified nominal values; English localization does not change them.
The DXF contains ten separate 1:1 modelspace views in a three-column grid. Grid offsets between views are not assembly coordinates.
Arrows, text and outlines are independent editable entities, not associative dimensions or production tolerances.
Profiles are design targets. Existing mould sections have not been supplied; compatibility with existing tooling is unconfirmed.
Check rim fit, deep drawing, enamel allowance and food space before completing mechanical CAD and tolerance definition.
lid_clearance.json records the nominal normal-offset inner profile and the example food cylinder's vertical gap.
It does not include thermal deformation or enamel thickness.
''')
write('03_Blender_Model/Blender_Model_User_Guide.txt','''
EN LIGHT - REV B - BLENDER MODEL GUIDE
Design: 2026-11-02 | English issue: 2026-11-03
Created in Blender 4.5.15 LTS. Open with Blender 4.5 LTS or a compatible newer version.

OPENING AND NAVIGATION
Start Blender, choose File > Open, then select EN_Light_RevB_3D_Model.blend in this folder.
Drag with the middle mouse button to orbit; use the mouse wheel to zoom. Numpad 0 enters/exits camera view.
Parts are in 01_MODEL_PARTS. Lights, cameras and ground are in 90_STUDIO.
Hide 90_STUDIO before using Home to frame the model, because the studio ground is large.

FOUR TIMELINE PRESETS
Frame 1: closed lid, supporting frames deployed.
Frame 60: exploded structure.
Frame 90: compact stowage; frames rotate upwards about 11.3 degrees.
Frame 120: both frames raised about 122.2 degrees to form the carry grip; suspended pose.
Linear interpolation between frames only illustrates poses. It is not the actual operating sequence or full motion validation.

UNITS AND CONTENT
One scene unit equals one metre; displayed lengths are millimetres. Confirm scale when exporting to engineering systems.
EN_Light_RevB_3D_Preview.glb is a static frame-1 preview, without the four-pose animation.
The four PNGs are actual Cycles renders from the model. Bowl and lid have white enamel on both inner and outer surfaces.
Parts remain editable. The support folder contains the build and check scripts; the native model includes an English READ_ME text block.

ENGINEERING STATUS
This is mesh/curve visualization, not parametric mechanical CAD, STEP or a production/tooling release.
Rigid stops, independent locks, grip coupling, pivot reinforcement and hot-lid clamp compatibility require factory engineering and sample tests.
Verification covers four pose bounds, three closed shells, uniform colour and 61-angle frame/main-shell surface sampling.
Complete assembly interferences, tolerances, thermal behaviour, loads, stability, durability and production processes remain unvalidated.

REBUILDING
Keep the folder structure. Unified parameters are in ../02_CAD_and_Parameters/design_parameters.json.
Example: blender --background --factory-startup --python support/build_blender.py
Rebuilding overwrites generated models and renders. Save a separate copy before making manual changes.
''')
write('05_Factory_Feedback/Factory_Comments_English_Transcription.txt','''
FACTORY FEEDBACK - ENGLISH TRANSCRIPTION
Source: Chinese chat screenshot supplied by the user on 2026-11-02.
English issue: 2026-11-03. This is a translated transcription of the technical excerpts, not an original English chat screenshot.
The Chinese source image remains in the earlier Chinese package. Greetings and acknowledgements are omitted here.

SUPPLIER COMMENTS
1. Tooling for the grill is approximately RMB 40,000. It may be a little cheaper if a similar existing factory mould can be used.
2. The proposed lid design does not work. The engineer says that closing it would press down on the food, which is unreasonable.
3. There is also a surface-finish issue: most enamelling factories can make only one colour for this arrangement, either all white or all black.
4. Referring to the image, the supplier suggests removing the two indicated handles and extending/turning the lower wire upwards so it can be carried, like their bucket-style grill.
5. The supplier says the lower feature appears to be an air outlet.

FORWARDED-MESSAGE CONTEXT
The supplier said they would forward the engineer's original wording and ask for Mandarin because the original recording used a dialect. That recording and the factory's bucket-grill reference were not supplied in this chat.

USER CLARIFICATION, 2026-11-02
The user explicitly confirmed: the legs should flip over and also serve as the handle.

REV B DESIGN RESPONSE
Increase lid rise to 85 mm and define nominal food clearance.
Specify one white enamel colour on both sides of the bowl and lid.
Use two supporting U-frames that flip up and meet as the carrying grip. Remove the separate bail and fixed lid-top handle.
Clarify intended airflow as bottom intake and top exhaust; the supplier's outlet comment is a source observation, not the adopted airflow specification.
Keep the tooling figure as an unconfirmed estimate; obtain actual existing-mould data before deciding on reuse.
''')
write('05_Factory_Feedback/Factory_Response_Checklist.txt','''
FACTORY RESPONSE FORM - EN LIGHT REV B
English issue: 2026-11-03 | Design revision: 2026-11-02

Please review the English drawings, model and nominal parameters together and return the following:

A. Existing bowl-mould ID, actual rim diameter, depth, sheet gauge and rolled-rim section:
   __________________________________________________________________________
B. Existing deep-lid mould ID, inner-profile section, actual rise/depth and mating rim:
   __________________________________________________________________________
C. Can the D280 x H50 food-space example be retained? State minimum clearance after enamel and hot deformation:
   __________________________________________________________________________
D. Dual-frame coaxial short-pin stack, inner reinforcement and welding method:
   __________________________________________________________________________
E. Sketch the rigid deployed stops, two independent anti-fold locks, stow/carry retention and coupling between the grips:
   __________________________________________________________________________
F. Validate one-person frame movement, suspended lifting and restoration of locked resting support:
   __________________________________________________________________________
G. Purchased lid-clamp model and grip, temperature and rim-compatibility trial results:
   __________________________________________________________________________
H. White enamel sample and feasibility of the same finish on both sides:
   __________________________________________________________________________
I. Rated load, assembled mass, tipping, carry-load, temperature-rise and thermal-cycle test plan:
   __________________________________________________________________________
J. New/reused/altered tooling and trial scope, price, taxes/freight, lead time and included modification rounds:
   __________________________________________________________________________

Complete mechanism and sample review before issuing tooling approval. This package does not include final mechanical CAD or mould drawings.
''')

# English graphics are typeset from the translated technical text and actual renders.
def font(n,bold=False):return ImageFont.truetype('C:/Windows/Fonts/'+('arialbd.ttf' if bold else 'arial.ttf'),n)
poster=Image.new('RGB',(2400,1300),'#f6f4ef');d=ImageDraw.Draw(poster)
d.text((70,36),'EN LIGHT',font=font(60,True),fill='#202826')
d.text((70,115),'REV B  |  FACTORY REVIEW  |  ENGLISH ISSUE 2026-11-03',font=font(26),fill='#65716c')
d.text((1310,62),'RAISED LID / WHITE ENAMEL / LEGS AS HANDLE',font=font(32,True),fill='#354b40')
panels=[('01_Blender_Closed_Deployed.png',70,'DEPLOYED SUPPORT','Rigid stops and separate locks required on both frames.'),('04_Blender_Legs_Up_Carry.png',1230,'FLIP LEGS UP TO CARRY','Suspended pose; locks and grip coupling need engineering.')]
for name,x,label,sub in panels:
    im=Image.open(ROOT/'03_Blender_Model'/name).convert('RGB').resize((1100,825),Image.Resampling.LANCZOS)
    poster.paste(im,(x,190));d.text((x,1038),label,font=font(37,True),fill='#24342c')
    d.text((x,1097),sub,font=font(26),fill='#58655e')
d.line((70,1163,2330,1163),fill='#bcc7bd',width=2)
d.text((70,1188),'Lid rise 85 mm     Central headroom approx. 89 mm     Same white enamel, inside and outside',font=font(31),fill='#24342c')
d.text((70,1245),'FACTORY REVIEW: Cool completely before flipping/carrying. Use a separate hot-lid clamp. Mechanism, loads and process approval remain pending.',font=font(24),fill='#667168')
poster.save(ROOT/'04_Design_Overview'/'EN_Light_RevB_Design_Overview_EN.png',optimize=True)

page=Image.new('RGB',(1800,1560),'#f6f4ef');d=ImageDraw.Draw(page)
d.text((80,58),'FACTORY FEEDBACK',font=font(52,True),fill='#202826')
d.text((80,128),'ENGLISH TRANSCRIPTION - TECHNICAL EXCERPTS',font=font(27,True),fill='#52695b')
d.text((80,177),'Source: user-supplied Chinese chat, received 2026-11-02. Translation issued 2026-11-03.',font=font(24),fill='#65716c')
items=[
 ('01  TOOLING ESTIMATE','About RMB 40,000 for the grill tooling; a similar existing factory mould may cost a little less.'),
 ('02  LID CLEARANCE','The engineer says the shallow lid would press down on food when closed; the design needs revision.'),
 ('03  ENAMEL COLOUR','Most enamelling factories can supply only one colour for this arrangement: all white or all black.'),
 ('04  HANDLE SIMPLIFICATION','Remove the two indicated handles and turn the lower wire upwards for carrying, like the factory bucket-style grill.'),
 ('05  LOWER AIR FEATURE','The supplier observes that the bottom feature appears to be an air outlet.'),
]
y=255
for title,body in items:
    d.line((80,y-18,1720,y-18),fill='#c2ccc2',width=2)
    d.text((80,y),title,font=font(29,True),fill='#2b4435');y+=49
    for line in textwrap.wrap(body,105):d.text((80,y),line,font=font(28),fill='#343d37');y+=38
    y+=40
d.rounded_rectangle((65,1235,1735,1465),radius=12,fill='#e0e7de')
d.text((90,1258),'USER CLARIFICATION / ADOPTED DESIGN',font=font(28,True),fill='#2b4435')
lines=[
 'User confirmed: the two leg frames flip upwards and also serve as the carry handle.',
 'Rev B airflow is specified as bottom intake and top exhaust; the supplier observation is retained above.',
 'This is a translated record, not an original English chat screenshot. Greetings are omitted.',
 'The original Chinese screenshot remains in the earlier source package, outside this English deliverable.'
]
y=1310
for line in lines:d.text((90,y),line,font=font(25),fill='#4a5c4e');y+=35
page.save(ROOT/'05_Factory_Feedback'/'Factory_Feedback_English_Transcription.png',optimize=True)
print('ENGLISH_DOCUMENTS_AND_GRAPHICS_CREATED')
