建立方向盘项目初始版本
This commit is contained in:
42
scripts/prepare_kfl001_plate_v1.py
Normal file
42
scripts/prepare_kfl001_plate_v1.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from pathlib import Path
|
||||
|
||||
root = Path(r'C:\projects\wheel')
|
||||
scripts = root / 'scripts'
|
||||
output = root / 'models' / 'kfl001_plate_v1'
|
||||
output.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
src = (scripts / 'build_kfl001_plate_draft.py').read_text(encoding='utf8')
|
||||
for before, after in [
|
||||
('kfl001_plate_draft', 'kfl001_plate_v1'),
|
||||
('KFL001_Plate_Draft', 'KFL001_Plate_V1'),
|
||||
('KFL001 8mm plate DRAFT - centre cut unverified', 'KFL001 8mm bearing mounting plate V1'),
|
||||
('Parameters - centre diameter UNVERIFIED', 'Parameters - dimensions in mm'),
|
||||
('TEMPORARY ONLY - verify real KFL back geometry', '39 mm clearance for user confirmed 38 mm boss'),
|
||||
('TEMP_CentreHole', 'CentreHole'),
|
||||
('Plate_DRAFT', 'Plate_V1'),
|
||||
('DRAFT bearing plate - centre 39mm NOT verified', 'KFL001 bearing mounting plate V1'),
|
||||
('KFL001_plate_DRAFT', 'KFL001_plate_V1'),
|
||||
('center_diameter_provisional', 'center_diameter'),
|
||||
("'center_UNVERIFIED':True", "'boss_diameter_user_confirmed_mm':38"),
|
||||
]:
|
||||
src = src.replace(before, after)
|
||||
src = src.replace('Editable KFL001 bearing mounting plate -- provisional concept only.', 'Editable KFL001 bearing mounting plate for prototype.')
|
||||
src = src.replace('The centre cut is an unverified placeholder and MUST NOT be used for CNC.', 'The centre cut provides 0.5 mm radial clearance for a 38 mm boss.')
|
||||
(scripts / 'build_kfl001_plate_v1.py').write_text(src, encoding='utf8')
|
||||
(scripts / 'rebuild_kfl001_plate_v1.FCMacro').write_text("from pathlib import Path\nscript = Path(__file__).resolve().with_name('build_kfl001_plate_v1.py')\nexec(compile(script.read_text(encoding='utf-8'), str(script), 'exec'), {'__name__':'__main__','__file__':str(script)})\n", encoding='utf8')
|
||||
|
||||
src = (scripts / 'render_kfl_plate_draft.py').read_text(encoding='utf8')
|
||||
for before, after in [
|
||||
('kfl001_plate_draft', 'kfl001_plate_v1'),
|
||||
('KFL001板_尺寸草图_禁止加工.pdf', 'KFL001固定板_尺寸图.pdf'),
|
||||
('尺寸草图_禁止加工.png', 'KFL001固定板_尺寸图.png'),
|
||||
('KFL001 mounting plate - provisional dimensions', 'KFL001 mounting plate V1 - prototype'),
|
||||
('KFL001 固定板尺寸草图', 'KFL001 固定板尺寸图'),
|
||||
('草图:中心孔仅按直径 39 mm 示意,必须实测后才能加工', '试制版:中心孔直径 39,适配直径 38 凸起'),
|
||||
('1 中心孔:直径 39 暂定,真实凸起待实测', '1 中心孔:直径 39,适配直径 38 凸起'),
|
||||
('中心孔可能需要改小或改轮廓,', '轴承及连接件先试装,'),
|
||||
('请勿用本图或草模直接下单加工。', '紧固和动态强度需实物验证。'),
|
||||
('注意:圆孔、板边与调节槽均贯穿,轴承真实外形、螺丝及垫圈待核对。', '注:圆孔和长槽均贯穿;两块相同。按孔心尺寸加工,无螺纹。'),
|
||||
]:
|
||||
src = src.replace(before, after)
|
||||
(scripts / 'render_kfl_plate_v1.py').write_text(src, encoding='utf8')
|
||||
Reference in New Issue
Block a user