diff --git a/.gitignore b/.gitignore index 1bf98496..fa0b412b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,73 +1,35 @@ -# file types to ignore -.* -!*.gitattributes -!*.gitignore -!/.clang-format -!/.clang-tidy -!/.git-blame-ignore-revs -!/.gitattributes -!/.github/ -!/.gitignore -!/.gitmodules -!/.packit.yaml -!/.pre-commit-config.yaml -!/.pylintrc -!/contrib/.vscode/ -*.clangd -*.DS_Store -*.dep -*.exp -*.kdev4 -*.lib -*.manifest -*.o -*.obj -*.orig -*.output -*.pch +/freecad-source/build-web/ +/freecad-source/build/ +/web/node_modules/ +/web/dist/ +/web/public/kernel/ +/web/public/modules/ +/docs/current/continuation-runs/ +/docs/current/user-tests-20260915/ +/docs/current/business-evidence/ +/docs/current/failure-evidence/ +/docs/current/round-reports/ +/docs/current/periodic-optimization/ +/docs/current/operator-gap-discovery/ +**/__pycache__/ *.pyc -*.vcproj -# Ignore .db files created by Qt Designer when editing .ui files -*.db -*qrc.depends -*~ -BuildLog.htm -CMakeCache.txt -CMakeFiles/ -CMakeLists.txt.user -Makefile -cmake_install.cmake -config.h -install_manifest.txt -moc_*.cpp -qrc_*.cpp -ui_*.h -/.vscode/ -/ALL_BUILD.dir/ -/Mod/ -/ZERO_CHECK.dir/ -/bin/ -/build-*/ -/build/ -/cmake-build*/ -/conda/environment.yml -/doc/ -/lib/ -/src/Tools/offlinedoc/*.txt -/src/Tools/offlinedoc/localwiki/ -OpenSCAD_rc.py -tags -/CMakeUserPresets.json -Testing -compile_commands.json -*.sublime-project -*.sublime-workspace +*.log +*.out +*.tmp +.env* -# crowdin file -files_to_translate.txt -src/Tools/freecad.zip -tsupdate_stderr.log -tsupdate_stdout.log -# pixi environments -*.egg-info -.pixi +# BIM workshop video production cache (raw recording, Chrome profile, ffmpeg segments) +web/tools/bim-workshop-video/profile/ +web/tools/bim-workshop-video/raw/ +web/tools/bim-workshop-video/segments/ + +# Production-line course: regenerable recording/audio caches and local media +web/tools/line-course/raw/ +web/tools/line-course/episodes/*/segments/ +web/tools/line-course/episodes/*/audio/ +web/teaching/media/line-course/*.mp4 +web/teaching/media/line-course/*.webm +web/teaching/media/line-course/*.vtt +web/teaching/media/line-course/*.srt +web/teaching/media/line-course/*-poster.png +web/teaching/cases/line-models diff --git a/web/public/line/models.json b/web/public/line/models.json new file mode 100644 index 00000000..1c6d8fdb --- /dev/null +++ b/web/public/line/models.json @@ -0,0 +1,302 @@ +{ + "schema": "freecad-web-line-course/reference-models/v1", + "models": [ + { + "file": "ABB_IRB_120.glb", + "name": "ABB_IRB_120", + "label": "ABB IRB 120 机器人", + "dims": [ + 219.36, + 687.567, + 699.587 + ], + "parts": 11 + }, + { + "file": "Tool.glb", + "name": "ToolFrame", + "label": "工具坐标系", + "dims": [ + 72.244, + 72.244, + 72.244 + ], + "parts": 3 + }, + { + "file": "三柜子.glb", + "name": "CabinetA", + "label": "主控制柜", + "dims": [ + 1499.932, + 744.225, + 754 + ], + "parts": 8 + }, + { + "file": "三柜子1.glb", + "name": "CabinetB", + "label": "长控制柜", + "dims": [ + 2969.994, + 774.283, + 774.001 + ], + "parts": 8 + }, + { + "file": "三色灯.glb", + "name": "StackLight", + "label": "三色警示灯", + "dims": [ + 50, + 40, + 468 + ], + "parts": 2 + }, + { + "file": "上料.glb", + "name": "Loader", + "label": "上料机构", + "dims": [ + 374.932, + 140, + 212 + ], + "parts": 2 + }, + { + "file": "传送带送料装置.glb", + "name": "ConveyorFeeder", + "label": "传送带送料装置", + "dims": [ + 613.967, + 270.043, + 204.607 + ], + "parts": 6 + }, + { + "file": "原料上料.glb", + "name": "RawFeeder", + "label": "原料上料装置", + "dims": [ + 210, + 208, + 204.1 + ], + "parts": 5 + }, + { + "file": "原料装配.glb", + "name": "RawAssembly", + "label": "原料装配平台", + "dims": [ + 498.3, + 144.929, + 338.125 + ], + "parts": 3 + }, + { + "file": "原点.glb", + "name": "OriginMarker", + "label": "原点标记", + "dims": [ + 141.682, + 141.682, + 141.682 + ], + "parts": 3 + }, + { + "file": "地面平面.glb", + "name": "GroundPlane", + "label": "地面与地线", + "dims": [ + 4867.482, + 3673.23, + 310.061 + ], + "parts": 2 + }, + { + "file": "夹取送料装置.glb", + "name": "PickFeeder", + "label": "夹取送料装置", + "dims": [ + 1026, + 277.257, + 455.018 + ], + "parts": 5 + }, + { + "file": "平面.001.glb", + "name": "Plane001", + "label": "地面平面 001", + "dims": [ + 4867.482, + 3673.23, + 310.061 + ], + "parts": 2 + }, + { + "file": "平面.glb", + "name": "Plane", + "label": "地面平面", + "dims": [ + 4867.482, + 3673.23, + 310.061 + ], + "parts": 2 + }, + { + "file": "推料装置.glb", + "name": "Pusher", + "label": "推料装置", + "dims": [ + 490, + 336, + 587.8 + ], + "parts": 2 + }, + { + "file": "料仓.glb", + "name": "Hopper", + "label": "料仓", + "dims": [ + 280, + 250, + 200 + ], + "parts": 2 + }, + { + "file": "新版2.glb", + "name": "SensorBlock", + "label": "新版检测块", + "dims": [ + 21.992, + 21.967, + 7 + ], + "parts": 1 + }, + { + "file": "旋转运送装置.glb", + "name": "RotaryTransfer", + "label": "旋转运送装置", + "dims": [ + 536.869, + 536.268, + 202 + ], + "parts": 2 + }, + { + "file": "显示屏.glb", + "name": "DisplayA", + "label": "显示屏 A", + "dims": [ + 249, + 161.2, + 312 + ], + "parts": 2 + }, + { + "file": "显示屏1.glb", + "name": "DisplayB", + "label": "显示屏 B", + "dims": [ + 249, + 161.2, + 312 + ], + "parts": 2 + }, + { + "file": "柜门.glb", + "name": "CabinetDoor", + "label": "柜门", + "dims": [ + 30, + 560, + 560 + ], + "parts": 1 + }, + { + "file": "检测台.glb", + "name": "InspectionTable", + "label": "检测台", + "dims": [ + 75, + 148.486, + 325 + ], + "parts": 1 + }, + { + "file": "物料存储区.glb", + "name": "MaterialStore", + "label": "物料存储区", + "dims": [ + 351.815, + 82.979, + 412.75 + ], + "parts": 5 + }, + { + "file": "称重平台.glb", + "name": "WeighPlatform", + "label": "称重平台", + "dims": [ + 200, + 199.316, + 175 + ], + "parts": 2 + }, + { + "file": "辅助夹爪.glb", + "name": "AuxGripper", + "label": "辅助夹爪", + "dims": [ + 73.312, + 94.272, + 102.394 + ], + "parts": 3 + }, + { + "file": "运送支架.glb", + "name": "TransportBracket", + "label": "运送支架", + "dims": [ + 60, + 113.5, + 310 + ], + "parts": 1 + }, + { + "file": "运送检测装置.glb", + "name": "TransportInspector", + "label": "运送检测装置", + "dims": [ + 75, + 148.486, + 325 + ], + "parts": 2 + } + ] +} diff --git a/web/src/delta-reference-panel.tsx b/web/src/delta-reference-panel.tsx new file mode 100644 index 00000000..dbb3bbfa --- /dev/null +++ b/web/src/delta-reference-panel.tsx @@ -0,0 +1,156 @@ +import React, { useEffect, useRef, useState } from "react"; +import * as THREE from "three"; +import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js"; +import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js"; + +// Three.js reference viewer for GLB models. The OCCT build used by the Web +// kernel is configured with USE_RAPIDJSON=OFF, so RWGltf cannot read/write +// glTF; this React panel provides the reference view without touching the +// kernel. It supports Y-up (DELTA) and Z-up (production-line) GLBs. +export type GlbReferenceModel = { file: string; label: string; name?: string; dims?: number[] }; + +export function GlbReferencePanel({ + src, title = "参考模型", upAxis = "y", ariaLabel = "GLB reference viewer", + modelsUrl, onClose, +}: { + src?: string; + title?: string; + upAxis?: "y" | "z"; + ariaLabel?: string; + modelsUrl?: string; + onClose: () => void; +}) { + const host = useRef(null); + const [info, setInfo] = useState("加载参考模型…"); + const [error, setError] = useState(""); + const [models, setModels] = useState([]); + const [selected, setSelected] = useState(src ?? ""); + + useEffect(() => { + if (!modelsUrl) return; + let cancelled = false; + fetch(modelsUrl).then(response => response.json()).then(payload => { + if (cancelled) return; + const list: GlbReferenceModel[] = payload.models ?? []; + setModels(list); + setSelected(current => current || (list[0] ? `/line-glb/${encodeURIComponent(list[0].file)}` : "")); + }).catch(loadError => { if (!cancelled) setError(String(loadError?.message ?? loadError)); }); + return () => { cancelled = true; }; + }, [modelsUrl]); + + useEffect(() => { + const container = host.current; + const effectiveSrc = selected || src; + if (!container || !effectiveSrc) return; + let disposed = false; + const scene = new THREE.Scene(); + scene.background = new THREE.Color(0x0f1419); + const camera = new THREE.PerspectiveCamera(42, 1, 0.01, 100000); + camera.up.set(0, upAxis === "z" ? 0 : 1, upAxis === "z" ? 1 : 0); + const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false }); + renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); + container.appendChild(renderer.domElement); + renderer.domElement.style.width = "100%"; + renderer.domElement.style.height = "100%"; + renderer.domElement.style.display = "block"; + scene.add(new THREE.HemisphereLight(0xffffff, 0x334455, 2.2)); + const key = new THREE.DirectionalLight(0xffffff, 2.2); + key.position.set(2, 4, 3); scene.add(key); + const fill = new THREE.DirectionalLight(0xffffff, 0.9); + fill.position.set(-3, 1, -2); scene.add(fill); + const controls = new OrbitControls(camera, renderer.domElement); + controls.enableDamping = true; controls.dampingFactor = 0.08; + + const resize = () => { + const width = container.clientWidth || 430; + const height = container.clientHeight || 260; + renderer.setSize(width, height, false); + camera.aspect = width / height; + camera.updateProjectionMatrix(); + }; + resize(); + const observer = new ResizeObserver(resize); + observer.observe(container); + setError(""); + setInfo("加载参考模型…"); + + new GLTFLoader().load(effectiveSrc, gltf => { + if (disposed) return; + const root = gltf.scene; + scene.add(root); + const box = new THREE.Box3().setFromObject(root); + const size = box.getSize(new THREE.Vector3()); + const center = box.getCenter(new THREE.Vector3()); + root.position.sub(center); + const maxSize = Math.max(size.x, size.y, size.z) || 1; + camera.position.set(maxSize * 1.15, maxSize * 1.25, maxSize * 1.45); + if (upAxis === "z") camera.position.set(maxSize * 1.15, -maxSize * 1.45, maxSize * 1.05); + camera.near = maxSize / 200; camera.far = maxSize * 30; + camera.updateProjectionMatrix(); + controls.target.set(0, 0, 0); controls.update(); + let meshes = 0; + root.traverse(child => { if ((child as THREE.Mesh).isMesh) meshes++; }); + setInfo(`${meshes} 个网格 · 包围盒 ${size.x.toFixed(2)} × ${size.y.toFixed(2)} × ${size.z.toFixed(2)} m`); + }, undefined, loadError => { + if (!disposed) setError(String((loadError as Error | undefined)?.message ?? loadError)); + }); + + let frame = 0; + const animate = () => { + frame = requestAnimationFrame(animate); + controls.update(); + renderer.render(scene, camera); + }; + animate(); + return () => { + disposed = true; + cancelAnimationFrame(frame); + observer.disconnect(); + controls.dispose(); + scene.traverse(child => { + const mesh = child as THREE.Mesh; + if (!mesh.isMesh) return; + mesh.geometry?.dispose(); + const materials = Array.isArray(mesh.material) ? mesh.material : [mesh.material]; + for (const material of materials) { + const map = (material as THREE.MeshStandardMaterial | undefined)?.map; + map?.dispose(); + material?.dispose(); + } + }); + renderer.dispose(); + if (renderer.domElement.parentElement === container) container.removeChild(renderer.domElement); + }; + }, [selected, src, upAxis]); + + return ; +} + +export function DeltaReferencePanel({ onClose }: { onClose: () => void }) { + return ; +} + +export function LineReferencePanel({ onClose }: { onClose: () => void }) { + return ; +} diff --git a/web/src/project-shell.tsx b/web/src/project-shell.tsx new file mode 100644 index 00000000..642afe4e --- /dev/null +++ b/web/src/project-shell.tsx @@ -0,0 +1,3121 @@ +import { PartMeshConversionTask } from "./part-mesh-conversion-task.js"; +import { PartNewSketchTask } from "./part-new-sketch-task.js"; +import { PartSamplePointsTask } from "./part-sample-points-task.js"; +import { PartAttachmentTask } from "./part-attachment-task.js"; +import { PartTubeTask } from "./part-tube-task.js"; +import { PartToleranceTask } from "./part-tolerance-task.js"; +import { PartPrimitivesTask } from "./part-primitives-task.js"; +import { requestOpenScadExport, requestOpenScadExportPreferences } from "./openscad-format-facade.js"; +import { saved as savedExportPreferences, persist as persistExportPreferences } from "./parameter-storage.js"; +import { requestOpenScadFile, type OpenScadFileArgs } from "./openscad-format-facade.js"; +import { openScadDocumentSnapshot, saveOpenScadFile, type OpenScadDocument } from "./openscad-desktop-adapter.js"; +import { OpenScadDesktopView } from "./openscad-desktop-view.js"; +import { MaterialDesktopTask } from "./material-desktop-task.js"; +import { SHOW_DOCUMENT_LIFECYCLE_COMMAND, type ShowDocumentLifecyclePayload, type ShowDocumentLifecycleResult } from "./show-python-family-facade.js"; +import { ShowClippingTask } from "./show-clipping-task.js"; +import { TestViewExampleTask } from "./test-view-example-task.js"; +import { requestTestScene, sceneDocumentSnapshot, encodeSceneFile, TEST_EXAMPLES } from "./test-scene-session.js"; +import { fcstdDocumentXml } from "./jtreader-document-facade.js"; +import { isJtReaderFcstd, JTREADER_DOCUMENT_COMMAND, JTREADER_DOCUMENT_SCHEMA, type JtReaderDocumentPayload, type JtPlacementResult } from "./jtreader-document-facade.js"; +import { MeasureMassPropertiesTask } from "./measure-mass-properties-task.js"; +import { axisAngleFromEuler, eulerFromAxisAngle, roundDegrees } from "./placement-euler.js"; +import { MeasureDistanceTask } from "./measure-distance-task.js"; +import { MeasureQuickSelection } from "./measure-quick-selection.js"; +import type { MeasureSelection } from "./measure-document-adapter.js"; +import { SurfaceFillingTask } from "./surface-filling-task.js"; +import { SurfaceGeomFillTask } from "./surface-geomfill-task.js"; +import { SpreadsheetCsvPanel } from "./spreadsheet-csv-panel.js"; +import { SpreadsheetSheetEditor, type SheetCell, type SheetStructure, sheetColumn, sheetCoordinate } from "./spreadsheet-sheet-editor.js"; +import { PersistentToolbarWorkspace, ToolbarGroup } from "./persistent-toolbar-workspace.js"; +import { StartLaunchPanel } from "./start-launch-panel.js"; +import { startParameters } from "./start-preferences.js"; +import { pickFiles } from "./web-open-adapter.js"; +import { PartMakeFaceTask } from "./part-make-face-task.js"; +import { PartSplitDocumentTask } from "./part-split-document-task.js"; +import { PartJoinTask } from "./part-join-task.js"; +import { PartCompoundTask } from "./part-compound-task.js"; +import { PartFaceColorTask } from "./part-face-color-task.js"; +import { PartSectionCutTask } from "./part-section-cut-task.js"; +import { PartProjectionTask } from "./part-projection-task.js"; +import { PartBuilderTask } from "./part-builder-task.js"; +import { PartCrossSectionsTask } from "./part-cross-sections-task.js"; +import { PartScaleTask } from "./part-scale-task.js"; +import { PartMirrorTask } from "./part-mirror-task.js"; +import { PartCopyTask } from "./part-copy-task.js"; +import { PartRuledSurfaceTask } from "./part-ruled-surface-task.js"; +import { PartThicknessTask } from "./part-thickness-task.js"; +import { PartCleanupTask } from "./part-cleanup-task.js"; +import { PartOffsetTask } from "./part-offset-task.js"; +import { PartRevolveTask } from "./part-revolve-task.js"; +import { PartProfileTask } from "./part-profile-task.js"; +import { PartChamferTask } from "./part-chamfer-task.js"; +import { PartCheckGeometryTask } from "./part-check-geometry-task.js"; +import { executePartFixedBoxDesktop, executePartReverseDesktop } from "./part-desktop-adapter.js"; +import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; +import { createRoot } from "react-dom/client"; + +import { PartWorkbenchMenu, PartWorkbenchViewItems, PartWorkbenchToolbars, partUiCss, type PartUiAction } from "./part-workbench-ui.js"; +import { WorkbenchParityMenu } from "./workbench-parity-menu.js"; + +import { Box, Boxes, Cylinder, Cone, Circle, CircleDot, Plus, RefreshCw, Merge, Scissors, Layers2, Move3d, Undo2, Redo2, ArrowLeftRight, FileOutput, Download, X, ChevronLeft, ChevronRight, type IconNode } from "lucide"; +import { ProjectSessionStore } from "./project-session.js"; +import { ProjectSliceProperties } from "./project-slice-properties.js"; +import { WebViewTask } from "./web-view-task.js"; +import { WebGroupTask } from "./web-group-task.js"; +import { executeWebDesktop } from "./web-desktop-adapter.js"; +import { ProjectCheckpointStore } from "./session-persistence.js"; +import { WebModuleRouter } from "./module-router.js"; +import { installNavigation, readNavigationContext, updateNavigationContext } from "./navigation.js"; +import { installUiAccessibility } from "./ui-accessibility.js"; +import type { FacadeResponse } from "./facade-envelope.js"; +import { documentSessionReducer } from "./document-session.js"; +import { PART_DOCUMENT_COMMAND, PART_DOCUMENT_SCHEMA, PART_PRIMITIVE_FIELDS, documentObjectMesh, type PartPrimitive, type PartBoolean, type PartDocumentAction, type PartDocumentPayload, type PartDocumentResult } from "./part-document-facade.js"; +import { isOpfsSupported, listDocumentFiles, listExportFiles, readDocumentFile, readExportFile, writeDocumentFile } from "./storage.js"; +import { ExportService } from "./export-service.js"; +import { DeltaReferencePanel, LineReferencePanel } from "./delta-reference-panel.js"; +import type { MeshPayload } from "./worker-protocol.js"; +import { ImportRenderBridge } from "./import-render-bridge.js"; +import { registerTestMdiHost } from "./test-desktop-adapter.js"; +import { navigationPreferenceSource, requestOwnerParameters, SPREADSHEET_PARAMETER_PATH } from "./view-navigation-preferences.js"; +import { IMPORT_DESKTOP_COMMANDS, importDesktopPayload, type ImportDesktopCommand } from "./import-desktop-adapter.js"; +import { readImportExportSettings } from "./import-export-preferences.js"; +import { RecoveryController } from "./recovery-controller.js"; +import { mountQueueRecoveryPanel } from "./queue-recovery-panel.js"; +import { PartDesignWorkspace } from "./partdesign-workspace-component.js"; +import { DocumentTree, type DocumentTreeNode } from "./document-tree.js"; +import { PARTDESIGN_DOCUMENT_COMMAND, PARTDESIGN_DOCUMENT_SCHEMA, type DesignAction, type DesignPayload, type DesignResult } from "./partdesign-document-facade.js"; + +const css = `:root{color-scheme:dark;font-family:Inter,system-ui,sans-serif;background:#10161d;color:#e7edf3}*{box-sizing:border-box}html{overflow-x:hidden}body{margin:0;min-width:320px;overflow-x:hidden}.top{align-items:center;background:#17212b;border-bottom:1px solid #2c3b48;display:flex;gap:14px;padding:14px 20px}.brand{background:#3b9db0;border-radius:5px;color:#071219;font-weight:800;padding:7px}.title{margin-left:auto}.layout{display:grid;grid-template-columns:260px minmax(0,1fr) 300px;min-height:calc(100vh - 56px)}aside{background:#17212b;padding:18px;overflow:auto}aside:first-child{border-right:1px solid #2c3b48}aside:last-child{border-left:1px solid #2c3b48}.stage{background:#0d1319;padding:24px}.viewport{background:#0d1319;border:1px solid #334854;height:330px;margin:12px 0}.viewport canvas{display:block;height:100%;width:100%}.tab,.action{background:#1d2a35;border:1px solid #435464;border-radius:5px;color:#e7edf3;cursor:pointer;display:block;font:inherit;margin:7px 0;padding:9px 11px;text-align:left;width:100%}.tab.active{background:#264b56;border-color:#66c7d5}.action:hover{border-color:#66b7c8}.action:disabled{opacity:.45}.status{color:#9cb6c2;line-height:1.5}.status.ok{color:#9ce0bd}.status.error{color:#ff9e9e}.stat{border-bottom:1px solid #2c3b48;padding:10px 0}.stat small{color:#8ea2ae;display:block;margin-top:4px}.result{font:12px ui-monospace,monospace;line-height:1.5;max-height:60vh;overflow:auto;white-space:pre-wrap;word-break:break-word}`; + +const primitives: Record }> = { + Plane: { label: "Plane", icon: Layers2, defaults: { Length: 10, Width: 10 } }, + Ellipsoid: { label: "Ellipsoid", icon: Circle, defaults: { Radius1: 2, Radius2: 4, Radius3: 0, Angle1: -90, Angle2: 90, Angle3: 360 } }, + Box: { label: "Box", icon: Box, defaults: { Length: 10, Width: 10, Height: 10 } }, + Cylinder: { label: "圆柱", icon: Cylinder, defaults: { Radius: 5, Height: 10, Angle: 360 } }, + Cone: { label: "圆锥", icon: Cone, defaults: { Radius1: 5, Radius2: 2, Height: 10, Angle: 360 } }, + Sphere: { label: "球", icon: Circle, defaults: { Radius: 5, Angle1: -90, Angle2: 90, Angle3: 360 } }, + Torus: { label: "圆环", icon: CircleDot, defaults: { Radius1: 10, Radius2: 2, Angle1: -180, Angle2: 180, Angle3: 360 } }, +}; +function ToolIcon({ nodes }: { nodes: IconNode }) { + return ; +} + +function App() { + const router = useMemo(() => new WebModuleRouter(), []); + const navigationContext = useMemo(() => readNavigationContext(), []); + const initialDocumentId = navigationContext.documentId ?? "project-document-1"; + const requestedWorkbench = new URLSearchParams(window.location.search).get("workbench"); + const initialWorkbench = ["Part", "Sketcher", "PartDesign", "Spreadsheet", "Surface", "Assembly", "Draft", "Architecture", "TechDraw", "CAM"].includes(requestedWorkbench ?? "") + ? requestedWorkbench as "Part" | "Sketcher" | "PartDesign" | "Spreadsheet" | "Surface" | "Assembly" | "Draft" | "Architecture" | "TechDraw" | "CAM" : undefined; + const store = useMemo(() => { const value = new ProjectSessionStore(); value.open(initialDocumentId, initialDocumentId); value.open("project-document-2", "Project Document 2"); value.switchTo(initialDocumentId); return value; }, [initialDocumentId]); + const checkpoint = useMemo(() => new ProjectCheckpointStore("freecad-web-project-ui-checkpoint"), []); + const recovery = useMemo(() => new RecoveryController(), []); + const [recoveryVersion, setRecoveryVersion] = useState(0); + const [active, setActive] = useState(store.currentDocumentId ?? "project-document-1"); + const [documents, setDocuments] = useState(store.list()); + const documentTabsRef = useRef(null); + const [documentTabsOverflow, setDocumentTabsOverflow] = useState(false); + const [documentTabsCanScrollLeft, setDocumentTabsCanScrollLeft] = useState(false); + const [documentTabsCanScrollRight, setDocumentTabsCanScrollRight] = useState(false); + const [startVisible, setStartVisible] = useState(new URLSearchParams(window.location.search).has("start")); + const [startEpoch, setStartEpoch] = useState(0); + const [showClippingOpen, setShowClippingOpen] = useState(false); + const showStart = () => { setStartVisible(true); setStartEpoch(value => value + 1); }; + const updateDocumentTabsScroll = () => { + const tabs = documentTabsRef.current; + if (!tabs) return; + setDocumentTabsOverflow(tabs.scrollWidth > tabs.clientWidth + 1); + setDocumentTabsCanScrollLeft(tabs.scrollLeft > 1); + setDocumentTabsCanScrollRight(tabs.scrollLeft + tabs.clientWidth < tabs.scrollWidth - 1); + }; + useLayoutEffect(() => { + const tabs = documentTabsRef.current; + if (!tabs) return; + updateDocumentTabsScroll(); + const observer = new ResizeObserver(updateDocumentTabsScroll); + observer.observe(tabs); + window.addEventListener("resize", updateDocumentTabsScroll); + return () => { observer.disconnect(); window.removeEventListener("resize", updateDocumentTabsScroll); }; + }, [documents.length]); + useEffect(() => { + const tabs = documentTabsRef.current; + const selected = tabs?.querySelector(`[data-document-id="${CSS.escape(active)}"]`); + if (!tabs || !selected) return; + const viewport = tabs.getBoundingClientRect(); + const bounds = selected.getBoundingClientRect(); + if (bounds.left < viewport.left) tabs.scrollLeft += bounds.left - viewport.left; + else if (bounds.right > viewport.right) tabs.scrollLeft += bounds.right - viewport.right; + }, [active, documents.length]); + const handleApplicationMenuKeyDown = (event: React.KeyboardEvent) => { + const nav = event.currentTarget; + const target = event.target as HTMLElement; + const summary = target.closest("summary"); + const topButton = target.closest("button")?.parentElement === nav ? target.closest("button") : null; + const topItems = () => Array.from(nav.querySelectorAll(":scope > button, :scope > details > summary")); + if ((summary && summary.parentElement?.parentElement === nav) || topButton) { + const items = topItems(); + const index = items.indexOf((summary ?? topButton) as HTMLElement); + if (["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) { + if (index < 0) return; + const next = event.key === "Home" ? 0 : event.key === "End" ? items.length - 1 + : (index + (event.key === "ArrowRight" ? 1 : -1) + items.length) % items.length; + event.preventDefault(); items[next]?.focus(); return; + } + if (["ArrowDown", "Enter", " "].includes(event.key)) { + if (!summary) { event.preventDefault(); topButton?.focus(); return; } + const details = summary.parentElement as HTMLDetailsElement | null; + if (!details) return; + event.preventDefault(); details.open = true; + const first = details.querySelector(".menu-items button:not(:disabled), .workbench-parity-items button:not(:disabled)"); + (first ?? summary).focus(); return; + } + } + const menu = target.closest(".menu-items, .workbench-parity-items"); + if (!menu) return; + const actions = Array.from(menu.querySelectorAll("button:not(:disabled)")); + const actionIndex = actions.indexOf(target.closest("button") as HTMLButtonElement); + if (["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key) && actionIndex >= 0) { + const next = event.key === "Home" ? 0 : event.key === "End" ? actions.length - 1 + : (actionIndex + (event.key === "ArrowDown" ? 1 : -1) + actions.length) % actions.length; + event.preventDefault(); actions[next]?.focus(); return; + } + if (event.key === "Escape") { + const details = menu.closest("details"); + if (!details) return; + const menuSummary = details.firstElementChild instanceof HTMLElement ? details.firstElementChild : null; + event.preventDefault(); event.stopPropagation(); details.open = false; + menuSummary?.focus(); + } + }; + useEffect(() => { + let disposed = false; + void startParameters(router).then(value => { + // Start opens only from its button (or the ?start URL); a startup flag must + // not cover the workbench with a dialog the user never asked for. + if (!disposed && new URLSearchParams(window.location.search).has("start")) setStartVisible(true); + }).catch(error => { if (!disposed) { setStartVisible(true); setStatus(String(error)); } }); + return () => { disposed = true; }; + }, [router]); + useEffect(() => { + const receive = (event: MessageEvent) => { + if (event.origin === window.location.origin && event.source === window.parent && event.data?.type === "freecad-show-start") showStart(); + }; + window.addEventListener("message", receive); + return () => window.removeEventListener("message", receive); + }, []); + const [status, setStatus] = useState("Project session ready"); + const [response, setResponse] = useState(null); + const [importedMesh, setImportedMesh] = useState(null); + const [importing, setImporting] = useState(false); + const importCancellation = useRef(null); + const [cancelRequested, setCancelRequested] = useState(false); + const [importPhase, setImportPhase] = useState(""); + const [importProgress, setImportProgress] = useState({ label: "", current: 0, total: 0, state: "running" as "running" | "completed" | "error" | "cancelled" }); + const [exportFormat, setExportFormat] = useState("stl"); + const [referenceOpen, setReferenceOpen] = useState(false); + const [lineReferenceOpen, setLineReferenceOpen] = useState(false); + // SolidWorks-style direct manipulation: picking an object arms the translate + // controller together with the local triad and selection focus. The toolbar + // still lets the user switch to rotate or turn the handles off entirely. + const [transformMode, setTransformMode] = useState<"off" | "translate" | "rotate">("translate"); + const [exportFileName, setExportFileName] = useState(""); + const [exportOptions, setExportOptions] = useState({ exportFa: 12, exportFs: 2, exportConvexity: 10, meshdeflection: 0 }); + const exportCancellation = useRef(null); + const [exportPreferencesReady, setExportPreferencesReady] = useState(false); + useEffect(() => { + if (!["csg", "scad"].includes(exportFormat) || exportPreferencesReady) return; + let cancelled = false; + void savedExportPreferences("OpenSCAD-export.FCParam").then(data => requestOpenScadExportPreferences(router, data)) + .then(options => { if (!cancelled) { setExportOptions(options); setExportPreferencesReady(true); } }) + .catch(error => { if (!cancelled) setStatus(String(error)); }); + return () => { cancelled = true; }; + }, [exportFormat, exportPreferencesReady, router]); + useEffect(() => () => exportCancellation.current?.abort(), []); + + const [selectedObjects, setSelectedObjects] = useState>({}); + const [measureSelection, setMeasureSelection] = useState([]); + const measureOpeningSelection = useRef<{ selected: string | null; compound?: string[] }>({ selected: null }); + const restoreMeasureSelection = () => { + setSelectedObjects(previous => ({ ...previous, [active]: measureOpeningSelection.current.selected })); + setCompoundSelections(previous => ({ ...previous, [active]: measureOpeningSelection.current.compound ?? [] })); + setMeasureSelection([]); + }; + const surfaceOpeningSelection = useRef(null); + const surfaceOpeningCompoundSelection = useRef(); + const surfaceOpeningDocument = useRef[number]>(); + const [compoundSelections, setCompoundSelections] = useState>({}); + const renderBridge = useMemo(() => new ImportRenderBridge(), []); + const viewportRef = useRef(null); + useEffect(() => { + const surface = viewportRef.current; + if (!surface || !active) return; + const parent = surface.parentElement; + if (!parent) return; + let state: "docked" | "removed" = "docked"; + return registerTestMdiHost({ documentId: active, viewId: `${active}:primary`, prepare(operation) { + if (state !== "docked" || surface.parentElement !== parent) throw new Error("当前视图已移出主窗口,请先恢复视图"); + let applied = false; + return { apply() { + if (operation === "remove-window") { surface.remove(); state = "removed"; } + else { surface.dataset.testMdiState = operation === "remove-subwindow" ? "subwindow" : "window"; } + applied = true; window.dispatchEvent(new Event("resize")); + return (operation === "remove-window" ? "removed" : operation === "remove-subwindow" ? "subwindow" : "window"); + }, dispose() { if (!applied && surface.parentElement !== parent) parent.append(surface); } }; + }}); + }, [active]); + const [nativeBytes, setNativeBytes] = useState(null); + const nativeDocuments = useRef(new Set()); + const testDocuments = useRef(new Map()); + const [testRevision, setTestRevision] = useState(0); + const jtDocuments = useRef(new Set()); + const openScadDocuments = useRef(new Map()); + const [openScadSnapshots, setOpenScadSnapshots] = useState>({}); + const rememberOpenScad = (id: string, document: OpenScadDocument) => { + openScadDocuments.current.set(id, document); + nativeDocuments.current.add(id); + setOpenScadSnapshots(previous => ({ ...previous, [id]: document })); + }; + const openScadRequest = async (id: string, action: OpenScadFileArgs["action"], details: Partial = {}) => { + const owner = openScadDocuments.current.get(id); + const result = await requestOpenScadFile(router, { ...details, action, + documentId: owner?.documentId, documentToken: owner?.documentToken }); + if (result.closed) { + openScadDocuments.current.delete(id); nativeDocuments.current.delete(id); + setOpenScadSnapshots(previous => { const next = { ...previous }; delete next[id]; return next; }); + } else rememberOpenScad(id, result); + return result; + }; + const remoteOwners = useRef(new Map()); + const remoteRequest = (id: string, action: string, details: Record = {}): Promise => new Promise((resolve, reject) => { + const owner = remoteOwners.current.get(id); + if (!owner) { reject(new Error("Document owner is missing")); return; } + if (window.parent === window) { reject(new Error("The document workbench host is unavailable. Reopen the document from its workbench.")); return; } + const requestId = crypto.randomUUID(); + const receive = (event: MessageEvent) => { + if (event.origin !== location.origin || event.source !== window.parent || event.data?.type !== "freecad-project-native-response" || event.data.requestId !== requestId) return; + window.removeEventListener("message", receive); + if (event.data.error) reject(new Error(event.data.error)); + else if (event.data.response?.kind === "error") reject(new Error(event.data.response.error.message)); + else if (event.data.response?.kind !== "result" || !event.data.response.result) + reject(new Error("The document workbench host returned no document result")); + else resolve(event.data.response.result as PartDocumentResult); + }; + window.addEventListener("message", receive); + window.parent.postMessage({ type: "freecad-project-native-request", requestId, document: owner.document, action, details }, location.origin); + }); + const designDocuments = useRef(new Set()); + const [partSnapshots, setPartSnapshots] = useState>({}); + const [designSnapshots, setDesignSnapshots] = useState>({}); + const [workbenches, setWorkbenches] = useState>(() => initialWorkbench ? { [initialDocumentId]: initialWorkbench } : {}); + const workbench = workbenches[active] ?? "Part"; + const [selectedSheets, setSelectedSheets] = useState>({}); + const [csvPanel, setCsvPanel] = useState<{ id: string; mode: "import" | "export"; selected?: string; done(result: Record): void } | null>(null); + const [sheetRanges, setSheetRanges] = useState>({}); + const sheetSelectionHistory = useRef(new Map()); + const [sheetZooms, setSheetZooms] = useState>({}); + const [sheetCells, setSheetCells] = useState>({}); + const [boxDimensions, setBoxDimensions] = useState<[number, number, number]>([10, 10, 10]); + const [committedBoxDimensions, setCommittedBoxDimensions] = useState<[number, number, number]>([10, 10, 10]); + const [primitive, setPrimitive] = useState("Cylinder"); + const [primitiveParameters, setPrimitiveParameters] = useState>({ ...primitives.Cylinder.defaults }); + const [partTaskMode, setPartTaskMode] = useState(); + const [booleanOperation, setBooleanOperation] = useState("Fuse"); + const [booleanBase, setBooleanBase] = useState(""); + const [booleanTool, setBooleanTool] = useState(""); + const [position, setPosition] = useState<[number, number, number]>([0, 0, 0]); + const [rotationAxis, setRotationAxis] = useState<[number, number, number]>([0, 0, 1]); + const [rotationAngle, setRotationAngle] = useState(0); + const [transactions, setTransactions] = useState>({}); + const [savedDocuments, setSavedDocuments] = useState([]); + // Geometry exports live in OPFS; the import panel lists them so a document + // never has to leave OPFS just to be opened again. + const [opfsExports, setOpfsExports] = useState([]); + const [opfsExportName, setOpfsExportName] = useState(""); + const [savedDocument, setSavedDocument] = useState(""); + const [viewCommand, setViewCommand] = useState(""); + const [developerMode, setDeveloperMode] = useState(false); + const [workspaceTask, setWorkspaceTask] = useState(""); + const [importCommand, setImportCommand] = useState(null); + const [importFile, setImportFile] = useState(null); + const [replaceImport, setReplaceImport] = useState(false); + useEffect(() => { setImportCommand(null); setImportFile(null); setReplaceImport(false); }, [active]); + const [treeWidth, setTreeWidth] = useState(240); + const [propertyWidth, setPropertyWidth] = useState(300); + const [propertyColumnWidth, setPropertyColumnWidth] = useState(() => { + try { + const value = Number(window.localStorage.getItem("freecad.propertyEditor.firstColumnWidth")); + return Number.isFinite(value) && value >= 72 ? value : null; + } catch { return null; } + }); + useEffect(() => { setWorkspaceTask(""); setViewCommand(""); }, [active]); + const nextDocumentNumber = useRef(3); + const incomingFile = useRef(new URLSearchParams(window.location.search).get("fcstd")); + const incomingStarted = useRef(false); + const exporter = useMemo(() => new ExportService(store), [store]); + useEffect(() => () => router.dispose(), [router]); + useEffect(() => { + if (viewportRef.current) renderBridge.mount(viewportRef.current, navigationPreferenceSource(router, () => ({ + owner: "DocumentProbe", documentId: nativeName(store.currentDocumentId ?? initialDocumentId), + }))); + return () => renderBridge.dispose(); + }, [renderBridge, router, store, initialDocumentId]); + useEffect(() => { + const receive = (event: Event) => { + const detail = (event as CustomEvent<{ owner: string; documentId: string; value: { framing?: { bounds: number[] | null; rotation?: number[] } } }>).detail; + if (detail?.owner !== "DocumentProbe" || !detail.value?.framing) return; + const currentId = store.currentDocumentId; + if (!currentId || nativeName(currentId) !== detail.documentId) return; + renderBridge.applyFraming(currentId, detail.value.framing); + }; + window.addEventListener("freecad-document-framing", receive); + return () => window.removeEventListener("freecad-document-framing", receive); + }, [renderBridge, store]); + useEffect(() => { const stage = document.querySelector("[data-developer-panel]"); if (!stage || !developerMode) return; const previous = stage.querySelector("[data-queue-recovery]"); previous?.remove(); return mountQueueRecoveryPanel(stage, store, recovery, () => setRecoveryVersion((value) => value + 1)); }, [recovery, recoveryVersion, store, developerMode]); + const nativeName = (id: string) => openScadDocuments.current.get(id)?.documentId ?? testDocuments.current.get(id)?.documentName ?? remoteOwners.current.get(id)?.document ?? `web_${id.replace(/\W/g, "_")}`; + const refresh = () => setDocuments(store.list()); + const currentDocument = documents.find(document => document.id === active); + const objects = Object.values(currentDocument?.objects ?? {}); + const treeNodes = useMemo(() => objects.map(object => { + const label = String(object.properties.Label ?? object.id); + const iconSlug = object.type.startsWith("PartDesign::") ? `PartDesign_${object.type.replace("PartDesign::", "")}` + : object.type === "Sketcher::SketchObject" ? "" : "Part_3D_object"; + const icon = object.type === "Sketcher::SketchObject" ? "/icons/part/Sketcher_NewSketch.svg" : `/icons/partdesign/${iconSlug}.svg`; + return { + id: object.id, + label, + internalName: String(object.properties.NativeName ?? object.id), + description: object.type, + type: object.type, + icon, + visible: object.properties.Visibility !== false, + toggleable: true, + children: [], + }; + }), [objects]); + const selectedObject = objects.find(object => object.id === selectedObjects[active]); + // Placement readout: the viewport bar and the Properties panel both show the + // selected object's position and Euler XYZ degrees, derived from the native + // snapshot's axis/angle so imported solids read correctly too. + const placementSnapshot = useMemo(() => { + const properties = selectedObject?.properties ?? {}; + const position = Array.isArray(properties.position) && properties.position.length === 3 + ? (properties.position as number[]).map(value => Number(value) || 0) as [number, number, number] : [0, 0, 0] as [number, number, number]; + const rotation = properties.rotation as { axis?: number[]; angle?: number } | undefined; + const primitive = properties.primitivePlacement as { axis?: number[]; angle?: number } | undefined; + const axis = Array.isArray(rotation?.axis) && rotation.axis.length === 3 ? rotation.axis + : Array.isArray(primitive?.axis) ? primitive.axis : [0, 0, 1]; + const angle = typeof rotation?.angle === "number" ? rotation.angle : typeof primitive?.angle === "number" ? primitive.angle : 0; + return { position, euler: roundDegrees(eulerFromAxisAngle(axis, angle)) }; + }, [selectedObject?.id, JSON.stringify(selectedObject?.properties.position), JSON.stringify(selectedObject?.properties.rotation), JSON.stringify(selectedObject?.properties.primitivePlacement)]); + const placementXyz = placementSnapshot.position; + const placementEuler = placementSnapshot.euler; + // Strict probe hook: every object's placement, so a test can prove that a drag + // touched only the selected object and left the rest byte-identical. + useEffect(() => { + (window as unknown as { __freecadPlacements?: unknown }).__freecadPlacements = Object.fromEntries(objects + .filter(object => object.properties.NativeName) + .map(object => { + const position = Array.isArray(object.properties.position) ? object.properties.position as number[] : [0, 0, 0]; + const rotation = object.properties.rotation as { axis?: number[]; angle?: number } | undefined; + const primitive = object.properties.primitivePlacement as { axis?: number[]; angle?: number } | undefined; + const axis = Array.isArray(rotation?.axis) ? rotation.axis : Array.isArray(primitive?.axis) ? primitive.axis : [0, 0, 1]; + const angle = typeof rotation?.angle === "number" ? rotation.angle : typeof primitive?.angle === "number" ? primitive.angle : 0; + return [String(object.properties.NativeName), { + position: position.map(value => Math.round(value * 1000) / 1000), + euler: roundDegrees(eulerFromAxisAngle(axis, angle)), + }]; + })); + }, [JSON.stringify(objects.map(object => [object.id, object.properties.NativeName, object.properties.position, object.properties.rotation, object.properties.primitivePlacement]))]); + // The local frame is read-only unless the user deliberately unlocks it. A + // locked frame still draws the triad and focus box, but the gizmo is not + // attached, so a stray drag can never rewrite the object's placement. + const [frameLocked, setFrameLocked] = useState(true); + const [frameEditor, setFrameEditor] = useState<{ object: string; position: [number, number, number]; euler: [number, number, number] } | null>(null); + useEffect(() => { + (window as unknown as { __freecadPlacementReadout?: unknown }).__freecadPlacementReadout = selectedObject?.properties.NativeName ? { + object: String(selectedObject.properties.NativeName), + position: placementXyz.map(value => Math.round(value * 1000) / 1000), + euler: placementEuler.map(value => Math.round(value * 100) / 100), + mode: transformMode, + locked: frameLocked, + } : null; + }, [selectedObject?.id, placementXyz[0], placementXyz[1], placementXyz[2], placementEuler[0], placementEuler[1], placementEuler[2], transformMode, frameLocked]); + const selectedPrimitive = selectedObject?.properties.primitive as PartPrimitive | undefined; + const selectedPrimitiveDefinition = selectedPrimitive && Object.hasOwn(primitives, selectedPrimitive) ? primitives[selectedPrimitive] : undefined; + const compoundSelection = (compoundSelections[active] ?? (selectedObject?.properties.NativeName ? [String(selectedObject.properties.NativeName)] : [])) + .filter(name => partSnapshots[active]?.objects?.some(item => item.name === name && !item.empty && item.topology)); + const quickMeasureSelection: MeasureSelection[] = (compoundSelection.length ? compoundSelection : selectedObject?.properties.NativeName ? [String(selectedObject.properties.NativeName)] : []) + .slice(0, 100).map(object => ({ documentId: nativeName(active), object })); + const chooseCompoundSources = (names: string[]) => { + const next = [...new Set(names)]; + setCompoundSelections(previous => ({ ...previous, [active]: next })); + setSelectedObjects(previous => ({ ...previous, [active]: next.length ? `native:${next[next.length - 1]}` : null })); + }; + const selectPrimaryObject = (objectId: string | null, additive = false) => { + if (importing) return; + if (workspaceTask === "measure-mass-properties" && objectId) { + const name = objects.find(o => o.id === objectId)?.properties.NativeName; + if (typeof name === "string") setMeasureSelection(rows => rows.some(r => r.object === name) ? rows : [...rows, { documentId: nativeName(active), object: name }]); + return; + } + if (workspaceTask === "measure-distance" && objectId) { + const name = objects.find(o => o.id === objectId)?.properties.NativeName; + if (typeof name === "string") setMeasureSelection(rows => [...rows, { documentId: nativeName(active), object: name }]); + return; + } + const chosen = objects.find(item => item.id === objectId); + if (chosen?.type === "Spreadsheet::Sheet") { + setSelectedSheets(previous => ({ ...previous, [active]: chosen.id })); + setWorkbenches(previous => ({ ...previous, [active]: "Spreadsheet" })); + } + const name = chosen?.properties.NativeName; + if (workbench === "Part" && (workspaceTask === "compound" || workspaceTask === "compound-filter" || workspaceTask === "explode-compound" || workspaceTask === "join" || workspaceTask === "split" || workspaceTask === "make-face" || workspaceTask === "make-solid" || workspaceTask === "reverse-shapes" || workspaceTask === "section" || additive) && typeof name === "string") { + // Selection lists are additive: a controlled react-arborist selection can + // echo onSelect back for the same id, and a toggle would cancel itself. + // Deselecting is done with the task's own checkboxes. + chooseCompoundSources(compoundSelection.includes(name) ? compoundSelection : [...compoundSelection, name]); + } else { + setCompoundSelections(previous => { const next = { ...previous }; delete next[active]; return next; }); + setSelectedObjects(previous => ({ ...previous, [active]: objectId })); + } + }; + const partObjects = objects.filter(object => object.properties.NativeName && object.type.startsWith("Part::")); + useEffect(() => { if (isOpfsSupported()) void listDocumentFiles().then(files => { setSavedDocuments(files); window.dispatchEvent(new Event("freecad-document-persistence")); }).catch(error => setStatus(String(error))); }, []); + useLayoutEffect(() => { + const dimensions = selectedObject?.properties.dimensions; + if (Array.isArray(dimensions) && dimensions.length === 3) { + const committed = [...dimensions] as [number, number, number]; + setBoxDimensions(committed); + setCommittedBoxDimensions(committed); + } + }, [selectedObject?.id, JSON.stringify(selectedObject?.properties.dimensions)]); + useLayoutEffect(() => { + const value = selectedObject?.properties.primitive as PartPrimitive | undefined; + if (value && Object.hasOwn(primitives, value) && selectedObject?.properties.parameters) { + setPrimitive(value); + setPrimitiveParameters({ ...selectedObject.properties.parameters as Record }); + } + }, [selectedObject?.id, JSON.stringify(selectedObject?.properties.parameters)]); + useLayoutEffect(() => { + setPosition(selectedObject?.properties.position ? [...selectedObject.properties.position as [number, number, number]] : [0, 0, 0]); + // Snapshot rotation is authoritative: a gizmo drag writes Placement, which + // shows up as properties.rotation for every feature, not only primitives. + const placement = selectedObject?.properties.primitivePlacement as { axis?: number[]; angle?: number } | undefined; + const rotation = selectedObject?.properties.rotation as { axis?: number[]; angle?: number } | undefined; + const axis = Array.isArray(rotation?.axis) && rotation.axis.length === 3 ? rotation.axis : placement?.axis; + const angle = typeof rotation?.angle === "number" ? rotation.angle : placement?.angle; + setRotationAxis(Array.isArray(axis) && axis.length === 3 ? [...axis as [number, number, number]] : [0, 0, 1]); + setRotationAngle(typeof angle === "number" ? angle : 0); + if (selectedObject?.properties.operation) { + setBooleanOperation(selectedObject.properties.operation as PartBoolean); + setBooleanBase(String(selectedObject.properties.base)); setBooleanTool(String(selectedObject.properties.tool)); + } + }, [active, selectedObject?.id, JSON.stringify(selectedObject?.properties.position), JSON.stringify(selectedObject?.properties.rotation), JSON.stringify(selectedObject?.properties.primitivePlacement), selectedObject?.properties.base, selectedObject?.properties.tool]); + useEffect(() => { + const names = partObjects.map(object => String(object.properties.NativeName)); + if (!names.includes(booleanBase)) setBooleanBase(names[0] ?? ""); + if (!names.includes(booleanTool)) setBooleanTool(names[1] ?? ""); + }, [active, JSON.stringify(partObjects.map(object => object.id)), booleanBase, booleanTool]); + const allocateDocumentId = () => { + // Navigation and restored checkpoints can already own counter-generated + // names. Avoid both project ID and sanitized native-name collisions. + const reserved = new Set([...store.list().map(document => document.id), + ...nativeDocuments.current, ...designDocuments.current].map(nativeName)); + let id: string; + do { id = `project-document-${nextDocumentNumber.current++}`; } while (reserved.has(nativeName(id))); + return id; + }; + const validateRequestDocument = (id: string, document: string | undefined) => { + if (document !== undefined && document !== nativeName(id)) { + throw new Error("The modeling request belongs to a different document"); + } + }; + const designRequest = async (id: string, action: DesignPayload["action"], details: Partial = {}) => { + validateRequestDocument(id, details.document); + if (!designDocuments.current.has(id)) throw new Error("The active document is not owned by the modeling workspace"); + const reply = remoteOwners.current.has(id) + ? { kind: "result" as const, result: await remoteRequest(id, action, details) } + : await router.request("PartDesign", PARTDESIGN_DOCUMENT_COMMAND, + { ...details, schema: PARTDESIGN_DOCUMENT_SCHEMA, module: "PartDesign", document: nativeName(id), action, includeMesh: details.includeMesh ?? true }, id); + if (reply.kind === "error") throw new Error(`${reply.error.code}: ${reply.error.message}`); + const result = reply.result as DesignResult; + if (result.document !== nativeName(id)) throw new Error("Native modeling response belongs to a different document"); + if (action === "create" || action === "open") nativeDocuments.current.add(id); + if (action === "close") { + nativeDocuments.current.delete(id); designDocuments.current.delete(id); remoteOwners.current.delete(id); + setDesignSnapshots(previous => { const next = { ...previous }; delete next[id]; return next; }); + } + return result; + }; + const jtRequest = async (id: string, action: JtReaderDocumentPayload["action"], details: Partial = {}) => { + const reply = await router.request("JtReader", JTREADER_DOCUMENT_COMMAND, { + ...details, schema: JTREADER_DOCUMENT_SCHEMA, module: "JtReader", document: nativeName(id), action, + }, id); + if (reply.kind === "error") throw new Error(`${reply.error.code}: ${reply.error.message}`); + const result = reply.result as PartDocumentResult; + if (action === "openJt" || action === "open" || action === "insertJt" || action === "insertInventor") { + // Retain the JT facade as the placement owner even when the native + // document was opened by Part or PartDesign. The JT worker keeps the + // Inventor object transaction alongside the retained owner document. + jtDocuments.current.add(id); nativeDocuments.current.add(id); + } + if (action === "close" || action === "cancelOpen") { jtDocuments.current.delete(id); nativeDocuments.current.delete(id); } + return result; + }; + const nativeOwnerRequest = async (id: string, action: PartDocumentAction, details: Partial = {}) => { + validateRequestDocument(id, details.document); + if (openScadDocuments.current.has(id)) { + const mapped = action === "snapshot" ? "read" : action; + if (!["read", "save", "close", "undo", "redo"].includes(mapped)) + throw new Error(`Use the OpenSCAD document controls for ${action}`); + return openScadDocumentSnapshot(await openScadRequest(id, mapped as OpenScadFileArgs["action"])); + } + const testOwner = testDocuments.current.get(id); + if (testOwner) { + const mapped = action === "snapshot" ? "read" : action; + if (!["read", "save", "close", "undo", "redo"].includes(mapped)) + throw new Error(`Use the Test scene controls for ${action}`); + const result = await requestTestScene(router, id, testOwner.command, { action: mapped }); + if (result.closed) { testDocuments.current.delete(id); nativeDocuments.current.delete(id); } + setTestRevision(value => value + 1); + return sceneDocumentSnapshot(result); + } + // A JT capability may be retained alongside a Part or PartDesign owner + // after Inventor insertion. Route only JT placement/source operations to + // that capability; ordinary workbench commands stay with the native owner. + const jtAction = new Set([ + "decodeJt", "insertJt", "insertInventor", "acceptInsert", "cancelInsert", + "beginPlacement", "previewPlacement", "applyPlacement", "acceptPlacement", + "cancelPlacement", "restorePlacement", "openJt", "acceptOpen", "cancelOpen", + ]); + if (jtDocuments.current.has(id) && jtAction.has(action)) { + const { schema: _schema, module: _module, action: _action, ...jtDetails } = details; + return jtRequest(id, action as JtReaderDocumentPayload["action"], { ...jtDetails, + displayProperties: action === "save" ? details.displayProperties ?? Object.values(store.list().find(value => value.id === id)?.objects ?? {}) + .filter(object => object.properties.NativeName).map(object => ({ object: String(object.properties.NativeName), visible: object.properties.Visibility !== false, + color: String(object.properties.Color ?? "#73c6d4"), properties: Object.fromEntries(Object.entries(object.properties).filter(([key]) => key !== "NativeName")) })) : undefined }); + } + if (remoteOwners.current.has(id)) { + const owner = remoteOwners.current.get(id)!; + const mapped = owner.module === "PartDesign" && action === "exportShape" ? "export" : action; + const result = await remoteRequest(id, mapped, details); + if (action === "close") { nativeDocuments.current.delete(id); designDocuments.current.delete(id); remoteOwners.current.delete(id); } + return result; + } + if (designDocuments.current.has(id)) { + const supported: Record = { create: "create", open: "open", close: "close", save: "save", + createDatum: "createDatum", editDatum: "editDatum", setDisplayMode: "setDisplayMode", + materialAssignment: "materialAssignment", insertTestFeature: "insertTestFeature", snapshot: "snapshot", massProperties: "massProperties", measureDistance: "measureDistance", undo: "undo", redo: "redo", remove: "remove", exportShape: "export", + insertRowsBefore: "insertRowsBefore", insertRowsAfter: "insertRowsAfter", insertColumnsBefore: "insertColumnsBefore", insertColumnsAfter: "insertColumnsAfter", removeRows: "removeRows", removeColumns: "removeColumns", + completeSheetReference: "completeSheetReference", importSheetCsv: "importSheetCsv", exportSheetCsv: "exportSheetCsv", createSheet: "createSheet", cancelSheetClipboard: "cancelSheetClipboard", copySheetCells: "copySheetCells", cutSheetCells: "cutSheetCells", pasteSheetCells: "pasteSheetCells", clearSheetCells: "clearSheetCells", mergeSheetCells: "mergeSheetCells", splitSheetCell: "splitSheetCell", setSheetSectionSize: "setSheetSectionSize", setSheetProperties: "setSheetProperties", recomputeSheetCells: "recomputeSheetCells", setSheetStyle: "setSheetStyle", setSheetCell: "setSheetCell", recompute: "recompute", + importShape: "importShape", finishImport: "finishImport", sketcherCommand: "sketcherCommand" }; + const designAction = supported[action]; + if (!designAction) throw new Error(`Use Sketcher or PartDesign to edit this document; ${action} is not connected for its native owner`); + return await designRequest(id, designAction, details as Partial) as PartDocumentResult; + } + const displayProperties = action === "save" ? details.displayProperties ?? Object.values(store.list().find(value => value.id === id)?.objects ?? {}) + .filter(object => object.properties.NativeName).map(object => ({ object: String(object.properties.NativeName), + color: String(object.properties.Color ?? "#73c6d4"), visible: object.properties.Visibility !== false })) : undefined; + const result = await router.request("Part", PART_DOCUMENT_COMMAND, { ...details, schema: PART_DOCUMENT_SCHEMA, module: "Part", document: nativeName(id), action, builderInfo: true, includeMesh: details.includeMesh ?? true, displayProperties }, id); + if (result.kind === "error") throw new Error(`${result.error.code}: ${result.error.message}`); + if (action === "create" || action === "open") nativeDocuments.current.add(id); + if (action === "close") nativeDocuments.current.delete(id); + return result.result as PartDocumentResult; + }; + const showLifecycle = async (payload: ShowDocumentLifecyclePayload) => { + const response = await router.request("Show", SHOW_DOCUMENT_LIFECYCLE_COMMAND, payload, payload.documentId); + if (response.kind === "error") throw new Error(response.error.message); + return response.result as ShowDocumentLifecycleResult; + }; + const savingDocuments = useRef(new Set()); + const nativeRequest = async (id: string, action: PartDocumentAction, details: Partial = {}): Promise => { + if (savingDocuments.current.has(id)) throw new Error("This document is being saved"); + if (action === "close") { + const result = await nativeOwnerRequest(id, action, details); + await showLifecycle({ documentId: id, action: "delete" }); + return result; + } + // Documents opened by the parent workbench already own their native + // lifetime there. The project workspace must not start a separate Show + // lifecycle for them before saving; route the FCStd save directly through + // the retained parent owner. + if (action === "save" && remoteOwners.current.has(id)) + return nativeOwnerRequest(id, action, details); + if (action !== "save") return nativeOwnerRequest(id, action, details); + savingDocuments.current.add(id); + const token = crypto.randomUUID(); + try { + const displayProperties = Object.values(store.list().find(value => value.id === id)?.objects ?? {}) + .filter(object => object.properties.NativeName).map(object => ({ object: String(object.properties.NativeName), + color: String(object.properties.Color ?? "#73c6d4"), visible: object.properties.Visibility !== false, + properties: Object.fromEntries(Object.entries(object.properties).filter(([key]) => key !== "NativeName")) })); + const persistence = await showLifecycle({ documentId: id, action: "startSave", token, displayProperties }); + return await nativeOwnerRequest(id, action, { ...details, includeMesh: false, displayProperties: persistence.displayProperties?.map(value => ({ + ...value, color: value.color ?? displayProperties.find(item => item.object === value.object)?.color ?? "#73c6d4", + visible: value.visible ?? displayProperties.find(item => item.object === value.object)?.visible ?? true, + })) }); + } finally { + try { await showLifecycle({ documentId: id, action: "finishSave", token }); } + finally { savingDocuments.current.delete(id); } + } + }; + const refreshPartSnapshot = async () => { + if (!active) return; + const result = await nativeRequest(active, "snapshot", { includeMesh: true, builderInfo: true }); + applyNativeDocument(active, result, false); + }; + const applyNativeDocument = (id: string, result: PartDocumentResult, dirty = true, metadataOnly = false) => { + const document = store.list().find(value => value.id === id); + if (!document || !result.objects) return; + setCompoundSelections(previous => previous[id] ? { ...previous, [id]: previous[id].filter(name => result.objects!.some(item => item.name === name && !item.empty && item.topology)) } : previous); + if (!designDocuments.current.has(id)) setPartSnapshots(previous => ({ ...previous, [id]: result })); + if (designDocuments.current.has(id)) setDesignSnapshots(previous => { + const incoming = result as DesignResult; + const cached = previous[id]; + if (!metadataOnly || incoming.document !== nativeName(id) || cached?.document !== incoming.document) { + return { ...previous, [id]: incoming }; + } + const cachedObjects = new Map(cached.objects?.map(object => [object.name, object])); + // Only an explicitly metadata-only response may reuse display data. + // Iterate the new object list so deleted objects cannot survive a save. + return { ...previous, [id]: { ...incoming, objects: incoming.objects?.map(object => { + const prior = cachedObjects.get(object.name); + if (!prior || prior.type !== object.type) return object; + return { ...object, mesh: object.mesh ?? prior.mesh, + faceCount: object.faceCount ?? prior.faceCount, edgeCount: object.edgeCount ?? prior.edgeCount }; + }) } }; + }); + const nextObjects = Object.fromEntries(Object.entries(document.objects).filter(([, object]) => !object.properties.NativeName)); + const nativeIds = new Set(result.objects.map(object => `native:${object.name}`)); + renderBridge.setMeasurements(id, result.objects); + const referenced = new Set(result.objects.flatMap(object => object.type.startsWith("Measure::") || object.type === "App::DocumentObjectGroup" || object.type === "App::Part" ? [] + : object.dependencies ?? [object.base, object.tool, ...(object.tools ?? []), ...(object.links ?? [])].filter(Boolean))); + const previouslyReferenced = new Set(Object.values(document.objects).flatMap(object => object.type.startsWith("Measure::") || object.type === "App::DocumentObjectGroup" || object.type === "App::Part" ? [] + : object.links.map(link => String(document.objects[link]?.properties.NativeName ?? "")))); + for (const object of Object.values(document.objects)) { + if (object.properties.NativeName && !nativeIds.has(object.id)) renderBridge.scenes.remove(id, object.id); + } + for (const object of result.objects) { + const objectId = `native:${object.name}`; + if (object.type === "Spreadsheet::Sheet") { + const key = `${id}:${objectId}`; + const previous = document.objects[objectId]?.properties.sheetStructure as SheetStructure | undefined; + const structure = (object as unknown as { sheetStructure?: SheetStructure }).sheetStructure ?? { rows: 30, columns: 8 }; + let selection = { cell: sheetCells[key] ?? "A1", ranges: sheetRanges[key] ?? "" }; + if (!previous || previous.revision !== structure.revision) { + if (previous) sheetSelectionHistory.current.set(`${key}:${previous.revision ?? ""}`, selection); + selection = sheetSelectionHistory.current.get(`${key}:${structure.revision ?? ""}`) + ?? (structure.selection ? { cell: structure.selection.cell, ranges: structure.selection.ranges.join(",") } : selection); + } + const clamp = (value: string) => { const [c, r] = sheetCoordinate(value); return `${sheetColumn(Math.max(1, Math.min(c, structure.columns)))}${Math.max(1, Math.min(r, structure.rows))}`; }; + const spans = (object as unknown as { sheetSpans?: { address: string; rows: number; columns: number }[] }).sheetSpans ?? []; + const selectedCell = clamp(selection.cell), [column, row] = sheetCoordinate(selectedCell); + const span = spans.find(value => { const [c, r] = sheetCoordinate(value.address); return column >= c && column < c + value.columns && row >= r && row < r + value.rows; }); + setSheetCells(prior => ({ ...prior, [key]: span?.address ?? selectedCell })); + setSheetRanges(prior => ({ ...prior, [key]: selection.ranges ? selection.ranges.split(",").map(range => { + const [first, last = first] = range.split(":").map(clamp).map(sheetCoordinate); + let [left, top] = first, [right, bottom] = last, changed = true; + while (changed) { + changed = false; + for (const value of spans) { + const [c, r] = sheetCoordinate(value.address), endColumn = c + value.columns - 1, endRow = r + value.rows - 1; + if (c > right || endColumn < left || r > bottom || endRow < top) continue; + if (c < left || endColumn > right || r < top || endRow > bottom) { + left = Math.min(left, c); right = Math.max(right, endColumn); top = Math.min(top, r); bottom = Math.max(bottom, endRow); changed = true; + } + } + } + return `${sheetColumn(left)}${top}:${sheetColumn(right)}${bottom}`; + }).join(",") : "" })); + } + + // Keep the native document semantics when another workbench supplies a + // snapshot. Body/Tip, sketch constraints and feature profiles must survive + // the primary shell's projection into the project session. Mesh buffers + // belong to the render bridge and must not inflate persisted properties. + const owner = (result as DesignResult).objects?.find(value => value.type === "PartDesign::Body" && value.name === (object as { body?: string }).body); + const tipVisibility = owner && object.type.startsWith("PartDesign::") && (object.volume ?? 0) > 0 + && document.objects[`native:${owner.name}`]?.properties.tip !== owner.tip + ? object.name === owner.tip : undefined; + const nativeProperties = Object.fromEntries(Object.entries(object).filter(([key]) => key !== "mesh")); + nextObjects[objectId] = { id: objectId, module: openScadDocuments.current.has(id) ? "OpenSCAD" : jtDocuments.current.has(id) ? "JtReader" : designDocuments.current.has(id) ? "PartDesign" : "Part", + command: openScadDocuments.current.has(id) ? "openscad.pythonFamilyBatch" : jtDocuments.current.has(id) ? JTREADER_DOCUMENT_COMMAND : designDocuments.current.has(id) ? PARTDESIGN_DOCUMENT_COMMAND : PART_DOCUMENT_COMMAND, type: object.type, + links: [...new Set(object.dependencies ?? [object.base, object.tool, ...(object.tools ?? []), ...(object.links ?? [])].filter((name): name is string => Boolean(name)))].map(name => `native:${name}`), properties: { + ...document.objects[objectId]?.properties, ...nativeProperties, ...(object as unknown as { testProperties?: Record }).testProperties, NativeName: object.name, Label: object.label, + cells: (object as unknown as { cells?: SheetCell[] }).cells, + usedRange: (object as unknown as { usedRange?: string }).usedRange, + dimensions: object.dimensions, volume: object.volume, SourceFile: `${nativeName(id)}.FCStd`, + primitive: object.primitive, parameters: object.parameters, + primitiveExpressions: object.primitiveExpressions, primitivePlacementExpressions: object.primitivePlacementExpressions, + operation: object.operation, base: object.base, tool: object.tool, tools: object.tools, position: object.position, + sliceProperties: object.sliceProperties, + Color: object.appearance ? object.displayColor : document.objects[objectId]?.properties.Color ?? object.displayColor ?? "#73c6d4", + Visibility: tipVisibility ?? (referenced.has(object.name) !== previouslyReferenced.has(object.name) + ? (document.objects[objectId] ? !referenced.has(object.name) : object.displayVisibility ?? !referenced.has(object.name)) + : document.objects[objectId]?.properties.Visibility ?? object.displayVisibility ?? !referenced.has(object.name)), + faceCount: object.faceCount ?? object.mesh?.faceCount ?? document.objects[objectId]?.properties.faceCount, + bounds: object.mesh?.bounds ?? document.objects[objectId]?.properties.bounds, + triangleCount: object.mesh?.triangleCount ?? document.objects[objectId]?.properties.triangleCount, + } }; + const mesh = documentObjectMesh(object); + if (mesh) renderBridge.scenes.add(id, objectId, mesh); + else if (object.empty) renderBridge.scenes.remove(id, objectId); + } + store.set({ ...document, objects: nextObjects, revision: document.revision + 1, dirty }); + setTransactions(previous => ({ ...previous, [id]: { undo: result.undoCount ?? 0, redo: result.redoCount ?? 0 } })); + setSelectedObjects(previous => { + const selected = previous[id]; + if ((!selected || !nextObjects[selected]) && workbenches[id] === "Spreadsheet") { + const restored = nextObjects[selectedSheets[id]] ?? Object.values(nextObjects).find(object => object.type === "Spreadsheet::Sheet"); + return { ...previous, [id]: restored?.id ?? null }; + } + return selected && !nextObjects[selected] ? { ...previous, [id]: null } : previous; + }); + setNativeBytes(null); refresh(); + }; + const [sheetPropertiesRequest, setSheetPropertiesRequest] = useState<{ token: string; aliasOnly: boolean; done: (result: Record) => void } | null>(null); + const createSheet = async (requestedId?: string, remoteModule?: "Part" | "PartDesign", command = "Spreadsheet_CreateSheet", requestedSheet?: string, requestedRanges?: string[], cancelled?: boolean, materialAssignment?: Record, cellProperties?: import("./spreadsheet-sheet-editor.js").SheetProperties) => { + if (importing || csvPanel || workspaceTask || viewCommand) throw new Error("Finish the active task first"); + let id = requestedId ? store.list().find(document => document.id === requestedId || nativeName(document.id) === requestedId)?.id : active; + if (!id && requestedId && (remoteModule || nativeDocuments.current.size === 0)) id = requestedId; + if (!id) throw new Error("Select an open project document, or supply its actual runtimeOwner for editing"); + setImporting(true); + try { + if (command === "Test_InsertFeature" && cancelled) throw new Error("Insertion cancelled"); + if (command === "Test_InsertFeature" && remoteModule && requestedId) { + const existing = [...remoteOwners.current].find(([, owner]) => owner.module === remoteModule && owner.document === requestedId); + if (existing) id = existing[0]; + else if (nativeDocuments.current.has(id)) id = `native-owner-${remoteModule}-${crypto.randomUUID()}`; + } + if (remoteModule && requestedId && !nativeDocuments.current.has(id)) { + remoteOwners.current.set(id, { document: requestedId, module: remoteModule }); + if (remoteModule === "PartDesign") designDocuments.current.add(id); + try { + const snapshot = await nativeRequest(id, "snapshot"); + nativeDocuments.current.add(id); store.open(id, id); applyNativeDocument(id, snapshot, false); + if (command === "Test_InsertFeature") { + if (active) store.switchTo(active); + else { setActive(id); renderBridge.activateDocument(id); setStartVisible(false); } + } + } catch (error) { remoteOwners.current.delete(id); designDocuments.current.delete(id); throw error; } + } + if (command === "Show_Clipping") { + if (!store.list().some(document => document.id === id)) throw new Error("Open a document before clipping"); + store.switchTo(id); setActive(id); setStartVisible(false); setShowClippingOpen(true); + const selected = (requestedRanges ?? []).map(name => `native:${name}`); + setCompoundSelections(previous => ({ ...previous, [id!]: selected })); + setSelectedObjects(previous => ({ ...previous, [id!]: selected[0] ?? null })); + renderBridge.activateDocument(id); refresh(); + return { documentId: id, clipping: true }; + } + if (command === "Std_SetMaterial" || command === "Std_SetAppearance") { + if (!nativeDocuments.current.has(id)) throw new Error("Select an open modeling document"); + const result = await nativeRequest(id, "materialAssignment", { materialAssignment }); + if (result.materialAssignment?.documentChanged) applyNativeDocument(id, result); + return result; + } + if (command === "Test_InsertFeature") { + if (!nativeDocuments.current.has(id) || jtDocuments.current.has(id)) throw new Error("Select an open Part or PartDesign document"); + const result = await nativeRequest(id, "insertTestFeature", { cancelled }); + applyNativeDocument(id, result); + return { ...result, owner: designDocuments.current.has(id) ? "PartDesign" : "DocumentProbe" }; + } + if (command === "Spreadsheet_SetAlias" || command.startsWith("Spreadsheet_Align")) { + if (cancelled) return { cancelled: true }; + requestedSheet = requestedSheet ?? selectedObjects[id]?.replace(/^native:/, ""); + const selectionKey = `${id}:native:${requestedSheet}`; + requestedRanges = requestedRanges?.length ? requestedRanges : (sheetRanges[selectionKey] || sheetCells[selectionKey] || "A1").split(","); + if (!requestedSheet) throw new Error("Select a sheet in this document"); + if (command === "Spreadsheet_SetAlias") { + const [first, last] = requestedRanges[0].split(":"); + if (requestedRanges.length !== 1 || (last && first !== last)) throw new Error("Select exactly one cell to set an alias"); + } + store.switchTo(id); setActive(id); + setSelectedObjects(previous => ({ ...previous, [id!]: `native:${requestedSheet}` })); + setSelectedSheets(previous => ({ ...previous, [id!]: `native:${requestedSheet}` })); + setWorkbenches(previous => ({ ...previous, [id!]: "Spreadsheet" })); + setSheetRanges(previous => ({ ...previous, [selectionKey]: requestedRanges!.join(",") })); + setSheetCells(previous => ({ ...previous, [selectionKey]: requestedRanges![0].split(":")[0] })); + if (command === "Spreadsheet_SetAlias" && !cellProperties) { + applyNativeDocument(id, await nativeRequest(id, "snapshot", { includeMesh: false })); + setImporting(false); + return await new Promise>(done => setSheetPropertiesRequest({ token: crypto.randomUUID(), aliasOnly: true, done })); + } + const alignment: Record = { + Spreadsheet_AlignLeft: { horizontal: "left" }, Spreadsheet_AlignCenter: { horizontal: "center" }, Spreadsheet_AlignRight: { horizontal: "right" }, + Spreadsheet_AlignTop: { vertical: "top" }, Spreadsheet_AlignVCenter: { vertical: "center" }, Spreadsheet_AlignBottom: { vertical: "bottom" }, + }; + const result = await nativeRequest(id, "setSheetProperties", { object: requestedSheet, ranges: requestedRanges, cellProperties: command === "Spreadsheet_SetAlias" ? cellProperties : alignment[command] }); + applyNativeDocument(id, result); + return { documentId: nativeName(id), objects: result.objects, runtimeOwner: "project-workspace" }; + } + if (["Spreadsheet_StyleBold", "Spreadsheet_StyleItalic", "Spreadsheet_StyleUnderline"].includes(command)) { + if (cancelled) return { cancelled: true }; + if (!requestedSheet || !requestedRanges?.length) throw new Error("Supply the selected sheet and cell ranges in this document"); + const result = await nativeRequest(id, "setSheetStyle", { object: requestedSheet, ranges: requestedRanges, style: command.replace("Spreadsheet_Style", "").toLowerCase() }); + applyNativeDocument(id, result); + store.switchTo(id); setActive(id); setStartVisible(false); + setSelectedObjects(previous => ({ ...previous, [id!]: `native:${requestedSheet}` })); + setWorkbenches(previous => ({ ...previous, [id!]: "Spreadsheet" })); + const rangeText = requestedRanges.join(","); + setSheetRanges(previous => ({ ...previous, [`${id}:native:${requestedSheet}`]: rangeText })); + return { documentId: nativeName(id), objects: result.objects, runtimeOwner: "project-workspace" }; + } + if (command === "Spreadsheet_Import" || command === "Spreadsheet_Export") { + setImporting(false); + store.switchTo(id); setActive(id); setStartVisible(false); + setWorkbenches(previous => ({ ...previous, [id!]: "Spreadsheet" })); + return await new Promise>(done => setCsvPanel({ id: id!, mode: command === "Spreadsheet_Import" ? "import" : "export", + selected: requestedSheet ?? selectedObjects[id!]?.replace(/^native:/, ""), done })); + } + if (!nativeDocuments.current.has(id)) { + await nativeRequest(id, "create"); + if (!store.list().some(document => document.id === id)) store.open(id, id); + } + const before = new Set(Object.values(store.list().find(document => document.id === id)?.objects ?? {}).map(object => String(object.properties.NativeName))); + const result = await nativeRequest(id, "createSheet", { sheetName: "Sheet" }); + const sheet = result.objects?.find(object => object.type === "Spreadsheet::Sheet" && !before.has(object.name)); + applyNativeDocument(id, result); + if (!sheet) throw new Error("Native owner did not return the created sheet"); + store.switchTo(id); setActive(id); renderBridge.activateDocument(id); refresh(); + setSelectedObjects(previous => ({ ...previous, [id!]: `native:${sheet.name}` })); + setSelectedSheets(previous => ({ ...previous, [id!]: `native:${sheet.name}` })); + setWorkbenches(previous => ({ ...previous, [id!]: "Spreadsheet" })); + setStartVisible(false); + return { documentId: nativeName(id), createdSheet: sheet.name, runtimeOwner: "project-workspace" }; + } finally { setImporting(false); } + }; + useEffect(() => { + const receive = (event: MessageEvent) => { + if (event.origin !== location.origin || event.source !== window.parent) return; + if (event.data?.type === "freecad-project-select-native-object") { + if (importing || csvPanel || workspaceTask || viewCommand) return; + const documentId = typeof event.data.documentId === "string" ? event.data.documentId : ""; + if (!documentId) return; + const existing = [...remoteOwners.current].find(([, owner]) => owner.document === documentId)?.[0] + ?? store.list().find(document => document.id === documentId || nativeName(document.id) === documentId)?.id; + const id = existing ?? documentId; + void (async () => { + if (!remoteOwners.current.has(id)) { + remoteOwners.current.set(id, { document: documentId, module: "Part" }); + nativeDocuments.current.add(id); + if (!store.list().some(document => document.id === id)) store.open(id, documentId); + const snapshot = await remoteRequest(id, "snapshot", { includeMesh: false }); + applyNativeDocument(id, snapshot, false); + // Large FCStd files need their object tree before mesh generation; + // hydrate the render scene after the workspace is interactive. + const hydrationRevision = store.list().find(document => document.id === id)?.revision; + void remoteRequest(id, "snapshot", { includeMesh: true }).then(result => { + const current = store.list().find(document => document.id === id); + if (remoteOwners.current.has(id) && current && current.revision === hydrationRevision && !current.dirty) { + applyNativeDocument(id, result, false); + renderBridge.activateDocument(id); + renderBridge.fitDocument(); + } + }).catch(error => setStatus(String(error))); + } + const objectId = event.data.object ? `native:${event.data.object}` : null; + if (objectId && !store.list().find(document => document.id === id)?.objects[objectId]) return; + store.switchTo(id); setActive(id); renderBridge.activateDocument(id); setStartVisible(false); + setSelectedObjects(previous => ({ ...previous, [id]: objectId })); refresh(); + })().catch(error => setStatus(String(error))); + return; + } + if (event.data?.type !== "freecad-create-sheet") return; + const requestId = event.data.requestId; + void createSheet(event.data.documentId, event.data.owner, event.data.command, event.data.object, event.data.ranges, event.data.cancelled, event.data.materialAssignment, event.data.cellProperties).then(result => window.parent.postMessage({ type: "freecad-sheet-created", requestId, result }, location.origin)) + .catch(error => window.parent.postMessage({ type: "freecad-sheet-created", requestId, error: String(error) }, location.origin)); + }; + window.addEventListener("message", receive); + window.parent.postMessage({ type: "freecad-project-ready" }, location.origin); + return () => window.removeEventListener("message", receive); + }, [active, importing, csvPanel, objects, workspaceTask, viewCommand]); + const createOrEditBox = async (edit: boolean) => { + if (!active || importing) return; + setImporting(true); + try { + if (!nativeDocuments.current.has(active)) await nativeRequest(active, "create"); + let name = edit ? String(selectedObject?.properties.NativeName ?? "") : "Box1"; + if (!edit) { let index = 1; while (currentDocument?.objects[`native:${name}`]) name = `Box${++index}`; } + const result = await nativeRequest(active, "setBox", { object: name, dimensions: boxDimensions }); + applyNativeDocument(active, result); + setCommittedBoxDimensions([...boxDimensions]); + setSelectedObjects(previous => ({ ...previous, [active]: `native:${name}` })); + renderBridge.activateDocument(active); renderBridge.fitDocument(); + setStatus(`${name}: ${boxDimensions.join(" × ")}`); + } catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + }; + const commitNativeLabel = async (labelValue?: string) => { + if (!selectedObject?.properties.NativeName) return; + try { applyNativeDocument(active, await nativeRequest(active, "setLabel", { object: String(selectedObject.properties.NativeName), label: labelValue ?? String(selectedObject.properties.Label ?? ""), includeMesh: false })); } + catch (error) { setStatus(String(error)); } + }; + const createFixedBox = async (boxCommand: "Part_Box" | "Part_Box2" | "Part_Box3") => { + if (!active || importing) return; + const id = active; + setImporting(true); + try { + if (!nativeDocuments.current.has(id)) await nativeRequest(id, "create"); + const result = await nativeRequest(id, "createFixedBox", { boxCommand }); + applyNativeDocument(id, result); + setSelectedObjects(previous => ({ ...previous, [id]: `native:${result.createdObject}` })); + renderBridge.activateDocument(id); renderBridge.fitDocument(); + setStatus(`${boxCommand}: ${result.createdObject}`); + } catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + }; + const createOrEditPrimitive = async (edit: boolean) => { + if (!active || importing) return; + const documentId = active; + setImporting(true); + try { + if (!nativeDocuments.current.has(documentId)) await nativeRequest(documentId, "create"); + let name = edit ? String(selectedObject?.properties.NativeName ?? "") : `${primitive}1`; + if (!edit) { let index = 1; while (currentDocument?.objects[`native:${name}`]) name = `${primitive}${++index}`; } + const result = await nativeRequest(documentId, "setPrimitive", { object: name, primitive, parameters: primitiveParameters }); + applyNativeDocument(documentId, result); + setSelectedObjects(previous => ({ ...previous, [documentId]: `native:${name}` })); + renderBridge.activateDocument(documentId); renderBridge.fitDocument(); + setStatus(`${name}: ${Object.entries(primitiveParameters).map(([key, value]) => `${key}=${value}`).join(", ")}`); + } catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + }; + const editNative = async (action: PartDocumentAction, details: Partial = {}) => { + if (!active || importing) return; + const id = active; + setImporting(true); + try { + const result = await nativeRequest(id, action, details); + applyNativeDocument(id, result); + setSelectedObjects(previous => ({ ...previous, [id]: details.object ? `native:${details.object}` + : result.objects?.some(object => `native:${object.name}` === previous[id]) ? previous[id] : null })); + renderBridge.activateDocument(id); renderBridge.fitDocument(); + setStatus(`${action}: ${details.object ?? nativeName(id)}`); + } catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + }; + const createOrEditBoolean = (edit: boolean) => { + let name = edit ? String(selectedObject?.properties.NativeName ?? "") : `${booleanOperation}1`; + if (!edit) { let index = 1; while (currentDocument?.objects[`native:${name}`]) name = `${booleanOperation}${++index}`; } + return editNative("setBoolean", { object: name, operation: booleanOperation, base: booleanBase, tool: booleanTool }); + }; + useEffect(() => { + renderBridge.setClipping(active, store.list().find(document => document.id === active)?.showClipping ?? { objects: {} }); + renderBridge.onPick = workspaceTask === "measure-distance" ? (objectId, pickedPoint) => { + if (importing) return; + const name = objects.find(o => o.id === objectId)?.properties.NativeName; + if (typeof name === "string") setMeasureSelection(rows => [...rows, { documentId: nativeName(active), object: name, pickedPoint }]); + } : null; + renderBridge.onSelect = (objectId, additive) => { + if (objectId === "cross-sections:preview") return; + selectPrimaryObject(objectId, additive); + }; + // A gizmo drag commits an absolute placement; the kernel stores position plus + // an axis-angle rotation, which is what the bridge hands back here. + renderBridge.onTransformCommit = payload => { + if (payload.documentId !== active) return; + void editNative("setPlacement", { + object: payload.object, position: payload.position, axis: payload.axis, angle: payload.angle, + } as never); + }; + for (const object of objects) { + renderBridge.scenes.update(active, object.id, { + selected: compoundSelections[active] ? compoundSelection.includes(String(object.properties.NativeName)) : object.id === selectedObjects[active], + visible: object.properties.Visibility !== false, + color: String(object.properties.Color ?? "#73c6d4"), + ...(object.properties.appearance ? (() => { + const value = object.properties.appearance as Record; + return { displayMode: ({ "Flat Lines": "flat-lines", Shaded: "shaded", Wireframe: "wireframe", Points: "points" } as const)[value.displayMode as "Shaded"] ?? "shaded", + lineWidth: value.lineWidth, pointSize: value.pointSize, lineColor: value.lineColor, pointColor: value.pointColor, lineOpacity: 1 - value.lineTransparency / 100, + creaseAngle: value.creaseAngle, showOpenEdges: value.showOpenEdges, twoSidedLighting: value.twoSidedLighting }; + })() : {}), + }); + } + // Keep the gizmo on whatever the tree selection points at. Position and + // orientation come from the native snapshot; primitives carry axis/angle. + const gizmoName = selectedObject?.properties.NativeName; + // The shell owns the mode; push it to the bridge before placing the target so + // the very first selection already shows the controller (bridge defaults off). + // A locked local frame forces the controller off while keeping the triad and + // the selection focus visible: the model's local frame is never moved by a + // stray drag, only by the dedicated frame editor. + const effectiveMode = frameLocked ? "off" : transformMode; + renderBridge.setTransformMode(effectiveMode); + if (typeof gizmoName === "string" && gizmoName) { + const snapshotPosition = Array.isArray(selectedObject?.properties.position) ? selectedObject.properties.position as number[] : [0, 0, 0]; + const placement = selectedObject?.properties.primitivePlacement as { position?: number[]; axis?: number[]; angle?: number } | undefined; + const rotation = selectedObject?.properties.rotation as { axis?: number[]; angle?: number } | undefined; + // Prefer the snapshot rotation so a committed drag keeps the gizmo aligned + // with the object instead of snapping back to the unrotated frame. + renderBridge.setTransformTarget(active, gizmoName, + Array.isArray(placement?.position) ? placement.position : snapshotPosition, + Array.isArray(rotation?.axis) ? rotation.axis : placement?.axis, + typeof rotation?.angle === "number" ? rotation.angle : placement?.angle, + selectedObject?.id); + } else renderBridge.clearTransformTarget(); + (window as unknown as { __freecadSelectionFrameState?: unknown }).__freecadSelectionFrameState = renderBridge.selectionFrameSnapshot(); + return () => { renderBridge.onSelect = null; renderBridge.onPick = null; renderBridge.onTransformCommit = null; }; + }, [active, documents, renderBridge, selectedObjects, compoundSelections, workspaceTask, importing, workbench, transformMode, frameLocked]); + const openJtFile = async (file: File) => { + if (importing || importCancellation.current) throw new Error("Finish the active file operation first"); + const id = allocateDocumentId(), previous = active; + const cancellation = new AbortController(); importCancellation.current = cancellation; + setImporting(true); setCancelRequested(false); setImportPhase("reading"); + try { + if (!file.size || file.size > 64 * 1024 * 1024) throw new Error("Choose a JT file between 1 byte and 64 MiB"); + const bytes = await file.arrayBuffer(); cancellation.signal.throwIfAborted(); + setImportPhase("native"); setStatus(`Opening ${file.name}...`); + const result = await jtRequest(id, "openJt", { fileName: file.name, bytes }); + cancellation.signal.throwIfAborted(); + // Publish only after native decoding and scene projection both succeeded. + setImportPhase("finishing"); + await jtRequest(id, "acceptOpen", { includeMesh: false }); + cancellation.signal.throwIfAborted(); + store.open(id, file.name); applyNativeDocument(id, result); + store.switchTo(id); setActive(id); setStartVisible(false); + setSelectedObjects(value => ({ ...value, [id]: result.objects?.[0] ? `native:${result.objects[0].name}` : null })); + renderBridge.activateDocument(id); renderBridge.fitDocument(); + store.touchFile({ path: file.name, module: "JtReader", format: "jt", updatedAt: new Date().toISOString() }); + refresh(); setStatus(`Opened ${file.name}`); + return true; + } catch (error) { + if (testDocuments.current.has(id)) { + await nativeRequest(id, "close").catch(() => undefined); + store.close(id); renderBridge.removeDocument(id); + } + if (jtDocuments.current.has(id)) await jtRequest(id, "cancelOpen", { includeMesh: false }); + if (jtDocuments.current.has(previous)) await jtRequest(previous, "activate", { includeMesh: false }); + setStatus(cancellation.signal.aborted ? "JT open cancelled; previous document preserved" : String(error)); + if (cancellation.signal.aborted) return false; + throw error; + } finally { importCancellation.current = null; setImporting(false); setCancelRequested(false); setImportPhase(""); } + }; + const insertJtFile = async (file: File) => { + if (!active || (!jtDocuments.current.has(active) && !nativeDocuments.current.has(active))) + throw new Error("Import JT into an open Part, PartDesign, or JT document"); + if (importing || importCancellation.current) return false; + const id = active, cancellation = new AbortController(); + importCancellation.current = cancellation; + setImporting(true); setCancelRequested(false); setImportPhase("reading"); + let pending = false; + try { + if (!file.size || file.size > 64 * 1024 * 1024) throw new Error("Choose a JT file between 1 byte and 64 MiB"); + const bytes = await file.arrayBuffer(); cancellation.signal.throwIfAborted(); + setImportPhase("native"); setStatus(`Importing ${file.name}...`); + let projected: PartDocumentResult; + if (jtDocuments.current.has(id)) { + const decoded = await jtRequest(id, "decodeJt", { fileName: file.name, bytes }); + cancellation.signal.throwIfAborted(); + if (!(decoded as typeof decoded & { inventorBuffer?: string }).inventorBuffer) + throw new Error("JT decoder returned no Inventor buffer"); + projected = await jtRequest(id, "insertInventor", { + fileName: file.name, + inventorBuffer: (decoded as typeof decoded & { inventorBuffer: string }).inventorBuffer, + }); + } else { + // JtReader owns decoding, while the mounted Part/PartDesign document + // remains the transaction owner through the retained-document bridge. + projected = await jtRequest(id, "insertJt", { fileName: file.name, bytes }); + } + pending = true; + cancellation.signal.throwIfAborted(); + const inserted = projected.objects?.at(-1); + if (!inserted || !documentObjectMesh(inserted)) throw new Error("Native JT import produced no display mesh"); + // Projection has completed. Acceptance is now atomic and no longer cancellable. + importCancellation.current = null; setImportPhase("finishing"); + const committed = await jtRequest(id, "acceptInsert", { includeMesh: false }); + pending = false; + applyNativeDocument(id, { ...projected, undoCount: committed.undoCount, redoCount: committed.redoCount }); + setCompoundSelections(previous => { const next = { ...previous }; delete next[id]; return next; }); + setSelectedObjects(previous => ({ ...previous, [id]: `native:${inserted.name}` })); + store.touchFile({ path: file.name, module: "JtReader", format: "jt", updatedAt: new Date().toISOString() }); + refresh(); setStatus(`Imported ${file.name}`); + return true; + } catch (error) { + if (pending) await jtRequest(id, "cancelInsert", { includeMesh: false }); + setStatus(cancellation.signal.aborted ? "JT import cancelled; existing document preserved" : String(error)); + return false; + } finally { importCancellation.current = null; setImporting(false); setCancelRequested(false); setImportPhase(""); } + }; + const importOpenScadFile = async (file: File, newDocument: boolean) => { + if ((!active && !newDocument) || importing || importCancellation.current) return false; + const id = newDocument ? allocateDocumentId() : active; + const cancellation = new AbortController(); importCancellation.current = cancellation; + setImporting(true); setCancelRequested(false); setImportPhase("reading"); + const owner = openScadDocuments.current.get(id); + let pending: Awaited> | undefined; + let committed = false; + try { + if (!file.size || file.size > 64 * 1024 * 1024) throw new Error("Choose a SCAD or CSG file between 1 byte and 64 MiB"); + const contentBase64 = encodeSceneFile(await file.arrayBuffer()); + cancellation.signal.throwIfAborted(); + let documentBase64: string | undefined; + let documentObjects: Array<{ name: string; type: string }> | undefined; + const hasOriginal = !newDocument && nativeDocuments.current.has(id) && !owner; + if (!newDocument && !owner && Object.values(store.list().find(value => value.id === id)?.objects ?? {}).some(object => !object.properties.NativeName)) + throw new Error("Save or attach the existing imported views before inserting OpenSCAD source"); + if (hasOriginal) { + const original = await nativeRequest(id, "save", { path: `/tmp/${nativeName(id)}.FCStd`, includeMesh: false }); + if (!original.bytes) throw new Error("The active document owner returned no FCStd data"); + if (!original.objects) throw new Error("The active document owner returned no object manifest"); + documentObjects = original.objects.map(object => ({ name: object.name, type: object.type })); + documentBase64 = encodeSceneFile(original.bytes); + } + cancellation.signal.throwIfAborted(); + setImportPhase("native"); setStatus(`${newDocument ? "Opening" : "Inserting"} ${file.name}...`); + pending = await requestOpenScadFile(router, { action: "import", fileName: file.name, + extension: file.name.split(".").pop()!.toLowerCase(), contentBase64, documentBase64, documentObjects, + newDocument: newDocument || (!owner && !documentBase64), documentId: owner?.documentId, + documentToken: owner?.documentToken, operationToken: crypto.randomUUID() }); + cancellation.signal.throwIfAborted(); + // Geometry and identity are returned before acceptance. Cancellation stays + // local until this point because synchronous native parsing cannot yield. + importCancellation.current = null; setImportPhase("finishing"); + const result = await requestOpenScadFile(router, { action: "finishImport", documentId: pending.documentId, + documentToken: pending.documentToken, operationToken: pending.operationToken, commitImport: true }); + if (result.cancelled) throw new Error("OpenSCAD import transaction expired before commit"); + committed = true; pending = undefined; + let retirementError = ""; + if (hasOriginal) { + try { await nativeOwnerRequest(id, "close", { includeMesh: false }); } + catch (error) { retirementError = `; previous document owner could not close: ${String(error)}`; } + } + designDocuments.current.delete(id); jtDocuments.current.delete(id); remoteOwners.current.delete(id); testDocuments.current.delete(id); + rememberOpenScad(id, result); + if (newDocument) store.open(id, file.name); + applyNativeDocument(id, openScadDocumentSnapshot(result)); + store.switchTo(id); setActive(id); setStartVisible(false); + setSelectedObjects(previous => ({ ...previous, [id]: result.selection[0] ? `native:${result.selection[0]}` : null })); + setNativeBytes(null); + store.touchFile({ path: file.name, module: "OpenSCAD", format: file.name.split(".").pop()!.toLowerCase(), updatedAt: new Date().toISOString() }); + refresh(); setStatus(`${newDocument ? "Opened" : "Inserted"} ${file.name}${retirementError}`); + return true; + } catch (error) { + if (pending && !committed) { + try { await requestOpenScadFile(router, { action: "finishImport", documentId: pending.documentId, + documentToken: pending.documentToken, operationToken: pending.operationToken, commitImport: false }); } + catch (rollback) { setStatus(`OpenSCAD rollback: ${String(rollback)}; ${String(error)}`); return false; } + } + setStatus(cancellation.signal.aborted ? "OpenSCAD import cancelled; original document preserved" : String(error)); + if (newDocument && !cancellation.signal.aborted) throw error; + return false; + } finally { importCancellation.current = null; setImporting(false); setCancelRequested(false); setImportPhase(""); } + }; + const importUserFiles = async (files: File[], desktopCommand?: ImportDesktopCommand, newDocument = false) => { + if (files.some(file => /\.(scad|csg)$/i.test(file.name))) { + if (files.length !== 1) throw new Error("Choose one SCAD or CSG source file at a time"); + return importOpenScadFile(files[0], newDocument); + } + if (files.some(file => /\.jt$/i.test(file.name))) { + if (files.length !== 1) throw new Error("Choose one standalone JT file at a time"); + return newDocument ? openJtFile(files[0]) : insertJtFile(files[0]); + } + if ((!active && !newDocument) || importing || importCancellation.current) return false; + const documentId = newDocument ? allocateDocumentId() : active; + const cancellation = new AbortController(); importCancellation.current = cancellation; + setCancelRequested(false); + setImporting(true); + let pendingNativeImport = false; + try { + const importSettings = await readImportExportSettings(router, nativeName(documentId)); + for (const file of files) { + cancellation.signal.throwIfAborted(); + setImportPhase("reading"); + setImportProgress(previous => ({ ...previous, label: `Reading ${file.name}`, state: "running" })); + setStatus(`Importing ${file.name}...`); + if (!/\.(step|stp|iges|igs|brep|brp|rle|stl|3mf|gltf|glb|plmxml|stpz|stepz)$/i.test(file.name)) throw new Error("Supported native formats: STEP, STEPZ, PLMXML, IGES, BREP, STL, 3MF, glTF"); + if (!file.size || file.size > 64 * 1024 * 1024) + throw new Error("Import requires a file between 1 byte and 64 MiB"); + if (!nativeDocuments.current.has(documentId)) await nativeRequest(documentId, "create"); + const document = store.list().find(value => value.id === documentId); + if (!document && !newDocument) throw new Error("Import document was closed"); + let index = 1; + while (document?.objects[`native:Imported${index}`]) index++; + const replacing = !!desktopCommand && replaceImport; + if (replacing && selectedObject?.type !== "Part::Feature") throw new Error("Select an imported Part feature to replace"); + const name = replacing ? String(selectedObject!.properties.NativeName) : `Imported${index}`; + const bytes = await file.arrayBuffer(); + cancellation.signal.throwIfAborted(); + const extension = file.name.split(".").pop()!.toLowerCase(); + setImportPhase("native"); + setImportProgress(previous => ({ ...previous, label: `Importing ${file.name}`, state: "running" })); + const fileCommand = desktopCommand ?? (/^(step|stp)$/.test(extension) ? "Part_ImportStep" + : /^(iges|igs)$/.test(extension) ? "Import_Iges" : /^(gltf|glb)$/.test(extension) ? "Import_Gltf" + : extension === "plmxml" ? "Import_PlmXml" : /^(stpz|stepz)$/.test(extension) ? "Import_StepZ" : undefined); + const previousNames = new Set(Object.values(document?.objects ?? {}).map(value => String(value.properties.NativeName))); + const input = fileCommand ? importDesktopPayload(fileCommand, nativeName(documentId), name, file.name, bytes, replacing, importSettings) + : { object: name, label: file.name, path: `/tmp/${nativeName(documentId)}_${name}.${extension}`, bytes, importExportSettings: importSettings }; + const imported = await nativeRequest(documentId, "importShape", { ...input, deferImportCommit: true }); + pendingNativeImport = true; + const importedNames = new Set((imported.objects ?? []).filter(value => replacing + ? value.name === name : !previousNames.has(value.name)).map(value => value.name)); + if (!importedNames.size) + throw new Error("Native import produced no document objects"); + // Synchronous OCCT work cannot process a Worker cancel message mid-call. + // Keep its transaction uncommitted until the browser decides to publish it. + const commitImport = !cancellation.signal.aborted; + importCancellation.current = null; + setImportPhase("finishing"); + setImportProgress(previous => ({ ...previous, label: `Finishing ${file.name}`, current: previous.current + 1, state: "running" })); + const result = await nativeRequest(documentId, "finishImport", { commitImport }); + pendingNativeImport = false; + if (!commitImport) throw new Error("Import cancelled; native transaction rolled back"); + importCancellation.current = cancellation; + const object = result.objects?.find(value => importedNames.has(value.name) && documentObjectMesh(value)) + ?? result.objects?.find(value => importedNames.has(value.name)); + const mesh = object ? documentObjectMesh(object) : null; + if (!object) throw new Error("Native import produced no document objects"); + if (newDocument && !document) { store.open(documentId, file.name); switchDocument(documentId); } + applyNativeDocument(documentId, result); + renderBridge.activateDocument(documentId); renderBridge.fitDocument(); + setSelectedObjects(previous => ({ ...previous, [documentId]: `native:${object!.name}` })); + setImportedMesh(mesh); + store.touchFile({ path: file.name, module: "Import", format: file.name.split(".").pop()?.toLowerCase() ?? "step", updatedAt: new Date().toISOString() }); + refresh(); + setStatus(mesh ? `Imported ${file.name}: ${mesh.triangleCount.toLocaleString()} triangles` + : `Imported ${file.name}: ${importedNames.size} document objects`); + setImportProgress(previous => ({ ...previous, label: `Imported ${file.name}`, state: "completed" })); + if (desktopCommand) { setImportCommand(null); setImportFile(null); setReplaceImport(false); } + } + return true; + } catch (error) { + if (pendingNativeImport) { + try { await nativeRequest(documentId, "finishImport", { commitImport: false }); } + catch (rollback) { setStatus(`Import rollback failed: ${String(rollback)}`); return; } + } + if (newDocument && !store.list().some(value => value.id === documentId) && nativeDocuments.current.has(documentId)) + await nativeRequest(documentId, "close", { includeMesh: false }); + setStatus(cancellation.signal.aborted ? "Import cancelled; native transaction rolled back" : error instanceof Error ? error.message : String(error)); + setImportProgress(previous => ({ ...previous, label: cancellation.signal.aborted ? "Import cancelled" : "Import failed", state: cancellation.signal.aborted ? "cancelled" : "error" })); + if (newDocument) throw error; + return false; + } + finally { + importCancellation.current = null; setImporting(false); setCancelRequested(false); setImportPhase(""); + // Desktop import tasks are transient dialogs; always close them after + // the native transaction settles so browser workflows cannot remain + // mounted behind a completed or failed operation. + if (desktopCommand) { setImportCommand(null); setImportFile(null); setReplaceImport(false); } + } + }; + const exportSelectedShape = async () => { + if (!active || importing || !selectedObject?.properties.NativeName) return; + setImporting(true); + try { + const name = String(selectedObject.properties.NativeName); + if (["csg", "scad"].includes(exportFormat)) { + const id = active; + const cancellation = new AbortController(); exportCancellation.current = cancellation; + const owner = openScadDocuments.current.get(id); + const documentId = nativeName(id); + const names = (compoundSelections[id]?.length ? compoundSelections[id]! : [name]).map(value => value.replace(/^native:/, "")); + const args: OpenScadFileArgs = { action: "export", documentId, documentToken: owner?.documentToken, + selection: names.map(object => ({ documentId, object })), extension: exportFormat, + fileName: exportFileName.trim() || `${name}.${exportFormat}`, exportOptions, + preferencesBase64: await savedExportPreferences("OpenSCAD-export.FCParam") }; + if (!owner) { + const original = await nativeRequest(id, "save", { path: `/tmp/${documentId}.FCStd`, includeMesh: false }); + if (!original.bytes || !original.objects) throw new Error("The active owner returned no FCStd export snapshot"); + args.documentBase64 = encodeSceneFile(original.bytes); + args.documentObjects = original.objects.map(object => ({ name: object.name, type: object.type })); + } + cancellation.signal.throwIfAborted(); + const result = await requestOpenScadExport(router, args); + cancellation.signal.throwIfAborted(); + if (store.active()?.id !== id) throw new Error("Export cancelled because the active document changed"); + await persistExportPreferences(result.preferencesBase64, "OpenSCAD-export.FCParam"); + cancellation.signal.throwIfAborted(); + const bytes = Uint8Array.from(atob(result.base64), character => character.charCodeAt(0)).buffer; + const exported = exporter.download({ module: "OpenSCAD", format: "text/plain", fileName: result.fileName, bytes }); + if (exported.status !== "ok") throw new Error(exported.error?.message || "OPFS write failed"); + setStatus(`已写入 OPFS:${result.fileName} (${bytes.byteLength} bytes)`); + return; + } + const result = await nativeRequest(active, "exportShape", { object: name, + path: `/tmp/${nativeName(active)}_${name}.${exportFormat}`, includeMesh: false }); + if (!result.bytes?.byteLength) throw new Error("Native export returned no file bytes"); + const exported = exporter.download({ module: exportFormat === "gltf" || exportFormat === "glb" ? "Import" : "Part", format: exportFormat === "gltf" ? "model/gltf+json" : exportFormat === "glb" ? "model/gltf-binary" : "application/octet-stream", + fileName: `${name}.${exportFormat}`, bytes: result.bytes }); + if (exported.status !== "ok") throw new Error(exported.error?.message ?? "OPFS write failed"); + setStatus(`已写入 OPFS:${name}.${exportFormat} (${result.bytes.byteLength} bytes)`); + } catch (error) { setStatus(String(error)); } + finally { exportCancellation.current = null; setImporting(false); } + }; + const updateProperty = (objectId: string, name: string, value: unknown) => { + const document = store.active(); + if (!document) return; + const next = documentSessionReducer(document, { type: "property.set", objectId, name, value }); + store.set(next); refresh(); + if (next.lastError) setStatus(next.lastError.message); + }; + const removeSelected = async () => { + const document = store.active(); + if (!document || !selectedObject) return; + if (selectedObject.properties.NativeName) { + setImporting(true); + try { applyNativeDocument(active, await nativeRequest(active, "remove", { object: String(selectedObject.properties.NativeName) })); setSelectedObjects(previous => ({ ...previous, [active]: null })); } + catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + return; + } + const remaining = { ...document.objects }; delete remaining[selectedObject.id]; + store.set({ ...document, objects: remaining, revision: document.revision + 1, dirty: true }); + renderBridge.scenes.remove(active, selectedObject.id); + setSelectedObjects(previous => ({ ...previous, [active]: Object.keys(remaining).at(-1) ?? null })); refresh(); + }; + const switchDocument = (id: string) => { if (importing) return; if (jtDocuments.current.has(id)) void jtRequest(id, "activate", { includeMesh: false }).catch(error => setStatus(String(error))); store.switchTo(id); renderBridge.activateDocument(id); renderBridge.fitDocument(); setNativeBytes(null); setActive(id); refresh(); updateNavigationContext({ documentId: id, module: "Project", command: "document.activate" }); setStatus(`Active document: ${id}`); }; + const createDocument = async () => { + if (importing) return false; + setImporting(true); + try { + const id = allocateDocumentId(); + const result = await nativeRequest(id, "create"); + store.open(id, id); switchDocument(id); applyNativeDocument(id, result, false); + return true; + } catch (error) { setStatus(String(error)); return false; } + finally { setImporting(false); } + }; + const launchSpecialized = async (kind: "Assembly" | "Draft" | "Architecture" | "ParametricBody") => { + if (importing) return false; + const preferences = await startParameters(router); + if (kind === "ParametricBody") { + const id = allocateDocumentId(); + setImporting(true); + try { + designDocuments.current.add(id); + const result = await designRequest(id, "create"); + store.open(id, id); switchDocument(id); applyNativeDocument(id, result, false); + setWorkbenches(previous => ({ ...previous, [id]: "PartDesign" })); + await startParameters(router, { LastModule: "PartDesignWorkbench" }, true); + setStartVisible(false); + if (window.parent !== window) window.parent.postMessage({ type: "freecad-start-launch-complete", closeStart: preferences.closeStart }, location.origin); + return true; + } catch (error) { + designDocuments.current.delete(id); + setStatus(String(error)); + return false; + } finally { setImporting(false); } + } + const created = await createDocument(); + if (!created) return false; + const document = store.currentDocumentId; + if (!document) throw new Error(`${kind} launch created no active document`); + if (window.parent === window) { + setWorkbenches(previous => ({ ...previous, [document]: kind })); + await startParameters(router, { LastModule: `${kind}Workbench` }, true); + setStartVisible(!preferences.closeStart); + return true; + } + await new Promise((resolve, reject) => { + const requestId = crypto.randomUUID(); + const receive = (event: MessageEvent) => { + if (event.origin !== location.origin || event.source !== window.parent + || event.data?.type !== "freecad-start-workbench-activated" || event.data.requestId !== requestId) return; + window.removeEventListener("message", receive); + if (event.data.error) reject(new Error(event.data.error)); else resolve(); + }; + window.addEventListener("message", receive); + window.parent.postMessage({ type: "freecad-start-activate-workbench", requestId, + document, module: kind }, location.origin); + }); + await startParameters(router, { LastModule: `${kind}Workbench` }, true); + setStartVisible(!preferences.closeStart); + window.parent.postMessage({ type: "freecad-start-launch-complete", closeStart: preferences.closeStart }, location.origin); + return true; + }; + const closeDocument = async (requestedId = active) => { + if (!requestedId || importing) return; + const closingActive = requestedId === active; + setImporting(true); + try { + if (nativeDocuments.current.has(requestedId)) await nativeRequest(requestedId, "close", { includeMesh: false }); + else await showLifecycle({ documentId: requestedId, action: "delete" }); + store.close(requestedId); renderBridge.removeDocument(requestedId); + if (closingActive) { + const next = store.currentDocumentId ?? ""; + renderBridge.activateDocument(next); renderBridge.fitDocument(); + setNativeBytes(null); setActive(next); + } + refresh(); setStatus(`Closed ${requestedId}`); + } catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + }; + const saveFcstd = async () => { + if (!active || importing) return; + setImporting(true); + try { + if (openScadDocuments.current.has(active)) { + const result = await openScadRequest(active, "save"); + if (!result.file) throw new Error("OpenSCAD returned no FCStd file"); + await saveOpenScadFile(result); + const snapshot = openScadDocumentSnapshot(result); + applyNativeDocument(active, snapshot, false); setNativeBytes(snapshot.bytes!); + setSavedDocuments(await listDocumentFiles()); window.dispatchEvent(new Event("freecad-document-persistence")); setSavedDocument(`OpenSCAD/${result.file.name}`); + setStatus(`Saved ${result.file.name} to OPFS`); + return; + } + if (objects.some(object => !object.properties.NativeName)) throw new Error("Imported STEP views are not yet attached to this native FCStd document"); + if (!nativeDocuments.current.has(active)) await nativeRequest(active, "create"); + const fileName = `${jtDocuments.current.has(active) ? "JtReader_" : designDocuments.current.has(active) ? "PartDesign_" : ""}${nativeName(active)}.FCStd`; + const result = await nativeRequest(active, "save", { path: `/tmp/${fileName}`, includeMesh: false }); + if (!result.bytes) throw new Error("Native document returned no FCStd bytes"); + await writeDocumentFile(fileName, result.bytes); + applyNativeDocument(active, result, false, true); setNativeBytes(result.bytes); + setSavedDocuments(await listDocumentFiles()); window.dispatchEvent(new Event("freecad-document-persistence")); setSavedDocument(fileName); + setStatus(`Saved ${fileName} to OPFS (${result.bytes.byteLength} bytes)`); + } catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + }; + const openSavedDocument = async (requestedFile = savedDocument, suppliedBytes?: ArrayBuffer, reportError = false) => { + if (!requestedFile || importing) return; + setImporting(true); + let id = allocateDocumentId(); + let registeredDesignOwner = false; + try { + if ((requestedFile.includes("/") && !/^(Test|OpenSCAD)\/[^/]+$/.test(requestedFile)) || requestedFile.includes("\\") || !/\.FCStd$/i.test(requestedFile)) + throw new Error("Invalid FCStd file name"); + const bytes = suppliedBytes ?? await readDocumentFile(requestedFile); + if (requestedFile.startsWith("OpenSCAD/") || requestedFile.startsWith("OpenSCAD_")) { + const result = await openScadRequest(id, "open", { contentBase64: encodeSceneFile(bytes) }); + store.open(id, requestedFile.split("/").pop()); + applyNativeDocument(id, openScadDocumentSnapshot(result), false); + store.switchTo(id); setActive(id); setStartVisible(false); + setSelectedObjects(previous => ({ ...previous, [id]: result.selection[0] ? `native:${result.selection[0]}` : null })); + setNativeBytes(bytes); setStatus(`Opened ${requestedFile}${suppliedBytes ? "" : " from OPFS"}`); + const url = new URL(window.location.href); url.searchParams.delete("fcstd"); window.history.replaceState(null, "", url); + return true; + } + if (requestedFile.startsWith("PartDesign_")) { + designDocuments.current.add(id); + registeredDesignOwner = true; + } + const sceneXml = await fcstdDocumentXml(bytes); + const example = TEST_EXAMPLES.find(command => sceneXml.includes(command.replace("Std_", "Test")) && sceneXml.includes('name="SceneState"')); + let sceneResult; + if (example) { + id = `test-scene-${id}`; + sceneResult = await requestTestScene(router, id, example, { action: "open", contentsBase64: encodeSceneFile(bytes) }); + testDocuments.current.set(id, { command: sceneResult.command!, documentName: sceneResult.documentName }); + nativeDocuments.current.add(id); + } + const result = sceneResult ? sceneDocumentSnapshot(sceneResult) : (requestedFile.startsWith("JtReader_") || await isJtReaderFcstd(bytes)) + ? await jtRequest(id, "open", { fileName: requestedFile, bytes }) + : await nativeRequest(id, "open", { path: `/tmp/${nativeName(id)}.FCStd`, bytes, includeMesh: false }); + if (jtDocuments.current.has(id)) await jtRequest(id, "acceptOpen", { includeMesh: false }); + store.open(id); applyNativeDocument(id, result, false); + if (result.objects?.some(object => object.type === "Spreadsheet::Sheet")) setWorkbenches(previous => ({ ...previous, [id]: "Spreadsheet" })); + else if (designDocuments.current.has(id)) setWorkbenches(previous => ({ ...previous, [id]: "PartDesign" })); + setActive(id); renderBridge.activateDocument(id); renderBridge.fitDocument(); + setSelectedObjects(previous => ({ ...previous, [id]: (result.objects?.find(object => object.type === "Spreadsheet::Sheet") ?? result.objects?.[0]) ? `native:${(result.objects?.find(object => object.type === "Spreadsheet::Sheet") ?? result.objects![0]).name}` : null })); + setNativeBytes(bytes); setStatus(`Opened ${requestedFile}${suppliedBytes ? "" : " from OPFS"}`); + const openedRevision = store.list().find(document => document.id === id)?.revision; + void window.setTimeout(() => { + void nativeRequest(id, "snapshot", { includeMesh: true }).then(snapshot => { + const current = store.list().find(document => document.id === id); + if (nativeDocuments.current.has(id) && current?.revision === openedRevision) applyNativeDocument(id, snapshot, false); + }).catch(error => setStatus(String(error))); + }, 0); + const url = new URL(window.location.href); url.searchParams.delete("fcstd"); window.history.replaceState(null, "", url); + return true; + } catch (error) { + // nativeRequest records successful opens. Roll back only provisional + // ownership when reading/restoring failed before a native document exists. + if (jtDocuments.current.has(id)) await jtRequest(id, "cancelOpen", { includeMesh: false }); + if (registeredDesignOwner && !nativeDocuments.current.has(id)) designDocuments.current.delete(id); + setStatus(String(error)); + if (reportError) throw error; + return false; + } + finally { setImporting(false); } + }; + useEffect(() => { + if (!incomingStarted.current && incomingFile.current) { + incomingStarted.current = true; + void openSavedDocument(incomingFile.current); + } + }, []); + const openStartFiles = async (files: File[]) => { + if (!files.length || importing) return false; + for (const file of files) { + if (/\.fcstd$/i.test(file.name)) { + const opened = await openSavedDocument(file.name, await file.arrayBuffer(), true); + if (!opened) return false; + } + else await importUserFiles([file], undefined, true); + } + return true; + }; + const openStartFile = async () => openStartFiles(await pickFiles()); + const startAction = async (action: () => Promise) => { + try { return await action(); } + finally { setStartVisible(true); } + }; + const finishStartLaunch = async (specialized: boolean) => { + const preferences = await startParameters(router); + if (!specialized) { + const requested = preferences.AutoloadModule === "$LastModule" + ? (await startParameters(router, undefined, true)).LastModule ?? "" : preferences.AutoloadModule; + const name = requested.replace(/Workbench$/, ""); + if (name) { + const retained = store.currentDocumentId ? remoteOwners.current.get(store.currentDocumentId) : undefined; + if (retained && window.parent !== window) { + await new Promise((resolve, reject) => { + const requestId = crypto.randomUUID(); + const receive = (event: MessageEvent) => { + if (event.origin !== location.origin || event.source !== window.parent + || event.data?.type !== "freecad-start-workbench-activated" || event.data.requestId !== requestId) return; + window.removeEventListener("message", receive); + if (event.data.error) reject(new Error(event.data.error)); + else resolve(); + }; + window.addEventListener("message", receive); + window.parent.postMessage({ type: "freecad-start-activate-workbench", requestId, + document: retained.document, module: name }, location.origin); + }); + await startParameters(router, { LastModule: `${name}Workbench` }, true); + setStartVisible(!preferences.closeStart); + window.parent.postMessage({ type: "freecad-start-launch-complete", closeStart: preferences.closeStart }, location.origin); + return; + } + if (!["Part", "Sketcher", "PartDesign", "Spreadsheet", "Surface"].includes(name)) + throw new Error(`Document opened. Workbench ${requested} is not available in this document workspace. Select another Start workbench.`); + const id = store.currentDocumentId; + if (id) { + if (name === "Surface" && (designDocuments.current.has(id) || remoteOwners.current.get(id)?.module === "PartDesign")) + throw new Error("Document opened. Surface requires a Part document owner; the current owner has been retained."); + if ((name === "Sketcher" || name === "PartDesign") && !designDocuments.current.has(id)) { + if (nativeDocuments.current.has(id) || Object.keys(store.active()?.objects ?? {}).length) + throw new Error("Document opened. Sketcher/PartDesign requires a native ownership handoff; the current owner has been retained."); + designDocuments.current.add(id); + } + setWorkspaceTask(""); setViewCommand(""); + setWorkbenches(previous => ({ ...previous, [id]: name as typeof workbench })); + await startParameters(router, { LastModule: `${name}Workbench` }, true); + } + } + } + setStartVisible(!preferences.closeStart); + }; + const downloadFcstd = () => { if (!nativeBytes) return; const result = exporter.download({ module: "Part", format: "application/octet-stream", fileName: `${openScadDocuments.current.has(active) ? "OpenSCAD_" : jtDocuments.current.has(active) ? "JtReader_" : ""}${nativeName(active)}.FCStd`, bytes: nativeBytes }); setStatus(result.status === "ok" ? "FCStd 已写入 OPFS" : result.error?.message || "FCStd OPFS write failed"); }; + const exportDependencyGraph = async () => { + if (importing || !active || !nativeDocuments.current.has(active)) return; + const documentId = nativeName(active); + setImporting(true); + try { + const result = await executeWebDesktop(router, "Std_ExportDependencyGraph", { + runtimeOwner: "DocumentProbe", filename: `${documentId}.gv`, + }, documentId); + if (!result) throw new Error("Dependency graph export has no route"); + setResponse(result); + if (result.kind !== "result") throw new Error(JSON.stringify(result)); + setStatus(`Dependency graph download requested: ${documentId}.gv`); + } catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + }; + const editSliceInWorkbench = async (polygon = false) => { + if (importing || !active || !nativeDocuments.current.has(active)) return; + setImporting(true); + try { + const snapshot = await nativeRequest(active, "save", { path: `/tmp/${nativeName(active)}.FCStd`, includeMesh: false }); + if (!snapshot.bytes?.byteLength) throw new Error("Native document returned no FCStd snapshot"); + const identifier = crypto.randomUUID().replaceAll("-", ""); + const name = await writeDocumentFile(`Project-${identifier}.FCStd`, snapshot.bytes); + const url = new URL("/workbench.html", window.location.origin); + url.searchParams.set("module", polygon ? "TemplatePyMod" : "Part"); url.searchParams.set("command", polygon ? "TemplatePyMod_Cmd2" : "Part_Slice"); + url.searchParams.set("document", `${polygon ? "Polygon" : "Slice"}_${identifier}`); url.searchParams.set("fcstd", name); + window.location.assign(url.href); + } catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + }; + const openPlotWorkbench = () => { + if (importing || !active) return; + const url = new URL("/workbench.html", window.location.origin); + url.searchParams.set("module", "Plot"); + url.searchParams.set("document", nativeName(active)); + window.location.assign(url.href); + }; + const saveCheckpoint = () => { checkpoint.save(store); setStatus("Project checkpoint saved"); }; + const restoreCheckpoint = () => { const result = checkpoint.restore(store); refresh(); setActive(store.currentDocumentId ?? ""); setStatus(result.restored ? "Project checkpoint restored" : result.error ? `Checkpoint rejected: ${result.error}` : "No checkpoint found"); }; + const resetTaskDrafts = () => { + const dimensions = selectedObject?.properties.dimensions; + setBoxDimensions(Array.isArray(dimensions) && dimensions.length === 3 + ? dimensions.map(Number) as [number, number, number] : [...committedBoxDimensions]); + const committedPosition = selectedObject?.properties.position; + setPosition(Array.isArray(committedPosition) && committedPosition.length === 3 + ? [...committedPosition] as [number, number, number] : [0, 0, 0]); + const selectedPrimitive = selectedObject?.type.replace("Part::", "") as PartPrimitive | undefined; + const restoredPrimitive = selectedPrimitive && Object.hasOwn(primitives, selectedPrimitive) ? selectedPrimitive : primitive; + setPrimitive(restoredPrimitive); + setPrimitiveParameters(selectedPrimitive === restoredPrimitive && selectedObject?.properties.parameters + ? { ...selectedObject.properties.parameters as Record } : { ...primitives[restoredPrimitive].defaults }); + setBooleanOperation(selectedObject?.properties.operation as PartBoolean ?? "Fuse"); + setBooleanBase(String(selectedObject?.properties.base ?? partObjects[0]?.properties.NativeName ?? "")); + setBooleanTool(String(selectedObject?.properties.tool ?? partObjects[1]?.properties.NativeName ?? "")); + }; + const [retainedPartResponse, setRetainedPartResponse] = useState(null); + // Keep the task router stable during native snapshots so attachment cleanup + // runs only when the task/document actually unmounts. + const retainedPartOwner = useRef({ nativeRequest, applyNativeDocument }); + retainedPartOwner.current = { nativeRequest, applyNativeDocument }; + const retainedPartRouter = useMemo(() => { + const id = active; + const openingDirty = !!store.list().find(doc => doc.id === id)?.dirty; + return { request: async (module: string, command: string, payload: PartDocumentPayload) => { + if (module !== "Part" || command !== PART_DOCUMENT_COMMAND) + throw new Error(`Unsupported retained Part document command: ${module}/${command}`); + const result = await retainedPartOwner.current.nativeRequest(id, payload.action as PartDocumentAction, payload); + const dirty = ["snapshot", "beginAttachment"].includes(payload.action) + ? !!store.list().find(doc => doc.id === id)?.dirty + : payload.action === "cancelAttachment" ? openingDirty : true; + retainedPartOwner.current.applyNativeDocument(id, result, dirty); + return { schema: "freecad-web-facade/v1", version: 1, kind: "result", requestId: "primary-retained-part", result }; + } } as unknown as WebModuleRouter; + }, [active, workspaceTask]); + const runRetainedPartCommand = async (command: string, args: Record) => { + if (importing || !active) return; + if (args.action === "cancel" && command !== "Part_EditAttachment") { cancelWorkspaceTask(); return; } + const id = active; + setImporting(true); + try { + if (!nativeDocuments.current.has(id)) await nativeRequest(id, "create"); + const reply = await executePartFixedBoxDesktop(retainedPartRouter, command, args, nativeName(id)); + if (reply) setRetainedPartResponse(reply); + if (!reply || reply.kind !== "result") throw new Error(reply?.error.message ?? "No native Part task response"); + const result = reply.result as PartDocumentResult; + if (result.createdObject) { + setSelectedObjects(previous => ({ ...previous, [id]: `native:${result.createdObject}` })); + renderBridge.activateDocument(id); renderBridge.fitDocument(); + } + setStatus(args.action === "read" ? "Part task ready" : `${command}: ${result.createdObject ?? "updated"}`); + if (args.action === "accept" && ["Part_ShapeFromMesh", "Part_PointsFromMesh"].includes(command)) cancelWorkspaceTask(); + } catch (error) { setStatus(String(error)); } + finally { setImporting(false); } + }; + const partActionDisabled = (item: PartUiAction) => !active || importing || workbench !== "Part" + || designDocuments.current.has(active) || remoteOwners.current.get(active)?.module === "PartDesign" + || !!workspaceTask || !!viewCommand || !!csvPanel + || item.command === "Part_ColorPerFace" && (compoundSelection.length !== 1 + || !partSnapshots[active]?.objects?.some(object => object.name === compoundSelection[0] && object.topology?.Face && object.type !== "App::Link")); + const activatePartAction = (item: PartUiAction) => { + if (partActionDisabled(item)) return; + resetTaskDrafts(); setViewCommand(""); setPartTaskMode(item); setRetainedPartResponse(null); + if (item.command === "Part_Box") { + // Desktop Cube opens the editable box task after creating its starter solid. + setWorkspaceTask("box"); + void createFixedBox("Part_Box"); + return; + } + if (item.primitive) { + const nextPrimitive = item.primitive; + const nextParameters = { ...primitives[nextPrimitive].defaults }; + setPrimitive(nextPrimitive); setPrimitiveParameters(nextParameters); + void (async () => { + if (!active || importing) return; + const id = active; setImporting(true); + try { + if (!nativeDocuments.current.has(id)) await nativeRequest(id, "create"); + let name = `${nextPrimitive}1`; let index = 1; + while (currentDocument?.objects[`native:${name}`]) name = `${nextPrimitive}${++index}`; + const result = await nativeRequest(id, "setPrimitive", { object: name, primitive: nextPrimitive, parameters: nextParameters }); + applyNativeDocument(id, result); setSelectedObjects(previous => ({ ...previous, [id]: `native:${name}` })); + renderBridge.activateDocument(id); renderBridge.fitDocument(); setStatus(`${name}: created`); + } catch (error) { setStatus(String(error)); } finally { setImporting(false); } + })(); + return; + } + if (item.boolean) { + const operation = item.boolean; + const names = compoundSelection.length >= 2 ? compoundSelection : partObjects.slice(0, 2).map(object => String(object.properties.NativeName)); + setBooleanOperation(operation); setBooleanBase(names[0] ?? ""); setBooleanTool(names[1] ?? ""); + if (names.length >= 2) void editNative("setBoolean", { object: `${operation}1`, operation, base: names[0], tool: names[1] }); + else setStatus(`${item.label}: select two objects`); + return; + } + if (item.command === "Sketcher_NewSketch") { + setWorkspaceTask("sketcher-new-sketch"); setStatus("Choose a sketch plane or document support"); return; + } + if (item.command === "Materials_InspectAppearance") { + setWorkspaceTask("appearance"); setStatus(item.label); return; + } + if (item.command === "Materials_InspectMaterial") { + setWorkspaceTask("material-assignment"); setStatus(item.label); return; + } + if (item.command === "Part_BoxSelection") { + setViewCommand("Part_BoxSelection"); setStatus(item.label); return; + } + setWorkspaceTask(item.task); setStatus(item.label); + if (["tube", "tolerance", "primitives", "shape-from-mesh", "points-from-mesh", "edit-attachment"].includes(item.task)) void runRetainedPartCommand(item.command, { action: "read" }); + }; + const cancelWorkspaceTask = () => { + setPartTaskMode(undefined); + if (workspaceTask === "measure-mass-properties") { + void nativeRequest(active, "clearMassGeometry", {}).then(result => applyNativeDocument(active, result, true)).catch(error => setStatus(String(error))); + } + if (workspaceTask === "measure-distance") { + renderBridge.setMeasurements(active, (designSnapshots[active] ?? partSnapshots[active])?.objects ?? []); + restoreMeasureSelection(); + } + if (["surface-blend", "surface-sections", "surface-extend", "surface-geomfill"].includes(workspaceTask)) { + if (surfaceOpeningDocument.current) { store.set(surfaceOpeningDocument.current); refresh(); } + setSelectedObjects(previous => ({ ...previous, [active]: surfaceOpeningSelection.current })); + setCompoundSelections(previous => { + const next = { ...previous }; + if (surfaceOpeningCompoundSelection.current) next[active] = surfaceOpeningCompoundSelection.current; + else delete next[active]; + return next; + }); + renderBridge.activateDocument(active); + } + if (workspaceTask === "make-face" || workspaceTask === "make-solid" || workspaceTask === "reverse-shapes" || workspaceTask === "section") chooseCompoundSources([]); + if (workspaceTask === "shape-builder") setSelectedObjects(previous => ({ ...previous, [active]: null })); + resetTaskDrafts(); + setWorkspaceTask(""); setViewCommand(""); + setStatus("Task closed; unapplied edits discarded"); + }; + useEffect(() => { + const onKeyDown = (event: KeyboardEvent) => { + if (event.key === "Escape" && !importing && (workspaceTask || viewCommand)) { + if (workspaceTask === "primitives" && document.querySelector('[aria-label="Primitive pick status"]')) return; + event.preventDefault(); cancelWorkspaceTask(); + } + }; + window.addEventListener("keydown", onKeyDown); + return () => window.removeEventListener("keydown", onKeyDown); + }, [importing, workspaceTask, viewCommand, committedBoxDimensions, selectedObject, primitive, partObjects]); + const resizePanel = (event: React.PointerEvent, side: "tree" | "properties") => { + event.currentTarget.setPointerCapture(event.pointerId); + event.currentTarget.dataset.dragStart = String(event.clientX); + event.currentTarget.dataset.initialWidth = String(side === "tree" ? treeWidth : propertyWidth); + }; + const movePanel = (event: React.PointerEvent, side: "tree" | "properties") => { + if (!event.currentTarget.hasPointerCapture(event.pointerId)) return; + const delta = (event.clientX - Number(event.currentTarget.dataset.dragStart)) * (side === "tree" ? 1 : -1); + (side === "tree" ? setTreeWidth : setPropertyWidth)(Math.max(180, Math.min(420, Number(event.currentTarget.dataset.initialWidth) + delta))); + }; + const resizePropertyColumn = (event: React.PointerEvent) => { + if (!event.currentTarget.hasPointerCapture(event.pointerId)) return; + const grid = event.currentTarget.parentElement; + const initial = Number(event.currentTarget.dataset.initialWidth); + const start = Number(event.currentTarget.dataset.dragStart); + if (!grid || !Number.isFinite(initial) || !Number.isFinite(start)) return; + const width = Math.max(72, Math.min(Math.max(72, grid.clientWidth - 72), initial + event.clientX - start)); + event.currentTarget.dataset.width = String(width); + setPropertyColumnWidth(width); + }; + const finishPropertyColumnResize = (event: React.PointerEvent) => { + if (event.currentTarget.hasPointerCapture(event.pointerId)) event.currentTarget.releasePointerCapture(event.pointerId); + const width = Number(event.currentTarget.dataset.width); + if (!Number.isFinite(width)) return; + try { window.localStorage.setItem("freecad.propertyEditor.firstColumnWidth", String(Math.round(width))); } catch { /* storage is optional */ } + }; + const adjustPropertyColumn = (event: React.KeyboardEvent) => { + if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return; + event.preventDefault(); + const grid = event.currentTarget.parentElement; + const current = propertyColumnWidth ?? grid?.querySelector("dt")?.getBoundingClientRect().width ?? 110; + const max = Math.max(72, (grid?.clientWidth ?? 300) - 72); + const width = event.key === "Home" ? 72 : event.key === "End" ? max + : Math.max(72, Math.min(max, current + (event.key === "ArrowRight" ? 12 : -12))); + setPropertyColumnWidth(width); + try { window.localStorage.setItem("freecad.propertyEditor.firstColumnWidth", String(Math.round(width))); } catch { /* storage is optional */ } + }; + const beginPropertyColumnResize = (event: React.PointerEvent) => { + event.preventDefault(); + const grid = event.currentTarget.parentElement; + const first = grid?.querySelector("dt"); + if (!grid || !first) return; + event.currentTarget.setPointerCapture(event.pointerId); + event.currentTarget.dataset.dragStart = String(event.clientX); + event.currentTarget.dataset.initialWidth = String(first.getBoundingClientRect().width); + event.currentTarget.dataset.width = String(first.getBoundingClientRect().width); + }; + const panelSeparator = (side: "tree" | "properties") =>
resizePanel(event, side)} onPointerMove={event => movePanel(event, side)} + onKeyDown={event => { if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return; event.preventDefault(); + (side === "tree" ? setTreeWidth : setPropertyWidth)(previous => event.key === "Home" ? 180 : event.key === "End" ? 420 : Math.max(180, Math.min(420, previous + (event.key === "ArrowRight" ? 20 : -20)))); }} />; + return
FCFreeCAD 1.2 Web{active || "Workspace"}
+ {startVisible && { if (node && !node.open) node.showModal(); }} + onClose={() => setStartVisible(false)} onCancel={() => setStartVisible(false)}> + setStartVisible(false)} onNew={() => startAction(createDocument)} onOpen={() => startAction(openStartFile)} + onSpecialized={kind => startAction(() => launchSpecialized(kind))} + onOpenFiles={files => startAction(() => openStartFiles(files)) as Promise} onLaunched={finishStartLaunch} + savedFiles={savedDocuments} onOpenSaved={name => startAction(() => openSavedDocument(name, undefined, true))} /> + } + + + + + + + {active && ["material-assignment", "appearance"].includes(workspaceTask) && ({ documentId: nativeName(active), object: id.replace(/^native:/, "") })) })} + onChange={() => {}} busy={importing} onAction={async (action, values) => { + if (action === "cancel") { setWorkspaceTask(""); return; } + setImporting(true); + try { + const result = await nativeRequest(active, "materialAssignment", { materialAssignment: { ...values, action, document: nativeName(active), property: workspaceTask === "appearance" ? "ShapeAppearance" : "ShapeMaterial" } }); + if (result.materialAssignment?.documentChanged) { applyNativeDocument(active, result); if (workspaceTask !== "appearance") setWorkspaceTask(""); } + return { schema: "freecad-web-facade/v1", version: 1, kind: "result", requestId: "material-assignment", result }; + } finally { setImporting(false); } + }} />} + + + {csvPanel && document.id === csvPanel.id)?.objects ?? {}).filter(object => object.type === "Spreadsheet::Sheet").map(object => ({ name: String(object.properties.NativeName), label: String(object.properties.Label) }))} + onCancel={() => { csvPanel.done({ cancelled: true }); setCsvPanel(null); }} + onAccept={async input => { + const { id, mode, done } = csvPanel; + setImporting(true); + try { + if (mode === "import" && !nativeDocuments.current.has(id)) await nativeRequest(id, "create"); + const before = new Set(Object.values(store.list().find(document => document.id === id)?.objects ?? {}).map(object => String(object.properties.NativeName))); + const result = await nativeRequest(id, mode === "import" ? "importSheetCsv" : "exportSheetCsv", { + csv: input.csv, delimiter: input.delimiter, quote: input.quote, escape: input.escape, + object: input.object, sheetName: "Sheet", label: input.filename.replace(/\.[^.]+$/, ""), + }); + if (mode === "import") { + const sheet = result.objects?.find(object => object.type === "Spreadsheet::Sheet" && !before.has(object.name)); + applyNativeDocument(id, result); + if (!sheet) throw new Error("Native import did not return its sheet"); + const range = (sheet as unknown as { usedRange?: string }).usedRange ?? ""; + const key = `${id}:native:${sheet.name}`; + setSelectedObjects(previous => ({ ...previous, [id]: `native:${sheet.name}` })); + setSelectedSheets(previous => ({ ...previous, [id]: `native:${sheet.name}` })); + setSheetCells(previous => ({ ...previous, [key]: range.split(":")[0] || "A1" })); + setSheetRanges(previous => ({ ...previous, [key]: range })); + setStatus(`Imported ${input.filename}${range ? ` — ${range}` : " (empty sheet)"}`); + done({ documentId: nativeName(id), createdSheet: sheet.name, usedRange: range }); + } else { + if (typeof result.csv !== "string") throw new Error("Native export did not return CSV contents"); + const url = URL.createObjectURL(new Blob([result.csv], { type: "text/csv;charset=utf-8" })); + const link = document.createElement("a"); link.href = url; + link.download = /\.csv$/i.test(input.filename) ? input.filename : `${input.filename}.csv`; + document.body.appendChild(link); link.click(); link.remove(); setTimeout(() => URL.revokeObjectURL(url), 1000); + done({ documentId: nativeName(id), exportedSheet: input.object, filename: link.download }); + } + setCsvPanel(null); + } finally { setImporting(false); } + }} />} + + {workbench === "Spreadsheet" && <> + } + {workbench === "Spreadsheet" && } + + {workbench === "Part" && } +
{panelSeparator("tree")}

{active || "Workspace"}

+ {workbench === "Spreadsheet" && (selectedObject?.type === "Spreadsheet::Sheet" ? { + const result = await nativeRequest(active, "completeSheetReference", { object: String(selectedObject.properties.NativeName), completionParent, includeMesh: false }); + if (!Array.isArray(result.completions)) throw new Error("The native owner did not return reference completions"); + return result.completions; + }} + onOutput={command => setViewCommand(command)} + aliasPreferences={async settings => { + const request = async (args: Record) => { + const reply = await requestOwnerParameters(router, "DocumentProbe", nativeName(active), { path: SPREADSHEET_PARAMETER_PATH, ...args }); + if (reply.kind !== "result") throw new Error(reply.error.message); + return (reply.result as { parameters?: Array<[string, string, unknown]> }).parameters ?? []; + }; + if (settings) { + await request({ operation: "set", name: "DisplayAliasFormatString", type: "String", value: settings.DisplayAliasFormatString }); + await request({ operation: "set", name: "showAliasName", type: "Bool", value: settings.showAliasName }); + } + const values = Object.fromEntries((await request({ operation: "read" })).map(([, name, value]) => [name, value])); + return { showAliasName: values.showAliasName === true, DisplayAliasFormatString: typeof values.DisplayAliasFormatString === "string" ? values.DisplayAliasFormatString : "%V = %A" }; + }} + zoom={sheetZooms[`${active}:${selectedObject.id}`]} + onZoom={value => { const key = `${active}:${selectedObject.id}`; setSheetZooms(previous => ({ ...previous, [key]: typeof value === "function" ? value(previous[key] ?? 100) : value })); }} + readDefaultZoom={async () => { + const reply = await requestOwnerParameters(router, "DocumentProbe", nativeName(active), { path: SPREADSHEET_PARAMETER_PATH, operation: "read" }); + if (reply.kind !== "result") throw new Error(reply.error.message); + const parameters = (reply.result as { parameters?: Array<[string, string, unknown]> }).parameters; + const value = parameters?.find(([type, name]) => type === "Int" && name === "DefaultZoomLevel")?.[2]; + return typeof value === "number" && Number.isFinite(value) ? value : 100; + }} + propertiesRequest={sheetPropertiesRequest ?? undefined} + onPropertiesClosed={cancelled => { sheetPropertiesRequest?.done({ cancelled, documentId: nativeName(active), runtimeOwner: "project-workspace" }); setSheetPropertiesRequest(null); }} + onSectionSize={async (sectionAxis, sectionSize, ranges) => { + if (importing || csvPanel || workspaceTask || viewCommand) throw new Error("Finish the active task first"); + setImporting(true); + try { applyNativeDocument(active, await nativeRequest(active, "setSheetSectionSize", { object: String(selectedObject.properties.NativeName), ranges, sectionAxis, sectionSize })); } + finally { setImporting(false); } + }} + onProperties={async (cellProperties, ranges) => { + if (importing || csvPanel || workspaceTask || viewCommand) throw new Error("Finish the active task first"); + setImporting(true); + try { applyNativeDocument(active, await nativeRequest(active, "setSheetProperties", { object: String(selectedObject.properties.NativeName), ranges, cellProperties })); } + finally { setImporting(false); } + }} + cells={(selectedObject.properties.cells as SheetCell[]) ?? []} + structure={(selectedObject.properties.sheetStructure as SheetStructure) ?? { rows: 30, columns: 8 }} + onClipboard={((documentId: string, sheetName: string, remoteOwner: unknown, designOwner: boolean): React.ComponentProps["onClipboard"] => async (action, ranges, clipboard) => { + if (action === "cancelSheetClipboard") { + if (remoteOwners.current.get(documentId) !== remoteOwner || designDocuments.current.has(documentId) !== designOwner) + throw new Error("The clipboard document runtime owner changed"); + const result = await nativeRequest(documentId, action, { object: sheetName, clipboard, includeMesh: false }); + return (result as any).clipboard; + } + if (importing || csvPanel || workspaceTask || viewCommand) throw new Error("Finish the active task first"); + setImporting(true); + try { + const result = await nativeRequest(documentId, action, { object: sheetName, ranges, clipboard }); + if (action === "pasteSheetCells" || action === "clearSheetCells") applyNativeDocument(documentId, result); + return (result as any).clipboard; + } finally { setImporting(false); } + })(active, String(selectedObject.properties.NativeName), remoteOwners.current.get(active), designDocuments.current.has(active))} + spans={(selectedObject.properties.sheetSpans as { address: string; rows: number; columns: number }[]) ?? []} + onSpan={async (action, ranges) => { + if (importing || csvPanel || workspaceTask || viewCommand) throw new Error("Finish the active task first"); + setImporting(true); + try { applyNativeDocument(active, await nativeRequest(active, action, { object: String(selectedObject.properties.NativeName), ranges, + cell: sheetCells[`${active}:${selectedObject.id}`] ?? "A1" })); } + finally { setImporting(false); } + }} + onStructure={async (action, ranges) => { + if (importing || csvPanel || workspaceTask || viewCommand) throw new Error("Finish the active task first"); + const structure = (selectedObject.properties.sheetStructure as SheetStructure) ?? { rows: 30, columns: 8 }; + setImporting(true); + try { applyNativeDocument(active, await nativeRequest(active, action, { object: String(selectedObject.properties.NativeName), ranges, + cell: sheetCells[`${active}:${selectedObject.id}`] ?? "A1", sheetRows: structure.rows, sheetColumns: structure.columns, structureRevision: crypto.randomUUID() })); } + finally { setImporting(false); } + }} + address={sheetCells[`${active}:${selectedObject.id}`] ?? "A1"} selectedRange={sheetRanges[`${active}:${selectedObject.id}`]} busy={importing || !!csvPanel || !!workspaceTask || (!!viewCommand && !viewCommand.startsWith("Std_Print"))} + onSelect={address => { setSheetCells(previous => ({ ...previous, [`${active}:${selectedObject.id}`]: address })); setSheetRanges(previous => ({ ...previous, [`${active}:${selectedObject.id}`]: "" })); }} + onRanges={ranges => setSheetRanges(previous => ({ ...previous, [`${active}:${selectedObject.id}`]: ranges }))} + onBind={async () => { const ranges = (sheetRanges[`${active}:${selectedObject.id}`] || sheetCells[`${active}:${selectedObject.id}`] || "A1").split(","); return await nativeRequest(active, "readSheetBinding", { object: String(selectedObject.properties.NativeName), ranges }); }} onConfiguration={async () => await nativeRequest(active, "readSheetConfiguration", { object: String(selectedObject.properties.NativeName), range: sheetRanges[`${active}:${selectedObject.id}`] || sheetCells[`${active}:${selectedObject.id}`] || "A1" })} onConfigurationApply={async (value, mode) => { if (importing) return; setImporting(true); try { applyNativeDocument(active, await nativeRequest(active, mode === "remove" ? "removeSheetConfiguration" : "setSheetConfiguration", { object: String(selectedObject.properties.NativeName), ...value })); } finally { setImporting(false); } }} + onBindingApply={async (binding, mode) => { if (importing) return; setImporting(true); try { applyNativeDocument(active, await nativeRequest(active, mode === "remove" ? "removeSheetBinding" : "setSheetBinding", { object: String(selectedObject.properties.NativeName), binding })); } finally { setImporting(false); } }} + onStyle={async (style, ranges) => { + if (importing || csvPanel || workspaceTask || viewCommand) return; + setImporting(true); + try { applyNativeDocument(active, await nativeRequest(active, "setSheetStyle", { object: String(selectedObject.properties.NativeName), style, ranges })); } + finally { setImporting(false); } + }} + onApply={async (cell, content) => { + if (importing) return; + setImporting(true); + try { applyNativeDocument(active, await nativeRequest(active, "setSheetCell", { object: String(selectedObject.properties.NativeName), cell, content })); } + finally { setImporting(false); } + }} onRecompute={async ranges => { + if (importing || csvPanel || workspaceTask || viewCommand) throw new Error("Finish the active task first"); + setImporting(true); + try { applyNativeDocument(active, await nativeRequest(active, "recomputeSheetCells", { object: String(selectedObject.properties.NativeName), ranges })); } + finally { setImporting(false); } + }} /> :

Select a sheet in the document tree, or create a spreadsheet.

)} + + + + {viewCommand && ({ documentId: nativeName(active), object }))} + onSelection={(_document, selection) => { + setSelectedObjects(previous => ({ ...previous, [active]: selection[0] ? `native:${selection[0].object}` : null })); + setCompoundSelections(previous => ({ ...previous, [active]: [...new Set(selection.map(item => item.object))] })); + }} />} + {viewCommand === "Part_BoxSelection" && } +
+ + + +
+ {testDocuments.current.has(active) && <> + + setSelectedObjects(previous => ({ ...previous, [active]: object ? `native:${object}` : null }))} + onResult={result => { + if (result.closed) { + testDocuments.current.delete(active); nativeDocuments.current.delete(active); + store.close(active); renderBridge.removeDocument(active); + const next = store.currentDocumentId ?? ""; setActive(next); renderBridge.activateDocument(next); refresh(); + } else applyNativeDocument(active, sceneDocumentSnapshot(result)); + if (result.file) void listDocumentFiles().then(files => { setSavedDocuments(files); window.dispatchEvent(new Event("freecad-document-persistence")); }).catch(error => setStatus(String(error))); + }} /> + } + {openScadSnapshots[active] && selectPrimaryObject(`native:${name}`)} />} +
+
+ {([["translate", "移动"], ["rotate", "旋转"], ["off", "关闭"]] as const).map(([mode, label]) => ( + ))} + + + {selectedObject?.properties.NativeName ? + 位置 {placementXyz.map(value => value.toFixed(2)).join(", ")} · 欧拉角 {placementEuler.map(value => value.toFixed(2)).join(", ")}° + : 未选中对象} +
+

中键按住平移 · 滚轮缩放 · 中键加左键(或右键加 Shift)旋转 · 局部坐标默认锁定,改写请用「局部坐标…」

+ {frameEditor && { if (node && !node.open) node.showModal(); }} + onClose={() => setFrameEditor(null)} onCancel={() => setFrameEditor(null)}> +

局部坐标:{frameEditor.object}

+

原点与欧拉角(XYZ°,先绕 X 再 Y 再 Z)。应用后写入模型 Placement,控制器姿态同步刷新。

+
原点
{["X", "Y", "Z"].map((axis, index) => ( + ))}
+
欧拉角
{["X", "Y", "Z"].map((axis, index) => ( + ))}
+
+ + + + +
+
} + {importProgress.total > 0 &&
{importProgress.label} · {importProgress.current} / {importProgress.total} · {importProgress.state}
} +
{Object.entries(IMPORT_DESKTOP_COMMANDS).map(([command, config]) => + )}
+ {importCommand &&
+ {IMPORT_DESKTOP_COMMANDS[importCommand].label} + + + + +
} +
Files + {importing && importCancellation.current && } + + {["csg", "scad"].includes(exportFormat) &&
+ Selected-object export + + {([['exportFa', 'Fragment angle'], ['exportFs', 'Fragment size'], ['exportConvexity', 'Convexity'], ['meshdeflection', 'Mesh deflection']] as const).map(([key, label]) => + )} +
} + {importing && exportCancellation.current && } + + + + + + + + + + {objects.some(object => Array.isArray(object.properties.tools) && object.properties.tools.length > 0 + && object.type === "Part::FeaturePython") && } + +
+ + {showClippingOpen && active && { + const document = store.list().find(document => document.id === active); + if (!document) return; + store.set({ ...document, showClipping: state }); renderBridge.setClipping(active, state); refresh(); + }} />} + {developerMode &&
+ + {importedMesh ?
Imported native mesh{importedMesh.vertexCount.toLocaleString()} vertices · {importedMesh.triangleCount.toLocaleString()} triangles · {importedMesh.faceCount.toLocaleString()} faces
: null} + {response ?
{JSON.stringify(response, null, 2)}
: null} +
} +
+ {documentTabsOverflow && } +
+ {documents.map(document =>
switchDocument(document.id)} onKeyDown={event => { if (event.target !== event.currentTarget || !["Enter", " "].includes(event.key)) return; event.preventDefault(); switchDocument(document.id); }} onDragStart={event => { event.dataTransfer.effectAllowed = "move"; event.dataTransfer.setData("text/plain", document.id); }} onDragOver={event => { event.preventDefault(); event.dataTransfer.dropEffect = "move"; }} onDrop={event => { event.preventDefault(); const source = event.dataTransfer.getData("text/plain"); if (!source || source === document.id) return; store.move(source, document.id); refresh(); setStatus(`Moved ${source}`); }}> + {document.id}revision {document.revision} · {document.dirty ? "dirty" : "clean"} + +
)} +
+ {documentTabsOverflow && } +
+
{panelSeparator("properties")}{referenceOpen && setReferenceOpen(false)} />} + {lineReferenceOpen && setLineReferenceOpen(false)} />}

{status}

; +} + +installNavigation("project", readNavigationContext()); +installUiAccessibility(); +createRoot(document.querySelector("#app")!).render(); diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P01.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P01.stl new file mode 100644 index 00000000..3c2dbd0a Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P01.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P02.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P02.stl new file mode 100644 index 00000000..b5cf67e1 Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P02.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P03.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P03.stl new file mode 100644 index 00000000..891e5627 Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P03.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P04.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P04.stl new file mode 100644 index 00000000..50e56ff3 Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P04.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P05.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P05.stl new file mode 100644 index 00000000..dae85d9a Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P05.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P06.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P06.stl new file mode 100644 index 00000000..4446d7c4 Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P06.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P07.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P07.stl new file mode 100644 index 00000000..7ed39f65 Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P07.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P08.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P08.stl new file mode 100644 index 00000000..4826ef71 Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P08.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P09.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P09.stl new file mode 100644 index 00000000..18d4b61c Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P09.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P10.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P10.stl new file mode 100644 index 00000000..4e362245 Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P10.stl differ diff --git a/web/teaching/cases/line-parts/ABB_IRB_120_P11.stl b/web/teaching/cases/line-parts/ABB_IRB_120_P11.stl new file mode 100644 index 00000000..d2cc7eca Binary files /dev/null and b/web/teaching/cases/line-parts/ABB_IRB_120_P11.stl differ diff --git a/web/teaching/cases/line-parts/AuxGripper_P01.stl b/web/teaching/cases/line-parts/AuxGripper_P01.stl new file mode 100644 index 00000000..8eef383d Binary files /dev/null and b/web/teaching/cases/line-parts/AuxGripper_P01.stl differ diff --git a/web/teaching/cases/line-parts/AuxGripper_P02.stl b/web/teaching/cases/line-parts/AuxGripper_P02.stl new file mode 100644 index 00000000..320265c4 Binary files /dev/null and b/web/teaching/cases/line-parts/AuxGripper_P02.stl differ diff --git a/web/teaching/cases/line-parts/AuxGripper_P03.stl b/web/teaching/cases/line-parts/AuxGripper_P03.stl new file mode 100644 index 00000000..22a77d43 Binary files /dev/null and b/web/teaching/cases/line-parts/AuxGripper_P03.stl differ diff --git a/web/teaching/cases/line-parts/CabinetA_P01.stl b/web/teaching/cases/line-parts/CabinetA_P01.stl new file mode 100644 index 00000000..1e88ea21 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetA_P01.stl differ diff --git a/web/teaching/cases/line-parts/CabinetA_P02.stl b/web/teaching/cases/line-parts/CabinetA_P02.stl new file mode 100644 index 00000000..6da5134c Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetA_P02.stl differ diff --git a/web/teaching/cases/line-parts/CabinetA_P03.stl b/web/teaching/cases/line-parts/CabinetA_P03.stl new file mode 100644 index 00000000..c8e1a080 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetA_P03.stl differ diff --git a/web/teaching/cases/line-parts/CabinetA_P04.stl b/web/teaching/cases/line-parts/CabinetA_P04.stl new file mode 100644 index 00000000..eccd2826 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetA_P04.stl differ diff --git a/web/teaching/cases/line-parts/CabinetA_P05.stl b/web/teaching/cases/line-parts/CabinetA_P05.stl new file mode 100644 index 00000000..40653905 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetA_P05.stl differ diff --git a/web/teaching/cases/line-parts/CabinetA_P06.stl b/web/teaching/cases/line-parts/CabinetA_P06.stl new file mode 100644 index 00000000..0b588d14 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetA_P06.stl differ diff --git a/web/teaching/cases/line-parts/CabinetA_P07.stl b/web/teaching/cases/line-parts/CabinetA_P07.stl new file mode 100644 index 00000000..a2baf976 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetA_P07.stl differ diff --git a/web/teaching/cases/line-parts/CabinetA_P08.stl b/web/teaching/cases/line-parts/CabinetA_P08.stl new file mode 100644 index 00000000..2034e138 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetA_P08.stl differ diff --git a/web/teaching/cases/line-parts/CabinetB_P01.stl b/web/teaching/cases/line-parts/CabinetB_P01.stl new file mode 100644 index 00000000..cd930c99 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetB_P01.stl differ diff --git a/web/teaching/cases/line-parts/CabinetB_P02.stl b/web/teaching/cases/line-parts/CabinetB_P02.stl new file mode 100644 index 00000000..9bdd1915 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetB_P02.stl differ diff --git a/web/teaching/cases/line-parts/CabinetB_P03.stl b/web/teaching/cases/line-parts/CabinetB_P03.stl new file mode 100644 index 00000000..02558aae Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetB_P03.stl differ diff --git a/web/teaching/cases/line-parts/CabinetB_P04.stl b/web/teaching/cases/line-parts/CabinetB_P04.stl new file mode 100644 index 00000000..6e9f113f Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetB_P04.stl differ diff --git a/web/teaching/cases/line-parts/CabinetB_P05.stl b/web/teaching/cases/line-parts/CabinetB_P05.stl new file mode 100644 index 00000000..03426005 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetB_P05.stl differ diff --git a/web/teaching/cases/line-parts/CabinetB_P06.stl b/web/teaching/cases/line-parts/CabinetB_P06.stl new file mode 100644 index 00000000..2ecfbe12 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetB_P06.stl differ diff --git a/web/teaching/cases/line-parts/CabinetB_P07.stl b/web/teaching/cases/line-parts/CabinetB_P07.stl new file mode 100644 index 00000000..cfbf9eb6 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetB_P07.stl differ diff --git a/web/teaching/cases/line-parts/CabinetB_P08.stl b/web/teaching/cases/line-parts/CabinetB_P08.stl new file mode 100644 index 00000000..cd06d7cf Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetB_P08.stl differ diff --git a/web/teaching/cases/line-parts/CabinetDoor_P01.stl b/web/teaching/cases/line-parts/CabinetDoor_P01.stl new file mode 100644 index 00000000..f4f10882 Binary files /dev/null and b/web/teaching/cases/line-parts/CabinetDoor_P01.stl differ diff --git a/web/teaching/cases/line-parts/ConveyorFeeder_P01.stl b/web/teaching/cases/line-parts/ConveyorFeeder_P01.stl new file mode 100644 index 00000000..a16b7b53 Binary files /dev/null and b/web/teaching/cases/line-parts/ConveyorFeeder_P01.stl differ diff --git a/web/teaching/cases/line-parts/ConveyorFeeder_P02.stl b/web/teaching/cases/line-parts/ConveyorFeeder_P02.stl new file mode 100644 index 00000000..d9d39210 Binary files /dev/null and b/web/teaching/cases/line-parts/ConveyorFeeder_P02.stl differ diff --git a/web/teaching/cases/line-parts/ConveyorFeeder_P03.stl b/web/teaching/cases/line-parts/ConveyorFeeder_P03.stl new file mode 100644 index 00000000..f2b16c5a Binary files /dev/null and b/web/teaching/cases/line-parts/ConveyorFeeder_P03.stl differ diff --git a/web/teaching/cases/line-parts/ConveyorFeeder_P04.stl b/web/teaching/cases/line-parts/ConveyorFeeder_P04.stl new file mode 100644 index 00000000..7d516f72 Binary files /dev/null and b/web/teaching/cases/line-parts/ConveyorFeeder_P04.stl differ diff --git a/web/teaching/cases/line-parts/ConveyorFeeder_P05.stl b/web/teaching/cases/line-parts/ConveyorFeeder_P05.stl new file mode 100644 index 00000000..43a2d91b Binary files /dev/null and b/web/teaching/cases/line-parts/ConveyorFeeder_P05.stl differ diff --git a/web/teaching/cases/line-parts/ConveyorFeeder_P06.stl b/web/teaching/cases/line-parts/ConveyorFeeder_P06.stl new file mode 100644 index 00000000..4146ddff Binary files /dev/null and b/web/teaching/cases/line-parts/ConveyorFeeder_P06.stl differ diff --git a/web/teaching/cases/line-parts/DisplayA_P01.stl b/web/teaching/cases/line-parts/DisplayA_P01.stl new file mode 100644 index 00000000..80759789 Binary files /dev/null and b/web/teaching/cases/line-parts/DisplayA_P01.stl differ diff --git a/web/teaching/cases/line-parts/DisplayA_P02.stl b/web/teaching/cases/line-parts/DisplayA_P02.stl new file mode 100644 index 00000000..da2ad9da Binary files /dev/null and b/web/teaching/cases/line-parts/DisplayA_P02.stl differ diff --git a/web/teaching/cases/line-parts/DisplayB_P01.stl b/web/teaching/cases/line-parts/DisplayB_P01.stl new file mode 100644 index 00000000..98f46a72 Binary files /dev/null and b/web/teaching/cases/line-parts/DisplayB_P01.stl differ diff --git a/web/teaching/cases/line-parts/DisplayB_P02.stl b/web/teaching/cases/line-parts/DisplayB_P02.stl new file mode 100644 index 00000000..2464ccd6 Binary files /dev/null and b/web/teaching/cases/line-parts/DisplayB_P02.stl differ diff --git a/web/teaching/cases/line-parts/GroundPlane_P01.stl b/web/teaching/cases/line-parts/GroundPlane_P01.stl new file mode 100644 index 00000000..de67cf5a Binary files /dev/null and b/web/teaching/cases/line-parts/GroundPlane_P01.stl differ diff --git a/web/teaching/cases/line-parts/GroundPlane_P02.stl b/web/teaching/cases/line-parts/GroundPlane_P02.stl new file mode 100644 index 00000000..22032a00 Binary files /dev/null and b/web/teaching/cases/line-parts/GroundPlane_P02.stl differ diff --git a/web/teaching/cases/line-parts/Hopper_P01.stl b/web/teaching/cases/line-parts/Hopper_P01.stl new file mode 100644 index 00000000..8c0ebe79 Binary files /dev/null and b/web/teaching/cases/line-parts/Hopper_P01.stl differ diff --git a/web/teaching/cases/line-parts/Hopper_P02.stl b/web/teaching/cases/line-parts/Hopper_P02.stl new file mode 100644 index 00000000..64eed49b Binary files /dev/null and b/web/teaching/cases/line-parts/Hopper_P02.stl differ diff --git a/web/teaching/cases/line-parts/InspectionTable_P01.stl b/web/teaching/cases/line-parts/InspectionTable_P01.stl new file mode 100644 index 00000000..394fe2b0 Binary files /dev/null and b/web/teaching/cases/line-parts/InspectionTable_P01.stl differ diff --git a/web/teaching/cases/line-parts/Loader_P01.stl b/web/teaching/cases/line-parts/Loader_P01.stl new file mode 100644 index 00000000..cad79f13 Binary files /dev/null and b/web/teaching/cases/line-parts/Loader_P01.stl differ diff --git a/web/teaching/cases/line-parts/Loader_P02.stl b/web/teaching/cases/line-parts/Loader_P02.stl new file mode 100644 index 00000000..28da5a03 Binary files /dev/null and b/web/teaching/cases/line-parts/Loader_P02.stl differ diff --git a/web/teaching/cases/line-parts/MaterialStore_P01.stl b/web/teaching/cases/line-parts/MaterialStore_P01.stl new file mode 100644 index 00000000..e1298aee Binary files /dev/null and b/web/teaching/cases/line-parts/MaterialStore_P01.stl differ diff --git a/web/teaching/cases/line-parts/MaterialStore_P02.stl b/web/teaching/cases/line-parts/MaterialStore_P02.stl new file mode 100644 index 00000000..74eaf100 Binary files /dev/null and b/web/teaching/cases/line-parts/MaterialStore_P02.stl differ diff --git a/web/teaching/cases/line-parts/MaterialStore_P03.stl b/web/teaching/cases/line-parts/MaterialStore_P03.stl new file mode 100644 index 00000000..4ac65f03 Binary files /dev/null and b/web/teaching/cases/line-parts/MaterialStore_P03.stl differ diff --git a/web/teaching/cases/line-parts/MaterialStore_P04.stl b/web/teaching/cases/line-parts/MaterialStore_P04.stl new file mode 100644 index 00000000..2a711176 Binary files /dev/null and b/web/teaching/cases/line-parts/MaterialStore_P04.stl differ diff --git a/web/teaching/cases/line-parts/MaterialStore_P05.stl b/web/teaching/cases/line-parts/MaterialStore_P05.stl new file mode 100644 index 00000000..24866e84 Binary files /dev/null and b/web/teaching/cases/line-parts/MaterialStore_P05.stl differ diff --git a/web/teaching/cases/line-parts/OriginMarker_P01.stl b/web/teaching/cases/line-parts/OriginMarker_P01.stl new file mode 100644 index 00000000..ba327711 Binary files /dev/null and b/web/teaching/cases/line-parts/OriginMarker_P01.stl differ diff --git a/web/teaching/cases/line-parts/OriginMarker_P02.stl b/web/teaching/cases/line-parts/OriginMarker_P02.stl new file mode 100644 index 00000000..2f2e5350 Binary files /dev/null and b/web/teaching/cases/line-parts/OriginMarker_P02.stl differ diff --git a/web/teaching/cases/line-parts/OriginMarker_P03.stl b/web/teaching/cases/line-parts/OriginMarker_P03.stl new file mode 100644 index 00000000..62dab0df Binary files /dev/null and b/web/teaching/cases/line-parts/OriginMarker_P03.stl differ diff --git a/web/teaching/cases/line-parts/PickFeeder_P01.stl b/web/teaching/cases/line-parts/PickFeeder_P01.stl new file mode 100644 index 00000000..9b97904c Binary files /dev/null and b/web/teaching/cases/line-parts/PickFeeder_P01.stl differ diff --git a/web/teaching/cases/line-parts/PickFeeder_P02.stl b/web/teaching/cases/line-parts/PickFeeder_P02.stl new file mode 100644 index 00000000..b5dd9608 Binary files /dev/null and b/web/teaching/cases/line-parts/PickFeeder_P02.stl differ diff --git a/web/teaching/cases/line-parts/PickFeeder_P03.stl b/web/teaching/cases/line-parts/PickFeeder_P03.stl new file mode 100644 index 00000000..9dff84ba Binary files /dev/null and b/web/teaching/cases/line-parts/PickFeeder_P03.stl differ diff --git a/web/teaching/cases/line-parts/PickFeeder_P04.stl b/web/teaching/cases/line-parts/PickFeeder_P04.stl new file mode 100644 index 00000000..50d6b5bc Binary files /dev/null and b/web/teaching/cases/line-parts/PickFeeder_P04.stl differ diff --git a/web/teaching/cases/line-parts/PickFeeder_P05.stl b/web/teaching/cases/line-parts/PickFeeder_P05.stl new file mode 100644 index 00000000..0990b19a Binary files /dev/null and b/web/teaching/cases/line-parts/PickFeeder_P05.stl differ diff --git a/web/teaching/cases/line-parts/Plane001_P01.stl b/web/teaching/cases/line-parts/Plane001_P01.stl new file mode 100644 index 00000000..de67cf5a Binary files /dev/null and b/web/teaching/cases/line-parts/Plane001_P01.stl differ diff --git a/web/teaching/cases/line-parts/Plane001_P02.stl b/web/teaching/cases/line-parts/Plane001_P02.stl new file mode 100644 index 00000000..22032a00 Binary files /dev/null and b/web/teaching/cases/line-parts/Plane001_P02.stl differ diff --git a/web/teaching/cases/line-parts/Plane_P01.stl b/web/teaching/cases/line-parts/Plane_P01.stl new file mode 100644 index 00000000..4c813f23 Binary files /dev/null and b/web/teaching/cases/line-parts/Plane_P01.stl differ diff --git a/web/teaching/cases/line-parts/Plane_P02.stl b/web/teaching/cases/line-parts/Plane_P02.stl new file mode 100644 index 00000000..481618e0 Binary files /dev/null and b/web/teaching/cases/line-parts/Plane_P02.stl differ diff --git a/web/teaching/cases/line-parts/Pusher_P01.stl b/web/teaching/cases/line-parts/Pusher_P01.stl new file mode 100644 index 00000000..e144c179 Binary files /dev/null and b/web/teaching/cases/line-parts/Pusher_P01.stl differ diff --git a/web/teaching/cases/line-parts/Pusher_P02.stl b/web/teaching/cases/line-parts/Pusher_P02.stl new file mode 100644 index 00000000..5b130145 Binary files /dev/null and b/web/teaching/cases/line-parts/Pusher_P02.stl differ diff --git a/web/teaching/cases/line-parts/RawAssembly_P01.stl b/web/teaching/cases/line-parts/RawAssembly_P01.stl new file mode 100644 index 00000000..be0baf09 Binary files /dev/null and b/web/teaching/cases/line-parts/RawAssembly_P01.stl differ diff --git a/web/teaching/cases/line-parts/RawAssembly_P02.stl b/web/teaching/cases/line-parts/RawAssembly_P02.stl new file mode 100644 index 00000000..81e6dcb5 Binary files /dev/null and b/web/teaching/cases/line-parts/RawAssembly_P02.stl differ diff --git a/web/teaching/cases/line-parts/RawAssembly_P03.stl b/web/teaching/cases/line-parts/RawAssembly_P03.stl new file mode 100644 index 00000000..28d36528 Binary files /dev/null and b/web/teaching/cases/line-parts/RawAssembly_P03.stl differ diff --git a/web/teaching/cases/line-parts/RawFeeder_P01.stl b/web/teaching/cases/line-parts/RawFeeder_P01.stl new file mode 100644 index 00000000..2dafedad Binary files /dev/null and b/web/teaching/cases/line-parts/RawFeeder_P01.stl differ diff --git a/web/teaching/cases/line-parts/RawFeeder_P02.stl b/web/teaching/cases/line-parts/RawFeeder_P02.stl new file mode 100644 index 00000000..c67d6e19 Binary files /dev/null and b/web/teaching/cases/line-parts/RawFeeder_P02.stl differ diff --git a/web/teaching/cases/line-parts/RawFeeder_P03.stl b/web/teaching/cases/line-parts/RawFeeder_P03.stl new file mode 100644 index 00000000..76a9248f Binary files /dev/null and b/web/teaching/cases/line-parts/RawFeeder_P03.stl differ diff --git a/web/teaching/cases/line-parts/RawFeeder_P04.stl b/web/teaching/cases/line-parts/RawFeeder_P04.stl new file mode 100644 index 00000000..1aab1333 Binary files /dev/null and b/web/teaching/cases/line-parts/RawFeeder_P04.stl differ diff --git a/web/teaching/cases/line-parts/RawFeeder_P05.stl b/web/teaching/cases/line-parts/RawFeeder_P05.stl new file mode 100644 index 00000000..0e3ea2e0 Binary files /dev/null and b/web/teaching/cases/line-parts/RawFeeder_P05.stl differ diff --git a/web/teaching/cases/line-parts/RotaryTransfer_P01.stl b/web/teaching/cases/line-parts/RotaryTransfer_P01.stl new file mode 100644 index 00000000..4134c994 Binary files /dev/null and b/web/teaching/cases/line-parts/RotaryTransfer_P01.stl differ diff --git a/web/teaching/cases/line-parts/RotaryTransfer_P02.stl b/web/teaching/cases/line-parts/RotaryTransfer_P02.stl new file mode 100644 index 00000000..51bc9356 Binary files /dev/null and b/web/teaching/cases/line-parts/RotaryTransfer_P02.stl differ diff --git a/web/teaching/cases/line-parts/SensorBlock_P01.stl b/web/teaching/cases/line-parts/SensorBlock_P01.stl new file mode 100644 index 00000000..07594017 Binary files /dev/null and b/web/teaching/cases/line-parts/SensorBlock_P01.stl differ diff --git a/web/teaching/cases/line-parts/StackLight_P01.stl b/web/teaching/cases/line-parts/StackLight_P01.stl new file mode 100644 index 00000000..d4f8aba6 Binary files /dev/null and b/web/teaching/cases/line-parts/StackLight_P01.stl differ diff --git a/web/teaching/cases/line-parts/StackLight_P02.stl b/web/teaching/cases/line-parts/StackLight_P02.stl new file mode 100644 index 00000000..c36e4b3b Binary files /dev/null and b/web/teaching/cases/line-parts/StackLight_P02.stl differ diff --git a/web/teaching/cases/line-parts/ToolFrame_P01.stl b/web/teaching/cases/line-parts/ToolFrame_P01.stl new file mode 100644 index 00000000..76844096 Binary files /dev/null and b/web/teaching/cases/line-parts/ToolFrame_P01.stl differ diff --git a/web/teaching/cases/line-parts/ToolFrame_P02.stl b/web/teaching/cases/line-parts/ToolFrame_P02.stl new file mode 100644 index 00000000..82bfcc4a Binary files /dev/null and b/web/teaching/cases/line-parts/ToolFrame_P02.stl differ diff --git a/web/teaching/cases/line-parts/ToolFrame_P03.stl b/web/teaching/cases/line-parts/ToolFrame_P03.stl new file mode 100644 index 00000000..21ac95c5 Binary files /dev/null and b/web/teaching/cases/line-parts/ToolFrame_P03.stl differ diff --git a/web/teaching/cases/line-parts/TransportBracket_P01.stl b/web/teaching/cases/line-parts/TransportBracket_P01.stl new file mode 100644 index 00000000..6c326db4 Binary files /dev/null and b/web/teaching/cases/line-parts/TransportBracket_P01.stl differ diff --git a/web/teaching/cases/line-parts/TransportInspector_P01.stl b/web/teaching/cases/line-parts/TransportInspector_P01.stl new file mode 100644 index 00000000..ca08d486 Binary files /dev/null and b/web/teaching/cases/line-parts/TransportInspector_P01.stl differ diff --git a/web/teaching/cases/line-parts/TransportInspector_P02.stl b/web/teaching/cases/line-parts/TransportInspector_P02.stl new file mode 100644 index 00000000..0d88dbe4 Binary files /dev/null and b/web/teaching/cases/line-parts/TransportInspector_P02.stl differ diff --git a/web/teaching/cases/line-parts/WeighPlatform_P01.stl b/web/teaching/cases/line-parts/WeighPlatform_P01.stl new file mode 100644 index 00000000..306c2c2b Binary files /dev/null and b/web/teaching/cases/line-parts/WeighPlatform_P01.stl differ diff --git a/web/teaching/cases/line-parts/WeighPlatform_P02.stl b/web/teaching/cases/line-parts/WeighPlatform_P02.stl new file mode 100644 index 00000000..341ff365 Binary files /dev/null and b/web/teaching/cases/line-parts/WeighPlatform_P02.stl differ diff --git a/web/teaching/cases/line-parts/mapping.json b/web/teaching/cases/line-parts/mapping.json new file mode 100644 index 00000000..c60f2430 --- /dev/null +++ b/web/teaching/cases/line-parts/mapping.json @@ -0,0 +1,90 @@ +{ + "CabinetA_P01": 684, + "CabinetA_P02": 684, + "CabinetA_P03": 684, + "CabinetA_P04": 684, + "CabinetA_P05": 684, + "CabinetA_P06": 684, + "CabinetA_P07": 684, + "CabinetA_P08": 684, + "CabinetB_P01": 684, + "CabinetB_P02": 684, + "CabinetB_P03": 684, + "CabinetB_P04": 684, + "CabinetB_P05": 684, + "CabinetB_P06": 684, + "CabinetB_P07": 684, + "CabinetB_P08": 684, + "CabinetDoor_P01": 684, + "DisplayA_P01": 684, + "DisplayA_P02": 684, + "DisplayB_P01": 684, + "DisplayB_P02": 684, + "Hopper_P01": 684, + "Hopper_P02": 684, + "RawFeeder_P01": 684, + "RawFeeder_P02": 684, + "RawFeeder_P03": 684, + "RawFeeder_P04": 684, + "RawFeeder_P05": 684, + "Loader_P01": 684, + "Loader_P02": 684, + "ConveyorFeeder_P01": 684, + "ConveyorFeeder_P02": 684, + "ConveyorFeeder_P03": 684, + "ConveyorFeeder_P04": 684, + "ConveyorFeeder_P05": 684, + "ConveyorFeeder_P06": 684, + "RotaryTransfer_P01": 684, + "RotaryTransfer_P02": 684, + "WeighPlatform_P01": 684, + "WeighPlatform_P02": 684, + "PickFeeder_P01": 684, + "PickFeeder_P02": 684, + "PickFeeder_P03": 684, + "PickFeeder_P04": 684, + "PickFeeder_P05": 684, + "AuxGripper_P01": 684, + "AuxGripper_P02": 684, + "AuxGripper_P03": 684, + "Pusher_P01": 684, + "Pusher_P02": 684, + "MaterialStore_P01": 684, + "MaterialStore_P02": 684, + "MaterialStore_P03": 684, + "MaterialStore_P04": 684, + "MaterialStore_P05": 684, + "SensorBlock_P01": 684, + "TransportBracket_P01": 684, + "TransportInspector_P01": 684, + "TransportInspector_P02": 25084, + "RawAssembly_P01": 684, + "RawAssembly_P02": 684, + "RawAssembly_P03": 684, + "InspectionTable_P01": 684, + "StackLight_P01": 684, + "StackLight_P02": 25084, + "ToolFrame_P01": 684, + "ToolFrame_P02": 684, + "ToolFrame_P03": 25084, + "OriginMarker_P01": 684, + "OriginMarker_P02": 684, + "OriginMarker_P03": 25084, + "ABB_IRB_120_P01": 684, + "ABB_IRB_120_P02": 684, + "ABB_IRB_120_P03": 25084, + "ABB_IRB_120_P04": 684, + "ABB_IRB_120_P05": 684, + "ABB_IRB_120_P06": 684, + "ABB_IRB_120_P07": 684, + "ABB_IRB_120_P08": 684, + "ABB_IRB_120_P09": 684, + "ABB_IRB_120_P10": 684, + "ABB_IRB_120_P11": 684, + "GroundPlane_P01": 684, + "GroundPlane_P02": 684, + "Plane_P01": 684, + "Plane_P02": 684, + "Plane001_P01": 684, + "Plane001_P02": 684 +} diff --git a/web/teaching/cases/production-line-assembly.html b/web/teaching/cases/production-line-assembly.html new file mode 100644 index 00000000..afc96afb --- /dev/null +++ b/web/teaching/cases/production-line-assembly.html @@ -0,0 +1,93 @@ + + + + + + +生产线 · 27 个模型 / 88 个部件重建结果 + + + + +
+

生产线重建结果

+ + 加载中… +
+
+

左键旋转 · 滚轮缩放 · 右键平移

+ + + diff --git a/web/teaching/cases/production-line-assembly.png b/web/teaching/cases/production-line-assembly.png new file mode 100644 index 00000000..e5e617a7 Binary files /dev/null and b/web/teaching/cases/production-line-assembly.png differ diff --git a/web/teaching/cases/production-line-course.html b/web/teaching/cases/production-line-course.html new file mode 100644 index 00000000..06b46e84 --- /dev/null +++ b/web/teaching/cases/production-line-course.html @@ -0,0 +1,399 @@ + + + + + + +生产线 27 件 GLB 模型 Web FreeCAD 初学者视频课程 + + + +
+

生产线 27 件 GLB 模型 Web FreeCAD 初学者视频课程

+
+

+
+
+ +
+

S0 · 入门与参考模型

+
+
+ E01 +

界面与产线参考模型

+ +
+ + +
分步截图(6)
E01 S00-title.png
S00-title
E01 S01-interface.png
S01-interface
E01 S02-reference.png
S02-reference
E01 S03-cabinet.png
S03-cabinet
E01 S04-units.png
S04-units
E01 S05-recap.png
S05-recap
+
学习目标与参数表 +
  • 认识 Web FreeCAD 的对象树、三维视口和属性面板
  • 新建空白文档并在视口中旋转、缩放
  • 打开产线参考模型查看器,确认 27 个 GLB 的尺寸
  • 理解本批参考模型是 Z-up、米制,进入 FreeCAD 后统一换算为毫米
+
参考模型数量27 个 GLB
教学部件总数约 88 个 Box/Cylinder
主控制柜包围盒1500 × 744 × 754 mm
地面与地线包围盒4867 × 3673 × 310 mm
坐标约定Z-up,米 ×1000 → 毫米
+
+
自检清单
  • 能新建文档,并看到左侧对象树为空
  • 参考查看器下拉列表有 27 项
  • 主控制柜显示 1.50 × 0.74 × 0.75 m
  • 地面与地线显示 4.87 × 3.67 × 0.31 m
  • 视口可以旋转和缩放
+
常见错误与练习
  • 把参考查看器当成导入:它只显示 GLB,不会在文档里生成对象
  • 把米直接当毫米填进属性面板,模型会小一千倍
  • 把 GLB 的 Y-up 约定套到这批文件上,模型会躺倒

在查看器里依次找到料仓、ABB IRB 120 和显示屏,记录它们的包围盒,下一集填进零件表。

+

检查点:无

+
+
+
+ E02 +

测量、单位与零件表

+ +
+ + +
分步截图(6)
E02 S00-title.png
S00-title
E02 S01-reference.png
S01-reference
E02 S02-table.png
S02-table
E02 S03-formula.png
S03-formula
E02 S04-audit.png
S04-audit
E02 S05-recap.png
S05-recap
+
学习目标与参数表 +
  • 从参考查看器读取包围盒并换算成毫米
  • 用 Spreadsheet 建立可复用的零件表
  • 用公式核对尺寸联动,理解参数化表的用法
  • 识别单位错误和轴向错误的典型症状
+
零件表列模型、长X、宽Y、高Z、中心X、中心Y、中心Z
代表模型主控制柜、料仓、传送带、夹取、ABB、地面
公式测试B8 = B2 + C2;B2 1500 → 1600 → 1500
单位全部为毫米
+
+
自检清单
  • 查看器列表为 27 项
  • 六行零件表全部填写
  • 公式 B8 能随 B2 变化
  • 恢复原值后公式结果回到初始值
  • 所有尺寸都是毫米量级
+
常见错误与练习
  • 把查看器的米数直接填进毫米表
  • 把 Z-up 当成 Y-up,Y/Z 对调
  • 公式引用错列,导致结果与手算不一致

把其余 21 件模型的包围盒也补进零件表,并按工位排序。

+

检查点:无

+
+
+
+

S1 · 机柜与显示屏

+
+
+ E03 +

主控制柜

+ +
+ + +
分步截图(7)
E03 S00-title.png
S00-title
E03 S01-document.png
S01-document
E03 S02-parts.png
S02-parts
E03 S03-parts.png
S03-parts
E03 S04-parts.png
S04-parts
E03 S05-parts.png
S05-parts
E03 S06-recap.png
S06-recap
+
学习目标与参数表 +
  • 把复杂柜体拆成 8 个可参数化的图元部件
  • 用 Box 的 Length/Width/Height 精确控制尺寸
  • 用 Position 面板按参考最小角点摆放
  • 用 Object Color 设置并保存部件颜色
+
柜体 P021500 × 744.2 × 754 mm @ (-35, -214.3, 0)
立柱 P01/P03440 × 134.3 × 597 mm
柜门 P0430 × 560 × 560 mm
横梁 P05/P0640 × 560 × 40 mm
背板 P07/P08440 × 30 × 560 mm
整体包围盒1500 × 744 × 754 mm
+
+
自检清单
  • 对象树有 8 个 CabinetA_Pxx 对象
  • 每个对象尺寸与参数表一致
  • 柜门厚度方向为 X=30 mm
  • 颜色与参考一致,黑色立柱不发白
  • 保存后重新打开,对象和颜色仍在
+
常见错误与练习
  • 把柜门厚度填到 Z 方向,门会变成一块立着的厚板
  • 位置填成中心而不是最小角点,整体偏移半个尺寸
  • 只设了显示颜色但没有触发应用,保存后颜色丢失

把柜体 P02 的宽度改成 800 mm,观察整体包围盒变化,再改回 744.2。

+

下载 E03 检查点 FCStd

+
+
+
+ E04 +

长控制柜

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(7)
E04 S00-title.png
S00-title
E04 S01-start.png
S01-start
E04 S02-parts.png
S02-parts
E04 S03-parts.png
S03-parts
E04 S04-parts.png
S04-parts
E04 S05-parts.png
S05-parts
E04 S06-recap.png
S06-recap
+
学习目标与参数表 +
  • 在已有检查点上增量建模,保持累计场景
  • 用重复的立柱/横梁建立长柜体的节奏
  • 控制薄板类部件的厚度方向
  • 保存前做累计 16 对象的全量精度检查
+
整体包围盒2970 × 774 × 774 mm
左柜体 P021500 × 744.2 × 754 mm
顶板 P042960 × 640 × 20.3 mm
右侧小柜 P05540 × 640 × 600 mm
横梁 P06/P0740 × 560 × 40 mm
背板 P08440 × 30 × 560 mm
+
+
自检清单
  • 打开 E03 检查点后能看到 8 个 CabinetA 对象
  • 新增 8 个 CabinetB_Pxx 对象
  • 顶板厚度为 20 mm
  • 累计 16 个对象全部通过精度检查
  • E04 检查点保存成功
+
常见错误与练习
  • 新建了空白文档,丢掉上一集的柜体
  • 顶板长度填到 Y 方向,柜体变成 T 形
  • 右侧小柜和主体重叠过多,整体包围盒变短

把顶板 P04 的厚度从 20 改成 30 mm,观察整体高度变化,再改回 20.3。

+

下载 E04 检查点 FCStd

+
+
+
+ E05 +

柜门与双显示屏

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(6)
E05 S00-title.png
S00-title
E05 S01-start.png
S01-start
E05 S02-parts.png
S02-parts
E05 S03-parts.png
S03-parts
E05 S04-parts.png
S04-parts
E05 S05-recap.png
S05-recap
+
学习目标与参数表 +
  • 掌握薄板类零件的厚度方向
  • 用同一套参数复用两块显示屏
  • 理解屏幕外壳与面板的前后层级
  • 在累计文档中检查对象命名和数量
+
柜门30 × 560 × 560 mm
显示屏屏体249 × 161.2 × 312 mm
显示屏面板204 × 115.7 × 148.4 mm
显示屏 A 位置(-1472.4, -127.7, 774) mm
显示屏 B 位置(-1194.5, -325, 40) mm
累计对象21
+
+
自检清单
  • 柜门厚度为 X=30 mm
  • 两块屏体外壳尺寸相同
  • 面板在屏体前方,颜色更深
  • 对象树出现 DisplayA_P01/P02 与 DisplayB_P01/P02
  • 累计 21 个对象全部通过精度检查
+
常见错误与练习
  • 把柜门厚度填成 560,门变成方块
  • 两块屏共用同一个位置,重叠在一起
  • 面板和外壳颜色设反,屏幕看起来是凸出的白块

把显示屏 B 的 Z 位置整体抬高 100 mm,观察它与操作台的关系,再恢复。

+

下载 E05 检查点 FCStd

+
+
+
+

S2 · 上料与输送

+
+
+ E06 +

料仓与原料上料

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(7)
E06 S00-title.png
S00-title
E06 S01-start.png
S01-start
E06 S02-parts.png
S02-parts
E06 S03-parts.png
S03-parts
E06 S04-parts.png
S04-parts
E06 S05-parts.png
S05-parts
E06 S06-recap.png
S06-recap
+
学习目标与参数表 +
  • 建立料仓的外箱与内胆层次
  • 用绿色导轨检验颜色设置
  • 判断什么时候用 Box 而不是 Cylinder
  • 在累计 28 个对象时保持精度检查
+
料仓外箱280 × 250 × 200 mm @ Z=774
料仓内胆190.6 × 190.8 × 65 mm
上料机架84.8 × 56 × 189.7 mm
绿色导轨77.2 × 27.4 × 16 mm,绿色
上料底板210 × 208 × 186 mm
上料圆柱件68.4 × 56.4 × 100 mm(非正圆,用 Box)
+
+
自检清单
  • 料仓外箱底部在 Z=774 mm
  • 绿色导轨颜色正确
  • 上料底板与机架没有左右错位
  • 累计 28 个对象全部通过精度检查
  • E06 检查点保存成功
+
常见错误与练习
  • 把非正圆截面强行做成圆柱,Y 方向超出公差
  • 料仓落到 Z=0,沉到台面下面
  • 绿色导轨忘记设颜色,验收时颜色通道对不上

把料仓外箱高度从 200 改成 240 mm,观察内胆是否被完全包住,再改回 200。

+

下载 E06 检查点 FCStd

+
+
+
+ E07 +

上料与传送带送料

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(7)
E07 S00-title.png
S00-title
E07 S01-start.png
S01-start
E07 S02-parts.png
S02-parts
E07 S03-parts.png
S03-parts
E07 S04-parts.png
S04-parts
E07 S05-parts.png
S05-parts
E07 S06-recap.png
S06-recap
+
学习目标与参数表 +
  • 建立悬臂式上料机构
  • 理解传送带框架、皮带、滚筒的层级
  • 用小件补齐模型细节
  • 检查长条设备的 X 方向尺寸
+
上料机架165 × 140 × 212 mm
上料顶梁319.9 × 40 × 30 mm
传送带框架497 × 170 × 174 mm
皮带508.4 × 100 × 68.9 mm @ Z=906
滚筒44.5 × 152.5 × 34 mm,黑色
料口395 × 165 × 204.6 mm
+
+
自检清单
  • 上料顶梁向右侧伸出
  • 皮带高于框架,Z 起点约 906 mm
  • 黑色滚筒位于皮带右端
  • 六个 ConveyorFeeder 对象齐全
  • 累计 36 个对象全部通过精度检查
+
常见错误与练习
  • 把皮带和框架放在同一高度,皮带陷进框架
  • 滚筒位置放到左端,与料口方向相反
  • 漏建挡板或侧轨,对象数少两件

把皮带长度增加 20 mm,观察它与框架的相对长度,再恢复。

+

下载 E07 检查点 FCStd

+
+
+
+ E08 +

旋转运送与称重平台

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(5)
E08 S00-title.png
S00-title
E08 S01-start.png
S01-start
E08 S02-parts.png
S02-parts
E08 S03-parts.png
S03-parts
E08 S04-recap.png
S04-recap
+
学习目标与参数表 +
  • 建立大直径转盘的包围盒
  • 控制薄台面的厚度方向
  • 理解同一工位内两个部件的相对高度
  • 在 40 个对象的累计文档中定位新对象
+
旋转电机340 × 265 × 165 mm,黑色
转盘536.9 × 536.3 × 47 mm @ Z=929
称重底座200 × 199.3 × 170 mm
称重台面149.7 × 150 × 5 mm @ Z=944
累计对象40
+
+
自检清单
  • 转盘顶面高于电机
  • 称重台面厚度为 5 mm
  • 台面位于底座正上方
  • 累计 40 个对象全部通过精度检查
  • E08 检查点保存成功
+
常见错误与练习
  • 把转盘厚度 47 填到 Z 以外的方向
  • 称重台面与底座错位半个尺寸
  • 电机颜色忘记改成黑色

把称重台面抬高 20 mm,观察它与底座之间出现间隙,再恢复。

+

下载 E08 检查点 FCStd

+
+
+
+

S3 · 抓取、推料与存储

+
+
+ E09 +

夹取送料与辅助夹爪

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(7)
E09 S00-title.png
S00-title
E09 S01-start.png
S01-start
E09 S02-parts.png
S02-parts
E09 S03-parts.png
S03-parts
E09 S04-parts.png
S04-parts
E09 S05-parts.png
S05-parts
E09 S06-recap.png
S06-recap
+
学习目标与参数表 +
  • 建立一米级横向夹取机构
  • 控制悬臂与滑座的高度层级
  • 建立三件式夹爪结构
  • 在 48 个对象中检查新工位
+
夹爪本体148.5 × 60 × 60 mm,黑色
机架420 × 200 × 441.8 mm
横梁810 × 72 × 82 mm
滑座242.9 × 143.2 × 119.2 mm
辅助夹爪上座73.3 × 94.3 × 38.1 mm
辅助夹爪指尖34.1 × 29.9 × 53.9 mm
+
+
自检清单
  • 横梁跨度为 810 mm
  • 夹爪在横梁下方
  • 辅助夹爪三件对齐
  • 累计 48 个对象全部通过
  • E09 检查点保存成功
+
常见错误与练习
  • 横梁长度少填一位,整条抓取装置缩到十分之一
  • 滑座放到横梁上方
  • 辅助夹爪三件互相穿插

把滑座沿 X 方向移动 50 mm,观察它与横梁的相对位置,再恢复。

+

下载 E09 检查点 FCStd

+
+
+
+ E10 +

推料装置与物料存储区

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(7)
E10 S00-title.png
S00-title
E10 S01-start.png
S01-start
E10 S02-parts.png
S02-parts
E10 S03-parts.png
S03-parts
E10 S04-parts.png
S04-parts
E10 S05-parts.png
S05-parts
E10 S06-recap.png
S06-recap
+
学习目标与参数表 +
  • 建立竖直推杆结构
  • 用四个同尺寸支座练习阵列位置
  • 检查阵列件的坐标是否成对
  • 在 55 个对象中定位新工位
+
推料底座490 × 230 × 85 mm
推杆149.6 × 336 × 532.6 mm
存储区大板351.8 × 83 × 412.8 mm
支座39.9 × 40 × 30 mm × 4
累计对象55
+
+
自检清单
  • 推杆竖直安装
  • 四个支座位置成矩形
  • 支座颜色一致
  • 累计 55 个对象全部通过
  • E10 检查点保存成功
+
常见错误与练习
  • 推杆方向填反,向左侧伸出
  • 四个支座 Z 高度不一致
  • 只建了两个支座,对象数少两件

把四个支座的 Z 坐标统一加 10 mm,观察大板与支座的间隙,再恢复。

+

下载 E10 检查点 FCStd

+
+
+
+ E11 +

检测块、支架与运送检测

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(5)
E11 S00-title.png
S00-title
E11 S01-start.png
S01-start
E11 S02-parts.png
S02-parts
E11 S03-parts.png
S03-parts
E11 S04-recap.png
S04-recap
+
学习目标与参数表 +
  • 建立 7 mm 薄板小件
  • 第一次用 Part Cylinder 建圆柱
  • 确认圆柱包围盒 30 × 30 × 60
  • 检查小件在对象树中的命名
+
检测块22 × 22 × 7 mm
运送支架60 × 113.5 × 310 mm
检测头主体75 × 148.5 × 325 mm
红色圆柱半径 15 mm × 高度 60 mm
累计对象59
+
+
自检清单
  • 检测块厚度为 7 mm
  • 圆柱半径 15、高度 60
  • 圆柱颜色为红色
  • 累计 59 个对象全部通过
  • E11 检查点保存成功
+
常见错误与练习
  • 圆柱半径填成直径 30
  • 圆柱高度填成 30
  • 小件在视口里点不中,误选了别的对象

把圆柱半径改成 12 mm,观察包围盒从 30 变成 24,再恢复 15。

+

下载 E11 检查点 FCStd

+
+
+
+

S4 · 装配与检测

+
+
+ E12 +

原料装配与检测台

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(5)
E12 S00-title.png
S00-title
E12 S01-start.png
S01-start
E12 S02-parts.png
S02-parts
E12 S03-parts.png
S03-parts
E12 S04-recap.png
S04-recap
+
学习目标与参数表 +
  • 建立大板加立柱的装配平台
  • 处理 5 mm 见方的细杆
  • 建立单根立柱式检测台
  • 在 63 个对象中确认细杆存在
+
装配大板498.3 × 92 × 338.1 mm @ Z=786
装配立柱70.6 × 78.5 × 128.5 mm
细杆192.5 × 5 × 5 mm
检测台75 × 148.5 × 325 mm
累计对象63
+
+
自检清单
  • 大板抬到 786 mm
  • 细杆尺寸 192.5 × 5 × 5
  • 检测台落在台面上
  • 累计 63 个对象全部通过
  • E12 检查点保存成功
+
常见错误与练习
  • 细杆尺寸填成 192.5 × 50 × 50
  • 装配立柱沉到大板下面
  • 检测台位置与其它工位重叠

把细杆直径从 5 改成 8 mm,观察它与大板的相对粗细,再恢复。

+

下载 E12 检查点 FCStd

+
+
+
+ E13 +

三色灯、工具坐标系与原点

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(7)
E13 S00-title.png
S00-title
E13 S01-start.png
S01-start
E13 S02-parts.png
S02-parts
E13 S03-parts.png
S03-parts
E13 S04-parts.png
S04-parts
E13 S05-parts.png
S05-parts
E13 S06-recap.png
S06-recap
+
学习目标与参数表 +
  • 用 Cylinder 建立灯柱与 Z 轴
  • 用纯红/纯绿/纯蓝标记 XYZ 轴
  • 区分 72 mm 工具坐标与 142 mm 原点标记
  • 检查圆柱半径与高度
+
三色灯底座50 × 40 × 228 mm
三色灯柱R20 × 240 mm,绿色
Tool X/Y 轴67.7 × 9 × 9 mm,红/绿
Tool Z 轴R4.5 × 67.7 mm,蓝色
原点 X/Y 轴132.8 × 17.7 × 17.7 mm,红/绿
原点 Z 轴R8.85 × 132.8 mm,蓝色
+
+
自检清单
  • 灯柱半径 20、高度 240
  • Tool 三轴长度一致
  • 原点三轴长度一致
  • 红绿蓝颜色通道正确
  • 累计 71 个对象全部通过
+
常见错误与练习
  • 圆柱半径填成直径
  • 把 Z 轴做成立着的 Box
  • 红绿蓝设反,X 轴变绿

把 Tool 的 Z 轴高度改成 100 mm,观察三轴不再等长,再恢复 67.7。

+

下载 E13 检查点 FCStd

+
+
+
+

S5 · 机器人工作站

+
+
+ E14 +

ABB IRB 120 六轴机器人

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(9)
E14 S00-title.png
S00-title
E14 S01-start.png
S01-start
E14 S02-parts.png
S02-parts
E14 S03-parts.png
S03-parts
E14 S04-parts.png
S04-parts
E14 S05-parts.png
S05-parts
E14 S06-parts.png
S06-parts
E14 S07-parts.png
S07-parts
E14 S08-recap.png
S08-recap
+
学习目标与参数表 +
  • 按六轴结构拆分机器人
  • 用 Cylinder 建立下臂
  • 区分黑色车漆、不锈钢、白钢三种颜色
  • 检查圆柱包围盒与整机高度
+
底座214.9 × 217.3 × 177 mm,黑色
下臂圆柱R109.7 × 431.2 mm,白色
上臂115.5 × 234 × 188.1 mm
腕部黑色端板95.9 × 5 × 96 mm
夹爪本体94.3 × 38 × 73.3 mm,白钢
整机高度约 700 mm(Z 774–1474)
+
+
自检清单
  • 下臂圆柱直径 219.4、高度 431.2
  • 黑色端板厚度 5 mm
  • 夹爪两片夹指齐全
  • 整机 Z 范围 774–1474 mm
  • 累计 82 个对象全部通过
+
常见错误与练习
  • 圆柱半径填成 219.4(直径)
  • 下臂高度填成 43.12,机器人缩成一半
  • 黑色端板和白色腕部颜色设反

把下臂圆柱高度减少 50 mm,观察腕部位置下移,再恢复。

+

下载 E14 检查点 FCStd

+
+
+
+ E15 +

机器人工作站复核

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(5)
E15 S00-title.png
S00-title
E15 S01-checkpoint.png
S01-checkpoint
E15 S02-reference.png
S02-reference
E15 S03-robot.png
S03-robot
E15 S04-recap.png
S04-recap
+
学习目标与参数表 +
  • 复核机器人工作站的完整对象集
  • 用参考查看器核对三件关键模型
  • 从侧面检查机器人层级
  • 保存无新增几何的复核检查点
+
累计对象82
ABB 包围盒219 × 688 × 700 mm
三色灯包围盒50 × 40 × 468 mm
Tool 包围盒72 × 72 × 72 mm
+
+
自检清单
  • 对象树 82 个对象齐全
  • ABB 包围盒与参考一致
  • 三色灯立在柜顶
  • Tool 三轴等长
  • E15 检查点保存成功
+
常见错误与练习
  • 检查点未加载完就开始数对象
  • 把 Tool 的 72 mm 当成 720 mm
  • 只看了正面,没有检查侧面层级

在视口里隐藏地面,单独观察机器人工作站,再恢复显示。

+

下载 E15 检查点 FCStd

+
+
+
+

S6 · 场景、总装与交付

+
+
+ E16 +

地面平面与地线

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(6)
E16 S00-title.png
S00-title
E16 S01-start.png
S01-start
E16 S02-parts.png
S02-parts
E16 S03-parts.png
S03-parts
E16 S04-parts.png
S04-parts
E16 S05-recap.png
S05-recap
+
学习目标与参数表 +
  • 建立超大薄板地面
  • 重复模型但独立定位
  • 检查 88 个对象全部到齐
  • 为总装准备完整场景
+
地面大板4867.5 × 3673.2 × 310.1 mm
黄色地线4855.3 × 1109.3 × 0.1 mm
地面模型GroundPlane / Plane / Plane001
累计对象88
+
+
自检清单
  • 三块地面尺寸一致
  • 地线颜色为黄色
  • 地线 Z 厚度接近 0
  • 27 个模型 88 个部件全部存在
  • E16 检查点保存成功
+
常见错误与练习
  • 复制地面时连位置一起复制,三块重叠
  • 地线厚度填成 310,变成一堵墙
  • 漏掉第三块重复地面

把第二块地面沿 X 平移 500 mm,观察它与第一块的关系,再恢复。

+

下载 E16 检查点 FCStd

+
+
+
+ E17 +

整线总装

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(5)
E17 S00-title.png
S00-title
E17 S01-assembly.png
S01-assembly
E17 S02-links.png
S02-links
E17 S03-audit.png
S03-audit
E17 S04-recap.png
S04-recap
+
学习目标与参数表 +
  • 在 Assembly 工作台新建总装文档
  • 把 88 个部件插入为链接
  • 核对链接数量避免缺件/重复
  • 理解链接装配与复制几何的区别
+
总装文档LineAssembly / 生产线总装
源文件line-course-E16.FCStd
链接数量88
源对象27 个模型 / 88 个部件
+
+
自检清单
  • 总装文档创建成功
  • 源对象列表加载完成
  • 88 条链接全部插入
  • Accept 后链接保留
  • 没有重复链接
+
常见错误与练习
  • 源文件选错,插入了旧检查点
  • 只插入一部分就 Accept
  • 重复点击 Insert 产生重复链接

在总装里选择一条链接,查看它的源文档和源对象名。

+

检查点:无

+
+
+
+ E18 +

精度审计与交付

+ +
+

视频待制作(脚本与参数已就绪)。

+
分步截图(5)
E18 S00-title.png
S00-title
E18 S01-audit.png
S01-audit
E18 S02-exports.png
S02-exports
E18 S03-recap.png
S03-recap
E18 S04-delivery.png
S04-delivery
+
学习目标与参数表 +
  • 对 27 个模型 88 个部件做全量审计
  • 从 UI 导出 STEP/STL 到 OPFS
  • 保存 E18 交付检查点与证据
  • 理解 OPFS 与本地下载的边界
+
模型数27
部件数88
部件包围盒容差1.5 mm
中心容差3 mm
颜色容差每通道 0.02
导出目录OPFS freecad-exports
+
+
自检清单
  • 88 个对象全部加载
  • STEP 导出成功
  • STL 导出成功
  • 全量精度审计通过
  • E18 检查点与课程证据写入
+
常见错误与练习
  • 未选中对象就点导出,得到空文件
  • 把 OPFS 文件当成已下载到本地
  • 审计时只检查新对象,漏掉前面工位

在 freecad-exports 列表里找到刚导出的 STEP/STL,记录文件名与大小。

+

下载 E18 检查点 FCStd

+
+
+
+ + + diff --git a/web/teaching/cases/production-line-reference.html b/web/teaching/cases/production-line-reference.html new file mode 100644 index 00000000..486a892d --- /dev/null +++ b/web/teaching/cases/production-line-reference.html @@ -0,0 +1,93 @@ + + + + + + +生产线参考模型 · 27 个 GLB + + + + +
+

生产线参考模型

+ + 加载中… +
+
+

左键旋转 · 滚轮缩放 · 右键平移

+ + + diff --git a/web/teaching/cases/production-line-reference.png b/web/teaching/cases/production-line-reference.png new file mode 100644 index 00000000..22569075 Binary files /dev/null and b/web/teaching/cases/production-line-reference.png differ diff --git a/web/teaching/cases/production-line-spec.json b/web/teaching/cases/production-line-spec.json new file mode 100644 index 00000000..9b6ffd19 --- /dev/null +++ b/web/teaching/cases/production-line-spec.json @@ -0,0 +1,5916 @@ +{ + "schema": "freecad-web-line-course/spec/v1", + "generatedAt": "2026-11-12T18:03:40.094Z", + "sourceDir": "/home/mes123456/FreeCADWasmDev/working/GLTFmodel", + "units": { + "sourceNumerics": "meters", + "target": "mm", + "upAxis": "Z-up (identity map, x*1000,y*1000,z*1000)" + }, + "modelCount": 27, + "partCount": 88, + "triangleCount": 996148, + "sceneBBox": [ + -2439.842, + -2032.821, + -1039.203, + 2714.334, + 1844.211, + 1473.587 + ], + "warnings": [], + "models": [ + { + "file": "ABB_IRB_120.glb", + "name": "ABB_IRB_120", + "label": "ABB IRB 120 机器人", + "sha256": "c5800d1b1c5b9e3efb45f09541cbd77a667e3f21d55c967967c4402a7d1d45ea", + "meshCount": 17, + "triangleCount": 102260, + "partBudget": 11, + "overallBBox": [ + -965.303, + -335.358, + 774, + -745.943, + 352.209, + 1473.587 + ], + "overallDims": [ + 219.36, + 687.567, + 699.587 + ], + "parts": [ + { + "partName": "ABB_IRB_120_P01", + "label": "ABB_IRB_120_JT1", + "primitive": "box", + "fcLocalDims": [ + 214.889, + 217.312, + 177 + ], + "position": [ + -963.333, + 33.697, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -963.333, + 33.697, + 774, + -748.444, + 251.009, + 951 + ], + "center": [ + -855.888, + 142.353, + 862.5 + ], + "color": [ + 0.0667, + 0.0667, + 0.0667 + ], + "colorLinear": [ + 0.0056, + 0.0056, + 0.0056 + ], + "colorSource": "textureAvg", + "material": "黑色车漆_Baked.001", + "meshCount": 1, + "triangleCount": 7665, + "nodeNames": [ + "ABB_IRB_120_JT1" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1" + ] + }, + { + "partName": "ABB_IRB_120_P02", + "label": "ABB IRB 120 机器人 部件 2", + "primitive": "box", + "fcLocalDims": [ + 123, + 101.2, + 145 + ], + "position": [ + -917.373, + 251.009, + 778.001 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -917.373, + 251.009, + 778.001, + -794.373, + 352.209, + 923.001 + ], + "center": [ + -855.873, + 301.609, + 850.501 + ], + "color": [ + 0.4744, + 0.4744, + 0.4744 + ], + "colorLinear": [ + 0.1911, + 0.1911, + 0.1911 + ], + "colorSource": "textureAvg", + "material": "清洁不锈钢", + "meshCount": 2, + "triangleCount": 20586, + "nodeNames": [ + "Entity-149001", + "Entity-149001_1" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "Mesh_1223497002", + "Entity-149001" + ] + }, + { + "partName": "ABB_IRB_120_P03", + "label": "ABB IRB 120 机器人 部件 3", + "primitive": "cylinder", + "fcLocalDims": [ + 219.36, + 214.92, + 431.168 + ], + "position": [ + -965.303, + 33.549, + 951 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -965.303, + 33.549, + 951, + -745.943, + 248.469, + 1382.168 + ], + "center": [ + -855.623, + 141.009, + 1166.584 + ], + "color": [ + 0.8, + 0.8, + 0.8 + ], + "colorLinear": [ + 0.6038, + 0.6038, + 0.6038 + ], + "colorSource": "baseColorFactor", + "material": "abb白色高粗糙度", + "meshCount": 2, + "triangleCount": 18207, + "nodeNames": [ + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2" + ] + }, + { + "partName": "ABB_IRB_120_P04", + "label": "ABB IRB 120 机器人 部件 4", + "primitive": "box", + "fcLocalDims": [ + 115.5, + 234.013, + 188.114 + ], + "position": [ + -921.373, + -3.591, + 1285.473 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -921.373, + -3.591, + 1285.473, + -805.873, + 230.422, + 1473.587 + ], + "center": [ + -863.623, + 113.416, + 1379.53 + ], + "color": [ + 0.8, + 0.8, + 0.8 + ], + "colorLinear": [ + 0.6038, + 0.6038, + 0.6038 + ], + "colorSource": "baseColorFactor", + "material": "abb白色高粗糙度.002", + "meshCount": 2, + "triangleCount": 16136, + "nodeNames": [ + "ABB_IRB_120_JT4", + "Mesh_198026002" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4" + ] + }, + { + "partName": "ABB_IRB_120_P05", + "label": "ABB_IRB_120_JT6", + "primitive": "box", + "fcLocalDims": [ + 62, + 110.5, + 82 + ], + "position": [ + -886.873, + -205.491, + 1363 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -886.873, + -205.491, + 1363, + -824.873, + -94.991, + 1445 + ], + "center": [ + -855.873, + -150.241, + 1404 + ], + "color": [ + 0.8, + 0.8, + 0.8 + ], + "colorLinear": [ + 0.6038, + 0.6038, + 0.6038 + ], + "colorSource": "baseColorFactor", + "material": "abb白色高粗糙度.004", + "meshCount": 1, + "triangleCount": 5158, + "nodeNames": [ + "ABB_IRB_120_JT6" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6" + ] + }, + { + "partName": "ABB_IRB_120_P06", + "label": "ABB IRB 120 机器人 部件 6", + "primitive": "box", + "fcLocalDims": [ + 126.943, + 193.48, + 92.955 + ], + "position": [ + -919.81, + -201.071, + 1358.045 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -919.81, + -201.071, + 1358.045, + -792.867, + -7.591, + 1451 + ], + "center": [ + -856.338, + -104.331, + 1404.523 + ], + "color": [ + 0.8, + 0.8, + 0.8 + ], + "colorLinear": [ + 0.6038, + 0.6038, + 0.6038 + ], + "colorSource": "baseColorFactor", + "material": "abb白色高粗糙度.003", + "meshCount": 2, + "triangleCount": 10208, + "nodeNames": [ + "Entity-119001", + "Entity-119001_1" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "Entity-119001" + ] + }, + { + "partName": "ABB_IRB_120_P07", + "label": "Mesh_195968002", + "primitive": "box", + "fcLocalDims": [ + 95.916, + 5, + 95.958 + ], + "position": [ + -913.373, + -8.591, + 1356.021 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -913.373, + -8.591, + 1356.021, + -817.457, + -3.591, + 1451.979 + ], + "center": [ + -865.415, + -6.091, + 1404 + ], + "color": [ + 0.0667, + 0.0667, + 0.0667 + ], + "colorLinear": [ + 0.0056, + 0.0056, + 0.0056 + ], + "colorSource": "textureAvg", + "material": "黑色车漆_Baked.004", + "meshCount": 1, + "triangleCount": 224, + "nodeNames": [ + "Mesh_195968002" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "Mesh_195968002" + ] + }, + { + "partName": "ABB_IRB_120_P08", + "label": "ABB IRB 120 机器人 部件 8", + "primitive": "box", + "fcLocalDims": [ + 69.984, + 27.5, + 70 + ], + "position": [ + -890.857, + -232.991, + 1369 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -890.857, + -232.991, + 1369, + -820.873, + -205.491, + 1439 + ], + "center": [ + -855.865, + -219.241, + 1404 + ], + "color": [ + 0.0667, + 0.0667, + 0.0667 + ], + "colorLinear": [ + 0.0056, + 0.0056, + 0.0056 + ], + "colorSource": "textureAvg", + "material": "黑色车漆_Baked.003", + "meshCount": 2, + "triangleCount": 7176, + "nodeNames": [ + "ABB_IRB_120_JT7", + "Mesh_1327679002" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6", + "ABB_IRB_120_JT7" + ] + }, + { + "partName": "ABB_IRB_120_P09", + "label": "机器人夹爪", + "primitive": "box", + "fcLocalDims": [ + 94.258, + 38.04, + 73.312 + ], + "position": [ + -903, + -271.031, + 1367.344 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -903, + -271.031, + 1367.344, + -808.742, + -232.991, + 1440.656 + ], + "center": [ + -855.871, + -252.011, + 1404 + ], + "color": [ + 0.8633, + 0.9046, + 0.9386 + ], + "colorLinear": [ + 0.7167, + 0.7965, + 0.866 + ], + "colorSource": "baseColorFactor", + "material": "白钢.002", + "meshCount": 1, + "triangleCount": 13214, + "nodeNames": [ + "机器人夹爪" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6", + "ABB_IRB_120_JT7", + "机器人夹爪" + ] + }, + { + "partName": "ABB_IRB_120_P10", + "label": "ABB IRB 120 机器人 部件 10", + "primitive": "box", + "fcLocalDims": [ + 53.072, + 70.027, + 40 + ], + "position": [ + -888.057, + -335.358, + 1385.037 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -888.057, + -335.358, + 1385.037, + -834.985, + -265.331, + 1425.037 + ], + "center": [ + -861.521, + -300.345, + 1405.037 + ], + "color": [ + 0.7146, + 0.7145, + 0.7145 + ], + "colorLinear": [ + 0.4691, + 0.4689, + 0.4689 + ], + "colorSource": "baseColorFactor", + "material": "钢", + "meshCount": 2, + "triangleCount": 2218, + "nodeNames": [ + "夹爪003", + "机器人的料001" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6", + "ABB_IRB_120_JT7", + "机器人夹爪", + "夹爪003" + ] + }, + { + "partName": "ABB_IRB_120_P11", + "label": "夹爪1002", + "primitive": "box", + "fcLocalDims": [ + 29.874, + 53.9, + 34.133 + ], + "position": [ + -853.297, + -319.231, + 1387.817 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -853.297, + -319.231, + 1387.817, + -823.423, + -265.331, + 1421.95 + ], + "center": [ + -838.36, + -292.281, + 1404.884 + ], + "color": [ + 0.7146, + 0.7145, + 0.7145 + ], + "colorLinear": [ + 0.4691, + 0.4689, + 0.4689 + ], + "colorSource": "baseColorFactor", + "material": "钢.001", + "meshCount": 1, + "triangleCount": 1468, + "nodeNames": [ + "夹爪1002" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6", + "ABB_IRB_120_JT7", + "机器人夹爪", + "夹爪1002" + ] + } + ] + }, + { + "file": "Tool.glb", + "name": "ToolFrame", + "label": "工具坐标系", + "sha256": "b477e465100b57f3ac70a33a4d73256499b245f21c1645b9afcf5b6ebde1f8c2", + "meshCount": 6, + "triangleCount": 108, + "partBudget": 3, + "overallBBox": [ + -4.515, + -4.515, + -4.515, + 67.729, + 67.729, + 67.729 + ], + "overallDims": [ + 72.244, + 72.244, + 72.244 + ], + "parts": [ + { + "partName": "ToolFrame_P01", + "label": "X", + "primitive": "box", + "fcLocalDims": [ + 67.729, + 9.03, + 9.03 + ], + "position": [ + 0, + -4.515, + -4.515 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 0, + -4.515, + -4.515, + 67.729, + 4.515, + 4.515 + ], + "center": [ + 33.865, + 0, + 0 + ], + "color": [ + 1, + 0, + 0 + ], + "colorLinear": [ + 1, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "material-1", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "X" + ], + "chain": [ + "Tool", + "X" + ] + }, + { + "partName": "ToolFrame_P02", + "label": "Y", + "primitive": "box", + "fcLocalDims": [ + 9.03, + 67.729, + 9.03 + ], + "position": [ + -4.515, + 0, + -4.515 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -4.515, + 0, + -4.515, + 4.515, + 67.729, + 4.515 + ], + "center": [ + 0, + 33.865, + 0 + ], + "color": [ + 0, + 1, + 0 + ], + "colorLinear": [ + 0, + 1, + 0 + ], + "colorSource": "baseColorFactor", + "material": "material-3", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "Y" + ], + "chain": [ + "Tool", + "Y" + ] + }, + { + "partName": "ToolFrame_P03", + "label": "Z", + "primitive": "cylinder", + "fcLocalDims": [ + 9.03, + 9.03, + 67.729 + ], + "position": [ + -4.515, + -4.515, + 0 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -4.515, + -4.515, + 0, + 4.515, + 4.515, + 67.729 + ], + "center": [ + 0, + 0, + 33.865 + ], + "color": [ + 0, + 0, + 1 + ], + "colorLinear": [ + 0, + 0, + 1 + ], + "colorSource": "baseColorFactor", + "material": "material-5", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "Z" + ], + "chain": [ + "Tool", + "Z" + ] + } + ] + }, + { + "file": "三柜子.glb", + "name": "CabinetA", + "label": "主控制柜", + "sha256": "fe87a0f121346b2eb3cebad29c460bee80446c1993c8551af95bdef85401bbcb", + "meshCount": 56, + "triangleCount": 194304, + "partBudget": 8, + "overallBBox": [ + -34.991, + -214.285, + 0, + 1464.941, + 529.94, + 754 + ], + "overallDims": [ + 1499.932, + 744.225, + 754 + ], + "parts": [ + { + "partName": "CabinetA_P01", + "label": "主控制柜 部件 1", + "primitive": "box", + "fcLocalDims": [ + 440, + 134.284, + 597 + ], + "position": [ + 15.003, + -214.285, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 15.003, + -214.285, + 154, + 455.003, + -80.001, + 751 + ], + "center": [ + 235.003, + -147.143, + 452.5 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.010", + "meshCount": 16, + "triangleCount": 44624, + "nodeNames": [ + "__22_______P740865012", + "__22_______P740865012_1", + "__22_______P740865012_2", + "__22_______P740865012_3", + "__22_______P740865012_4", + "__22_______P740865012_5", + "__22___P2053", + "KONGQIKG025", + "KONGQIKG026", + "ZX-JX02-02-63____¹_____013", + "ZX-JX02-02-22____¹_____049", + "ZX-JX02-02-22____¹_____052" + ], + "chain": [ + "三柜子", + "__22_______P013", + "__22_______P740865012" + ] + }, + { + "partName": "CabinetA_P02", + "label": "主控制柜 部件 2", + "primitive": "box", + "fcLocalDims": [ + 1499.932, + 744.225, + 754 + ], + "position": [ + -34.991, + -214.285, + 0 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -34.991, + -214.285, + 0, + 1464.941, + 529.94, + 754 + ], + "center": [ + 714.975, + 157.828, + 377 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.004", + "meshCount": 20, + "triangleCount": 99424, + "nodeNames": [ + "__22_______P740865013", + "__22_______P740865013_1", + "__22_______P740865013_2", + "__22_______P740865013_3", + "__22_______P740865013_4", + "__22_______P740865013_5", + "__22___P2054", + "KONGQIKG027", + "ZX-JX02-02-22____¹_____053", + "ZX-JX02-02-22____¹_____056", + "KONGQIKG028", + "zb4_bk1213690782027" + ], + "chain": [ + "三柜子", + "__22_______P014", + "__22_______P740865013" + ] + }, + { + "partName": "CabinetA_P03", + "label": "主控制柜 部件 3", + "primitive": "box", + "fcLocalDims": [ + 440, + 134.284, + 597 + ], + "position": [ + 975.003, + -214.285, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 975.003, + -214.285, + 154, + 1415.003, + -80.001, + 751 + ], + "center": [ + 1195.003, + -147.143, + 452.5 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.012", + "meshCount": 15, + "triangleCount": 43044, + "nodeNames": [ + "__22_______P740865014", + "__22_______P740865014_1", + "__22_______P740865014_2", + "__22_______P740865014_3", + "__22_______P740865014_4", + "__22_______P740865014_5", + "__22___P2057", + "KONGQIKG029", + "ZX-JX02-02-22____¹_____057", + "ZX-JX02-02-22____¹_____060", + "KONGQIKG030", + "zb4_bk1213690782028" + ], + "chain": [ + "三柜子", + "__22_______P015", + "__22_______P740865014" + ] + }, + { + "partName": "CabinetA_P04", + "label": "ZX-JX02-02-02A______________¹___001", + "primitive": "box", + "fcLocalDims": [ + 30, + 560, + 560 + ], + "position": [ + 1425.003, + -80.001, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1425.003, + -80.001, + 154, + 1455.003, + 479.999, + 714 + ], + "center": [ + 1440.003, + 199.999, + 434 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.006", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-02A______________¹___001" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-02A______________¹___001" + ] + }, + { + "partName": "CabinetA_P05", + "label": "ZX-JX02-02-03____²_______________¹___097", + "primitive": "box", + "fcLocalDims": [ + 40, + 560, + 40 + ], + "position": [ + -24.997, + -80.001, + 114 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -24.997, + -80.001, + 114, + 15.003, + 479.999, + 154 + ], + "center": [ + -4.997, + 199.999, + 134 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.005", + "meshCount": 1, + "triangleCount": 1728, + "nodeNames": [ + "ZX-JX02-02-03____²_______________¹___097" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-03____²_______________¹___097" + ] + }, + { + "partName": "CabinetA_P06", + "label": "ZX-JX02-02-03____²_______________¹___105", + "primitive": "box", + "fcLocalDims": [ + 40, + 560, + 40 + ], + "position": [ + 935.003, + -80.001, + 714 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 935.003, + -80.001, + 714, + 975.003, + 479.999, + 754 + ], + "center": [ + 955.003, + 199.999, + 734 + ], + "color": [ + 0.898, + 0.9137, + 0.9255 + ], + "colorLinear": [ + 0.7835, + 0.8148, + 0.8388 + ], + "colorSource": "baseColorFactor", + "material": "Material27.014", + "meshCount": 1, + "triangleCount": 1728, + "nodeNames": [ + "ZX-JX02-02-03____²_______________¹___105" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-03____²_______________¹___105" + ] + }, + { + "partName": "CabinetA_P07", + "label": "ZX-JX02-02-80______013", + "primitive": "box", + "fcLocalDims": [ + 440, + 30, + 560 + ], + "position": [ + 15.003, + 489.999, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 15.003, + 489.999, + 154, + 455.003, + 519.999, + 714 + ], + "center": [ + 235.003, + 504.999, + 434 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.010", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-80______013" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-80______013" + ] + }, + { + "partName": "CabinetA_P08", + "label": "ZX-JX02-02-80______015", + "primitive": "box", + "fcLocalDims": [ + 440, + 30, + 560 + ], + "position": [ + 975.003, + 489.999, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 975.003, + 489.999, + 154, + 1415.003, + 519.999, + 714 + ], + "center": [ + 1195.003, + 504.999, + 434 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.012", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-80______015" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-80______015" + ] + } + ] + }, + { + "file": "三柜子1.glb", + "name": "CabinetB", + "label": "长控制柜", + "sha256": "555eed4ab247c5cf01095ce1eafc77208f48082bb889cbc57fda9058c7ced7df", + "meshCount": 53, + "triangleCount": 209556, + "partBudget": 8, + "overallBBox": [ + -1514.908, + -214.241, + 0, + 1455.086, + 560.042, + 774.001 + ], + "overallDims": [ + 2969.994, + 774.283, + 774.001 + ], + "parts": [ + { + "partName": "CabinetB_P01", + "label": "长控制柜 部件 1", + "primitive": "box", + "fcLocalDims": [ + 440, + 134.283, + 597 + ], + "position": [ + -1464.914, + -214.241, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1464.914, + -214.241, + 154, + -1024.914, + -79.958, + 751 + ], + "center": [ + -1244.914, + -147.099, + 452.5 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.001", + "meshCount": 13, + "triangleCount": 45364, + "nodeNames": [ + "__22_______P740865015", + "__22_______P740865015_1", + "__22___P3063", + "________018", + "KA016", + "KONGQIKG031", + "ZX-JX02-02-63____¹_____016", + "KONGQIKG032", + "ZX-JX02-02-22____¹_____061", + "ZX-JX02-02-22____¹_____064", + "zb4_bk1213690782032", + "zb4_bk1213690782032_1" + ], + "chain": [ + "三柜子1", + "__22_______P016", + "__22_______P740865015" + ] + }, + { + "partName": "CabinetB_P02", + "label": "长控制柜 部件 2", + "primitive": "box", + "fcLocalDims": [ + 1499.932, + 744.224, + 754 + ], + "position": [ + -1514.908, + -214.241, + 0 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1514.908, + -214.241, + 0, + -14.976, + 529.983, + 754 + ], + "center": [ + -764.942, + 157.871, + 377 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.001", + "meshCount": 17, + "triangleCount": 98216, + "nodeNames": [ + "__22_______P740865016", + "__22_______P740865016_1", + "__22___P3064", + "KA017", + "KONGQIKG033", + "ZX-JX02-02-63____¹_____017", + "KONGQIKG034", + "ZX-JX02-02-22____¹_____065", + "ZX-JX02-02-22____¹_____068", + "zb4_bk1213690782031", + "zb4_bk1213690782031_1", + "________019" + ], + "chain": [ + "三柜子1", + "__22_______P017", + "__22_______P740865016" + ] + }, + { + "partName": "CabinetB_P03", + "label": "长控制柜 部件 3", + "primitive": "box", + "fcLocalDims": [ + 440, + 134.283, + 597 + ], + "position": [ + -504.914, + -214.241, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -504.914, + -214.241, + 154, + -64.914, + -79.958, + 751 + ], + "center": [ + -284.914, + -147.099, + 452.5 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑", + "meshCount": 15, + "triangleCount": 47208, + "nodeNames": [ + "__22_______P740865017", + "__22_______P740865017_1", + "__22___P2069", + "KA018", + "KONGQIKG035", + "ZX-JX02-02-63____¹_____018", + "KONGQIKG036", + "ZX-JX02-02-22____¹_____069", + "ZX-JX02-02-22____¹_____072", + "ZX-JX02-02-64PLC¹_____006", + "zb4_bk1213690782034", + "zb4_bk1213690782034_1" + ], + "chain": [ + "三柜子1", + "__22_______P018", + "__22_______P740865017" + ] + }, + { + "partName": "CabinetB_P04", + "label": "ZX-JX02-02-02A______________¹___135", + "primitive": "box", + "fcLocalDims": [ + 2960, + 640.057, + 20.345 + ], + "position": [ + -1504.914, + -120.015, + 753.656 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1504.914, + -120.015, + 753.656, + 1455.086, + 520.042, + 774.001 + ], + "center": [ + -24.914, + 200.014, + 763.829 + ], + "color": [ + 0.5445, + 0.5445, + 0.5445 + ], + "colorLinear": [ + 0.2576, + 0.2576, + 0.2576 + ], + "colorSource": "textureAvg", + "material": "普通钢.003", + "meshCount": 1, + "triangleCount": 7488, + "nodeNames": [ + "ZX-JX02-02-02A______________¹___135" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-02A______________¹___135" + ] + }, + { + "partName": "CabinetB_P05", + "label": "长控制柜 部件 5", + "primitive": "box", + "fcLocalDims": [ + 540, + 640, + 600 + ], + "position": [ + -564.914, + -79.958, + 114 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -564.914, + -79.958, + 114, + -24.914, + 560.042, + 714 + ], + "center": [ + -294.914, + 240.042, + 414 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.003", + "meshCount": 4, + "triangleCount": 6572, + "nodeNames": [ + "ZX-JX02-02-03______003", + "ZX-JX02-02-03____²_______________¹___139", + "ZX-JX02-02-03____²_______________¹___135", + "ZX-JX02-02-80______018" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-03______003" + ] + }, + { + "partName": "CabinetB_P06", + "label": "ZX-JX02-02-03____²_______________¹___129", + "primitive": "box", + "fcLocalDims": [ + 40, + 560, + 40 + ], + "position": [ + -544.914, + -79.958, + 714 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -544.914, + -79.958, + 714, + -504.914, + 480.042, + 754 + ], + "center": [ + -524.914, + 200.042, + 734 + ], + "color": [ + 0.898, + 0.9137, + 0.9255 + ], + "colorLinear": [ + 0.7835, + 0.8148, + 0.8388 + ], + "colorSource": "baseColorFactor", + "material": "Material27.019", + "meshCount": 1, + "triangleCount": 1728, + "nodeNames": [ + "ZX-JX02-02-03____²_______________¹___129" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-03____²_______________¹___129" + ] + }, + { + "partName": "CabinetB_P07", + "label": "ZX-JX02-02-03____²_______________¹___142", + "primitive": "box", + "fcLocalDims": [ + 40, + 560, + 40 + ], + "position": [ + -1024.914, + -79.958, + 714 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1024.914, + -79.958, + 714, + -984.914, + 480.042, + 754 + ], + "center": [ + -1004.914, + 200.042, + 734 + ], + "color": [ + 0.898, + 0.9137, + 0.9255 + ], + "colorLinear": [ + 0.7835, + 0.8148, + 0.8388 + ], + "colorSource": "baseColorFactor", + "material": "Material27.022", + "meshCount": 1, + "triangleCount": 1728, + "nodeNames": [ + "ZX-JX02-02-03____²_______________¹___142" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-03____²_______________¹___142" + ] + }, + { + "partName": "CabinetB_P08", + "label": "ZX-JX02-02-80______016", + "primitive": "box", + "fcLocalDims": [ + 440, + 30.001, + 560 + ], + "position": [ + -1464.914, + 490.042, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1464.914, + 490.042, + 154, + -1024.914, + 520.043, + 714 + ], + "center": [ + -1244.914, + 505.043, + 434 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.005", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-80______016" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-80______016" + ] + } + ] + }, + { + "file": "三色灯.glb", + "name": "StackLight", + "label": "三色警示灯", + "sha256": "f372bb327fb2b4aee528e05f7898560777e925a8e9146583e7684227fca83d29", + "meshCount": 7, + "triangleCount": 2118, + "partBudget": 2, + "overallBBox": [ + -1506.999, + 420.001, + 726, + -1456.999, + 460.001, + 1194 + ], + "overallDims": [ + 50, + 40, + 468 + ], + "parts": [ + { + "partName": "StackLight_P01", + "label": "三色警示灯 部件 1", + "primitive": "box", + "fcLocalDims": [ + 50, + 40, + 228 + ], + "position": [ + -1506.999, + 420.001, + 726 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1506.999, + 420.001, + 726, + -1456.999, + 460.001, + 954 + ], + "center": [ + -1481.999, + 440.001, + 840 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.008", + "meshCount": 4, + "triangleCount": 1674, + "nodeNames": [ + "工位1三色灯_1", + "__________________M20__1_GB__T_808-1988_003", + "__________________M20__1_GB__T_808-1988_001", + "____001" + ], + "chain": [ + "三色灯", + "工位1三色灯_1" + ] + }, + { + "partName": "StackLight_P02", + "label": "三色警示灯 部件 2", + "primitive": "cylinder", + "fcLocalDims": [ + 40, + 39.989, + 240 + ], + "position": [ + -1496.999, + 420.006, + 954 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1496.999, + 420.006, + 954, + -1456.999, + 459.995, + 1194 + ], + "center": [ + -1476.999, + 440.001, + 1074 + ], + "color": [ + 0.1137, + 0.2196, + 0.1098 + ], + "colorLinear": [ + 0.0123, + 0.0395, + 0.0116 + ], + "colorSource": "textureAvg", + "material": "深绿色光泽_Baked.002", + "meshCount": 3, + "triangleCount": 444, + "nodeNames": [ + "____003", + "_____001", + "____005" + ], + "chain": [ + "三色灯", + "工位1三色灯_1", + "____003" + ] + } + ] + }, + { + "file": "上料.glb", + "name": "Loader", + "label": "上料机构", + "sha256": "2c64f1f97caa53b8e9b29b96b4ce9adb1aab9d5960f930728566ea13de584397", + "meshCount": 9, + "triangleCount": 13952, + "partBudget": 2, + "overallBBox": [ + -1414.432, + 67, + 774, + -1039.5, + 207, + 986 + ], + "overallDims": [ + 374.932, + 140, + 212 + ], + "parts": [ + { + "partName": "Loader_P01", + "label": "ZX-JX01-02-05001", + "primitive": "box", + "fcLocalDims": [ + 165, + 140, + 212 + ], + "position": [ + -1204.5, + 67, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1204.5, + 67, + 774, + -1039.5, + 207, + 986 + ], + "center": [ + -1122, + 137, + 880 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.009", + "meshCount": 1, + "triangleCount": 7952, + "nodeNames": [ + "ZX-JX01-02-05001" + ], + "chain": [ + "上料", + "ZX-JX01-02-05001" + ] + }, + { + "partName": "Loader_P02", + "label": "上料机构 部件 2", + "primitive": "box", + "fcLocalDims": [ + 319.864, + 40, + 30 + ], + "position": [ + -1414.432, + 117, + 946 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1414.432, + 117, + 946, + -1094.568, + 157, + 976 + ], + "center": [ + -1254.5, + 137, + 961 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.001", + "meshCount": 8, + "triangleCount": 6000, + "nodeNames": [ + "物料零件集合", + "物料零件", + "物料零件001", + "物料零件002", + "物料零件003", + "物料零件004", + "物料零件005", + "物料零件006" + ], + "chain": [ + "上料", + "物料零件集合" + ] + } + ] + }, + { + "file": "传送带送料装置.glb", + "name": "ConveyorFeeder", + "label": "传送带送料装置", + "sha256": "d5ca0aed7bf6f69981da90ee1df3ff44118690743e071aada673b8635516879c", + "meshCount": 11, + "triangleCount": 69240, + "partBudget": 6, + "overallBBox": [ + 368.033, + 51, + 774, + 982, + 321.043, + 978.607 + ], + "overallDims": [ + 613.967, + 270.043, + 204.607 + ], + "parts": [ + { + "partName": "ConveyorFeeder_P01", + "label": "传送带送料装置 部件 1", + "primitive": "box", + "fcLocalDims": [ + 508.364, + 100, + 68.879 + ], + "position": [ + 370.068, + 100, + 906 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 370.068, + 100, + 906, + 878.432, + 200, + 974.879 + ], + "center": [ + 624.25, + 150, + 940.44 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.011", + "meshCount": 5, + "triangleCount": 2416, + "nodeNames": [ + "传送带", + "新版1_1", + "新版1001", + "新版2", + "新版1001_1" + ], + "chain": [ + "传送带送料装置", + "传送带" + ] + }, + { + "partName": "ConveyorFeeder_P02", + "label": "传送带送料装置 部件 2", + "primitive": "box", + "fcLocalDims": [ + 44.5, + 152.501, + 34 + ], + "position": [ + 805, + 168.542, + 943 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 805, + 168.542, + 943, + 849.5, + 321.043, + 977 + ], + "center": [ + 827.25, + 244.793, + 960 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.019", + "meshCount": 2, + "triangleCount": 11332, + "nodeNames": [ + "工位5传送带送料装置JT1", + "工位5传送带送料装置JT2" + ], + "chain": [ + "传送带送料装置", + "工位5传送带送料装置JT1" + ] + }, + { + "partName": "ConveyorFeeder_P03", + "label": "LH-C06-01083425002", + "primitive": "box", + "fcLocalDims": [ + 496.967, + 170, + 174 + ], + "position": [ + 368.033, + 51, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 368.033, + 51, + 774, + 865, + 221, + 948 + ], + "center": [ + 616.517, + 136, + 861 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.011", + "meshCount": 1, + "triangleCount": 35932, + "nodeNames": [ + "LH-C06-01083425002" + ], + "chain": [ + "传送带送料装置", + "工位5传送带送料装置传送", + "LH-C06-01083425002" + ] + }, + { + "partName": "ConveyorFeeder_P04", + "label": "工位5传送带送料装置底座", + "primitive": "box", + "fcLocalDims": [ + 395, + 165, + 204.607 + ], + "position": [ + 587, + 106, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 587, + 106, + 774, + 982, + 271, + 978.607 + ], + "center": [ + 784.5, + 188.5, + 876.304 + ], + "color": [ + 0.8389, + 0.8664, + 0.8978 + ], + "colorLinear": [ + 0.6719, + 0.7226, + 0.7831 + ], + "colorSource": "textureAvg", + "material": "抛光金属1.006", + "meshCount": 1, + "triangleCount": 13896, + "nodeNames": [ + "工位5传送带送料装置底座" + ], + "chain": [ + "传送带送料装置", + "工位5传送带送料装置底座" + ] + }, + { + "partName": "ConveyorFeeder_P05", + "label": "工位5传送带送料装置料口", + "primitive": "box", + "fcLocalDims": [ + 120, + 89.131, + 21.5 + ], + "position": [ + 845, + 105.434, + 941 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 845, + 105.434, + 941, + 965, + 194.565, + 962.5 + ], + "center": [ + 905, + 150, + 951.75 + ], + "color": [ + 0.7444, + 0.7565, + 0.7586 + ], + "colorLinear": [ + 0.5138, + 0.5327, + 0.536 + ], + "colorSource": "textureAvg", + "material": "划痕钢.004", + "meshCount": 1, + "triangleCount": 1464, + "nodeNames": [ + "工位5传送带送料装置料口" + ], + "chain": [ + "传送带送料装置", + "工位5传送带送料装置料口" + ] + }, + { + "partName": "ConveyorFeeder_P06", + "label": "工位5轨道", + "primitive": "box", + "fcLocalDims": [ + 175, + 9, + 6.5 + ], + "position": [ + 807, + 244, + 941 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 807, + 244, + 941, + 982, + 253, + 947.5 + ], + "center": [ + 894.5, + 248.5, + 944.25 + ], + "color": [ + 0.7614, + 0.734, + 0.6948 + ], + "colorLinear": [ + 0.5405, + 0.4979, + 0.4406 + ], + "colorSource": "textureAvg", + "material": "划伤金属.005", + "meshCount": 1, + "triangleCount": 4200, + "nodeNames": [ + "工位5轨道" + ], + "chain": [ + "传送带送料装置", + "工位5轨道" + ] + } + ] + }, + { + "file": "原料上料.glb", + "name": "RawFeeder", + "label": "原料上料装置", + "sha256": "c364b31cd40599a69bd87a315b817ba507fbbce518039b5ece46a701682d8723", + "meshCount": 22, + "triangleCount": 103275, + "partBudget": 5, + "overallBBox": [ + -730.014, + 196, + 774, + -520.014, + 404, + 978.1 + ], + "overallDims": [ + 210, + 208, + 204.1 + ], + "parts": [ + { + "partName": "RawFeeder_P01", + "label": "原料上料装置 部件 1", + "primitive": "box", + "fcLocalDims": [ + 84.818, + 56, + 189.727 + ], + "position": [ + -644.514, + 236.943, + 777 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -644.514, + 236.943, + 777, + -559.696, + 292.943, + 966.727 + ], + "center": [ + -602.105, + 264.943, + 871.863 + ], + "color": [ + 0.7614, + 0.734, + 0.6948 + ], + "colorLinear": [ + 0.5405, + 0.4979, + 0.4406 + ], + "colorSource": "textureAvg", + "material": "划伤金属.002", + "meshCount": 18, + "triangleCount": 56762, + "nodeNames": [ + "ATP16XL037_A_N12_A001", + "TM-GZCS-02-06__001", + "原料上料-JT1", + "原料1", + "原料10", + "原料10001", + "原料10002", + "原料10003", + "原料10004", + "原料10005", + "原料10006", + "原料2" + ], + "chain": [ + "原料上料", + "ATP16XL037_A_N12_A001" + ] + }, + { + "partName": "RawFeeder_P02", + "label": "GEWINDESTIFT_DIN_913___M4X3_001", + "primitive": "box", + "fcLocalDims": [ + 77.175, + 27.352, + 16 + ], + "position": [ + -688.014, + 247.324, + 791 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -688.014, + 247.324, + 791, + -610.839, + 274.676, + 807 + ], + "center": [ + -649.426, + 261, + 799 + ], + "color": [ + 0, + 0.1274, + 0 + ], + "colorLinear": [ + 0, + 0.0148, + 0 + ], + "colorSource": "baseColorFactor", + "material": "深绿色", + "meshCount": 1, + "triangleCount": 6354, + "nodeNames": [ + "GEWINDESTIFT_DIN_913___M4X3_001" + ], + "chain": [ + "原料上料", + "GEWINDESTIFT_DIN_913___M4X3_001" + ] + }, + { + "partName": "RawFeeder_P03", + "label": "工位2原料上料支杆", + "primitive": "box", + "fcLocalDims": [ + 50, + 83.234, + 197.1 + ], + "position": [ + -602.514, + 219.383, + 781 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -602.514, + 219.383, + 781, + -552.514, + 302.617, + 978.1 + ], + "center": [ + -577.514, + 261, + 879.55 + ], + "color": [ + 0.7614, + 0.734, + 0.6948 + ], + "colorLinear": [ + 0.5405, + 0.4979, + 0.4406 + ], + "colorSource": "textureAvg", + "material": "划伤金属.001", + "meshCount": 1, + "triangleCount": 20271, + "nodeNames": [ + "工位2原料上料支杆" + ], + "chain": [ + "原料上料", + "工位2原料上料支杆" + ] + }, + { + "partName": "RawFeeder_P04", + "label": "工位2原料上料架体", + "primitive": "box", + "fcLocalDims": [ + 210, + 208, + 186 + ], + "position": [ + -730.014, + 196, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -730.014, + 196, + 774, + -520.014, + 404, + 960 + ], + "center": [ + -625.014, + 300, + 867 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.012", + "meshCount": 1, + "triangleCount": 16104, + "nodeNames": [ + "工位2原料上料架体" + ], + "chain": [ + "原料上料", + "工位2原料上料架体" + ] + }, + { + "partName": "RawFeeder_P05", + "label": "工位2原料上料电机", + "primitive": "box", + "fcLocalDims": [ + 68.4, + 56.4, + 100 + ], + "position": [ + -716.214, + 232.8, + 789 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -716.214, + 232.8, + 789, + -647.814, + 289.2, + 889 + ], + "center": [ + -682.014, + 261, + 839 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.020", + "meshCount": 1, + "triangleCount": 3784, + "nodeNames": [ + "工位2原料上料电机" + ], + "chain": [ + "原料上料", + "工位2原料上料电机" + ] + } + ] + }, + { + "file": "原料装配.glb", + "name": "RawAssembly", + "label": "原料装配平台", + "sha256": "545d0b4d48be65c887ba3b6859fe15185dc9012175e54ac477529f3b95ba08ea", + "meshCount": 12, + "triangleCount": 40676, + "partBudget": 3, + "overallBBox": [ + -872.299, + 250.071, + 786.001, + -373.999, + 395, + 1124.126 + ], + "overallDims": [ + 498.3, + 144.929, + 338.125 + ], + "parts": [ + { + "partName": "RawAssembly_P01", + "label": "原料装配平台", + "primitive": "box", + "fcLocalDims": [ + 498.3, + 92, + 338.125 + ], + "position": [ + -872.299, + 303, + 786.001 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -872.299, + 303, + 786.001, + -373.999, + 395, + 1124.126 + ], + "center": [ + -623.149, + 349, + 955.064 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.013", + "meshCount": 1, + "triangleCount": 19608, + "nodeNames": [ + "原料装配平台" + ], + "chain": [ + "原料装配", + "原料装配平台" + ] + }, + { + "partName": "RawAssembly_P02", + "label": "原料装配平台 部件 2", + "primitive": "box", + "fcLocalDims": [ + 70.599, + 78.529, + 128.485 + ], + "position": [ + -608.07, + 250.071, + 991.563 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -608.07, + 250.071, + 991.563, + -537.471, + 328.6, + 1120.048 + ], + "center": [ + -572.771, + 289.336, + 1055.806 + ], + "color": [ + 0.5445, + 0.5445, + 0.5445 + ], + "colorLinear": [ + 0.2576, + 0.2576, + 0.2576 + ], + "colorSource": "textureAvg", + "material": "普通钢.009", + "meshCount": 10, + "triangleCount": 20944, + "nodeNames": [ + "原料装配-JT1", + "工位2原料装配升降装置", + "工位2原料装配-JT2", + "柱体", + "柱体001", + "爪子安放的地方", + "工位2夹爪001", + "原料1001", + "夹爪002", + "夹爪001" + ], + "chain": [ + "原料装配", + "原料装配平台", + "原料装配-JT1" + ] + }, + { + "partName": "RawAssembly_P03", + "label": "柱体002", + "primitive": "box", + "fcLocalDims": [ + 192.545, + 4.999, + 4.999 + ], + "position": [ + -780.978, + 312, + 1050.588 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -780.978, + 312, + 1050.588, + -588.433, + 316.999, + 1055.587 + ], + "center": [ + -684.705, + 314.5, + 1053.088 + ], + "color": [ + 0.7614, + 0.734, + 0.6948 + ], + "colorLinear": [ + 0.5405, + 0.4979, + 0.4406 + ], + "colorSource": "textureAvg", + "material": "划伤金属.004", + "meshCount": 1, + "triangleCount": 124, + "nodeNames": [ + "柱体002" + ], + "chain": [ + "原料装配", + "原料装配平台", + "原料装配-JT1", + "柱体002" + ] + } + ] + }, + { + "file": "原点.glb", + "name": "OriginMarker", + "label": "原点标记", + "sha256": "e4c898890d5fe49c9fd4345d62e92bfd2101d50ce8524abdf6a3be76b802b45a", + "meshCount": 6, + "triangleCount": 108, + "partBudget": 3, + "overallBBox": [ + -8.855, + -8.855, + -8.855, + 132.827, + 132.827, + 132.827 + ], + "overallDims": [ + 141.682, + 141.682, + 141.682 + ], + "parts": [ + { + "partName": "OriginMarker_P01", + "label": "X", + "primitive": "box", + "fcLocalDims": [ + 132.827, + 17.71, + 17.71 + ], + "position": [ + 0, + -8.855, + -8.855 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 0, + -8.855, + -8.855, + 132.827, + 8.855, + 8.855 + ], + "center": [ + 66.414, + 0, + 0 + ], + "color": [ + 1, + 0, + 0 + ], + "colorLinear": [ + 1, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "material-1", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "X" + ], + "chain": [ + "原点", + "X" + ] + }, + { + "partName": "OriginMarker_P02", + "label": "Y", + "primitive": "box", + "fcLocalDims": [ + 17.71, + 132.827, + 17.71 + ], + "position": [ + -8.855, + 0, + -8.855 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -8.855, + 0, + -8.855, + 8.855, + 132.827, + 8.855 + ], + "center": [ + 0, + 66.414, + 0 + ], + "color": [ + 0, + 1, + 0 + ], + "colorLinear": [ + 0, + 1, + 0 + ], + "colorSource": "baseColorFactor", + "material": "material-3", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "Y" + ], + "chain": [ + "原点", + "Y" + ] + }, + { + "partName": "OriginMarker_P03", + "label": "Z", + "primitive": "cylinder", + "fcLocalDims": [ + 17.71, + 17.71, + 132.827 + ], + "position": [ + -8.855, + -8.855, + 0 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -8.855, + -8.855, + 0, + 8.855, + 8.855, + 132.827 + ], + "center": [ + 0, + 0, + 66.414 + ], + "color": [ + 0, + 0, + 1 + ], + "colorLinear": [ + 0, + 0, + 1 + ], + "colorSource": "baseColorFactor", + "material": "material-5", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "Z" + ], + "chain": [ + "原点", + "Z" + ] + } + ] + }, + { + "file": "地面平面.glb", + "name": "GroundPlane", + "label": "地面与地线", + "sha256": "2cfabda80de37b5fe9364aeb525c8156b6fc58b5321083b3329d15bdfa34efc1", + "meshCount": 6, + "triangleCount": 66, + "partBudget": 2, + "overallBBox": [ + -2153.148, + -2032.821, + -1039.203, + 2714.334, + 1640.409, + -729.142 + ], + "overallDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "parts": [ + { + "partName": "GroundPlane_P01", + "label": "地面与地线 部件 1", + "primitive": "box", + "fcLocalDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "position": [ + -2153.148, + -2032.821, + -1039.203 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2153.148, + -2032.821, + -1039.203, + 2714.334, + 1640.409, + -729.142 + ], + "center": [ + 280.593, + -196.206, + -884.172 + ], + "color": [ + 0.3801, + 0.3753, + 0.3698 + ], + "colorLinear": [ + 0.1193, + 0.1162, + 0.1127 + ], + "colorSource": "textureAvg", + "material": "环氧涂料.001", + "meshCount": 3, + "triangleCount": 16, + "nodeNames": [ + "1_1", + "平面_1", + "平面_1001" + ], + "chain": [ + "地面平面", + "1_1" + ] + }, + { + "partName": "GroundPlane_P02", + "label": "地面与地线 部件 2", + "primitive": "box", + "fcLocalDims": [ + 4855.255, + 1109.334, + 0.122 + ], + "position": [ + -2140.94, + -2032.819, + -739.025 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2140.94, + -2032.819, + -739.025, + 2714.315, + -923.485, + -738.903 + ], + "center": [ + 286.688, + -1478.152, + -738.964 + ], + "color": [ + 0.7137, + 0.6392, + 0.2431 + ], + "colorLinear": [ + 0.4677, + 0.3662, + 0.0482 + ], + "colorSource": "textureAvg", + "material": "黄色光泽_Baked.002", + "meshCount": 3, + "triangleCount": 50, + "nodeNames": [ + "地线_1", + "地线_1001", + "地线_1003" + ], + "chain": [ + "地面平面", + "地线_1" + ] + } + ] + }, + { + "file": "夹取送料装置.glb", + "name": "PickFeeder", + "label": "夹取送料装置", + "sha256": "3039c5ca2934a59f49cbfb18bf9cbfd90d433400325dec0d14a5b9fb004901ac", + "meshCount": 13, + "triangleCount": 81279, + "partBudget": 5, + "overallBBox": [ + -277.5, + 122.743, + 774, + 748.5, + 400, + 1229.018 + ], + "overallDims": [ + 1026, + 277.257, + 455.018 + ], + "parts": [ + { + "partName": "PickFeeder_P01", + "label": "_0_4_kWith_key_and_end_of_tapNo_body_2001", + "primitive": "box", + "fcLocalDims": [ + 148.5, + 60, + 60 + ], + "position": [ + 600, + 199.5, + 1144.8 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 600, + 199.5, + 1144.8, + 748.5, + 259.5, + 1204.8 + ], + "center": [ + 674.25, + 229.5, + 1174.8 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.025", + "meshCount": 1, + "triangleCount": 12970, + "nodeNames": [ + "_0_4_kWith_key_and_end_of_tapNo_body_2001" + ], + "chain": [ + "夹取送料装置", + "_0_4_kWith_key_and_end_of_tapNo_body_2001" + ] + }, + { + "partName": "PickFeeder_P02", + "label": "A-L024001", + "primitive": "box", + "fcLocalDims": [ + 420, + 200, + 441.8 + ], + "position": [ + -30, + 200, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -30, + 200, + 774, + 390, + 400, + 1215.8 + ], + "center": [ + 180, + 300, + 994.9 + ], + "color": [ + 0.6146, + 0.6349, + 0.6463 + ], + "colorLinear": [ + 0.3359, + 0.3608, + 0.3753 + ], + "colorSource": "textureAvg", + "material": "铁", + "meshCount": 1, + "triangleCount": 42480, + "nodeNames": [ + "A-L024001" + ], + "chain": [ + "夹取送料装置", + "A-L024001" + ] + }, + { + "partName": "PickFeeder_P03", + "label": "AT68-R1616-7901426108001", + "primitive": "box", + "fcLocalDims": [ + 810, + 72, + 82 + ], + "position": [ + -180, + 198, + 1133.8 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -180, + 198, + 1133.8, + 630, + 270, + 1215.8 + ], + "center": [ + 225, + 234, + 1174.8 + ], + "color": [ + 0.6146, + 0.6349, + 0.6463 + ], + "colorLinear": [ + 0.3359, + 0.3608, + 0.3753 + ], + "colorSource": "textureAvg", + "material": "铁.001", + "meshCount": 1, + "triangleCount": 3356, + "nodeNames": [ + "AT68-R1616-7901426108001" + ], + "chain": [ + "夹取送料装置", + "AT68-R1616-790001", + "AT68-R1616-7901426108001" + ] + }, + { + "partName": "PickFeeder_P04", + "label": "夹取送料装置 部件 4", + "primitive": "box", + "fcLocalDims": [ + 242.917, + 143.2, + 119.2 + ], + "position": [ + -277.5, + 125.943, + 1109.818 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -277.5, + 125.943, + 1109.818, + -34.583, + 269.143, + 1229.018 + ], + "center": [ + -156.041, + 197.543, + 1169.418 + ], + "color": [ + 0.3725, + 0.3725, + 0.3725 + ], + "colorLinear": [ + 0.1144, + 0.1144, + 0.1144 + ], + "colorSource": "textureAvg", + "material": "中灰色光泽_Baked", + "meshCount": 5, + "triangleCount": 15635, + "nodeNames": [ + "夹取送料装置JT1", + "夹取送料装置JT2002", + "工位4夹取送", + "工位4夹取送料装置JT2001", + "工位4夹取送料装置JT3" + ], + "chain": [ + "夹取送料装置", + "夹取送料装置JT1" + ] + }, + { + "partName": "PickFeeder_P05", + "label": "夹取送料装置 部件 5", + "primitive": "box", + "fcLocalDims": [ + 70, + 59.275, + 141.469 + ], + "position": [ + -227.746, + 122.743, + 972.659 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -227.746, + 122.743, + 972.659, + -157.746, + 182.018, + 1114.128 + ], + "center": [ + -192.746, + 152.38, + 1043.393 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.022", + "meshCount": 5, + "triangleCount": 6838, + "nodeNames": [ + "夹取送料装置气缸JT2", + "夹爪", + "新版1005", + "新版3", + "夹爪1" + ], + "chain": [ + "夹取送料装置", + "夹取送料装置JT1", + "工位4夹取送", + "工位4夹取送料装置JT2001", + "夹取送料装置气缸JT2" + ] + } + ] + }, + { + "file": "平面.001.glb", + "name": "Plane001", + "label": "地面平面 001", + "sha256": "e4d0e3ccdf362bfa41e2135ef08c02d4e1c2c737f7e7ada1382238adc554e41b", + "meshCount": 6, + "triangleCount": 66, + "partBudget": 2, + "overallBBox": [ + -2153.148, + -2032.821, + -1039.203, + 2714.334, + 1640.409, + -729.142 + ], + "overallDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "parts": [ + { + "partName": "Plane001_P01", + "label": "地面平面 001 部件 1", + "primitive": "box", + "fcLocalDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "position": [ + -2153.148, + -2032.821, + -1039.203 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2153.148, + -2032.821, + -1039.203, + 2714.334, + 1640.409, + -729.142 + ], + "center": [ + 280.593, + -196.206, + -884.172 + ], + "color": [ + 0.3801, + 0.3753, + 0.3698 + ], + "colorLinear": [ + 0.1193, + 0.1162, + 0.1127 + ], + "colorSource": "textureAvg", + "material": "环氧涂料.001", + "meshCount": 3, + "triangleCount": 16, + "nodeNames": [ + "1_1", + "平面_1", + "平面_1001" + ], + "chain": [ + "地面平面", + "1_1" + ] + }, + { + "partName": "Plane001_P02", + "label": "地面平面 001 部件 2", + "primitive": "box", + "fcLocalDims": [ + 4855.255, + 1109.334, + 0.122 + ], + "position": [ + -2140.94, + -2032.819, + -739.025 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2140.94, + -2032.819, + -739.025, + 2714.315, + -923.485, + -738.903 + ], + "center": [ + 286.688, + -1478.152, + -738.964 + ], + "color": [ + 0.7137, + 0.6392, + 0.2431 + ], + "colorLinear": [ + 0.4677, + 0.3662, + 0.0482 + ], + "colorSource": "textureAvg", + "material": "黄色光泽_Baked.002", + "meshCount": 3, + "triangleCount": 50, + "nodeNames": [ + "地线_1", + "地线_1001", + "地线_1003" + ], + "chain": [ + "地面平面", + "地线_1" + ] + } + ] + }, + { + "file": "平面.glb", + "name": "Plane", + "label": "地面平面", + "sha256": "5aad2f7cac080b6a3b9657537152b20a0ce8c166c6e97beb7cd57d348582f8c8", + "meshCount": 6, + "triangleCount": 66, + "partBudget": 2, + "overallBBox": [ + -2439.842, + -1829.019, + -300, + 2427.64, + 1844.211, + 10.061 + ], + "overallDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "parts": [ + { + "partName": "Plane_P01", + "label": "地面平面 部件 1", + "primitive": "box", + "fcLocalDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "position": [ + -2439.842, + -1829.019, + -300 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2439.842, + -1829.019, + -300, + 2427.64, + 1844.211, + 10.061 + ], + "center": [ + -6.101, + 7.596, + -144.969 + ], + "color": [ + 0.3801, + 0.3753, + 0.3698 + ], + "colorLinear": [ + 0.1193, + 0.1162, + 0.1127 + ], + "colorSource": "textureAvg", + "material": "环氧涂料.001", + "meshCount": 3, + "triangleCount": 16, + "nodeNames": [ + "1_1", + "平面_1", + "平面_1001" + ], + "chain": [ + "平面", + "1_1" + ] + }, + { + "partName": "Plane_P02", + "label": "地面平面 部件 2", + "primitive": "box", + "fcLocalDims": [ + 4855.255, + 1109.334, + 0.122 + ], + "position": [ + -2427.634, + -1829.017, + 0.178 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2427.634, + -1829.017, + 0.178, + 2427.621, + -719.683, + 0.3 + ], + "center": [ + -0.006, + -1274.35, + 0.239 + ], + "color": [ + 0.7137, + 0.6392, + 0.2431 + ], + "colorLinear": [ + 0.4677, + 0.3662, + 0.0482 + ], + "colorSource": "textureAvg", + "material": "黄色光泽_Baked.002", + "meshCount": 3, + "triangleCount": 50, + "nodeNames": [ + "地线_1", + "地线_1001", + "地线_1003" + ], + "chain": [ + "平面", + "地线_1" + ] + } + ] + }, + { + "file": "推料装置.glb", + "name": "Pusher", + "label": "推料装置", + "sha256": "5a70fa850278cda7b13bdce66a7e4acd4067acfbdb0d6ca9567ae80738dd14d8", + "meshCount": 6, + "triangleCount": 49825, + "partBudget": 2, + "overallBBox": [ + 955, + -138.7, + 774, + 1445, + 197.3, + 1361.8 + ], + "overallDims": [ + 490, + 336, + 587.8 + ], + "parts": [ + { + "partName": "Pusher_P01", + "label": "工位6推料装置底板", + "primitive": "box", + "fcLocalDims": [ + 490, + 230, + 85 + ], + "position": [ + 955, + -35, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 955, + -35, + 774, + 1445, + 195, + 859 + ], + "center": [ + 1200, + 80, + 816.5 + ], + "color": [ + 0.7144, + 0.7301, + 0.734 + ], + "colorLinear": [ + 0.4688, + 0.4921, + 0.4979 + ], + "colorSource": "textureAvg", + "material": "银", + "meshCount": 1, + "triangleCount": 6170, + "nodeNames": [ + "工位6推料装置底板" + ], + "chain": [ + "推料装置", + "工位6推料装置底板" + ] + }, + { + "partName": "Pusher_P02", + "label": "推料装置 部件 2", + "primitive": "box", + "fcLocalDims": [ + 149.64, + 336, + 532.6 + ], + "position": [ + 965.008, + -138.7, + 829.2 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 965.008, + -138.7, + 829.2, + 1114.648, + 197.3, + 1361.8 + ], + "center": [ + 1039.828, + 29.3, + 1095.5 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.015", + "meshCount": 5, + "triangleCount": 43655, + "nodeNames": [ + "推料装置JT1", + "推料装置JT2", + "推料装置JT3", + "物料零件007", + "新版2001" + ], + "chain": [ + "推料装置", + "推料装置JT1" + ] + } + ] + }, + { + "file": "料仓.glb", + "name": "Hopper", + "label": "料仓", + "sha256": "9d65919f9268958501b0b2e9a445559efc6045a320e51e13d6a2792b1fe0690e", + "meshCount": 2, + "triangleCount": 11772, + "partBudget": 2, + "overallBBox": [ + -1485, + 90, + 774, + -1205, + 340, + 974 + ], + "overallDims": [ + 280, + 250, + 200 + ], + "parts": [ + { + "partName": "Hopper_P01", + "label": "hex_nuts__style_1-grades_ab_gb_GB_FASTENER_NUT_SNAB1_M12-N_013", + "primitive": "box", + "fcLocalDims": [ + 190.563, + 190.767, + 65 + ], + "position": [ + -1480.282, + 119.617, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1480.282, + 119.617, + 774, + -1289.719, + 310.384, + 839 + ], + "center": [ + -1385, + 215.001, + 806.5 + ], + "color": [ + 0.5445, + 0.5445, + 0.5445 + ], + "colorLinear": [ + 0.2576, + 0.2576, + 0.2576 + ], + "colorSource": "textureAvg", + "material": "普通钢.013", + "meshCount": 1, + "triangleCount": 6900, + "nodeNames": [ + "hex_nuts__style_1-grades_ab_gb_GB_FASTENER_NUT_SNAB1_M12-N_013" + ], + "chain": [ + "料仓", + "hex_nuts__style_1-grades_ab_gb_GB_FASTENER_NUT_SNAB1_M12-N_013" + ] + }, + { + "partName": "Hopper_P02", + "label": "M12____007", + "primitive": "box", + "fcLocalDims": [ + 280, + 250, + 200 + ], + "position": [ + -1485, + 90, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1485, + 90, + 774, + -1205, + 340, + 974 + ], + "center": [ + -1345, + 215, + 874 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.001", + "meshCount": 1, + "triangleCount": 4872, + "nodeNames": [ + "M12____007" + ], + "chain": [ + "料仓", + "M12____007" + ] + } + ] + }, + { + "file": "新版2.glb", + "name": "SensorBlock", + "label": "新版检测块", + "sha256": "66a6a34f8a4a4776a2c0dd990baa8b82f7e9151daeb36f85d55635243657afa5", + "meshCount": 1, + "triangleCount": 298, + "partBudget": 1, + "overallBBox": [ + 277.521, + -80.054, + 43.684, + 299.513, + -58.087, + 50.684 + ], + "overallDims": [ + 21.992, + 21.967, + 7 + ], + "parts": [ + { + "partName": "SensorBlock_P01", + "label": "新版1001_1", + "primitive": "box", + "fcLocalDims": [ + 21.992, + 21.967, + 7 + ], + "position": [ + 277.521, + -80.054, + 43.684 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 277.521, + -80.054, + 43.684, + 299.513, + -58.087, + 50.684 + ], + "center": [ + 288.517, + -69.071, + 47.184 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.014", + "meshCount": 1, + "triangleCount": 298, + "nodeNames": [ + "新版1001_1" + ], + "chain": [ + "新版2", + "新版1001_1" + ] + } + ] + }, + { + "file": "旋转运送装置.glb", + "name": "RotaryTransfer", + "label": "旋转运送装置", + "sha256": "aa7cd835229d028624d5cd21da1531bb48f64dc1e8129eb32910e9d106b2bcff", + "meshCount": 8, + "triangleCount": 44387, + "partBudget": 2, + "overallBBox": [ + -611.434, + -131.634, + 774, + -74.565, + 404.634, + 976 + ], + "overallDims": [ + 536.869, + 536.268, + 202 + ], + "parts": [ + { + "partName": "RotaryTransfer_P01", + "label": "旋转运送装置电机", + "primitive": "box", + "fcLocalDims": [ + 340, + 265, + 165 + ], + "position": [ + -473, + -20, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -473, + -20, + 774, + -133, + 245, + 939 + ], + "center": [ + -303, + 112.5, + 856.5 + ], + "color": [ + 0.0667, + 0.0667, + 0.0667 + ], + "colorLinear": [ + 0.0056, + 0.0056, + 0.0056 + ], + "colorSource": "textureAvg", + "material": "黑色车漆_Baked", + "meshCount": 1, + "triangleCount": 29295, + "nodeNames": [ + "旋转运送装置电机" + ], + "chain": [ + "旋转运送装置", + "旋转运送装置电机" + ] + }, + { + "partName": "RotaryTransfer_P02", + "label": "旋转运送装置 部件 2", + "primitive": "box", + "fcLocalDims": [ + 536.869, + 536.268, + 47 + ], + "position": [ + -611.434, + -131.634, + 929 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -611.434, + -131.634, + 929, + -74.565, + 404.634, + 976 + ], + "center": [ + -342.999, + 136.5, + 952.5 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.016", + "meshCount": 7, + "triangleCount": 15092, + "nodeNames": [ + "转盘", + "转盘零件1", + "转盘零件1-1", + "转盘零件2", + "转盘零件2-1", + "转盘零件3", + "转盘零件3-1" + ], + "chain": [ + "旋转运送装置", + "转盘" + ] + } + ] + }, + { + "file": "显示屏.glb", + "name": "DisplayA", + "label": "显示屏 A", + "sha256": "936f33b84ad6a91e8583289fe64469f474641e1196af3009a7332b2054aac8bb", + "meshCount": 2, + "triangleCount": 4502, + "partBudget": 2, + "overallBBox": [ + -1472.405, + -127.694, + 774, + -1223.405, + 33.506, + 1086 + ], + "overallDims": [ + 249, + 161.2, + 312 + ], + "parts": [ + { + "partName": "DisplayA_P01", + "label": "IH-C-07-031792213", + "primitive": "box", + "fcLocalDims": [ + 249, + 161.2, + 312 + ], + "position": [ + -1472.405, + -127.694, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1472.405, + -127.694, + 774, + -1223.405, + 33.506, + 1086 + ], + "center": [ + -1347.905, + -47.094, + 930 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.002", + "meshCount": 1, + "triangleCount": 4138, + "nodeNames": [ + "IH-C-07-031792213" + ], + "chain": [ + "显示屏", + "IH-C-07-03001", + "IH-C-07-031792213" + ] + }, + { + "partName": "DisplayA_P02", + "label": "IH-C-07-031792213_1", + "primitive": "box", + "fcLocalDims": [ + 204, + 115.676, + 148.432 + ], + "position": [ + -1451.405, + -120.077, + 923.324 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1451.405, + -120.077, + 923.324, + -1247.405, + -4.401, + 1071.756 + ], + "center": [ + -1349.405, + -62.239, + 997.54 + ], + "color": [ + 0.4604, + 0.4727, + 0.4823 + ], + "colorLinear": [ + 0.1792, + 0.1896, + 0.198 + ], + "colorSource": "textureAvg", + "material": "材质", + "meshCount": 1, + "triangleCount": 364, + "nodeNames": [ + "IH-C-07-031792213_1" + ], + "chain": [ + "显示屏", + "IH-C-07-03001", + "IH-C-07-031792213_1" + ] + } + ] + }, + { + "file": "显示屏1.glb", + "name": "DisplayB", + "label": "显示屏 B", + "sha256": "72eb3ee957160c52ca223d1604c6af4f670c4a5fc6eb5f5e706d93f6238b0c36", + "meshCount": 2, + "triangleCount": 4502, + "partBudget": 2, + "overallBBox": [ + -1194.5, + -325, + 40, + -945.5, + -163.8, + 352 + ], + "overallDims": [ + 249, + 161.2, + 312 + ], + "parts": [ + { + "partName": "DisplayB_P01", + "label": "IH-C-07-031792213", + "primitive": "box", + "fcLocalDims": [ + 249, + 161.2, + 312 + ], + "position": [ + -1194.5, + -325, + 40 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1194.5, + -325, + 40, + -945.5, + -163.8, + 352 + ], + "center": [ + -1070, + -244.4, + 196 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.002", + "meshCount": 1, + "triangleCount": 4138, + "nodeNames": [ + "IH-C-07-031792213" + ], + "chain": [ + "显示屏", + "IH-C-07-03001", + "IH-C-07-031792213" + ] + }, + { + "partName": "DisplayB_P02", + "label": "IH-C-07-031792213_1", + "primitive": "box", + "fcLocalDims": [ + 204, + 115.676, + 148.432 + ], + "position": [ + -1173.5, + -317.383, + 189.324 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1173.5, + -317.383, + 189.324, + -969.5, + -201.707, + 337.756 + ], + "center": [ + -1071.5, + -259.545, + 263.54 + ], + "color": [ + 0.4604, + 0.4727, + 0.4823 + ], + "colorLinear": [ + 0.1792, + 0.1896, + 0.198 + ], + "colorSource": "textureAvg", + "material": "材质", + "meshCount": 1, + "triangleCount": 364, + "nodeNames": [ + "IH-C-07-031792213_1" + ], + "chain": [ + "显示屏", + "IH-C-07-03001", + "IH-C-07-031792213_1" + ] + } + ] + }, + { + "file": "柜门.glb", + "name": "CabinetDoor", + "label": "柜门", + "sha256": "5ab62fd4d919ea6343f765c96ee637a6cf915143acddb248f43afc51eda676ea", + "meshCount": 1, + "triangleCount": 1252, + "partBudget": 1, + "overallBBox": [ + -1505, + -80, + 155, + -1475, + 480, + 715 + ], + "overallDims": [ + 30, + 560, + 560 + ], + "parts": [ + { + "partName": "CabinetDoor_P01", + "label": "ZX-JX02-02-23²_____006", + "primitive": "box", + "fcLocalDims": [ + 30, + 560, + 560 + ], + "position": [ + -1505, + -80, + 155 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1505, + -80, + 155, + -1475, + 480, + 715 + ], + "center": [ + -1490, + 200, + 435 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.015", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-23²_____006" + ], + "chain": [ + "柜门", + "ZX-JX02-02-23²_____006" + ] + } + ] + }, + { + "file": "检测台.glb", + "name": "InspectionTable", + "label": "检测台", + "sha256": "51a0efdda45a6b4aef066cd1e5d659d6b39f4e4a059d4524fb7194f814a544ef", + "meshCount": 1, + "triangleCount": 5888, + "partBudget": 1, + "overallBBox": [ + 837.73, + -2.484, + 774, + 912.73, + 146.002, + 1099 + ], + "overallDims": [ + 75, + 148.486, + 325 + ], + "parts": [ + { + "partName": "InspectionTable_P01", + "label": "RP-0B03-02-02001", + "primitive": "box", + "fcLocalDims": [ + 75, + 148.486, + 325 + ], + "position": [ + 837.73, + -2.484, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 837.73, + -2.484, + 774, + 912.73, + 146.002, + 1099 + ], + "center": [ + 875.23, + 71.759, + 936.5 + ], + "color": [ + 0.7444, + 0.7565, + 0.7586 + ], + "colorLinear": [ + 0.5138, + 0.5327, + 0.536 + ], + "colorSource": "textureAvg", + "material": "划痕钢.002", + "meshCount": 1, + "triangleCount": 5888, + "nodeNames": [ + "RP-0B03-02-02001" + ], + "chain": [ + "检测台", + "RP-0B03-02-02001" + ] + } + ] + }, + { + "file": "物料存储区.glb", + "name": "MaterialStore", + "label": "物料存储区", + "sha256": "37697c7e53062e819758940f671bcafe9c7165ad42a24c40253083e95fc3ed9c", + "meshCount": 33, + "triangleCount": 18558, + "partBudget": 5, + "overallBBox": [ + 1038.935, + 199.25, + 774, + 1390.75, + 282.229, + 1186.75 + ], + "overallDims": [ + 351.815, + 82.979, + 412.75 + ], + "parts": [ + { + "partName": "MaterialStore_P01", + "label": "物料存储区 部件 1", + "primitive": "box", + "fcLocalDims": [ + 39.864, + 40, + 30 + ], + "position": [ + 1065.108, + 221.846, + 1104.741 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1065.108, + 221.846, + 1104.741, + 1104.972, + 261.846, + 1134.741 + ], + "center": [ + 1085.04, + 241.846, + 1119.741 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.029", + "meshCount": 2, + "triangleCount": 1048, + "nodeNames": [ + "新版101", + "新版101_1" + ], + "chain": [ + "物料存储区", + "新版101" + ] + }, + { + "partName": "MaterialStore_P02", + "label": "物料存储区 部件 2", + "primitive": "box", + "fcLocalDims": [ + 351.815, + 82.979, + 412.75 + ], + "position": [ + 1038.935, + 199.25, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1038.935, + 199.25, + 774, + 1390.75, + 282.229, + 1186.75 + ], + "center": [ + 1214.843, + 240.74, + 980.375 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.016", + "meshCount": 25, + "triangleCount": 14366, + "nodeNames": [ + "新版102", + "新版102_1", + "新版201", + "新版201_1", + "新版202", + "新版202_1", + "新版302", + "新版302_1", + "ZX-JX02-02-21____1354724", + "新版303", + "新版303_1", + "新版203" + ], + "chain": [ + "物料存储区", + "新版102" + ] + }, + { + "partName": "MaterialStore_P03", + "label": "物料存储区 部件 3", + "primitive": "box", + "fcLocalDims": [ + 39.864, + 40, + 30 + ], + "position": [ + 1328.422, + 221.846, + 1104.741 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1328.422, + 221.846, + 1104.741, + 1368.286, + 261.846, + 1134.741 + ], + "center": [ + 1348.354, + 241.846, + 1119.741 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.036", + "meshCount": 2, + "triangleCount": 1048, + "nodeNames": [ + "新版104", + "新版104_1" + ], + "chain": [ + "物料存储区", + "新版104" + ] + }, + { + "partName": "MaterialStore_P04", + "label": "物料存储区 部件 4", + "primitive": "box", + "fcLocalDims": [ + 39.864, + 40, + 30 + ], + "position": [ + 1065.108, + 221.846, + 860.235 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1065.108, + 221.846, + 860.235, + 1104.972, + 261.846, + 890.235 + ], + "center": [ + 1085.04, + 241.846, + 875.235 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.034", + "meshCount": 2, + "triangleCount": 1048, + "nodeNames": [ + "新版401", + "新版401_1" + ], + "chain": [ + "物料存储区", + "新版401" + ] + }, + { + "partName": "MaterialStore_P05", + "label": "物料存储区 部件 5", + "primitive": "box", + "fcLocalDims": [ + 39.863, + 40, + 30 + ], + "position": [ + 1329.24, + 221.846, + 858.6 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1329.24, + 221.846, + 858.6, + 1369.103, + 261.846, + 888.6 + ], + "center": [ + 1349.172, + 241.846, + 873.6 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.059", + "meshCount": 2, + "triangleCount": 1048, + "nodeNames": [ + "新版404", + "新版404_1" + ], + "chain": [ + "物料存储区", + "新版404" + ] + } + ] + }, + { + "file": "称重平台.glb", + "name": "WeighPlatform", + "label": "称重平台", + "sha256": "f6d584d958dc75e7ea1591b9a6b97a36212fcb699f3e10a0d9cde7540776066b", + "meshCount": 2, + "triangleCount": 12880, + "partBudget": 2, + "overallBBox": [ + 65.002, + 50.341, + 774, + 265.002, + 249.657, + 949 + ], + "overallDims": [ + 200, + 199.316, + 175 + ], + "parts": [ + { + "partName": "WeighPlatform_P01", + "label": "NA1_¹________001", + "primitive": "box", + "fcLocalDims": [ + 200, + 199.316, + 170 + ], + "position": [ + 65.002, + 50.341, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 65.002, + 50.341, + 774, + 265.002, + 249.657, + 944 + ], + "center": [ + 165.002, + 149.999, + 859 + ], + "color": [ + 0.8633, + 0.9046, + 0.9386 + ], + "colorLinear": [ + 0.7167, + 0.7965, + 0.866 + ], + "colorSource": "baseColorFactor", + "material": "白钢.001", + "meshCount": 1, + "triangleCount": 11986, + "nodeNames": [ + "NA1_¹________001" + ], + "chain": [ + "称重平台", + "NA1_¹________001" + ] + }, + { + "partName": "WeighPlatform_P02", + "label": "旋转送料装置JT1", + "primitive": "box", + "fcLocalDims": [ + 149.665, + 149.982, + 5 + ], + "position": [ + 90.17, + 75.008, + 944 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 90.17, + 75.008, + 944, + 239.835, + 224.99, + 949 + ], + "center": [ + 165.003, + 149.999, + 946.5 + ], + "color": [ + 0.8633, + 0.9046, + 0.9386 + ], + "colorLinear": [ + 0.7167, + 0.7965, + 0.866 + ], + "colorSource": "baseColorFactor", + "material": "白钢.003", + "meshCount": 1, + "triangleCount": 894, + "nodeNames": [ + "旋转送料装置JT1" + ], + "chain": [ + "称重平台", + "旋转送料装置JT1" + ] + } + ] + }, + { + "file": "辅助夹爪.glb", + "name": "AuxGripper", + "label": "辅助夹爪", + "sha256": "df0c62dfb59264cbbc7dd995e989f93784e8c7e75824f5c9aea65e948136a53d", + "meshCount": 4, + "triangleCount": 16900, + "partBudget": 3, + "overallBBox": [ + -530.519, + 80.32, + 945.984, + -457.207, + 174.592, + 1048.378 + ], + "overallDims": [ + 73.312, + 94.272, + 102.394 + ], + "parts": [ + { + "partName": "AuxGripper_P01", + "label": "机器人夹爪_1", + "primitive": "box", + "fcLocalDims": [ + 73.312, + 94.272, + 38.077 + ], + "position": [ + -530.519, + 80.32, + 1010.301 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -530.519, + 80.32, + 1010.301, + -457.207, + 174.592, + 1048.378 + ], + "center": [ + -493.863, + 127.456, + 1029.34 + ], + "color": [ + 0.8389, + 0.8664, + 0.8978 + ], + "colorLinear": [ + 0.6719, + 0.7226, + 0.7831 + ], + "colorSource": "textureAvg", + "material": "抛光金属1.011", + "meshCount": 1, + "triangleCount": 13214, + "nodeNames": [ + "机器人夹爪_1" + ], + "chain": [ + "辅助夹爪", + "机器人夹爪_1" + ] + }, + { + "partName": "AuxGripper_P02", + "label": "辅助夹爪 部件 2", + "primitive": "box", + "fcLocalDims": [ + 40, + 53.077, + 70.048 + ], + "position": [ + -512.825, + 95.245, + 945.984 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -512.825, + 95.245, + 945.984, + -472.825, + 148.322, + 1016.032 + ], + "center": [ + -492.825, + 121.784, + 981.008 + ], + "color": [ + 0.8389, + 0.8664, + 0.8978 + ], + "colorLinear": [ + 0.6719, + 0.7226, + 0.7831 + ], + "colorSource": "textureAvg", + "material": "抛光金属1.013", + "meshCount": 2, + "triangleCount": 2218, + "nodeNames": [ + "夹爪003001", + "机器人的料001001" + ], + "chain": [ + "辅助夹爪", + "机器人夹爪_1", + "夹爪003001" + ] + }, + { + "partName": "AuxGripper_P03", + "label": "夹爪1002001", + "primitive": "box", + "fcLocalDims": [ + 34.134, + 29.894, + 53.912 + ], + "position": [ + -510.046, + 130.005, + 962.107 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -510.046, + 130.005, + 962.107, + -475.912, + 159.899, + 1016.019 + ], + "center": [ + -492.979, + 144.952, + 989.063 + ], + "color": [ + 0.8389, + 0.8664, + 0.8978 + ], + "colorLinear": [ + 0.6719, + 0.7226, + 0.7831 + ], + "colorSource": "textureAvg", + "material": "抛光金属1.012", + "meshCount": 1, + "triangleCount": 1468, + "nodeNames": [ + "夹爪1002001" + ], + "chain": [ + "辅助夹爪", + "机器人夹爪_1", + "夹爪1002001" + ] + } + ] + }, + { + "file": "运送支架.glb", + "name": "TransportBracket", + "label": "运送支架", + "sha256": "8a8bc9d0c2b7f6f0a6a2236a91d264e3345ed7114c2f026467f9e1acde6af682", + "meshCount": 1, + "triangleCount": 2360, + "partBudget": 1, + "overallBBox": [ + -280, + -100, + 774, + -220, + 13.5, + 1084 + ], + "overallDims": [ + 60, + 113.5, + 310 + ], + "parts": [ + { + "partName": "TransportBracket_P01", + "label": "IH-C-08-01001", + "primitive": "box", + "fcLocalDims": [ + 60, + 113.5, + 310 + ], + "position": [ + -280, + -100, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -280, + -100, + 774, + -220, + 13.5, + 1084 + ], + "center": [ + -250, + -43.25, + 929 + ], + "color": [ + 0.7444, + 0.7565, + 0.7586 + ], + "colorLinear": [ + 0.5138, + 0.5327, + 0.536 + ], + "colorSource": "textureAvg", + "material": "划痕钢.001", + "meshCount": 1, + "triangleCount": 2360, + "nodeNames": [ + "IH-C-08-01001" + ], + "chain": [ + "运送支架", + "IH-C-08-01001" + ] + } + ] + }, + { + "file": "运送检测装置.glb", + "name": "TransportInspector", + "label": "运送检测装置", + "sha256": "4762f3404fddf8086e8b4b9f1f17c9d261df08882bad0dc918f06145f650b5e0", + "meshCount": 2, + "triangleCount": 5950, + "partBudget": 2, + "overallBBox": [ + -312.488, + 253.99, + 774, + -237.488, + 402.476, + 1099 + ], + "overallDims": [ + 75, + 148.486, + 325 + ], + "parts": [ + { + "partName": "TransportInspector_P01", + "label": "RP-0B03-02-02003", + "primitive": "box", + "fcLocalDims": [ + 75, + 148.486, + 325 + ], + "position": [ + -312.488, + 253.99, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -312.488, + 253.99, + 774, + -237.488, + 402.476, + 1099 + ], + "center": [ + -274.988, + 328.233, + 936.5 + ], + "color": [ + 0.7444, + 0.7565, + 0.7586 + ], + "colorLinear": [ + 0.5138, + 0.5327, + 0.536 + ], + "colorSource": "textureAvg", + "material": "划痕钢.003", + "meshCount": 1, + "triangleCount": 5888, + "nodeNames": [ + "RP-0B03-02-02003" + ], + "chain": [ + "运送检测装置", + "RP-0B03-02-02003" + ] + }, + { + "partName": "TransportInspector_P02", + "label": "扫描光线1_1", + "primitive": "cylinder", + "fcLocalDims": [ + 30, + 30, + 60 + ], + "position": [ + -289.988, + 254.976, + 968.182 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -289.988, + 254.976, + 968.182, + -259.988, + 284.976, + 1028.182 + ], + "center": [ + -274.988, + 269.976, + 998.182 + ], + "color": [ + 0.5946, + 0.0016, + 0.0016 + ], + "colorLinear": [ + 0.3123, + 0.0001, + 0.0001 + ], + "colorSource": "baseColorFactor", + "material": "红灯", + "meshCount": 1, + "triangleCount": 62, + "nodeNames": [ + "扫描光线1_1" + ], + "chain": [ + "运送检测装置", + "扫描光线1_1" + ] + } + ] + } + ] +} diff --git a/web/teaching/index.html b/web/teaching/index.html new file mode 100644 index 00000000..87fad9ea --- /dev/null +++ b/web/teaching/index.html @@ -0,0 +1,287 @@ + + + + + +FreeCAD Web 官方案例验收 · 初学者教学手册 + + + +
+
+ FreeCAD Web +

官方案例验收 · 初学者教学手册

+ +
+
+
+ +
+

这本手册面向第一次接触本项目的同学。它讲清楚一件事:为什么我们要在浏览器里,把 FreeCAD 桌面版的官方测试逐条重新跑一遍,并且怎么亲手跑。

+ +
+
278已通过验收的官方案例
+
95可一键可视化执行
+
72带现场截图证据
+
+ +

这个项目在做什么

+

FreeCAD 是一个开源的三维 CAD 软件,正常情况下它运行在桌面上,底层是 C++,界面用 Qt。本项目要把它移植成一份纯浏览器版本:C++ 内核编译成 WebAssembly,界面用 React 重写。移植最大的风险不是"能不能打开",而是"行为和桌面版是否一致"。

+

所以我们的验收方法是:把 FreeCAD 自带的官方测试用例(比如 Mod/PartDesign/PartDesignTests/TestPad.py)当作"考卷",在 Web 版里用真实的运行链路把它跑一遍,再和桌面版的结果逐项对比。每条通过验收的考卷,就是账本(ledger)里的一条 passed 记录。目前 324 条候选里有 278 条已经通过。

+ +
+

一句话记住三条线

+ + + + + +
线在哪作用
桌面依据freecad-source/src/Mod/...官方的 Python 测试代码,是我们唯一的"正确答案"
Web ownerweb/src/... + freecad-source/src/WebAssembly/...用 React 和 WASM 实现同样的能力,并由它对外提供命令入口
证据与账本docs/current/business-evidence/ 与 web/docs/current/freecad-official-case-ledger.json把每次验证的现场(截图、JSON 结果)和结论固化下来
+
+
+ +
+

一次验收要经过什么

+

这是本项目约定的统一顺序。初学者最容易犯的错是:页面一打开就急着断言"产品坏了",其实大多数时候是前置条件没准备好。

+ +
+ + + + + + + + + ① 桌面依据② Web owner③ host / server④ fixture⑤ Worker/WASM⑥ 断言 + + 官方测试代码是唯一正确答案 + React + C++ owner提供命令实现 + 页面能被打开端口 / 视图就绪 + 文档与对象准备好再跑 + 原生内核真正算出结果 + 执行并对比桌面 vs Web + + + + + + ⑦ 双视口(1440×900 桌面 / 390×844 移动)→ 页面无横向溢出、无 pageErrors + ⑧ 产品行为与保存回开 → 改参数、重算、存盘、重开,对象与属性一致 + ⑨ 证据落盘 → docs/current/business-evidence/<case>/ 下的截图与 JSON + ⑩ 64 项工作台审计 + 账本记账 → status=passed,acceptancePassed=true + + + +
图 1 验收管线的十个环节。前面任何一步不满足,都不能跳到⑥断言,更不能把前置失败记成产品回归。
+
+ +

为什么要分"前置失败"和"产品回归"

+

项目里出过真实教训:某个脚本因为工作目录不对,报 MODULE_NOT_FOUND,被误判为"产品失败"。后来定下铁律:日志很小且含 Cannot find module、No such file or directory 时,一律记为前置失败,先补前置,不得据此记账。

+
初学者记忆法:先问"我准备好了吗",再问"软件做对了吗"。
+
+ +
+

一条案例要过哪七道关

+ + + + + + + + + +
关卡含义怎么算通过
前置条件 preflightPassed入口、fixture、Worker、端口都就绪缺任何一项先补,不算产品失败
native 结果 nativeResultVerifiedWASM 内算出的数值与桌面一致体积、坐标、对象数等按类型比较
保存回开 saveReopenVerified存盘后重新打开,数据不变对象与属性逐项对比
桌面视口 desktopViewportVerified1440×900 下界面正常无溢出、无 pageErrors、在视口内
移动视口 mobileViewportVerified390×844 下界面正常同上
64 项审计 audit64Passed32 个模块 × 2 个视口64 条记录全部通过
总验收 acceptancePassed以上全部满足账本行记为 passed
+
+ +
+

动手演示:跑通一条案例

+

下面这条案例是 real.Inspection:inspection.createRecompute,它在 Web 端创建 Inspection 对象并做一次重算。跟着做一遍,你就掌握了整个验收动作。

+ +
    +
  1. +

    确认服务已经开着

    +

    Web 应用运行在 http://127.0.0.1:5180。打开终端先探一下:

    +
    curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:5180/
    +# 期望输出:200
    +

    如果不是 200,先启动 Web 服务,再继续。这就是"前置条件"。

    +
  2. +
  3. +

    打开工作台并选中命令

    +

    直接访问带参数的地址,页面会自动选中 Inspection 模块和该命令:

    +
    http://127.0.0.1:5180/workbench.html?module=Inspection&command=inspection.createRecompute
    +

    页面左侧是模块列表,中间是命令参数 JSON,右侧是执行结果。

    +
  4. +
  5. +

    检查参数与状态

    +

    参数框里应该已经有官方 fixture(PAYLOADS 注册的默认参数)。如果没有,就手动填 {}。注意页面 URL 上的 module 和 command 只有命中注册表才会生效。

    +
  6. +
  7. +

    点击"执行选中命令"

    +

    按钮会真正把请求发进 Worker,由 WASM 内核执行,再把结果回传给页面。稍等一两秒,右侧出现 JSON 结果:

    +
    {
    +  "schema": "freecad-web-inspection/create-recompute/v1",
    +  "inspection": { "distanceCount": 8, "rms": 0, "hasError": 0 },
    +  "recompute": { "count": 1, "hasError": 0 },
    +  "resourcesReleased": true
    +}
    +
  8. +
  9. +

    核对数值与状态

    +

    和桌面结果比对。注意按真实类型比较:数值带容差,字符串用前缀或子串,Vector 用 isEqual,对象按标识比较。

    +
  10. +
  11. +

    截屏并记录证据

    +

    截图存到 docs/current/business-evidence/<case>/,并把结果 JSON 一起写入。这一步是"证据"。可视化执行页已经帮你自动截图并写入 docs/current/teaching-runs/。

    +
  12. +
  13. +

    记账

    +

    七道关全过之后,才更新账本行。项目提供了统一入口,不要手工改 JSON:

    +
    node tools/close-official-case.mjs \
    +  --case <caseId> \
    +  --evidence <repo-relative-path> \
    +  --note "一句话说明"
    +
  14. +
+ +

打开可视化执行页查看 32 个模块的功能列表案例教学:4 缸发动机缸体案例教学:照 t1.stp 复刻零件案例教学:二级齿轮减速器(界面操作)案例教学:装配公差分析(初学者)案例教学:三轴 CAM(初学者)案例教学:航空母舰(含培训视频)案例教学:FEM 悬臂梁(应力云图)案例教学:三维产线(有头界面 + MCP)案例教学:ABB IRB 120 产线(MCP)视频课程:27 件 GLB 产线建模(18 集)Three.js Z-up 验证报告BIM 厂房车间(30×18m)BIM 厂房教程BIM 厂房初学者手册(视频)直接打开这条案例

+
+ + + +
+

术语小词典

+ + + + + + + + + + +
词用大白话解释
WASM / WebAssembly一种能在浏览器里高速运行的二进制格式。我们把 FreeCAD 的 C++ 内核编译成它。
Worker浏览器里的后台线程。内核在 Worker 里跑,避免卡住界面。
Probe(探针)一个专门用来"问内核问题"的小程序。比如 Test 探针负责跑 Python 语法检查。
fixture测试用的固定输入。比如一个已经画好盒子的文档。
owner某项能力的"负责人"代码。Web 端用 React/TS 实现界面语义,用 C++ 实现内核能力。
ledger(账本)freecad-official-case-ledger.json,记录每条案例的状态和证据。
preflight(前置)跑产品断言之前必须准备好的条件。
viewport(视口)浏览器可见区域大小。我们固定测桌面和移动两种。
+
+ +
+

按模块浏览

+
+
+ +
+
FreeCAD Web 教学目录 · 数据来自 web/teaching/data/cases.json(由账本自动生成)· 由可视化执行页可逐条运行
+ + + + diff --git a/web/teaching/media/line-course/checkpoints/E03.FCStd b/web/teaching/media/line-course/checkpoints/E03.FCStd new file mode 100644 index 00000000..c93315e1 Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E03.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E04.FCStd b/web/teaching/media/line-course/checkpoints/E04.FCStd new file mode 100644 index 00000000..4c92c6cc Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E04.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E05.FCStd b/web/teaching/media/line-course/checkpoints/E05.FCStd new file mode 100644 index 00000000..c7796c72 Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E05.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E06.FCStd b/web/teaching/media/line-course/checkpoints/E06.FCStd new file mode 100644 index 00000000..f045f6a6 Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E06.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E07.FCStd b/web/teaching/media/line-course/checkpoints/E07.FCStd new file mode 100644 index 00000000..2937abaa Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E07.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E08.FCStd b/web/teaching/media/line-course/checkpoints/E08.FCStd new file mode 100644 index 00000000..8141e1c4 Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E08.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E09.FCStd b/web/teaching/media/line-course/checkpoints/E09.FCStd new file mode 100644 index 00000000..b06c7946 Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E09.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E10.FCStd b/web/teaching/media/line-course/checkpoints/E10.FCStd new file mode 100644 index 00000000..54a01f0b Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E10.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E11.FCStd b/web/teaching/media/line-course/checkpoints/E11.FCStd new file mode 100644 index 00000000..db725a0c Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E11.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E12.FCStd b/web/teaching/media/line-course/checkpoints/E12.FCStd new file mode 100644 index 00000000..6674a049 Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E12.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E13.FCStd b/web/teaching/media/line-course/checkpoints/E13.FCStd new file mode 100644 index 00000000..8f7f414c Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E13.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E14.FCStd b/web/teaching/media/line-course/checkpoints/E14.FCStd new file mode 100644 index 00000000..73d1a281 Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E14.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E15.FCStd b/web/teaching/media/line-course/checkpoints/E15.FCStd new file mode 100644 index 00000000..6e6db01e Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E15.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E16.FCStd b/web/teaching/media/line-course/checkpoints/E16.FCStd new file mode 100644 index 00000000..684eced2 Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E16.FCStd differ diff --git a/web/teaching/media/line-course/checkpoints/E18.FCStd b/web/teaching/media/line-course/checkpoints/E18.FCStd new file mode 100644 index 00000000..15481c4e Binary files /dev/null and b/web/teaching/media/line-course/checkpoints/E18.FCStd differ diff --git a/web/teaching/media/line-course/stills/E01/S00-title.png b/web/teaching/media/line-course/stills/E01/S00-title.png new file mode 100644 index 00000000..1c5d975e Binary files /dev/null and b/web/teaching/media/line-course/stills/E01/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E01/S01-interface.png b/web/teaching/media/line-course/stills/E01/S01-interface.png new file mode 100644 index 00000000..9d09e935 Binary files /dev/null and b/web/teaching/media/line-course/stills/E01/S01-interface.png differ diff --git a/web/teaching/media/line-course/stills/E01/S02-reference.png b/web/teaching/media/line-course/stills/E01/S02-reference.png new file mode 100644 index 00000000..5d13d7b8 Binary files /dev/null and b/web/teaching/media/line-course/stills/E01/S02-reference.png differ diff --git a/web/teaching/media/line-course/stills/E01/S03-cabinet.png b/web/teaching/media/line-course/stills/E01/S03-cabinet.png new file mode 100644 index 00000000..e3024fa9 Binary files /dev/null and b/web/teaching/media/line-course/stills/E01/S03-cabinet.png differ diff --git a/web/teaching/media/line-course/stills/E01/S04-units.png b/web/teaching/media/line-course/stills/E01/S04-units.png new file mode 100644 index 00000000..08333dc6 Binary files /dev/null and b/web/teaching/media/line-course/stills/E01/S04-units.png differ diff --git a/web/teaching/media/line-course/stills/E01/S05-recap.png b/web/teaching/media/line-course/stills/E01/S05-recap.png new file mode 100644 index 00000000..252cba8e Binary files /dev/null and b/web/teaching/media/line-course/stills/E01/S05-recap.png differ diff --git a/web/teaching/media/line-course/stills/E02/S00-title.png b/web/teaching/media/line-course/stills/E02/S00-title.png new file mode 100644 index 00000000..685d5a6f Binary files /dev/null and b/web/teaching/media/line-course/stills/E02/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E02/S01-reference.png b/web/teaching/media/line-course/stills/E02/S01-reference.png new file mode 100644 index 00000000..81b7199b Binary files /dev/null and b/web/teaching/media/line-course/stills/E02/S01-reference.png differ diff --git a/web/teaching/media/line-course/stills/E02/S02-table.png b/web/teaching/media/line-course/stills/E02/S02-table.png new file mode 100644 index 00000000..d448254e Binary files /dev/null and b/web/teaching/media/line-course/stills/E02/S02-table.png differ diff --git a/web/teaching/media/line-course/stills/E02/S03-formula.png b/web/teaching/media/line-course/stills/E02/S03-formula.png new file mode 100644 index 00000000..7d8e96b2 Binary files /dev/null and b/web/teaching/media/line-course/stills/E02/S03-formula.png differ diff --git a/web/teaching/media/line-course/stills/E02/S04-audit.png b/web/teaching/media/line-course/stills/E02/S04-audit.png new file mode 100644 index 00000000..e763a590 Binary files /dev/null and b/web/teaching/media/line-course/stills/E02/S04-audit.png differ diff --git a/web/teaching/media/line-course/stills/E02/S05-recap.png b/web/teaching/media/line-course/stills/E02/S05-recap.png new file mode 100644 index 00000000..64b02230 Binary files /dev/null and b/web/teaching/media/line-course/stills/E02/S05-recap.png differ diff --git a/web/teaching/media/line-course/stills/E03/S00-title.png b/web/teaching/media/line-course/stills/E03/S00-title.png new file mode 100644 index 00000000..ba666556 Binary files /dev/null and b/web/teaching/media/line-course/stills/E03/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E03/S01-document.png b/web/teaching/media/line-course/stills/E03/S01-document.png new file mode 100644 index 00000000..946d0c9e Binary files /dev/null and b/web/teaching/media/line-course/stills/E03/S01-document.png differ diff --git a/web/teaching/media/line-course/stills/E03/S02-parts.png b/web/teaching/media/line-course/stills/E03/S02-parts.png new file mode 100644 index 00000000..eb9a18f8 Binary files /dev/null and b/web/teaching/media/line-course/stills/E03/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E03/S03-parts.png b/web/teaching/media/line-course/stills/E03/S03-parts.png new file mode 100644 index 00000000..e15938e5 Binary files /dev/null and b/web/teaching/media/line-course/stills/E03/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E03/S04-parts.png b/web/teaching/media/line-course/stills/E03/S04-parts.png new file mode 100644 index 00000000..7cba5b51 Binary files /dev/null and b/web/teaching/media/line-course/stills/E03/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E03/S05-parts.png b/web/teaching/media/line-course/stills/E03/S05-parts.png new file mode 100644 index 00000000..d4b4c515 Binary files /dev/null and b/web/teaching/media/line-course/stills/E03/S05-parts.png differ diff --git a/web/teaching/media/line-course/stills/E03/S06-recap.png b/web/teaching/media/line-course/stills/E03/S06-recap.png new file mode 100644 index 00000000..79a70172 Binary files /dev/null and b/web/teaching/media/line-course/stills/E03/S06-recap.png differ diff --git a/web/teaching/media/line-course/stills/E04/S00-title.png b/web/teaching/media/line-course/stills/E04/S00-title.png new file mode 100644 index 00000000..bdacf3f3 Binary files /dev/null and b/web/teaching/media/line-course/stills/E04/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E04/S01-start.png b/web/teaching/media/line-course/stills/E04/S01-start.png new file mode 100644 index 00000000..9b171dc3 Binary files /dev/null and b/web/teaching/media/line-course/stills/E04/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E04/S02-parts.png b/web/teaching/media/line-course/stills/E04/S02-parts.png new file mode 100644 index 00000000..d0cdd88d Binary files /dev/null and b/web/teaching/media/line-course/stills/E04/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E04/S03-parts.png b/web/teaching/media/line-course/stills/E04/S03-parts.png new file mode 100644 index 00000000..0e962c2f Binary files /dev/null and b/web/teaching/media/line-course/stills/E04/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E04/S04-parts.png b/web/teaching/media/line-course/stills/E04/S04-parts.png new file mode 100644 index 00000000..2f7133e9 Binary files /dev/null and b/web/teaching/media/line-course/stills/E04/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E04/S05-parts.png b/web/teaching/media/line-course/stills/E04/S05-parts.png new file mode 100644 index 00000000..8f445648 Binary files /dev/null and b/web/teaching/media/line-course/stills/E04/S05-parts.png differ diff --git a/web/teaching/media/line-course/stills/E04/S06-recap.png b/web/teaching/media/line-course/stills/E04/S06-recap.png new file mode 100644 index 00000000..e7d4e8fc Binary files /dev/null and b/web/teaching/media/line-course/stills/E04/S06-recap.png differ diff --git a/web/teaching/media/line-course/stills/E05/S00-title.png b/web/teaching/media/line-course/stills/E05/S00-title.png new file mode 100644 index 00000000..43b7667a Binary files /dev/null and b/web/teaching/media/line-course/stills/E05/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E05/S01-start.png b/web/teaching/media/line-course/stills/E05/S01-start.png new file mode 100644 index 00000000..6a1d1883 Binary files /dev/null and b/web/teaching/media/line-course/stills/E05/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E05/S02-parts.png b/web/teaching/media/line-course/stills/E05/S02-parts.png new file mode 100644 index 00000000..29416f35 Binary files /dev/null and b/web/teaching/media/line-course/stills/E05/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E05/S03-parts.png b/web/teaching/media/line-course/stills/E05/S03-parts.png new file mode 100644 index 00000000..c52f765a Binary files /dev/null and b/web/teaching/media/line-course/stills/E05/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E05/S04-parts.png b/web/teaching/media/line-course/stills/E05/S04-parts.png new file mode 100644 index 00000000..b91f6bcf Binary files /dev/null and b/web/teaching/media/line-course/stills/E05/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E05/S05-recap.png b/web/teaching/media/line-course/stills/E05/S05-recap.png new file mode 100644 index 00000000..fb1d8b60 Binary files /dev/null and b/web/teaching/media/line-course/stills/E05/S05-recap.png differ diff --git a/web/teaching/media/line-course/stills/E06/S00-title.png b/web/teaching/media/line-course/stills/E06/S00-title.png new file mode 100644 index 00000000..1d52f745 Binary files /dev/null and b/web/teaching/media/line-course/stills/E06/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E06/S01-start.png b/web/teaching/media/line-course/stills/E06/S01-start.png new file mode 100644 index 00000000..0645f864 Binary files /dev/null and b/web/teaching/media/line-course/stills/E06/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E06/S02-parts.png b/web/teaching/media/line-course/stills/E06/S02-parts.png new file mode 100644 index 00000000..9ca39806 Binary files /dev/null and b/web/teaching/media/line-course/stills/E06/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E06/S03-parts.png b/web/teaching/media/line-course/stills/E06/S03-parts.png new file mode 100644 index 00000000..b2e2ccf2 Binary files /dev/null and b/web/teaching/media/line-course/stills/E06/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E06/S04-parts.png b/web/teaching/media/line-course/stills/E06/S04-parts.png new file mode 100644 index 00000000..1020f592 Binary files /dev/null and b/web/teaching/media/line-course/stills/E06/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E06/S05-parts.png b/web/teaching/media/line-course/stills/E06/S05-parts.png new file mode 100644 index 00000000..705a2285 Binary files /dev/null and b/web/teaching/media/line-course/stills/E06/S05-parts.png differ diff --git a/web/teaching/media/line-course/stills/E06/S06-recap.png b/web/teaching/media/line-course/stills/E06/S06-recap.png new file mode 100644 index 00000000..58883bec Binary files /dev/null and b/web/teaching/media/line-course/stills/E06/S06-recap.png differ diff --git a/web/teaching/media/line-course/stills/E07/S00-title.png b/web/teaching/media/line-course/stills/E07/S00-title.png new file mode 100644 index 00000000..2edffc57 Binary files /dev/null and b/web/teaching/media/line-course/stills/E07/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E07/S01-start.png b/web/teaching/media/line-course/stills/E07/S01-start.png new file mode 100644 index 00000000..d9891af9 Binary files /dev/null and b/web/teaching/media/line-course/stills/E07/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E07/S02-parts.png b/web/teaching/media/line-course/stills/E07/S02-parts.png new file mode 100644 index 00000000..3f539eb9 Binary files /dev/null and b/web/teaching/media/line-course/stills/E07/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E07/S03-parts.png b/web/teaching/media/line-course/stills/E07/S03-parts.png new file mode 100644 index 00000000..e7b4a3cf Binary files /dev/null and b/web/teaching/media/line-course/stills/E07/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E07/S04-parts.png b/web/teaching/media/line-course/stills/E07/S04-parts.png new file mode 100644 index 00000000..ecd7e8c2 Binary files /dev/null and b/web/teaching/media/line-course/stills/E07/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E07/S05-parts.png b/web/teaching/media/line-course/stills/E07/S05-parts.png new file mode 100644 index 00000000..a998e334 Binary files /dev/null and b/web/teaching/media/line-course/stills/E07/S05-parts.png differ diff --git a/web/teaching/media/line-course/stills/E07/S06-recap.png b/web/teaching/media/line-course/stills/E07/S06-recap.png new file mode 100644 index 00000000..d21a7cc8 Binary files /dev/null and b/web/teaching/media/line-course/stills/E07/S06-recap.png differ diff --git a/web/teaching/media/line-course/stills/E08/S00-title.png b/web/teaching/media/line-course/stills/E08/S00-title.png new file mode 100644 index 00000000..421d2596 Binary files /dev/null and b/web/teaching/media/line-course/stills/E08/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E08/S01-start.png b/web/teaching/media/line-course/stills/E08/S01-start.png new file mode 100644 index 00000000..afa38a47 Binary files /dev/null and b/web/teaching/media/line-course/stills/E08/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E08/S02-parts.png b/web/teaching/media/line-course/stills/E08/S02-parts.png new file mode 100644 index 00000000..4dd61adf Binary files /dev/null and b/web/teaching/media/line-course/stills/E08/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E08/S03-parts.png b/web/teaching/media/line-course/stills/E08/S03-parts.png new file mode 100644 index 00000000..2ebfbca2 Binary files /dev/null and b/web/teaching/media/line-course/stills/E08/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E08/S04-recap.png b/web/teaching/media/line-course/stills/E08/S04-recap.png new file mode 100644 index 00000000..a03c4a14 Binary files /dev/null and b/web/teaching/media/line-course/stills/E08/S04-recap.png differ diff --git a/web/teaching/media/line-course/stills/E09/S00-title.png b/web/teaching/media/line-course/stills/E09/S00-title.png new file mode 100644 index 00000000..b8d273aa Binary files /dev/null and b/web/teaching/media/line-course/stills/E09/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E09/S01-start.png b/web/teaching/media/line-course/stills/E09/S01-start.png new file mode 100644 index 00000000..d5ed37d8 Binary files /dev/null and b/web/teaching/media/line-course/stills/E09/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E09/S02-parts.png b/web/teaching/media/line-course/stills/E09/S02-parts.png new file mode 100644 index 00000000..f55c8602 Binary files /dev/null and b/web/teaching/media/line-course/stills/E09/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E09/S03-parts.png b/web/teaching/media/line-course/stills/E09/S03-parts.png new file mode 100644 index 00000000..3a1f3c34 Binary files /dev/null and b/web/teaching/media/line-course/stills/E09/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E09/S04-parts.png b/web/teaching/media/line-course/stills/E09/S04-parts.png new file mode 100644 index 00000000..1fb64f10 Binary files /dev/null and b/web/teaching/media/line-course/stills/E09/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E09/S05-parts.png b/web/teaching/media/line-course/stills/E09/S05-parts.png new file mode 100644 index 00000000..7bf0f087 Binary files /dev/null and b/web/teaching/media/line-course/stills/E09/S05-parts.png differ diff --git a/web/teaching/media/line-course/stills/E09/S06-recap.png b/web/teaching/media/line-course/stills/E09/S06-recap.png new file mode 100644 index 00000000..b6235e59 Binary files /dev/null and b/web/teaching/media/line-course/stills/E09/S06-recap.png differ diff --git a/web/teaching/media/line-course/stills/E10/S00-title.png b/web/teaching/media/line-course/stills/E10/S00-title.png new file mode 100644 index 00000000..5a2d4863 Binary files /dev/null and b/web/teaching/media/line-course/stills/E10/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E10/S01-start.png b/web/teaching/media/line-course/stills/E10/S01-start.png new file mode 100644 index 00000000..91b6941c Binary files /dev/null and b/web/teaching/media/line-course/stills/E10/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E10/S02-parts.png b/web/teaching/media/line-course/stills/E10/S02-parts.png new file mode 100644 index 00000000..9bc1d9a7 Binary files /dev/null and b/web/teaching/media/line-course/stills/E10/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E10/S03-parts.png b/web/teaching/media/line-course/stills/E10/S03-parts.png new file mode 100644 index 00000000..426eb779 Binary files /dev/null and b/web/teaching/media/line-course/stills/E10/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E10/S04-parts.png b/web/teaching/media/line-course/stills/E10/S04-parts.png new file mode 100644 index 00000000..60d74f0d Binary files /dev/null and b/web/teaching/media/line-course/stills/E10/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E10/S05-parts.png b/web/teaching/media/line-course/stills/E10/S05-parts.png new file mode 100644 index 00000000..1d42a8f9 Binary files /dev/null and b/web/teaching/media/line-course/stills/E10/S05-parts.png differ diff --git a/web/teaching/media/line-course/stills/E10/S06-recap.png b/web/teaching/media/line-course/stills/E10/S06-recap.png new file mode 100644 index 00000000..38462ec1 Binary files /dev/null and b/web/teaching/media/line-course/stills/E10/S06-recap.png differ diff --git a/web/teaching/media/line-course/stills/E11/S00-title.png b/web/teaching/media/line-course/stills/E11/S00-title.png new file mode 100644 index 00000000..0e16ab07 Binary files /dev/null and b/web/teaching/media/line-course/stills/E11/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E11/S01-start.png b/web/teaching/media/line-course/stills/E11/S01-start.png new file mode 100644 index 00000000..db746c48 Binary files /dev/null and b/web/teaching/media/line-course/stills/E11/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E11/S02-parts.png b/web/teaching/media/line-course/stills/E11/S02-parts.png new file mode 100644 index 00000000..c4d91f0b Binary files /dev/null and b/web/teaching/media/line-course/stills/E11/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E11/S03-parts.png b/web/teaching/media/line-course/stills/E11/S03-parts.png new file mode 100644 index 00000000..a101aed5 Binary files /dev/null and b/web/teaching/media/line-course/stills/E11/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E11/S04-recap.png b/web/teaching/media/line-course/stills/E11/S04-recap.png new file mode 100644 index 00000000..02689867 Binary files /dev/null and b/web/teaching/media/line-course/stills/E11/S04-recap.png differ diff --git a/web/teaching/media/line-course/stills/E12/S00-title.png b/web/teaching/media/line-course/stills/E12/S00-title.png new file mode 100644 index 00000000..5e994080 Binary files /dev/null and b/web/teaching/media/line-course/stills/E12/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E12/S01-start.png b/web/teaching/media/line-course/stills/E12/S01-start.png new file mode 100644 index 00000000..321c2a46 Binary files /dev/null and b/web/teaching/media/line-course/stills/E12/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E12/S02-parts.png b/web/teaching/media/line-course/stills/E12/S02-parts.png new file mode 100644 index 00000000..4a625a6a Binary files /dev/null and b/web/teaching/media/line-course/stills/E12/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E12/S03-parts.png b/web/teaching/media/line-course/stills/E12/S03-parts.png new file mode 100644 index 00000000..d527e861 Binary files /dev/null and b/web/teaching/media/line-course/stills/E12/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E12/S04-recap.png b/web/teaching/media/line-course/stills/E12/S04-recap.png new file mode 100644 index 00000000..4d18c4d1 Binary files /dev/null and b/web/teaching/media/line-course/stills/E12/S04-recap.png differ diff --git a/web/teaching/media/line-course/stills/E13/S00-title.png b/web/teaching/media/line-course/stills/E13/S00-title.png new file mode 100644 index 00000000..53999dc2 Binary files /dev/null and b/web/teaching/media/line-course/stills/E13/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E13/S01-start.png b/web/teaching/media/line-course/stills/E13/S01-start.png new file mode 100644 index 00000000..b228e26e Binary files /dev/null and b/web/teaching/media/line-course/stills/E13/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E13/S02-parts.png b/web/teaching/media/line-course/stills/E13/S02-parts.png new file mode 100644 index 00000000..2028a43b Binary files /dev/null and b/web/teaching/media/line-course/stills/E13/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E13/S03-parts.png b/web/teaching/media/line-course/stills/E13/S03-parts.png new file mode 100644 index 00000000..4a9a73af Binary files /dev/null and b/web/teaching/media/line-course/stills/E13/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E13/S04-parts.png b/web/teaching/media/line-course/stills/E13/S04-parts.png new file mode 100644 index 00000000..fee9d660 Binary files /dev/null and b/web/teaching/media/line-course/stills/E13/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E13/S05-parts.png b/web/teaching/media/line-course/stills/E13/S05-parts.png new file mode 100644 index 00000000..fba45919 Binary files /dev/null and b/web/teaching/media/line-course/stills/E13/S05-parts.png differ diff --git a/web/teaching/media/line-course/stills/E13/S06-recap.png b/web/teaching/media/line-course/stills/E13/S06-recap.png new file mode 100644 index 00000000..b35984f8 Binary files /dev/null and b/web/teaching/media/line-course/stills/E13/S06-recap.png differ diff --git a/web/teaching/media/line-course/stills/E14/S00-title.png b/web/teaching/media/line-course/stills/E14/S00-title.png new file mode 100644 index 00000000..57e66688 Binary files /dev/null and b/web/teaching/media/line-course/stills/E14/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E14/S01-start.png b/web/teaching/media/line-course/stills/E14/S01-start.png new file mode 100644 index 00000000..902b36f3 Binary files /dev/null and b/web/teaching/media/line-course/stills/E14/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E14/S02-parts.png b/web/teaching/media/line-course/stills/E14/S02-parts.png new file mode 100644 index 00000000..19cc8e5b Binary files /dev/null and b/web/teaching/media/line-course/stills/E14/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E14/S03-parts.png b/web/teaching/media/line-course/stills/E14/S03-parts.png new file mode 100644 index 00000000..580dcc5e Binary files /dev/null and b/web/teaching/media/line-course/stills/E14/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E14/S04-parts.png b/web/teaching/media/line-course/stills/E14/S04-parts.png new file mode 100644 index 00000000..73e7f2b4 Binary files /dev/null and b/web/teaching/media/line-course/stills/E14/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E14/S05-parts.png b/web/teaching/media/line-course/stills/E14/S05-parts.png new file mode 100644 index 00000000..582be594 Binary files /dev/null and b/web/teaching/media/line-course/stills/E14/S05-parts.png differ diff --git a/web/teaching/media/line-course/stills/E14/S06-parts.png b/web/teaching/media/line-course/stills/E14/S06-parts.png new file mode 100644 index 00000000..e3f1d1bb Binary files /dev/null and b/web/teaching/media/line-course/stills/E14/S06-parts.png differ diff --git a/web/teaching/media/line-course/stills/E14/S07-parts.png b/web/teaching/media/line-course/stills/E14/S07-parts.png new file mode 100644 index 00000000..39bbd7fd Binary files /dev/null and b/web/teaching/media/line-course/stills/E14/S07-parts.png differ diff --git a/web/teaching/media/line-course/stills/E14/S08-recap.png b/web/teaching/media/line-course/stills/E14/S08-recap.png new file mode 100644 index 00000000..dc9d78d2 Binary files /dev/null and b/web/teaching/media/line-course/stills/E14/S08-recap.png differ diff --git a/web/teaching/media/line-course/stills/E15/S00-title.png b/web/teaching/media/line-course/stills/E15/S00-title.png new file mode 100644 index 00000000..b60299d5 Binary files /dev/null and b/web/teaching/media/line-course/stills/E15/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E15/S01-checkpoint.png b/web/teaching/media/line-course/stills/E15/S01-checkpoint.png new file mode 100644 index 00000000..2fcd1bbb Binary files /dev/null and b/web/teaching/media/line-course/stills/E15/S01-checkpoint.png differ diff --git a/web/teaching/media/line-course/stills/E15/S02-reference.png b/web/teaching/media/line-course/stills/E15/S02-reference.png new file mode 100644 index 00000000..a7e7d9e1 Binary files /dev/null and b/web/teaching/media/line-course/stills/E15/S02-reference.png differ diff --git a/web/teaching/media/line-course/stills/E15/S03-robot.png b/web/teaching/media/line-course/stills/E15/S03-robot.png new file mode 100644 index 00000000..4422143c Binary files /dev/null and b/web/teaching/media/line-course/stills/E15/S03-robot.png differ diff --git a/web/teaching/media/line-course/stills/E15/S04-recap.png b/web/teaching/media/line-course/stills/E15/S04-recap.png new file mode 100644 index 00000000..a09738da Binary files /dev/null and b/web/teaching/media/line-course/stills/E15/S04-recap.png differ diff --git a/web/teaching/media/line-course/stills/E16/S00-title.png b/web/teaching/media/line-course/stills/E16/S00-title.png new file mode 100644 index 00000000..b1bdb844 Binary files /dev/null and b/web/teaching/media/line-course/stills/E16/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E16/S01-start.png b/web/teaching/media/line-course/stills/E16/S01-start.png new file mode 100644 index 00000000..ad3054bf Binary files /dev/null and b/web/teaching/media/line-course/stills/E16/S01-start.png differ diff --git a/web/teaching/media/line-course/stills/E16/S02-parts.png b/web/teaching/media/line-course/stills/E16/S02-parts.png new file mode 100644 index 00000000..8825f269 Binary files /dev/null and b/web/teaching/media/line-course/stills/E16/S02-parts.png differ diff --git a/web/teaching/media/line-course/stills/E16/S03-parts.png b/web/teaching/media/line-course/stills/E16/S03-parts.png new file mode 100644 index 00000000..47e6005d Binary files /dev/null and b/web/teaching/media/line-course/stills/E16/S03-parts.png differ diff --git a/web/teaching/media/line-course/stills/E16/S04-parts.png b/web/teaching/media/line-course/stills/E16/S04-parts.png new file mode 100644 index 00000000..8685fb8a Binary files /dev/null and b/web/teaching/media/line-course/stills/E16/S04-parts.png differ diff --git a/web/teaching/media/line-course/stills/E16/S05-recap.png b/web/teaching/media/line-course/stills/E16/S05-recap.png new file mode 100644 index 00000000..1d2ec21e Binary files /dev/null and b/web/teaching/media/line-course/stills/E16/S05-recap.png differ diff --git a/web/teaching/media/line-course/stills/E17/S00-title.png b/web/teaching/media/line-course/stills/E17/S00-title.png new file mode 100644 index 00000000..b49cd83e Binary files /dev/null and b/web/teaching/media/line-course/stills/E17/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E17/S01-assembly.png b/web/teaching/media/line-course/stills/E17/S01-assembly.png new file mode 100644 index 00000000..f8acabaa Binary files /dev/null and b/web/teaching/media/line-course/stills/E17/S01-assembly.png differ diff --git a/web/teaching/media/line-course/stills/E17/S02-links.png b/web/teaching/media/line-course/stills/E17/S02-links.png new file mode 100644 index 00000000..df51fa76 Binary files /dev/null and b/web/teaching/media/line-course/stills/E17/S02-links.png differ diff --git a/web/teaching/media/line-course/stills/E17/S03-audit.png b/web/teaching/media/line-course/stills/E17/S03-audit.png new file mode 100644 index 00000000..f059251d Binary files /dev/null and b/web/teaching/media/line-course/stills/E17/S03-audit.png differ diff --git a/web/teaching/media/line-course/stills/E17/S04-recap.png b/web/teaching/media/line-course/stills/E17/S04-recap.png new file mode 100644 index 00000000..f545c41f Binary files /dev/null and b/web/teaching/media/line-course/stills/E17/S04-recap.png differ diff --git a/web/teaching/media/line-course/stills/E18/S00-title.png b/web/teaching/media/line-course/stills/E18/S00-title.png new file mode 100644 index 00000000..67d54136 Binary files /dev/null and b/web/teaching/media/line-course/stills/E18/S00-title.png differ diff --git a/web/teaching/media/line-course/stills/E18/S01-audit.png b/web/teaching/media/line-course/stills/E18/S01-audit.png new file mode 100644 index 00000000..ccc4b507 Binary files /dev/null and b/web/teaching/media/line-course/stills/E18/S01-audit.png differ diff --git a/web/teaching/media/line-course/stills/E18/S02-exports.png b/web/teaching/media/line-course/stills/E18/S02-exports.png new file mode 100644 index 00000000..b5b3a73f Binary files /dev/null and b/web/teaching/media/line-course/stills/E18/S02-exports.png differ diff --git a/web/teaching/media/line-course/stills/E18/S03-recap.png b/web/teaching/media/line-course/stills/E18/S03-recap.png new file mode 100644 index 00000000..eea2e6ea Binary files /dev/null and b/web/teaching/media/line-course/stills/E18/S03-recap.png differ diff --git a/web/teaching/media/line-course/stills/E18/S04-delivery.png b/web/teaching/media/line-course/stills/E18/S04-delivery.png new file mode 100644 index 00000000..369493d2 Binary files /dev/null and b/web/teaching/media/line-course/stills/E18/S04-delivery.png differ diff --git a/web/tools/line-course/CONTINUATION.md b/web/tools/line-course/CONTINUATION.md new file mode 100644 index 00000000..b1c235d2 --- /dev/null +++ b/web/tools/line-course/CONTINUATION.md @@ -0,0 +1,116 @@ +# 生产线 27 件 GLB 初学者课程 · 接续点 + +更新:2026-11-12 +计划:`/home/mes123456/.claude/plans/partitioned-puzzling-haven.md` + +## 目标 + +用有头 Web FreeCAD 把 `/home/mes123456/FreeCADWasmDev/working/GLTFmodel/` 的 27 个 GLB +逐个创建为图元部件模型,18 集中文配音课程(约 3 小时)+ 图文课程页 + 交互页。 + +## 已完成(P0 部分) + +- `build-line-spec.mjs`:27 个 GLB → `line-spec.json` + `line-inventory.md`。 + - 完整 `node.matrix`/TRS/scale;Z-up 恒等映射(×1000),已用地面平面 + 4867.5×3673.2×310.1 mm 做轴向自检。 + - 教学部件聚类:根子节点子树 → 凝聚合并/拆分;27 模型 / 88 部件;整线 + bbox `[-2439.8,-2032.8,-1039.2,2714.3,1844.2,1473.6]` mm。 + - 图元:默认世界对齐 Box;两轴近似相等且纵向拉长时 Cylinder;人工预算在 + `overrides.json`。 +- `sample-material-colors.py` → `material-colors.json`:296 个材质,184 个带贴图, + 用 Pillow 采样贴图平均色;spec 中 60 个部件用 `textureAvg`,28 个用 `baseColorFactor`。 +- 校核:`partCount=88` 与计划一致;ABB 11 段;颜色抽查(地面地线黄色、柜门浅灰)合理。 +- 参考查看器已泛化:`web/src/delta-reference-panel.tsx` 支持 `{src,title,upAxis,modelsUrl}`, + 新增 `LineReferencePanel`(27 件下拉、Z-up);项目页新增“产线参考模型”按钮。 + `vite.config.ts` 的 `connect-src` 增加 `blob:`(GLTFLoader 贴图走 blob,原先被 CSP 拦截)。 +- 冒烟通过:`spikes/line-reference-smoke.mjs`,27 个选项、地面与地线 + `4.87 × 3.67 × 0.31 m`、0 pageError/0 consoleError;证据 + `evidence/p0/reference-smoke.json` + `spikes/line-reference-smoke.png`。 +- 颜色持久化已确认:DELTA 检查点 `Document.xml` 中每个对象都有 + `WebDisplayColor`(`App::PropertyString`,`#rrggbb`),无需 `GuiDocument.xml`。 +- P1 管线落地:`course.json`(18 集、88 对象,由 `build-course-json.mjs` 从 spec 生成)、 + `record/generate-tts/assemble/verify/build-course-page`(line 薄包装,含 + `page.route("**/line-glb/*.glb")` 回填)、`lib/{ui,build,line-precision,assembly}.mjs`。 +- E01/E02/E03 smoke 全部通过(0 pageError/consoleError): + - E01:27 个参考模型,主控制柜 1.50×0.74×0.75 m,地面 4.87×3.67×0.31 m。 + - E02:Spreadsheet 6 行 + 公式 `B8=B2+C2`(2244.1→2344.2→2244.1,含 0.01 容差)。 + - E03:主控制柜 8 个 Box,保存 `checkpoints/E03.FCStd`(9,624 字节); + `line-precision` 8/8 通过、无多余对象;`Document.xml` 有 8 个 `WebDisplayColor` + (`#000000/#a2a6ad/#c5c5c5/#e5e9ec`)。 + - E04:长控制柜 8 件,累计 16 对象,precision 通过;`checkpoints/E04.FCStd`。 + - E05:柜门 + 双显示屏 5 件,累计 21 对象,precision 通过。 + - E06:料仓/原料上料 7 件,累计 28 对象;非正圆件回退 Box,precision 通过。 + - E07:上料/传送带 8 件,累计 36 对象,precision 通过。 + - E08:旋转/称重 4 件,累计 40 对象,precision 通过。 + - E09:夹取/辅助夹爪 8 件,累计 48,通过。 + - E10:推料/存储 7 件,累计 55,通过。 + - E11:检测块/支架/运送检测 4 件,累计 59;首次使用 `Part_Cylinder` + (R15×60 红色检测头),包围盒 30×30×60,通过。 + - E12:原料装配/检测台 4 件,累计 63,通过。 + - E13:三色灯/ Tool /原点 8 件,累计 71;3 个圆柱 + 纯红绿蓝坐标轴, + 逐对象 `WebDisplayColor` 验证 `#ff0000/#00ff00/#0000ff`,通过。 + - E14:ABB 11 件(含 R109.7×431.2 下臂圆柱),累计 82,通过。 + - E15:复核集(无新几何),累计 82,通过。 + - E16:三块地面 6 件,累计 88,通过;27 个模型全部建完。 + - E17:Assembly 新建 `LineAssembly`,插入 88 条链接,通过(0 pageError)。 + - E18:88 对象全量审计通过;选中 `CabinetA_P02` 导出 STEP/STL 到 OPFS; + 保存 `E18.FCStd`(89,483 字节)与 `evidence/course.json`。 +- **18/18 集 smoke 全部通过**(E02–E18 用 `COURSE_FAST=1` 快烟)。 +- E01 媒体链路已完整验证:TTS 6 场景 → 有头录制 242.2 s → assemble → + verify 20 项检查、21 条字幕、6 张 stills。 +- 课程页 `teaching/cases/production-line-course.html`:18 卡片、E01 视频、 + 17 集 pending、桌面/移动 0 错误、0 横向溢出(`evidence/course-page.json`)。 +- 参考页 `teaching/cases/production-line-reference.html`:27 件下拉、Z-up, + 地面 `4.87×3.67×0.31 m`,0 错误(`evidence/reference-page.json`, + 截图 `production-line-reference.png`)。 +- GLB 通过 `teaching/cases/line-models -> /home/.../working/GLTFmodel` 符号链接提供, + 未复制进 public/dist。 +- E02–E18 媒体批处理已在后台启动:`run-media-batch.sh`,日志 + `evidence/media-batch.log`(TTS → record → assemble → verify)。 + - E02 成片 261.6 s / 20 checks / 18 cues,passed。 + - E03 成片 522.4 s / 22 checks / 20 cues,precision 8/8,passed;截图确认 File 菜单已关闭。 + - E04 成片 523.3 s / 22 checks / 20 cues,precision 16/16,passed。 + - E01 已在 Xvfb `:3` 重录并重新 assemble/verify:242.2 s / 20 checks / 21 cues, + passed;截图确认 File 菜单关闭。raw 录制文件已按集删除以节省磁盘。 +- **E01 需重录**:首版录制时 File 菜单一直展开,遮住对象树/工具栏。已修 + `lib/ui.mjs newDocument` 与 E01 驱动(新建文档后关闭所有 `details[open]`); + E02 不经过该路径,E03 起批处理会使用修复后的代码;E03 截图已确认菜单关闭。 +- 整线交互页已生成:`production-line-assembly.html` + `production-line-assembly.png`; + STL 用 Node WASM 探针从 `E18.FCStd` 一次导出 88 件到 `teaching/cases/line-parts/` + (`spikes/export-stls-node.mjs`,182,192 字节),页面加载 88/88、27 个模型、 + 下拉 28 项、0 错误(`evidence/assembly-page.json`)。 +- 参考页与装配页均已加入课程页 hero;课程页新增“分步截图”画廊(`stills/E##`)。 +- `audit-course.mjs`:课程级审计(27 模型 / 88 部件 / 18 集媒体 + evidence + 检查点)。 +- 共享修复:`lib/model-build.mjs` 在 S01 等待检查点对象数达到 `expectedNames - 新部件` + 后再创建,避免快速模式下把已加载对象误认成新 Box(E07 首轮复现,修复后通过)。 +- E03–E08 目前均为 smoke,尚未 TTS/录屏/合成。 + +## 真实残余 + +- E02–E18 的媒体成片仍在后台生成;完成前课程页保持 pending。 +- 整线交互页 `production-line-assembly.html` 尚未生成;需要从 E18.FCStd 逐件导出 + STL 到 `teaching/cases/line-parts/`,再用 three.js 拼场景。 +- 课程页 hero 图只差 `production-line-assembly.png`。 +- 88 对象重开视口已冒烟(E18 审计通过),但整线截图/相机仍需人工确认。 +- 参考查看器首次选大文件(三柜子 17/24 MB)需等待。 +- E18 的 STEP/STL 只导出了 `CabinetA_P02` 作为流程演示;全量 STL 导出待做。 + +## 下一步精确入口 + +1. E04:复制 E03 驱动结构,模型改为 `CabinetB`(8 部件),`checkpointIn: "E03"`; + 先 smoke,再写 `script.zh.json`,再 generate-tts/record/assemble/verify。 +2. E05–E13 按 `course.json` 的 models 列表批量推进(每集一个驱动,复用 `createBuilder`)。 +3. E06 前先冒烟圆柱:`Part_Cylinder` → `Property Radius`/`Property Height` 或任务面板 + `Radius`/`Height`,确保半径/高度写入并重算。 +4. E17 前决定总装策略:27 个模型 Compound 链接 vs 88 个部件链接;用 E16 检查点做一次 + 88 对象重开性能冒烟。 +5. 每集完成后:`record --smoke` → `generate-tts --episode` → `DISPLAY=:2 record --episode` + → `assemble --episode` → `verify --episode` → 更新本文件。 + +## 关键路径 + +- 参考目录:`/home/mes123456/FreeCADWasmDev/working/GLTFmodel` +- 应用:`http://127.0.0.1:5181/project.html?workbench=Part` +- 课程服务:`5190` +- 复用:`web/tools/delta-course/`、`web/tools/carrier-course/lib/` +- 视频/配音工具:ffmpeg、`/home/mes123456/FreeCADWasmDev/working/FreeCAD/.venv-video/bin/edge-tts` diff --git a/web/tools/line-course/README.md b/web/tools/line-course/README.md new file mode 100644 index 00000000..722bf305 --- /dev/null +++ b/web/tools/line-course/README.md @@ -0,0 +1,53 @@ +# 生产线 27 件 GLB 初学者课程 + +用有头 Web FreeCAD 把 `/home/mes123456/FreeCADWasmDev/working/GLTFmodel/` 的 27 个 GLB +逐个创建为 88 个图元部件,18 集中文配音课程 + 图文课程页 + 交互页。 + +## 产物 + +| 文件 | 作用 | +|---|---| +| `line-spec.json` | 唯一几何真源:27 模型 / 88 部件,Z-up、mm、颜色 | +| `line-inventory.md` | 人可读零件表 | +| `course.json` | 18 集、对象列表、检查点关系 | +| `episodes/E01..E18/` | 每集 `driver.mjs` + `script.zh.json` | +| `checkpoints/E##.FCStd` | 累计检查点(E18 为交付主文档) | +| `evidence/E##/verification.json` | 每集媒体校验 | +| `evidence/course-audit.json` | 课程级 27/88/18 审计 | +| `teaching/media/line-course/` | MP4/WebM/VTT/SRT/海报 | +| `teaching/cases/production-line-course.html` | 图文课程页 | +| `teaching/cases/production-line-reference.html` | 27 件参考 GLB 查看器 | +| `teaching/cases/production-line-assembly.html` | 88 件重建结果交互页 | + +## 生成顺序 + +```bash +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/build-line-spec.mjs +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/build-course-json.mjs +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/record.mjs --episode E03 --smoke +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/generate-tts.mjs --episode E03 +DISPLAY=:2 node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/record.mjs --episode E03 +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/assemble.mjs --episode E03 +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/verify.mjs --episode E03 +``` + +`COURSE_FAST=1` 只用于冒烟,正式录制必须去掉。 + +## 页面/服务 + +- 应用:`http://127.0.0.1:5181/project.html?workbench=Part` +- 课程服务:`http://127.0.0.1:5190/cases/production-line-course.html` +- 参考 GLB 不复制进 public/dist:`teaching/cases/line-models` 符号链接到参考目录; + 录制时另由 `page.route("**/line-glb/*.glb")` 回填。 + +## 验收 + +```bash +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/audit-course.mjs +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/spikes/course-page-check.mjs +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/spikes/reference-page-check.mjs +node /home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/spikes/assembly-page-check.mjs +``` + +精度口径:部件包围盒 ±1.5 mm、中心 ±3 mm、颜色每通道 ±0.02;模型整体 ±2/5 mm; +颜色从 FCStd `Document.xml` 的 `WebDisplayColor` 读取。 diff --git a/web/tools/line-course/assemble.mjs b/web/tools/line-course/assemble.mjs new file mode 100644 index 00000000..2a8bc966 --- /dev/null +++ b/web/tools/line-course/assemble.mjs @@ -0,0 +1,205 @@ +#!/usr/bin/env node +// Assembles one episode: raw X11 recording + edge-tts narration + subtitles. +// Cuts are driven by raw//markers.json; optional speedup-start/end +// markers compress repetitive UI stretches. +import fs from "node:fs"; +import path from "node:path"; +import { spawnSync } from "node:child_process"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../.."); +const args = process.argv.slice(2); +const option = (name, fallback = "") => { + const index = args.indexOf(name); + return index < 0 ? fallback : args[index + 1] ?? fallback; +}; +const episodeId = option("--episode"); +if (!episodeId) throw new Error("--episode is required"); +const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8")); +const episode = course.episodes.find(item => item.id === episodeId); +if (!episode) throw new Error(`unknown episode ${episodeId}`); +const episodeDir = path.join(here, "episodes", episodeId); +const rawDir = path.join(here, "raw", episodeId); +const segmentsDir = path.join(episodeDir, "segments"); +const audioDir = path.join(episodeDir, "audio"); +const mediaDir = path.join(webRoot, "teaching", "media", "line-course"); +const ffmpeg = "ffmpeg"; +const ffprobe = "ffprobe"; +const readJson = file => JSON.parse(fs.readFileSync(file, "utf8")); + +const script = readJson(path.join(episodeDir, "script.zh.json")); +const durations = readJson(path.join(episodeDir, "audio-durations.json")).scenes; +const markerFile = readJson(path.join(rawDir, "markers.json")); +const markers = markerFile.markers; +const order = script.scenes.map(scene => scene.id); +const sceneStart = id => markers.find(entry => entry.id === "scene-start" && entry.scene === id); +const marker = id => markers.find(entry => entry.id === id); +for (const id of order) if (!sceneStart(id)) throw new Error(`missing scene-start ${id}`); +if (!marker("end")) throw new Error("recording is incomplete: missing end marker"); +const captureStart = marker("captureStart")?.offset ?? 0; +const rawVideo = path.join(rawDir, "screen-recording.mp4"); +if (!fs.existsSync(rawVideo)) throw new Error(`raw video missing: ${rawVideo}`); +for (const directory of [segmentsDir, mediaDir]) fs.mkdirSync(directory, { recursive: true }); + +const run = (command, argv, label) => { + const result = spawnSync(command, argv, { encoding: "utf8", maxBuffer: 512 * 1024 * 1024 }); + if (result.status !== 0) throw new Error(`${label} failed (${result.status})\n${(result.stderr || "").slice(-5000)}`); + return result.stdout; +}; +const probe = file => { + const text = String(run(ffprobe, ["-v", "error", "-show_entries", "format=duration", "-of", "default=nw=1:nk=1", file], `probe ${path.basename(file)}`)).trim(); + const value = Number(text); + if (!Number.isFinite(value) || value <= 0) throw new Error(`bad duration for ${file}: ${text}`); + return value; +}; +const round = value => Math.round(value * 1000) / 1000; +const concatList = (files, listPath) => { + fs.writeFileSync(listPath, files.map(file => `file '${file.replace(/'/g, "'\\''")}'`).join("\n") + "\n"); + return listPath; +}; +const videoArgs = output => ["-an", "-c:v", "libx264", "-preset", "veryfast", "-crf", "20", + "-pix_fmt", "yuv420p", "-profile:v", "high", "-level", "4.2", "-g", "60", "-r", "30", + "-movflags", "+faststart", output]; + +// Scene spans, with optional speedup compression. +const spans = []; +for (let index = 0; index < order.length; index++) { + const id = order[index]; + const start = sceneStart(id).offset - captureStart; + const end = index + 1 < order.length + ? sceneStart(order[index + 1]).offset - captureStart + : marker("end").offset - captureStart; + if (end <= start) throw new Error(`invalid span for ${id}: ${start}..${end}`); + spans.push({ id, start, end }); +} + +const segments = []; +for (const span of spans) { + const speedups = markers + .filter(entry => entry.id === "speedup-start" && entry.scene === span.id) + .map(entry => ({ start: entry.offset - captureStart, end: (markers.find(other => other.id === "speedup-end" && other.scene === span.id && other.offset > entry.offset)?.offset ?? span.end) - captureStart, factor: entry.factor ?? 6 })) + .filter(entry => entry.end > entry.start) + .sort((a, b) => a.start - b.start); + const parts = []; + let cursor = span.start; + const addCut = (from, to, factor, suffix) => { + if (to - from < 0.05) return; + const file = path.join(segmentsDir, `${span.id}${suffix}.mp4`); + const filter = factor > 1 + ? `setpts=(PTS-STARTPTS)/${factor},fps=30,crop=1600:860:0:40,scale=1600:900` + : "setpts=PTS-STARTPTS,fps=30,crop=1600:860:0:40,scale=1600:900"; + run(ffmpeg, ["-y", "-ss", String(from), "-t", String(to - from), "-i", rawVideo, + "-vf", filter, ...videoArgs(file)], `${span.id} cut ${suffix}`); + parts.push({ file, duration: probe(file) }); + }; + for (const speed of speedups) { + if (speed.start > cursor) addCut(cursor, speed.start, 1, `-pre${parts.length}`); + addCut(speed.start, speed.end, speed.factor, `-fast${parts.length}`); + cursor = Math.max(cursor, speed.end); + } + if (cursor < span.end) addCut(cursor, span.end, 1, `-post${parts.length}`); + if (!parts.length) throw new Error(`no parts for ${span.id}`); + segments.push({ id: span.id, parts, duration: parts.reduce((sum, part) => sum + part.duration, 0) }); +} + +// Keep narration intact: when a scene is shorter than its voice-over, clone +// the last frame instead of letting the audio trim cut the sentence off. +for (const segment of segments) { + const narration = durations[segment.id]?.duration ?? 0; + const pad = narration + 0.3 - segment.duration; + if (pad > 0.1) { + const last = segment.parts.at(-1); + const padded = path.join(segmentsDir, `${segment.id}-pad.mp4`); + const before = probe(last.file); + run(ffmpeg, ["-y", "-i", last.file, "-vf", `tpad=stop_mode=clone:stop_duration=${pad.toFixed(3)}`, + ...videoArgs(padded)], `${segment.id} pad`); + segment.duration = segment.duration - before + probe(padded); + last.file = padded; + console.log(`padded ${segment.id} by ${pad.toFixed(2)}s for narration`); + } +} +const videoOnly = path.join(segmentsDir, "video-only.mp4"); +run(ffmpeg, ["-y", "-f", "concat", "-safe", "0", "-i", concatList(segments.flatMap(item => item.parts.map(part => part.file)), path.join(segmentsDir, "video-list.txt")), + "-c", "copy", videoOnly], "concat video"); +const totalVideo = probe(videoOnly); +let cursor = 0; +for (const segment of segments) { + segment.start = round(cursor); + segment.end = round(cursor + segment.duration); + cursor += segment.duration; +} + +const narrationWavs = []; +for (const segment of segments) { + const source = path.join(audioDir, `${segment.id}.mp3`); + if (!fs.existsSync(source)) throw new Error(`missing narration ${source}`); + const wav = path.join(segmentsDir, `audio-${segment.id}.wav`); + run(ffmpeg, ["-y", "-i", source, "-af", `apad=whole_dur=${segment.duration.toFixed(3)},atrim=0:${segment.duration.toFixed(3)}`, + "-ar", "48000", "-ac", "2", "-c:a", "pcm_s16le", wav], `audio ${segment.id}`); + narrationWavs.push(wav); +} +const narration = path.join(segmentsDir, "narration.wav"); +run(ffmpeg, ["-y", "-f", "concat", "-safe", "0", "-i", concatList(narrationWavs, path.join(segmentsDir, "audio-list.txt")), + "-c:a", "pcm_s16le", narration], "concat narration"); + +const base = `${episode.id}-${episode.slug}`; +const mp4 = path.join(mediaDir, `${base}.mp4`); +run(ffmpeg, ["-y", "-i", videoOnly, "-i", narration, "-c:v", "copy", "-c:a", "aac", "-b:a", "192k", + "-ar", "48000", "-shortest", "-movflags", "+faststart", mp4], "mux mp4"); +const webm = path.join(mediaDir, `${base}.webm`); +run(ffmpeg, ["-y", "-i", mp4, "-c:v", "libvpx-vp9", "-crf", "38", "-b:v", "0", "-row-mt", "1", + "-deadline", "good", "-cpu-used", "6", "-c:a", "libopus", "-b:a", "112k", webm], "webm"); +const posterTime = (segments.find(item => item.id === "S02")?.start ?? 10) + 5; +const poster = path.join(mediaDir, `${base}-poster.png`); +run(ffmpeg, ["-y", "-ss", String(Math.min(posterTime, Math.max(totalVideo - 1, 0))), "-i", mp4, + "-frames:v", "1", "-q:v", "2", poster], "poster"); + +// Merge SRT cues into one timeline. Speedup regions are remapped by the +// ratio between the raw span and the assembled segment duration. +const toSeconds = text => { + const match = /^(\d+):(\d+):(\d+)[,.](\d+)$/.exec(text.trim()); + if (!match) return null; + return Number(match[1]) * 3600 + Number(match[2]) * 60 + Number(match[3]) + Number(match[4]) / 1000; +}; +const fmt = seconds => { + const ms = Math.round(seconds * 1000); + const h = Math.floor(ms / 3600000), m = Math.floor((ms % 3600000) / 60000), s = Math.floor((ms % 60000) / 1000), milli = ms % 1000; + return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}.${String(milli).padStart(3, "0")}`; +}; +const cues = []; +for (const segment of segments) { + const srtPath = path.join(audioDir, `${segment.id}.srt`); + if (!fs.existsSync(srtPath)) continue; + const blocks = fs.readFileSync(srtPath, "utf8").replace(/\r/g, "").trim().split(/\n\n+/); + for (const block of blocks) { + const lines = block.split("\n"); + const timing = lines.find(line => line.includes("-->")); + if (!timing) continue; + const [fromText, toText] = timing.split("-->").map(value => value.trim()); + const from = toSeconds(fromText), to = toSeconds(toText); + if (from === null || to === null) continue; + cues.push({ from: segment.start + from, to: segment.start + to, text: lines.slice(lines.indexOf(timing) + 1).join("\n").trim() }); + } +} +const vtt = ["WEBVTT", "", ...cues.map((cue, index) => `${index + 1}\n${fmt(cue.from)} --> ${fmt(cue.to)}\n${cue.text}\n`)].join("\n"); +const vttPath = path.join(mediaDir, `${base}.zh.vtt`); +fs.writeFileSync(vttPath, vtt); +const srtPath = path.join(mediaDir, `${base}.zh.srt`); +fs.writeFileSync(srtPath, cues.map((cue, index) => `${index + 1}\n${fmt(cue.from).replace(".", ",")} --> ${fmt(cue.to).replace(".", ",")}\n${cue.text}\n`).join("\n")); + +const assembly = { + schema: "freecad-web-line-course/video-assembly/v1", + generatedAt: new Date().toISOString(), + episode: episodeId, + title: episode.title, + status: "assembled", + source: path.relative(here, rawVideo), + captureStart, + totalVideo: round(totalVideo), + scenes: segments.map(segment => ({ id: segment.id, start: segment.start, end: segment.end, duration: round(segment.duration), narration: durations[segment.id]?.duration ?? null })), + outputs: { mp4: path.relative(webRoot, mp4), webm: path.relative(webRoot, webm), vtt: path.relative(webRoot, vttPath), srt: path.relative(webRoot, srtPath), poster: path.relative(webRoot, poster) }, + cues: cues.length, +}; +fs.writeFileSync(path.join(episodeDir, "assembly.json"), `${JSON.stringify(assembly, null, 2)}\n`); +console.log(JSON.stringify({ ok: true, episode: episodeId, totalVideo: assembly.totalVideo, scenes: assembly.scenes, outputs: assembly.outputs, cues: cues.length }, null, 2)); diff --git a/web/tools/line-course/audit-course.mjs b/web/tools/line-course/audit-course.mjs new file mode 100644 index 00000000..9268bbd7 --- /dev/null +++ b/web/tools/line-course/audit-course.mjs @@ -0,0 +1,44 @@ +#!/usr/bin/env node +// Course-level audit: 27 models / 88 parts, 18 episodes, media + evidence + checkpoints. +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../.."); +const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8")); +const spec = JSON.parse(fs.readFileSync(path.join(here, "line-spec.json"), "utf8")); +const mediaDir = path.join(webRoot, "teaching", "media", "line-course"); +const episodes = []; +for (const episode of course.episodes) { + const base = `${episode.id}-${episode.slug}`; + const media = [".mp4", ".webm", ".zh.vtt", ".zh.srt", "-poster.png"] + .map(suffix => ({ suffix, exists: fs.existsSync(path.join(mediaDir, `${base}${suffix}`)) })); + const evidencePath = path.join(here, "evidence", episode.id, "verification.json"); + const evidence = fs.existsSync(evidencePath) ? JSON.parse(fs.readFileSync(evidencePath, "utf8")) : null; + const checkpoint = episode.checkpointOut + ? fs.existsSync(path.join(here, "checkpoints", `${episode.id}.FCStd`)) : null; + episodes.push({ + id: episode.id, slug: episode.slug, objects: episode.objects.length, + media, mediaOk: media.every(item => item.exists), + verification: evidence?.status ?? null, checkpoint, + ok: media.every(item => item.exists) && evidence?.status === "passed" && checkpoint !== false, + }); +} +const models = spec.models.length; +const parts = spec.parts ? spec.parts.length : spec.models.reduce((sum, model) => sum + model.parts.length, 0); +const report = { + schema: "freecad-web-line-course/course-audit/v1", + generatedAt: new Date().toISOString(), + models, parts, + episodes: episodes.length, + mediaPassed: episodes.filter(episode => episode.mediaOk).length, + verificationPassed: episodes.filter(episode => episode.verification === "passed").length, + pending: episodes.filter(episode => !episode.ok).map(episode => episode.id), + detail: episodes, + ok: models === 27 && parts === 88 && episodes.length === 18 && episodes.every(episode => episode.ok), +}; +fs.mkdirSync(path.join(here, "evidence"), { recursive: true }); +fs.writeFileSync(path.join(here, "evidence", "course-audit.json"), `${JSON.stringify(report, null, 2)}\n`); +console.log(JSON.stringify({ ok: report.ok, models, parts, episodes: report.episodes, + mediaPassed: report.mediaPassed, verificationPassed: report.verificationPassed, pending: report.pending })); diff --git a/web/tools/line-course/build-assembly-page.mjs b/web/tools/line-course/build-assembly-page.mjs new file mode 100644 index 00000000..8ad6a532 --- /dev/null +++ b/web/tools/line-course/build-assembly-page.mjs @@ -0,0 +1,117 @@ +#!/usr/bin/env node +// Generates production-line-assembly.html from line-spec + exported STLs. +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../.."); +const spec = JSON.parse(fs.readFileSync(path.join(here, "line-spec.json"), "utf8")); +const outFile = path.join(webRoot, "teaching", "cases", "production-line-assembly.html"); +fs.copyFileSync(path.join(here, "line-spec.json"), path.join(webRoot, "teaching", "cases", "production-line-spec.json")); +const parts = spec.models.flatMap(model => model.parts.map(part => ({ + partName: part.partName, model: model.name, modelLabel: model.label, + color: part.color, worldBBox: part.worldBBox, +}))); +const models = spec.models.map(model => ({ name: model.name, label: model.label })); +const groundModels = new Set(["GroundPlane", "Plane", "Plane001"]); +const machineParts = parts.filter(part => !groundModels.has(part.model)); +const machineBox = [0, 1, 2].map(axis => Math.min(...machineParts.map(part => part.worldBBox[axis]))) + .concat([0, 1, 2].map(axis => Math.max(...machineParts.map(part => part.worldBBox[axis + 3])))); + +const html = ` + + + + + +生产线 · 27 个模型 / 88 个部件重建结果 + + + + +
+

生产线重建结果

+ + 加载中… +
+
+

左键旋转 · 滚轮缩放 · 右键平移

+ + + +`; +fs.writeFileSync(outFile, html); +console.log(JSON.stringify({ ok: true, outFile, parts: parts.length, models: models.length })); diff --git a/web/tools/line-course/build-course-json.mjs b/web/tools/line-course/build-course-json.mjs new file mode 100644 index 00000000..d3e023aa --- /dev/null +++ b/web/tools/line-course/build-course-json.mjs @@ -0,0 +1,88 @@ +#!/usr/bin/env node +// Builds course.json from line-spec.json and the fixed 18-episode mapping, so +// object lists always match the reference spec. +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const spec = JSON.parse(fs.readFileSync(path.join(here, "line-spec.json"), "utf8")); +const byName = new Map(spec.models.map(model => [model.name, model])); + +const episodes = [ + ["E01", "S0", "ui-and-reference", "界面与产线参考模型", [], ["ui", "reference-glb", "tree", "navigation", "opfs"], [180, 480]], + ["E02", "S0", "measure-and-spec", "测量、单位与零件表", [], ["measure", "bbox", "units", "spreadsheet"], [180, 480]], + ["E03", "S1", "cabinet-a", "主控制柜", ["CabinetA"], ["box", "compound", "placement", "color", "save"], [300, 900]], + ["E04", "S1", "cabinet-b", "长控制柜", ["CabinetB"], ["box", "compound", "placement", "color", "save"], [300, 900]], + ["E05", "S1", "doors-and-displays", "柜门与双显示屏", ["CabinetDoor", "DisplayA", "DisplayB"], ["box", "placement", "color", "save"], [240, 780]], + ["E06", "S2", "hopper-and-raw-feeder", "料仓与原料上料", ["Hopper", "RawFeeder"], ["cylinder", "box", "compound", "color", "save"], [300, 900]], + ["E07", "S2", "loader-and-conveyor", "上料与传送带送料", ["Loader", "ConveyorFeeder"], ["box", "compound", "placement", "color", "save"], [300, 900]], + ["E08", "S2", "rotary-and-weigh", "旋转运送与称重平台", ["RotaryTransfer", "WeighPlatform"], ["cylinder", "box", "placement", "color", "save"], [240, 780]], + ["E09", "S3", "pick-feeder-and-gripper", "夹取送料与辅助夹爪", ["PickFeeder", "AuxGripper"], ["box", "compound", "placement", "color", "save"], [300, 900]], + ["E10", "S3", "pusher-and-store", "推料装置与物料存储区", ["Pusher", "MaterialStore"], ["box", "compound", "array", "color", "save"], [300, 900]], + ["E11", "S3", "sensor-bracket-inspector", "检测块、支架与运送检测", ["SensorBlock", "TransportBracket", "TransportInspector"], ["box", "placement", "color", "save"], [240, 780]], + ["E12", "S4", "assembly-and-inspection", "原料装配与检测台", ["RawAssembly", "InspectionTable"], ["box", "compound", "placement", "color", "save"], [240, 780]], + ["E13", "S4", "lights-and-origin", "三色灯、工具坐标系与原点", ["StackLight", "ToolFrame", "OriginMarker"], ["cylinder", "box", "color", "save"], [240, 780]], + ["E14", "S5", "abb-robot", "ABB IRB 120 六轴机器人", ["ABB_IRB_120"], ["box", "cylinder", "compound", "placement", "color", "save"], [360, 1080]], + ["E15", "S5", "robot-station-review", "机器人工作站复核", [], ["review", "bbox", "color", "save"], [180, 600]], + ["E16", "S6", "ground-and-lines", "地面平面与地线", ["GroundPlane", "Plane", "Plane001"], ["box", "placement", "color", "save"], [240, 780]], + ["E17", "S6", "line-assembly", "整线总装", [], ["assembly", "insert-link", "joint", "solve", "save"], [300, 900]], + ["E18", "S6", "audit-and-delivery", "精度审计与交付", [], ["audit", "export", "stl", "evidence"], [300, 900]], +]; + +let cumulative = []; +const result = []; +for (const [id, season, slug, title, modelNames, features, durationRange] of episodes) { + const models = modelNames.map(name => { + const model = byName.get(name); + if (!model) throw new Error(`line-spec has no model ${name} for ${id}`); + return model; + }); + const objects = models.flatMap(model => model.parts.map(part => part.partName)); + cumulative = [...new Set([...cumulative, ...objects])]; + const index = episodes.findIndex(entry => entry[0] === id); + const previous = index > 0 ? episodes[index - 1][0] : null; + // E17 is an assembly demonstration and has no persisted document; E18 audits + // and saves from the E16 checkpoint. + const checkpointIn = id === "E01" || id === "E02" || id === "E03" ? null + : id === "E17" || id === "E18" ? "E16" : previous; + const checkpointOut = id === "E01" || id === "E02" || id === "E17" ? null : id; + result.push({ + id, season, slug, title, + page: id === "E17" ? "assembly" : "project", + workbench: id === "E17" ? "Assembly" : "Part", + checkpointIn, checkpointOut, + expectedObjects: ["E01", "E02", "E17"].includes(id) ? null : objects.length, + objects, + checkpointObjects: cumulative.slice(), + models: models.map(model => ({ + name: model.name, file: model.file, label: model.label, + parts: model.parts.map(part => part.partName), + })), + features, durationRange, + }); +} + +const course = { + schema: "freecad-web-line-course/course/v1", + title: "生产线 27 件 GLB 模型 Web FreeCAD 初学者视频课程", + voice: "zh-CN-XiaoxiaoNeural", + rate: "-4%", + appOrigin: "http://127.0.0.1:5181", + teachingOrigin: "http://127.0.0.1:5190", + seasons: [ + { id: "S0", title: "入门与参考模型", episodes: ["E01", "E02"] }, + { id: "S1", title: "机柜与显示屏", episodes: ["E03", "E04", "E05"] }, + { id: "S2", title: "上料与输送", episodes: ["E06", "E07", "E08"] }, + { id: "S3", title: "抓取、推料与存储", episodes: ["E09", "E10", "E11"] }, + { id: "S4", title: "装配与检测", episodes: ["E12", "E13"] }, + { id: "S5", title: "机器人工作站", episodes: ["E14", "E15"] }, + { id: "S6", title: "场景、总装与交付", episodes: ["E16", "E17", "E18"] }, + ], + episodes: result, +}; + +fs.writeFileSync(path.join(here, "course.json"), `${JSON.stringify(course, null, 2)}\n`); +console.log(JSON.stringify({ ok: true, episodes: result.length, + totalObjects: result.at(-1).checkpointObjects.length, + objectsByEpisode: Object.fromEntries(result.map(episode => [episode.id, episode.objects.length])) })); diff --git a/web/tools/line-course/build-course-page.mjs b/web/tools/line-course/build-course-page.mjs new file mode 100644 index 00000000..14865449 --- /dev/null +++ b/web/tools/line-course/build-course-page.mjs @@ -0,0 +1,171 @@ +#!/usr/bin/env node +// Generates web/teaching/cases/production-line-course.html from course.json, +// per-episode scripts and the media directory. Missing media is marked pending. +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../.."); +const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8")); +const mediaDir = path.join(webRoot, "teaching", "media", "line-course"); +const outFile = path.join(webRoot, "teaching", "cases", "production-line-course.html"); + +const esc = value => String(value ?? "").replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); +const mediaBase = `/media/line-course/`; +const has = suffix => episode => fs.existsSync(path.join(mediaDir, `${episode.id}-${episode.slug}${suffix}`)); + +const episodeHtml = episode => { + const scriptPath = path.join(here, "episodes", episode.id, "script.zh.json"); + const lesson = fs.existsSync(scriptPath) + ? JSON.parse(fs.readFileSync(scriptPath, "utf8")).lesson ?? {} + : {}; + const base = `${mediaBase}${episode.id}-${episode.slug}`; + const hasVideo = has(".mp4")(episode); + const parameters = (lesson.parameters ?? []).map(item => + `${esc(item.name)}${esc(item.value)}`).join(""); + const checklist = (lesson.checklist ?? []).map(item => `
  • ${esc(item)}
  • `).join(""); + const mistakes = (lesson.mistakes ?? []).map(item => `
  • ${esc(item)}
  • `).join(""); + const objectives = (lesson.objectives ?? []).map(item => `
  • ${esc(item)}
  • `).join(""); + const source = path.join(here, "checkpoints", `${episode.id}.FCStd`); + const copied = path.join(mediaDir, "checkpoints", `${episode.id}.FCStd`); + if (fs.existsSync(source)) { + fs.mkdirSync(path.dirname(copied), { recursive: true }); + fs.copyFileSync(source, copied); + } + const checkpoint = fs.existsSync(copied) + ? `下载 ${episode.id} 检查点 FCStd` + : `检查点:${esc(episode.checkpointOut ?? "无")}`; + const stillSource = path.join(here, "stills", episode.id); + const stillFiles = fs.existsSync(stillSource) + ? fs.readdirSync(stillSource).filter(name => name.endsWith(".png")).sort() + : []; + const stillTarget = path.join(mediaDir, "stills", episode.id); + if (stillFiles.length) { + fs.mkdirSync(stillTarget, { recursive: true }); + for (const name of stillFiles) fs.copyFileSync(path.join(stillSource, name), path.join(stillTarget, name)); + } + const stillsHtml = stillFiles.map(name => + `
    ${esc(episode.id)} ${esc(name)}
    ${esc(name.replace(/\.png$/, ""))}
    `).join(""); + return `
    +
    + ${esc(episode.id)} +

    ${esc(episode.title)}

    + +
    + ${hasVideo + ? ` + ` + : `

    视频待制作(脚本与参数已就绪)。

    `} +
    分步截图(${stillFiles.length})
    ${stillsHtml}
    +
    学习目标与参数表 +
      ${objectives}
    + ${parameters}
    +
    +
    自检清单
      ${checklist}
    +
    常见错误与练习
      ${mistakes}

    ${esc(lesson.exercise ?? "")}

    +

    ${checkpoint}

    +
    `; +}; + +const seasons = (course.seasons ?? []).map(season => { + const episodes = season.episodes.map(id => course.episodes.find(item => item.id === id)).filter(Boolean); + return `
    +

    ${esc(season.id)} · ${esc(season.title)}

    +
    ${episodes.map(episodeHtml).join("\n")}
    +
    `; +}).join("\n"); + +const heroHtml = fs.existsSync(path.join(webRoot, "teaching", "cases", "production-line-assembly.html")) + ? `
    +

    整线场景:参考模型与重建结果

    +
    +
    按参考 GLB 重建的生产线场景
    重建结果:FreeCAD 27 件模型 · 交互查看
    +
    参考 GLB 产线场景
    参考模型 27 个 GLB · 交互查看
    +
    +
    ` : ""; + +const html = ` + + + + + +${esc(course.title)} + + + +
    +

    ${esc(course.title)}

    +
    +

    +
    +
    +${heroHtml} +${seasons} +
    + + + +`; + +fs.writeFileSync(outFile, html); +console.log(JSON.stringify({ ok: true, outFile, episodes: course.episodes.length })); diff --git a/web/tools/line-course/build-line-spec.mjs b/web/tools/line-course/build-line-spec.mjs new file mode 100644 index 00000000..644a6fec --- /dev/null +++ b/web/tools/line-course/build-line-spec.mjs @@ -0,0 +1,381 @@ +#!/usr/bin/env node +// Parses all reference GLBs in working/GLTFmodel and writes line-spec.json: +// one teaching model per GLB, decomposed into 1-11 Box/Cylinder parts in +// FreeCAD coordinates (Z-up, millimetres). +// +// Key difference from build-delta-spec.mjs: +// - full node.matrix support (all 27 line GLBs store the root transform as a matrix) +// - these GLBs are already Z-up (three.js exported from a Z-up scene), so the +// axis map is identity, not DELTA's (x,-z,y) +// - teaching-part clustering, dominant material per part, scene bbox self-check +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { createHash } from "node:crypto"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const sourceDir = process.argv[2] ?? + "/home/mes123456/FreeCADWasmDev/working/GLTFmodel"; +const outFile = path.join(here, "line-spec.json"); +const inventoryFile = path.join(here, "line-inventory.md"); +const overrides = JSON.parse(fs.readFileSync(path.join(here, "overrides.json"), "utf8")).models; +const colorFile = path.join(here, "material-colors.json"); +const sampledColors = fs.existsSync(colorFile) + ? JSON.parse(fs.readFileSync(colorFile, "utf8")).files + : {}; + +const roundMm = value => Math.round(value * 1000) / 1000; +const toSrgb = value => value <= 0.0031308 + ? 12.92 * value + : 1.055 * Math.pow(value, 1 / 2.4) - 0.055; +const toLinear = value => value <= 0.04045 + ? value / 12.92 + : Math.pow((value + 0.055) / 1.055, 2.4); + +// ---- 4x4 row-major helpers (glTF stores matrices column-major) ---- +const identity = () => [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]; +const mul = (a, b) => a.map((row, r) => [0, 1, 2, 3].map(c => + row[0] * b[0][c] + row[1] * b[1][c] + row[2] * b[2][c] + row[3] * b[3][c])); +const apply = (m, v) => [0, 1, 2].map(r => + m[r][0] * v[0] + m[r][1] * v[1] + m[r][2] * v[2] + m[r][3]); +const fromGltfMatrix = m => [0, 1, 2, 3].map(r => [0, 1, 2, 3].map(c => m[c * 4 + r])); +const quatMatrix = q => { + const [x, y, z, w] = q; + return [ + [1 - 2 * (y * y + z * z), 2 * (x * y - z * w), 2 * (x * z + y * w), 0], + [2 * (x * y + z * w), 1 - 2 * (x * x + z * z), 2 * (y * z - x * w), 0], + [2 * (x * z - y * w), 2 * (y * z + x * w), 1 - 2 * (x * x + y * y), 0], + [0, 0, 0, 1], + ]; +}; +const localMatrix = node => { + if (node.matrix) return fromGltfMatrix(node.matrix); + const m = quatMatrix(node.rotation ?? [0, 0, 0, 1]); + const [tx, ty, tz] = node.translation ?? [0, 0, 0]; + const [sx, sy, sz] = node.scale ?? [1, 1, 1]; + m[0][3] = tx; m[1][3] = ty; m[2][3] = tz; + for (let r = 0; r < 3; r++) { m[r][0] *= sx; m[r][1] *= sy; m[r][2] *= sz; } + return m; +}; +const det3 = m => m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) + - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) + + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]); + +const readGlb = file => { + const buffer = fs.readFileSync(file); + let offset = 12; let gltf = null; + while (offset < buffer.length) { + const length = buffer.readUInt32LE(offset); + const type = buffer.toString("ascii", offset + 4, offset + 8); + if (type === "JSON") gltf = JSON.parse(buffer.toString("utf8", offset + 8, offset + 8 + length)); + offset += 8 + length; + } + if (!gltf) throw new Error(`no JSON chunk in ${file}`); + return { buffer, gltf }; +}; + +const materialInfo = (gltf, index, fileName) => { + const material = gltf.materials?.[index]; + if (!material) return { name: "", linear: [0.8, 0.8, 0.8], srgb: [0.906, 0.906, 0.906], colorSource: "default" }; + const factor = material.pbrMetallicRoughness?.baseColorFactor?.slice(0, 3) ?? [1, 1, 1]; + const sampled = sampledColors?.[fileName]?.[String(index)]; + const srgb = sampled?.srgb ?? factor.map(toSrgb); + return { + name: material.name ?? `material-${index}`, + linear: srgb.map(value => Math.round(toLinear(value) * 1e4) / 1e4), + srgb: srgb.map(value => Math.round(value * 1e4) / 1e4), + colorSource: sampled?.source ?? "baseColorFactor", + }; +}; + +const accessorBox = accessor => { + if (!accessor?.min || !accessor?.max) return null; + return { min: accessor.min.slice(0, 3), max: accessor.max.slice(0, 3) }; +}; + +// ---- per-file analysis ---- +const analyzeGlb = file => { + const { buffer, gltf } = readGlb(file); + const scene = gltf.scenes?.[gltf.scene ?? 0] ?? { nodes: [] }; + const nodes = gltf.nodes ?? []; + const meshes = gltf.meshes ?? []; + const entries = []; + + const visit = (index, parentM, chain, top) => { + const node = nodes[index]; + const world = mul(parentM, localMatrix(node)); + const name = node.name ?? `node-${index}`; + const nextChain = [...chain, name]; + if (node.mesh !== undefined) { + const mesh = meshes[node.mesh]; + const materialTris = new Map(); + let triangles = 0; + let bbox = null; + for (const [primitiveIndex, primitive] of (mesh.primitives ?? []).entries()) { + const accessor = gltf.accessors?.[primitive.attributes?.POSITION]; + const box = accessorBox(accessor); + const count = primitive.indices !== undefined + ? gltf.accessors[primitive.indices].count / 3 + : (accessor?.count ?? 0) / 3; + triangles += count; + if (primitive.material !== undefined) { + materialTris.set(primitive.material, (materialTris.get(primitive.material) ?? 0) + count); + } + if (!box) continue; + for (const x of [box.min[0], box.max[0]]) for (const y of [box.min[1], box.max[1]]) + for (const z of [box.min[2], box.max[2]]) { + const point = apply(world, [x, y, z]); + if (!bbox) bbox = { min: point.slice(), max: point.slice() }; + else for (let axis = 0; axis < 3; axis++) { + bbox.min[axis] = Math.min(bbox.min[axis], point[axis]); + bbox.max[axis] = Math.max(bbox.max[axis], point[axis]); + } + } + entries.push({ + key: `${index}:${primitiveIndex}`, + nodeName: name, + meshName: mesh.name ?? `mesh-${node.mesh}`, + chain: nextChain, + top, + topName: nextChain[1] ?? nextChain[0] ?? name, + bboxMm: bbox && { + min: bbox.min.map(value => roundMm(value * 1000)), + max: bbox.max.map(value => roundMm(value * 1000)), + }, + triangles: Math.round(count), + materialTris, + primitiveMaterial: primitive.material, + }); + bbox = null; + } + } + for (const child of node.children ?? []) visit(child, world, nextChain, top ?? child); + }; + + for (const rootIndex of scene.nodes ?? []) { + const root = nodes[rootIndex]; + const rootM = localMatrix(root); + if (root.children?.length) { + for (const child of root.children) visit(child, rootM, [root.name ?? `node-${rootIndex}`], child); + } else { + visit(rootIndex, identity(), [], rootIndex); + } + } + + // Dominant material per mesh entry. + for (const entry of entries) { + let best = entry.primitiveMaterial; let bestTris = -1; + for (const [index, tris] of entry.materialTris) if (tris > bestTris) { best = index; bestTris = tris; } + const material = materialInfo(gltf, best, path.basename(file)); + entry.material = material.name; + entry.color = material.srgb; + entry.colorLinear = material.linear; + entry.colorSource = material.colorSource; + } + return { buffer, gltf, entries }; +}; + +const unionBox = items => items.reduce((box, item) => { + if (!box) return { min: item.bboxMm.min.slice(), max: item.bboxMm.max.slice() }; + for (let axis = 0; axis < 3; axis++) { + box.min[axis] = Math.min(box.min[axis], item.bboxMm.min[axis]); + box.max[axis] = Math.max(box.max[axis], item.bboxMm.max[axis]); + } + return box; +}, null); + +const boxGap = (a, b) => { + let sum = 0; + for (let axis = 0; axis < 3; axis++) { + const gap = Math.max(0, Math.max(a.min[axis] - b.max[axis], b.min[axis] - a.max[axis])); + sum += gap * gap; + } + return Math.sqrt(sum); +}; +const boxCenter = box => [0, 1, 2].map(axis => (box.min[axis] + box.max[axis]) / 2); +const centerDistance = (a, b) => { + const ca = boxCenter(a); const cb = boxCenter(b); + return Math.hypot(ca[0] - cb[0], ca[1] - cb[1], ca[2] - cb[2]); +}; +const clusterBox = cluster => unionBox(cluster); + +const mergeClosest = (clusters, target) => { + const result = clusters.map(cluster => cluster.slice()); + while (result.length > target) { + let best = null; + for (let i = 0; i < result.length; i++) for (let j = i + 1; j < result.length; j++) { + const a = clusterBox(result[i]); const b = clusterBox(result[j]); + const score = boxGap(a, b) + centerDistance(a, b) * 1e-6; + if (!best || score < best.score) best = { i, j, score }; + } + result[best.i] = [...result[best.i], ...result[best.j]]; + result.splice(best.j, 1); + } + return result; +}; + +const splitLargest = (clusters, target) => { + const result = clusters.map(cluster => cluster.slice()); + while (result.length < target) { + let index = -1; let size = 1; + for (let i = 0; i < result.length; i++) if (result[i].length > size) { index = i; size = result[i].length; } + if (index < 0) break; + const parts = mergeClosest(result[index].map(entry => [entry]), 2); + result.splice(index, 1, ...parts); + } + return result; +}; + +const groupEntries = (entries, override) => { + const byTop = new Map(); + for (const entry of entries) { + const topName = entry.topName ?? entry.nodeName; + let key = entry.top; + if (override.groupBy === "axis") key = /^[xyz]/i.test(topName) ? topName[0].toUpperCase() : "Other"; + if (override.groupBy === "prefix") { + key = override.prefixes.find(prefix => topName.startsWith(prefix)) ?? override.prefixes[0]; + } + if (!byTop.has(key)) byTop.set(key, []); + byTop.get(key).push(entry); + } + let clusters = [...byTop.values()]; + const budget = Math.max(1, Math.min(override.budget ?? clusters.length, entries.length)); + if (clusters.length > budget) clusters = mergeClosest(clusters, budget); + if (clusters.length < budget) clusters = splitLargest(clusters, budget); + return { clusters, budget }; +}; + +const sanitize = text => String(text).replace(/[^A-Za-z0-9_]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 32) || "Part"; + +const primitiveFor = (cluster, dims) => { + const [x, y, z] = dims; + // A cylinder is only allowed when its AABB would stay within tolerance: + // the two cross-section dims must agree within 5% and Z must be the long axis. + const square = Math.abs(x - y) <= Math.max(1, Math.min(x, y) * 0.05); + if (!square) return "box"; + if (z > Math.max(x, y) * 1.2) return "cylinder"; + if (cluster.length === 1 && /料仓|电机|转盘|圆柱|轮|滚|灯|柱/.test(cluster[0].nodeName)) return "cylinder"; + return "box"; +}; + +const buildModel = (file, override) => { + const { buffer, gltf, entries } = analyzeGlb(file); + if (entries.length === 0) throw new Error(`no mesh entries in ${file}`); + const overall = unionBox(entries); + const { clusters, budget } = groupEntries(entries, override); + const courseName = override.courseName ?? sanitize(path.basename(file, ".glb")); + const label = override.label ?? path.basename(file, ".glb"); + const parts = clusters.map((cluster, index) => { + const box = unionBox(cluster); + const dims = [0, 1, 2].map(axis => roundMm(box.max[axis] - box.min[axis])); + const triangles = cluster.reduce((sum, entry) => sum + entry.triangles, 0); + const materialCounts = new Map(); + for (const entry of cluster) materialCounts.set(entry.material, (materialCounts.get(entry.material) ?? 0) + entry.triangles); + let material = ""; let best = -1; + for (const [name, count] of materialCounts) if (count > best) { material = name; best = count; } + const colorEntry = cluster.find(entry => entry.material === material) ?? cluster[0]; + const nodeNames = [...new Set(cluster.map(entry => entry.nodeName))]; + return { + partName: `${courseName}_P${String(index + 1).padStart(2, "0")}`, + label: nodeNames.length === 1 ? nodeNames[0] : `${label} 部件 ${index + 1}`, + primitive: primitiveFor(cluster, dims), + fcLocalDims: dims, + position: box.min.map(roundMm), + rotation: { axis: [0, 0, 1], angleDeg: 0 }, + worldBBox: [box.min[0], box.min[1], box.min[2], box.max[0], box.max[1], box.max[2]].map(roundMm), + center: [0, 1, 2].map(axis => roundMm((box.min[axis] + box.max[axis]) / 2)), + color: colorEntry.color, + colorLinear: colorEntry.colorLinear, + colorSource: colorEntry.colorSource, + material, + meshCount: new Set(cluster.map(entry => entry.key.split(":")[0])).size, + triangleCount: Math.round(triangles), + nodeNames: nodeNames.slice(0, 12), + chain: cluster[0].chain, + }; + }); + const modelBox = [overall.min[0], overall.min[1], overall.min[2], overall.max[0], overall.max[1], overall.max[2]] + .map(roundMm); + return { + file: path.basename(file), + name: courseName, + label, + sha256: createHash("sha256").update(buffer).digest("hex"), + meshCount: new Set(entries.map(entry => entry.key.split(":")[0])).size, + triangleCount: entries.reduce((sum, entry) => sum + entry.triangles, 0), + partBudget: budget, + overallBBox: modelBox, + overallDims: [0, 1, 2].map(axis => roundMm(overall.max[axis] - overall.min[axis])), + parts, + }; +}; + +const files = fs.readdirSync(sourceDir).filter(name => name.toLowerCase().endsWith(".glb")).sort(); +const models = []; +const warnings = []; +for (const file of files) { + const override = overrides[file]; + if (!override) warnings.push(`no overrides entry for ${file}; using defaults`); + models.push(buildModel(path.join(sourceDir, file), override ?? {})); +} + +// Axis sanity check: the ground plane must span XY (4867 x 3673 mm) with a small Z thickness. +const ground = models.find(model => model.file === "地面平面.glb"); +if (ground) { + const [x, y, z] = ground.overallDims; + const ok = Math.abs(x - 4867.5) < 20 && Math.abs(y - 3673.2) < 20 && z < 400; + if (!ok) throw new Error(`axis self-check failed: ground dims ${JSON.stringify(ground.overallDims)}; expected Z-up`); +} + +const sceneMin = [0, 1, 2].map(axis => Math.min(...models.map(model => model.overallBBox[axis]))); +const sceneMax = [0, 1, 2].map(axis => Math.max(...models.map(model => model.overallBBox[axis + 3]))); +const sceneBBox = [...sceneMin, ...sceneMax].map(roundMm); +const spec = { + schema: "freecad-web-line-course/spec/v1", + generatedAt: new Date().toISOString(), + sourceDir, + units: { sourceNumerics: "meters", target: "mm", upAxis: "Z-up (identity map, x*1000,y*1000,z*1000)" }, + modelCount: models.length, + partCount: models.reduce((sum, model) => sum + model.parts.length, 0), + triangleCount: models.reduce((sum, model) => sum + model.triangleCount, 0), + sceneBBox, + warnings, + models, +}; +fs.writeFileSync(outFile, `${JSON.stringify(spec, null, 2)}\n`); + +const lines = [ + "# 生产线参考零件表", + "", + `生成时间:${spec.generatedAt}`, + `模型数:${spec.modelCount},教学部件数:${spec.partCount},三角面:${spec.triangleCount}`, + `整线包围盒(mm):${sceneBBox.map(value => value.toFixed(1)).join(", ")}`, + "", + "| 模型 | 文件 | 部件 | 尺寸 mm | 部件明细 |", + "|---|---|---|---|---|", +]; +for (const model of models) { + const detail = model.parts.map(part => + `${part.partName}(${part.primitive},${part.fcLocalDims.map(value => Math.round(value)).join("×")})`).join("; "); + lines.push(`| ${model.label} | ${model.file} | ${model.parts.length} | ${model.overallDims.map(value => Math.round(value)).join("×")} | ${detail} |`); +} +fs.writeFileSync(inventoryFile, `${lines.join("\n")}\n`); + +// Small public index for the React reference viewer (GLBs are route-served, +// never copied into public/dist). +const publicIndex = path.resolve(here, "../../public/line/models.json"); +fs.mkdirSync(path.dirname(publicIndex), { recursive: true }); +fs.writeFileSync(publicIndex, `${JSON.stringify({ + schema: "freecad-web-line-course/reference-models/v1", + models: models.map(model => ({ + file: model.file, name: model.name, label: model.label, + dims: model.overallDims, parts: model.parts.length, + })), +}, null, 2)}\n`); + +console.log(JSON.stringify({ + publicIndex, + ok: true, outFile, inventoryFile, modelCount: spec.modelCount, + partCount: spec.partCount, sceneBBox: spec.sceneBBox, + warnings: warnings.length, +})); diff --git a/web/tools/line-course/build-reference-page.mjs b/web/tools/line-course/build-reference-page.mjs new file mode 100644 index 00000000..765117f6 --- /dev/null +++ b/web/tools/line-course/build-reference-page.mjs @@ -0,0 +1,109 @@ +#!/usr/bin/env node +// Generates teaching/cases/production-line-reference.html: a Z-up three.js +// viewer with a 27-model selector. GLBs are served from the line-models symlink. +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../.."); +const models = JSON.parse(fs.readFileSync(path.join(webRoot, "public", "line", "models.json"), "utf8")).models; +const outFile = path.join(webRoot, "teaching", "cases", "production-line-reference.html"); +const esc = value => String(value ?? "").replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); + +const html = ` + + + + + +生产线参考模型 · 27 个 GLB + + + + +
    +

    生产线参考模型

    + + 加载中… +
    +
    +

    左键旋转 · 滚轮缩放 · 右键平移

    + + + +`; +fs.writeFileSync(outFile, html); +console.log(JSON.stringify({ ok: true, outFile, models: models.length })); diff --git a/web/tools/line-course/checkpoints/E03.FCStd b/web/tools/line-course/checkpoints/E03.FCStd new file mode 100644 index 00000000..c93315e1 Binary files /dev/null and b/web/tools/line-course/checkpoints/E03.FCStd differ diff --git a/web/tools/line-course/checkpoints/E04.FCStd b/web/tools/line-course/checkpoints/E04.FCStd new file mode 100644 index 00000000..1472e9d7 Binary files /dev/null and b/web/tools/line-course/checkpoints/E04.FCStd differ diff --git a/web/tools/line-course/checkpoints/E05.FCStd b/web/tools/line-course/checkpoints/E05.FCStd new file mode 100644 index 00000000..36eaf7b5 Binary files /dev/null and b/web/tools/line-course/checkpoints/E05.FCStd differ diff --git a/web/tools/line-course/checkpoints/E06.FCStd b/web/tools/line-course/checkpoints/E06.FCStd new file mode 100644 index 00000000..f045f6a6 Binary files /dev/null and b/web/tools/line-course/checkpoints/E06.FCStd differ diff --git a/web/tools/line-course/checkpoints/E07.FCStd b/web/tools/line-course/checkpoints/E07.FCStd new file mode 100644 index 00000000..2937abaa Binary files /dev/null and b/web/tools/line-course/checkpoints/E07.FCStd differ diff --git a/web/tools/line-course/checkpoints/E08.FCStd b/web/tools/line-course/checkpoints/E08.FCStd new file mode 100644 index 00000000..8141e1c4 Binary files /dev/null and b/web/tools/line-course/checkpoints/E08.FCStd differ diff --git a/web/tools/line-course/checkpoints/E09.FCStd b/web/tools/line-course/checkpoints/E09.FCStd new file mode 100644 index 00000000..b06c7946 Binary files /dev/null and b/web/tools/line-course/checkpoints/E09.FCStd differ diff --git a/web/tools/line-course/checkpoints/E10.FCStd b/web/tools/line-course/checkpoints/E10.FCStd new file mode 100644 index 00000000..54a01f0b Binary files /dev/null and b/web/tools/line-course/checkpoints/E10.FCStd differ diff --git a/web/tools/line-course/checkpoints/E11.FCStd b/web/tools/line-course/checkpoints/E11.FCStd new file mode 100644 index 00000000..db725a0c Binary files /dev/null and b/web/tools/line-course/checkpoints/E11.FCStd differ diff --git a/web/tools/line-course/checkpoints/E12.FCStd b/web/tools/line-course/checkpoints/E12.FCStd new file mode 100644 index 00000000..6674a049 Binary files /dev/null and b/web/tools/line-course/checkpoints/E12.FCStd differ diff --git a/web/tools/line-course/checkpoints/E13.FCStd b/web/tools/line-course/checkpoints/E13.FCStd new file mode 100644 index 00000000..8f7f414c Binary files /dev/null and b/web/tools/line-course/checkpoints/E13.FCStd differ diff --git a/web/tools/line-course/checkpoints/E14.FCStd b/web/tools/line-course/checkpoints/E14.FCStd new file mode 100644 index 00000000..73d1a281 Binary files /dev/null and b/web/tools/line-course/checkpoints/E14.FCStd differ diff --git a/web/tools/line-course/checkpoints/E15.FCStd b/web/tools/line-course/checkpoints/E15.FCStd new file mode 100644 index 00000000..6e6db01e Binary files /dev/null and b/web/tools/line-course/checkpoints/E15.FCStd differ diff --git a/web/tools/line-course/checkpoints/E16.FCStd b/web/tools/line-course/checkpoints/E16.FCStd new file mode 100644 index 00000000..684eced2 Binary files /dev/null and b/web/tools/line-course/checkpoints/E16.FCStd differ diff --git a/web/tools/line-course/checkpoints/E18.FCStd b/web/tools/line-course/checkpoints/E18.FCStd new file mode 100644 index 00000000..15481c4e Binary files /dev/null and b/web/tools/line-course/checkpoints/E18.FCStd differ diff --git a/web/tools/line-course/cleanup-intermediates.mjs b/web/tools/line-course/cleanup-intermediates.mjs new file mode 100644 index 00000000..6377edbc --- /dev/null +++ b/web/tools/line-course/cleanup-intermediates.mjs @@ -0,0 +1,80 @@ +#!/usr/bin/env node +// Removes regenerable video-production caches (Chrome profiles, raw recordings +// whose final MP4 exists, per-scene segments and TTS audio caches). +// Usage: node cleanup-intermediates.mjs [--apply] +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../.."); +const apply = process.argv.includes("--apply"); + +const sizeOf = target => { + let total = 0; + const stack = [target]; + while (stack.length) { + const current = stack.pop(); + let stat; + try { stat = fs.lstatSync(current); } catch { continue; } + if (stat.isDirectory()) { + for (const entry of fs.readdirSync(current)) stack.push(path.join(current, entry)); + } else if (stat.isFile()) total += stat.size; + } + return total; +}; +const seen = new Set(); +const remove = (target, reason, items) => { + if (!fs.existsSync(target) || seen.has(target)) return; + seen.add(target); + const bytes = sizeOf(target); + items.push({ target: path.relative(webRoot, target), mb: Math.round(bytes / 1048576), reason }); + if (apply) fs.rmSync(target, { recursive: true, force: true }); +}; + +const items = []; +// Course tools with course.json -> media mapping. +for (const tool of ["line-course", "delta-course", "carrier-course"]) { + const toolDir = path.join(webRoot, "tools", tool); + const coursePath = path.join(toolDir, "course.json"); + if (!fs.existsSync(coursePath)) continue; + const course = JSON.parse(fs.readFileSync(coursePath, "utf8")); + const mediaDir = path.join(webRoot, "teaching", "media", tool); + for (const episode of course.episodes) { + const finalMp4 = path.join(mediaDir, `${episode.id}-${episode.slug}.mp4`); + const evidence = path.join(toolDir, "evidence", episode.id, "verification.json"); + const hasFinal = fs.existsSync(finalMp4) && fs.existsSync(evidence); + const rawDir = path.join(toolDir, "raw", episode.id); + remove(path.join(rawDir, "profile"), "Chrome profile cache", items); + if (hasFinal) { + remove(path.join(rawDir, "screen-recording.mp4"), "raw recording (final MP4 exists)", items); + remove(path.join(toolDir, "episodes", episode.id, "segments"), "scene segments (final MP4 exists)", items); + remove(path.join(toolDir, "episodes", episode.id, "audio"), "TTS audio cache (final MP4 exists)", items); + } + } + for (const name of fs.existsSync(path.join(toolDir, "raw")) ? fs.readdirSync(path.join(toolDir, "raw")) : []) { + remove(path.join(toolDir, "raw", name, "profile"), "Chrome profile cache", items); + } +} + +// Standalone video projects whose final tour videos already exist. +for (const project of ["carrier-video", "bim-workshop-video"]) { + const projectDir = path.join(webRoot, "tools", project); + if (!fs.existsSync(projectDir)) continue; + // Only remove profiles, raw, segments, audio; keep scripts/cards/stills. + for (const name of ["profile", "raw", "segments", "audio"]) { + remove(path.join(projectDir, name), "video production cache", items); + } +} + +// Stale tool backups. +for (const entry of fs.readdirSync(path.join(webRoot, "tools"))) { + if (/^tools\.bak\./.test(entry)) remove(path.join(webRoot, "tools", entry), "stale tools backup", items); +} + +const totalMb = items.reduce((sum, item) => sum + item.mb, 0); +for (const item of items.sort((a, b) => b.mb - a.mb).slice(0, 20)) { + console.log(`${String(item.mb).padStart(6)} MB ${item.target} (${item.reason})`); +} +console.log(JSON.stringify({ apply, items: items.length, totalMb, freeBefore: null })); +if (!apply) console.log("dry run only; pass --apply to delete"); diff --git a/web/tools/line-course/course.json b/web/tools/line-course/course.json new file mode 100644 index 00000000..ffbc483b --- /dev/null +++ b/web/tools/line-course/course.json @@ -0,0 +1,1796 @@ +{ + "schema": "freecad-web-line-course/course/v1", + "title": "生产线 27 件 GLB 模型 Web FreeCAD 初学者视频课程", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "appOrigin": "http://127.0.0.1:5181", + "teachingOrigin": "http://127.0.0.1:5190", + "seasons": [ + { + "id": "S0", + "title": "入门与参考模型", + "episodes": [ + "E01", + "E02" + ] + }, + { + "id": "S1", + "title": "机柜与显示屏", + "episodes": [ + "E03", + "E04", + "E05" + ] + }, + { + "id": "S2", + "title": "上料与输送", + "episodes": [ + "E06", + "E07", + "E08" + ] + }, + { + "id": "S3", + "title": "抓取、推料与存储", + "episodes": [ + "E09", + "E10", + "E11" + ] + }, + { + "id": "S4", + "title": "装配与检测", + "episodes": [ + "E12", + "E13" + ] + }, + { + "id": "S5", + "title": "机器人工作站", + "episodes": [ + "E14", + "E15" + ] + }, + { + "id": "S6", + "title": "场景、总装与交付", + "episodes": [ + "E16", + "E17", + "E18" + ] + } + ], + "episodes": [ + { + "id": "E01", + "season": "S0", + "slug": "ui-and-reference", + "title": "界面与产线参考模型", + "page": "project", + "workbench": "Part", + "checkpointIn": null, + "checkpointOut": null, + "expectedObjects": null, + "objects": [], + "checkpointObjects": [], + "models": [], + "features": [ + "ui", + "reference-glb", + "tree", + "navigation", + "opfs" + ], + "durationRange": [ + 180, + 480 + ] + }, + { + "id": "E02", + "season": "S0", + "slug": "measure-and-spec", + "title": "测量、单位与零件表", + "page": "project", + "workbench": "Part", + "checkpointIn": null, + "checkpointOut": null, + "expectedObjects": null, + "objects": [], + "checkpointObjects": [], + "models": [], + "features": [ + "measure", + "bbox", + "units", + "spreadsheet" + ], + "durationRange": [ + 180, + 480 + ] + }, + { + "id": "E03", + "season": "S1", + "slug": "cabinet-a", + "title": "主控制柜", + "page": "project", + "workbench": "Part", + "checkpointIn": null, + "checkpointOut": "E03", + "expectedObjects": 8, + "objects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08" + ], + "models": [ + { + "name": "CabinetA", + "file": "三柜子.glb", + "label": "主控制柜", + "parts": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08" + ] + } + ], + "features": [ + "box", + "compound", + "placement", + "color", + "save" + ], + "durationRange": [ + 300, + 900 + ] + }, + { + "id": "E04", + "season": "S1", + "slug": "cabinet-b", + "title": "长控制柜", + "page": "project", + "workbench": "Part", + "checkpointIn": "E03", + "checkpointOut": "E04", + "expectedObjects": 8, + "objects": [ + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08" + ], + "models": [ + { + "name": "CabinetB", + "file": "三柜子1.glb", + "label": "长控制柜", + "parts": [ + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08" + ] + } + ], + "features": [ + "box", + "compound", + "placement", + "color", + "save" + ], + "durationRange": [ + 300, + 900 + ] + }, + { + "id": "E05", + "season": "S1", + "slug": "doors-and-displays", + "title": "柜门与双显示屏", + "page": "project", + "workbench": "Part", + "checkpointIn": "E04", + "checkpointOut": "E05", + "expectedObjects": 5, + "objects": [ + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02" + ], + "models": [ + { + "name": "CabinetDoor", + "file": "柜门.glb", + "label": "柜门", + "parts": [ + "CabinetDoor_P01" + ] + }, + { + "name": "DisplayA", + "file": "显示屏.glb", + "label": "显示屏 A", + "parts": [ + "DisplayA_P01", + "DisplayA_P02" + ] + }, + { + "name": "DisplayB", + "file": "显示屏1.glb", + "label": "显示屏 B", + "parts": [ + "DisplayB_P01", + "DisplayB_P02" + ] + } + ], + "features": [ + "box", + "placement", + "color", + "save" + ], + "durationRange": [ + 240, + 780 + ] + }, + { + "id": "E06", + "season": "S2", + "slug": "hopper-and-raw-feeder", + "title": "料仓与原料上料", + "page": "project", + "workbench": "Part", + "checkpointIn": "E05", + "checkpointOut": "E06", + "expectedObjects": 7, + "objects": [ + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05" + ], + "models": [ + { + "name": "Hopper", + "file": "料仓.glb", + "label": "料仓", + "parts": [ + "Hopper_P01", + "Hopper_P02" + ] + }, + { + "name": "RawFeeder", + "file": "原料上料.glb", + "label": "原料上料装置", + "parts": [ + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05" + ] + } + ], + "features": [ + "cylinder", + "box", + "compound", + "color", + "save" + ], + "durationRange": [ + 300, + 900 + ] + }, + { + "id": "E07", + "season": "S2", + "slug": "loader-and-conveyor", + "title": "上料与传送带送料", + "page": "project", + "workbench": "Part", + "checkpointIn": "E06", + "checkpointOut": "E07", + "expectedObjects": 8, + "objects": [ + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06" + ], + "models": [ + { + "name": "Loader", + "file": "上料.glb", + "label": "上料机构", + "parts": [ + "Loader_P01", + "Loader_P02" + ] + }, + { + "name": "ConveyorFeeder", + "file": "传送带送料装置.glb", + "label": "传送带送料装置", + "parts": [ + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06" + ] + } + ], + "features": [ + "box", + "compound", + "placement", + "color", + "save" + ], + "durationRange": [ + 300, + 900 + ] + }, + { + "id": "E08", + "season": "S2", + "slug": "rotary-and-weigh", + "title": "旋转运送与称重平台", + "page": "project", + "workbench": "Part", + "checkpointIn": "E07", + "checkpointOut": "E08", + "expectedObjects": 4, + "objects": [ + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02" + ], + "models": [ + { + "name": "RotaryTransfer", + "file": "旋转运送装置.glb", + "label": "旋转运送装置", + "parts": [ + "RotaryTransfer_P01", + "RotaryTransfer_P02" + ] + }, + { + "name": "WeighPlatform", + "file": "称重平台.glb", + "label": "称重平台", + "parts": [ + "WeighPlatform_P01", + "WeighPlatform_P02" + ] + } + ], + "features": [ + "cylinder", + "box", + "placement", + "color", + "save" + ], + "durationRange": [ + 240, + 780 + ] + }, + { + "id": "E09", + "season": "S3", + "slug": "pick-feeder-and-gripper", + "title": "夹取送料与辅助夹爪", + "page": "project", + "workbench": "Part", + "checkpointIn": "E08", + "checkpointOut": "E09", + "expectedObjects": 8, + "objects": [ + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03" + ], + "models": [ + { + "name": "PickFeeder", + "file": "夹取送料装置.glb", + "label": "夹取送料装置", + "parts": [ + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05" + ] + }, + { + "name": "AuxGripper", + "file": "辅助夹爪.glb", + "label": "辅助夹爪", + "parts": [ + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03" + ] + } + ], + "features": [ + "box", + "compound", + "placement", + "color", + "save" + ], + "durationRange": [ + 300, + 900 + ] + }, + { + "id": "E10", + "season": "S3", + "slug": "pusher-and-store", + "title": "推料装置与物料存储区", + "page": "project", + "workbench": "Part", + "checkpointIn": "E09", + "checkpointOut": "E10", + "expectedObjects": 7, + "objects": [ + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03", + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05" + ], + "models": [ + { + "name": "Pusher", + "file": "推料装置.glb", + "label": "推料装置", + "parts": [ + "Pusher_P01", + "Pusher_P02" + ] + }, + { + "name": "MaterialStore", + "file": "物料存储区.glb", + "label": "物料存储区", + "parts": [ + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05" + ] + } + ], + "features": [ + "box", + "compound", + "array", + "color", + "save" + ], + "durationRange": [ + 300, + 900 + ] + }, + { + "id": "E11", + "season": "S3", + "slug": "sensor-bracket-inspector", + "title": "检测块、支架与运送检测", + "page": "project", + "workbench": "Part", + "checkpointIn": "E10", + "checkpointOut": "E11", + "expectedObjects": 4, + "objects": [ + "SensorBlock_P01", + "TransportBracket_P01", + "TransportInspector_P01", + "TransportInspector_P02" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03", + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05", + "SensorBlock_P01", + "TransportBracket_P01", + "TransportInspector_P01", + "TransportInspector_P02" + ], + "models": [ + { + "name": "SensorBlock", + "file": "新版2.glb", + "label": "新版检测块", + "parts": [ + "SensorBlock_P01" + ] + }, + { + "name": "TransportBracket", + "file": "运送支架.glb", + "label": "运送支架", + "parts": [ + "TransportBracket_P01" + ] + }, + { + "name": "TransportInspector", + "file": "运送检测装置.glb", + "label": "运送检测装置", + "parts": [ + "TransportInspector_P01", + "TransportInspector_P02" + ] + } + ], + "features": [ + "box", + "placement", + "color", + "save" + ], + "durationRange": [ + 240, + 780 + ] + }, + { + "id": "E12", + "season": "S4", + "slug": "assembly-and-inspection", + "title": "原料装配与检测台", + "page": "project", + "workbench": "Part", + "checkpointIn": "E11", + "checkpointOut": "E12", + "expectedObjects": 4, + "objects": [ + "RawAssembly_P01", + "RawAssembly_P02", + "RawAssembly_P03", + "InspectionTable_P01" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03", + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05", + "SensorBlock_P01", + "TransportBracket_P01", + "TransportInspector_P01", + "TransportInspector_P02", + "RawAssembly_P01", + "RawAssembly_P02", + "RawAssembly_P03", + "InspectionTable_P01" + ], + "models": [ + { + "name": "RawAssembly", + "file": "原料装配.glb", + "label": "原料装配平台", + "parts": [ + "RawAssembly_P01", + "RawAssembly_P02", + "RawAssembly_P03" + ] + }, + { + "name": "InspectionTable", + "file": "检测台.glb", + "label": "检测台", + "parts": [ + "InspectionTable_P01" + ] + } + ], + "features": [ + "box", + "compound", + "placement", + "color", + "save" + ], + "durationRange": [ + 240, + 780 + ] + }, + { + "id": "E13", + "season": "S4", + "slug": "lights-and-origin", + "title": "三色灯、工具坐标系与原点", + "page": "project", + "workbench": "Part", + "checkpointIn": "E12", + "checkpointOut": "E13", + "expectedObjects": 8, + "objects": [ + "StackLight_P01", + "StackLight_P02", + "ToolFrame_P01", + "ToolFrame_P02", + "ToolFrame_P03", + "OriginMarker_P01", + "OriginMarker_P02", + "OriginMarker_P03" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03", + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05", + "SensorBlock_P01", + "TransportBracket_P01", + "TransportInspector_P01", + "TransportInspector_P02", + "RawAssembly_P01", + "RawAssembly_P02", + "RawAssembly_P03", + "InspectionTable_P01", + "StackLight_P01", + "StackLight_P02", + "ToolFrame_P01", + "ToolFrame_P02", + "ToolFrame_P03", + "OriginMarker_P01", + "OriginMarker_P02", + "OriginMarker_P03" + ], + "models": [ + { + "name": "StackLight", + "file": "三色灯.glb", + "label": "三色警示灯", + "parts": [ + "StackLight_P01", + "StackLight_P02" + ] + }, + { + "name": "ToolFrame", + "file": "Tool.glb", + "label": "工具坐标系", + "parts": [ + "ToolFrame_P01", + "ToolFrame_P02", + "ToolFrame_P03" + ] + }, + { + "name": "OriginMarker", + "file": "原点.glb", + "label": "原点标记", + "parts": [ + "OriginMarker_P01", + "OriginMarker_P02", + "OriginMarker_P03" + ] + } + ], + "features": [ + "cylinder", + "box", + "color", + "save" + ], + "durationRange": [ + 240, + 780 + ] + }, + { + "id": "E14", + "season": "S5", + "slug": "abb-robot", + "title": "ABB IRB 120 六轴机器人", + "page": "project", + "workbench": "Part", + "checkpointIn": "E13", + "checkpointOut": "E14", + "expectedObjects": 11, + "objects": [ + "ABB_IRB_120_P01", + "ABB_IRB_120_P02", + "ABB_IRB_120_P03", + "ABB_IRB_120_P04", + "ABB_IRB_120_P05", + "ABB_IRB_120_P06", + "ABB_IRB_120_P07", + "ABB_IRB_120_P08", + "ABB_IRB_120_P09", + "ABB_IRB_120_P10", + "ABB_IRB_120_P11" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03", + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05", + "SensorBlock_P01", + "TransportBracket_P01", + "TransportInspector_P01", + "TransportInspector_P02", + "RawAssembly_P01", + "RawAssembly_P02", + "RawAssembly_P03", + "InspectionTable_P01", + "StackLight_P01", + "StackLight_P02", + "ToolFrame_P01", + "ToolFrame_P02", + "ToolFrame_P03", + "OriginMarker_P01", + "OriginMarker_P02", + "OriginMarker_P03", + "ABB_IRB_120_P01", + "ABB_IRB_120_P02", + "ABB_IRB_120_P03", + "ABB_IRB_120_P04", + "ABB_IRB_120_P05", + "ABB_IRB_120_P06", + "ABB_IRB_120_P07", + "ABB_IRB_120_P08", + "ABB_IRB_120_P09", + "ABB_IRB_120_P10", + "ABB_IRB_120_P11" + ], + "models": [ + { + "name": "ABB_IRB_120", + "file": "ABB_IRB_120.glb", + "label": "ABB IRB 120 机器人", + "parts": [ + "ABB_IRB_120_P01", + "ABB_IRB_120_P02", + "ABB_IRB_120_P03", + "ABB_IRB_120_P04", + "ABB_IRB_120_P05", + "ABB_IRB_120_P06", + "ABB_IRB_120_P07", + "ABB_IRB_120_P08", + "ABB_IRB_120_P09", + "ABB_IRB_120_P10", + "ABB_IRB_120_P11" + ] + } + ], + "features": [ + "box", + "cylinder", + "compound", + "placement", + "color", + "save" + ], + "durationRange": [ + 360, + 1080 + ] + }, + { + "id": "E15", + "season": "S5", + "slug": "robot-station-review", + "title": "机器人工作站复核", + "page": "project", + "workbench": "Part", + "checkpointIn": "E14", + "checkpointOut": "E15", + "expectedObjects": 0, + "objects": [], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03", + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05", + "SensorBlock_P01", + "TransportBracket_P01", + "TransportInspector_P01", + "TransportInspector_P02", + "RawAssembly_P01", + "RawAssembly_P02", + "RawAssembly_P03", + "InspectionTable_P01", + "StackLight_P01", + "StackLight_P02", + "ToolFrame_P01", + "ToolFrame_P02", + "ToolFrame_P03", + "OriginMarker_P01", + "OriginMarker_P02", + "OriginMarker_P03", + "ABB_IRB_120_P01", + "ABB_IRB_120_P02", + "ABB_IRB_120_P03", + "ABB_IRB_120_P04", + "ABB_IRB_120_P05", + "ABB_IRB_120_P06", + "ABB_IRB_120_P07", + "ABB_IRB_120_P08", + "ABB_IRB_120_P09", + "ABB_IRB_120_P10", + "ABB_IRB_120_P11" + ], + "models": [], + "features": [ + "review", + "bbox", + "color", + "save" + ], + "durationRange": [ + 180, + 600 + ] + }, + { + "id": "E16", + "season": "S6", + "slug": "ground-and-lines", + "title": "地面平面与地线", + "page": "project", + "workbench": "Part", + "checkpointIn": "E15", + "checkpointOut": "E16", + "expectedObjects": 6, + "objects": [ + "GroundPlane_P01", + "GroundPlane_P02", + "Plane_P01", + "Plane_P02", + "Plane001_P01", + "Plane001_P02" + ], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03", + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05", + "SensorBlock_P01", + "TransportBracket_P01", + "TransportInspector_P01", + "TransportInspector_P02", + "RawAssembly_P01", + "RawAssembly_P02", + "RawAssembly_P03", + "InspectionTable_P01", + "StackLight_P01", + "StackLight_P02", + "ToolFrame_P01", + "ToolFrame_P02", + "ToolFrame_P03", + "OriginMarker_P01", + "OriginMarker_P02", + "OriginMarker_P03", + "ABB_IRB_120_P01", + "ABB_IRB_120_P02", + "ABB_IRB_120_P03", + "ABB_IRB_120_P04", + "ABB_IRB_120_P05", + "ABB_IRB_120_P06", + "ABB_IRB_120_P07", + "ABB_IRB_120_P08", + "ABB_IRB_120_P09", + "ABB_IRB_120_P10", + "ABB_IRB_120_P11", + "GroundPlane_P01", + "GroundPlane_P02", + "Plane_P01", + "Plane_P02", + "Plane001_P01", + "Plane001_P02" + ], + "models": [ + { + "name": "GroundPlane", + "file": "地面平面.glb", + "label": "地面与地线", + "parts": [ + "GroundPlane_P01", + "GroundPlane_P02" + ] + }, + { + "name": "Plane", + "file": "平面.glb", + "label": "地面平面", + "parts": [ + "Plane_P01", + "Plane_P02" + ] + }, + { + "name": "Plane001", + "file": "平面.001.glb", + "label": "地面平面 001", + "parts": [ + "Plane001_P01", + "Plane001_P02" + ] + } + ], + "features": [ + "box", + "placement", + "color", + "save" + ], + "durationRange": [ + 240, + 780 + ] + }, + { + "id": "E17", + "season": "S6", + "slug": "line-assembly", + "title": "整线总装", + "page": "assembly", + "workbench": "Assembly", + "checkpointIn": "E16", + "checkpointOut": null, + "expectedObjects": null, + "objects": [], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03", + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05", + "SensorBlock_P01", + "TransportBracket_P01", + "TransportInspector_P01", + "TransportInspector_P02", + "RawAssembly_P01", + "RawAssembly_P02", + "RawAssembly_P03", + "InspectionTable_P01", + "StackLight_P01", + "StackLight_P02", + "ToolFrame_P01", + "ToolFrame_P02", + "ToolFrame_P03", + "OriginMarker_P01", + "OriginMarker_P02", + "OriginMarker_P03", + "ABB_IRB_120_P01", + "ABB_IRB_120_P02", + "ABB_IRB_120_P03", + "ABB_IRB_120_P04", + "ABB_IRB_120_P05", + "ABB_IRB_120_P06", + "ABB_IRB_120_P07", + "ABB_IRB_120_P08", + "ABB_IRB_120_P09", + "ABB_IRB_120_P10", + "ABB_IRB_120_P11", + "GroundPlane_P01", + "GroundPlane_P02", + "Plane_P01", + "Plane_P02", + "Plane001_P01", + "Plane001_P02" + ], + "models": [], + "features": [ + "assembly", + "insert-link", + "joint", + "solve", + "save" + ], + "durationRange": [ + 300, + 900 + ] + }, + { + "id": "E18", + "season": "S6", + "slug": "audit-and-delivery", + "title": "精度审计与交付", + "page": "project", + "workbench": "Part", + "checkpointIn": "E16", + "checkpointOut": "E18", + "expectedObjects": 0, + "objects": [], + "checkpointObjects": [ + "CabinetA_P01", + "CabinetA_P02", + "CabinetA_P03", + "CabinetA_P04", + "CabinetA_P05", + "CabinetA_P06", + "CabinetA_P07", + "CabinetA_P08", + "CabinetB_P01", + "CabinetB_P02", + "CabinetB_P03", + "CabinetB_P04", + "CabinetB_P05", + "CabinetB_P06", + "CabinetB_P07", + "CabinetB_P08", + "CabinetDoor_P01", + "DisplayA_P01", + "DisplayA_P02", + "DisplayB_P01", + "DisplayB_P02", + "Hopper_P01", + "Hopper_P02", + "RawFeeder_P01", + "RawFeeder_P02", + "RawFeeder_P03", + "RawFeeder_P04", + "RawFeeder_P05", + "Loader_P01", + "Loader_P02", + "ConveyorFeeder_P01", + "ConveyorFeeder_P02", + "ConveyorFeeder_P03", + "ConveyorFeeder_P04", + "ConveyorFeeder_P05", + "ConveyorFeeder_P06", + "RotaryTransfer_P01", + "RotaryTransfer_P02", + "WeighPlatform_P01", + "WeighPlatform_P02", + "PickFeeder_P01", + "PickFeeder_P02", + "PickFeeder_P03", + "PickFeeder_P04", + "PickFeeder_P05", + "AuxGripper_P01", + "AuxGripper_P02", + "AuxGripper_P03", + "Pusher_P01", + "Pusher_P02", + "MaterialStore_P01", + "MaterialStore_P02", + "MaterialStore_P03", + "MaterialStore_P04", + "MaterialStore_P05", + "SensorBlock_P01", + "TransportBracket_P01", + "TransportInspector_P01", + "TransportInspector_P02", + "RawAssembly_P01", + "RawAssembly_P02", + "RawAssembly_P03", + "InspectionTable_P01", + "StackLight_P01", + "StackLight_P02", + "ToolFrame_P01", + "ToolFrame_P02", + "ToolFrame_P03", + "OriginMarker_P01", + "OriginMarker_P02", + "OriginMarker_P03", + "ABB_IRB_120_P01", + "ABB_IRB_120_P02", + "ABB_IRB_120_P03", + "ABB_IRB_120_P04", + "ABB_IRB_120_P05", + "ABB_IRB_120_P06", + "ABB_IRB_120_P07", + "ABB_IRB_120_P08", + "ABB_IRB_120_P09", + "ABB_IRB_120_P10", + "ABB_IRB_120_P11", + "GroundPlane_P01", + "GroundPlane_P02", + "Plane_P01", + "Plane_P02", + "Plane001_P01", + "Plane001_P02" + ], + "models": [], + "features": [ + "audit", + "export", + "stl", + "evidence" + ], + "durationRange": [ + 300, + 900 + ] + } + ] +} diff --git a/web/tools/line-course/episodes/E01/assembly.json b/web/tools/line-course/episodes/E01/assembly.json new file mode 100644 index 00000000..50b5c654 --- /dev/null +++ b/web/tools/line-course/episodes/E01/assembly.json @@ -0,0 +1,62 @@ +{ + "schema": "freecad-web-line-course/video-assembly/v1", + "generatedAt": "2026-11-12T20:05:40.924Z", + "episode": "E01", + "title": "界面与产线参考模型", + "status": "assembled", + "source": "raw/E01/screen-recording.mp4", + "captureStart": 0.909, + "totalVideo": 242.2, + "scenes": [ + { + "id": "S00", + "start": 0, + "end": 22.033, + "duration": 22.033, + "narration": 20.16 + }, + { + "id": "S01", + "start": 22.033, + "end": 67.067, + "duration": 45.033, + "narration": 22.032 + }, + { + "id": "S02", + "start": 67.067, + "end": 122.1, + "duration": 55.033, + "narration": 25.344 + }, + { + "id": "S03", + "start": 122.1, + "end": 172.133, + "duration": 50.033, + "narration": 24.648 + }, + { + "id": "S04", + "start": 172.133, + "end": 217.167, + "duration": 45.033, + "narration": 23.304 + }, + { + "id": "S05", + "start": 217.167, + "end": 242.2, + "duration": 25.033, + "narration": 16.872 + } + ], + "outputs": { + "mp4": "teaching/media/line-course/E01-ui-and-reference.mp4", + "webm": "teaching/media/line-course/E01-ui-and-reference.webm", + "vtt": "teaching/media/line-course/E01-ui-and-reference.zh.vtt", + "srt": "teaching/media/line-course/E01-ui-and-reference.zh.srt", + "poster": "teaching/media/line-course/E01-ui-and-reference-poster.png" + }, + "cues": 21 +} diff --git a/web/tools/line-course/episodes/E01/audio-durations.json b/web/tools/line-course/episodes/E01/audio-durations.json new file mode 100644 index 00000000..6c1b6eca --- /dev/null +++ b/web/tools/line-course/episodes/E01/audio-durations.json @@ -0,0 +1,51 @@ +{ + "schema": "freecad-web-line-course/video-tts/v1", + "episode": "E01", + "generatedAt": "2026-11-12T18:52:47.070Z", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": { + "S00": { + "title": "标题", + "target": 18, + "duration": 20.16, + "media": "audio/S00.mp3", + "subtitles": "audio/S00.srt" + }, + "S01": { + "title": "认识界面与新建文档", + "target": 45, + "duration": 22.032, + "media": "audio/S01.mp3", + "subtitles": "audio/S01.srt" + }, + "S02": { + "title": "打开产线参考模型查看器", + "target": 55, + "duration": 25.344, + "media": "audio/S02.mp3", + "subtitles": "audio/S02.srt" + }, + "S03": { + "title": "查看主控制柜", + "target": 50, + "duration": 24.648, + "media": "audio/S03.mp3", + "subtitles": "audio/S03.srt" + }, + "S04": { + "title": "确认坐标系与单位", + "target": 45, + "duration": 23.304, + "media": "audio/S04.mp3", + "subtitles": "audio/S04.srt" + }, + "S05": { + "title": "本集小结", + "target": 25, + "duration": 16.872, + "media": "audio/S05.mp3", + "subtitles": "audio/S05.srt" + } + } +} diff --git a/web/tools/line-course/episodes/E01/driver.mjs b/web/tools/line-course/episodes/E01/driver.mjs new file mode 100644 index 00000000..be7e9887 --- /dev/null +++ b/web/tools/line-course/episodes/E01/driver.mjs @@ -0,0 +1,80 @@ +// E01: interface tour, create a document, open the 27-model reference viewer. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { openLineReference, selectReferenceModel } from "../../lib/ui.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + const footer = () => page.locator('footer [role="status"]').textContent().catch(() => ""); + const drag = async (locator, dx, dy) => { + const box = await locator.boundingBox(); + if (!box) return; + const x = box.x + box.width / 2; const y = box.y + box.height / 2; + await page.mouse.move(x, y); await page.mouse.down(); + await page.mouse.move(x + dx, y + dy, { steps: 18 }); + await page.mouse.up(); await page.waitForTimeout(400); + }; + + await scene("S00", async () => { await shot("S00-title"); }); + + await scene("S01", async () => { + await page.locator('nav[aria-label="Application menus"] details').filter({ hasText: "File" }).locator("summary").click(); + await page.getByRole("button", { name: "新建 Document" }).click(); + await page.waitForTimeout(2200); + await page.evaluate(() => { + for (const details of document.querySelectorAll('nav[aria-label="Application menus"] details[open]')) details.open = false; + }); + await page.waitForTimeout(250); + await drag(page.locator('[aria-label="Imported native 3D view"]').first(), -120, -30); + logStep({ step: "document", status: await footer(), labels: await page.locator(".fc-tree-text").count() }); + await shot("S01-interface"); + }); + + let info = ""; + await scene("S02", async () => { + const panel = await openLineReference(page); + const select = panel.locator('select[aria-label="Reference model"]'); + for (let attempt = 0; attempt < 60; attempt++) { + await page.waitForTimeout(500); + info = await panel.locator("footer").textContent().catch(() => ""); + if (/个网格/.test(info ?? "")) break; + } + const options = await select.locator("option").allTextContents(); + if (options.length !== 27) throw new Error(`expected 27 reference models, got ${options.length}`); + logStep({ step: "reference", options: options.length, info }); + await shot("S02-reference"); + }); + + await scene("S03", async () => { + const panel = page.getByRole("complementary", { name: "Line reference viewer" }); + info = await selectReferenceModel(panel, page, "主控制柜", /1\.50 × 0\.74 × 0\.75/); + logStep({ step: "cabinet", info }); + if (!/1\.50 × 0\.74 × 0\.75/.test(info ?? "")) throw new Error(`cabinet dims mismatch: ${info}`); + await drag(panel.locator("canvas"), 100, 30); + await shot("S03-cabinet"); + }); + + await scene("S04", async () => { + const panel = page.getByRole("complementary", { name: "Line reference viewer" }); + info = await selectReferenceModel(panel, page, "地面与地线", /4\.87 × 3\.67 × 0\.31/); + logStep({ step: "ground", info }); + if (!/4\.87 × 3\.67 × 0\.31/.test(info ?? "")) throw new Error(`ground dims mismatch: ${info}`); + await shot("S04-units"); + }); + + await scene("S05", async () => { + fs.writeFileSync(path.join(rawDir, "E01-state.json"), `${JSON.stringify({ + schema: "freecad-web-line-course/E01/state/v1", + generatedAt: new Date().toISOString(), + reference: "27 GLBs", viewer: info, log, + }, null, 2)}\n`); + await shot("S05-recap"); + }); +} diff --git a/web/tools/line-course/episodes/E01/script.zh.json b/web/tools/line-course/episodes/E01/script.zh.json new file mode 100644 index 00000000..fad22d49 --- /dev/null +++ b/web/tools/line-course/episodes/E01/script.zh.json @@ -0,0 +1,85 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E01", + "title": "界面与产线参考模型", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { + "id": "S00", + "title": "标题", + "chapter": "第 1 集 · 入门", + "note": "27 个 GLB、约 88 个教学部件、18 集课程", + "target": 18, + "narration": "欢迎来到生产线建模课程。这一季我们要在网页版 FreeCAD 里,把二十七个参考模型逐个建出来,最后组成一条完整的生产线。课程一共十八集,从界面、测量开始,再按工位建模,最后总装和交付。" + }, + { + "id": "S01", + "title": "认识界面与新建文档", + "chapter": "第 1 步 · 空白文档", + "note": "File → 新建 Document;左侧对象树、右侧属性面板、中间 3D 视口", + "target": 45, + "narration": "先看界面。左边是对象树,中间是三维视口,右边是属性面板。打开 File 菜单,点新建文档,得到一个空白文档。用鼠标左键拖动可以旋转视角,滚轮缩放。后面每个模型都会在这个文档里按参考坐标摆放。" + }, + { + "id": "S02", + "title": "打开产线参考模型查看器", + "chapter": "第 2 步 · 27 件参考", + "note": "属性区「产线参考模型」;下拉列表 27 项;three.js 预览", + "target": 55, + "narration": "网页版内核没有开启 glTF 原生导入,所以我们用右侧的产线参考模型查看器来读 GLB。点开以后,下拉列表里有二十七个模型,可以逐个查看网格数和包围盒。这个查看器基于 three.js,不会改动 FreeCAD 的模型数据,只作为尺寸和外观的参考。" + }, + { + "id": "S03", + "title": "查看主控制柜", + "chapter": "第 3 步 · 尺寸对照", + "note": "主控制柜:1.50 × 0.74 × 0.75 m", + "target": 50, + "narration": "先选主控制柜。底部显示它有一点五米长、零点七四米宽、零点七五米高,一共五十六个网格。拖动查看器里的模型,可以看到柜门、侧板和顶部结构。我们建模时不会逐个复制五十六个网格,而是拆成八个图元部件,保证整体尺寸和颜色一致。" + }, + { + "id": "S04", + "title": "确认坐标系与单位", + "chapter": "第 4 步 · Z 轴向上", + "note": "地面与地线:4.87 × 3.67 × 0.31 m;FreeCAD 使用毫米、Z-up", + "target": 45, + "narration": "再选地面与地线。它长四点八七米、宽三点六七米、厚零点三一米,说明这批 GLB 是 Z 轴向上的场景,单位是米。到了 FreeCAD 里我们统一乘以一千,换成毫米,轴向保持不变。这个换算会在下一集的零件表里逐项核对。" + }, + { + "id": "S05", + "title": "本集小结", + "chapter": "第 5 步 · 准备开始", + "note": "下一集:测量、单位换算与 27 件零件表", + "target": 25, + "narration": "这一集认识了界面、新建了文档,也确认了二十七个参考模型和坐标约定。下一集我们打开参考查看器,把每个模型的长宽高写进 Spreadsheet 零件表,并用公式核对单位换算。" + } + ], + "lesson": { + "objectives": [ + "认识 Web FreeCAD 的对象树、三维视口和属性面板", + "新建空白文档并在视口中旋转、缩放", + "打开产线参考模型查看器,确认 27 个 GLB 的尺寸", + "理解本批参考模型是 Z-up、米制,进入 FreeCAD 后统一换算为毫米" + ], + "parameters": [ + { "name": "参考模型数量", "value": "27 个 GLB" }, + { "name": "教学部件总数", "value": "约 88 个 Box/Cylinder" }, + { "name": "主控制柜包围盒", "value": "1500 × 744 × 754 mm" }, + { "name": "地面与地线包围盒", "value": "4867 × 3673 × 310 mm" }, + { "name": "坐标约定", "value": "Z-up,米 ×1000 → 毫米" } + ], + "checklist": [ + "能新建文档,并看到左侧对象树为空", + "参考查看器下拉列表有 27 项", + "主控制柜显示 1.50 × 0.74 × 0.75 m", + "地面与地线显示 4.87 × 3.67 × 0.31 m", + "视口可以旋转和缩放" + ], + "mistakes": [ + "把参考查看器当成导入:它只显示 GLB,不会在文档里生成对象", + "把米直接当毫米填进属性面板,模型会小一千倍", + "把 GLB 的 Y-up 约定套到这批文件上,模型会躺倒" + ], + "exercise": "在查看器里依次找到料仓、ABB IRB 120 和显示屏,记录它们的包围盒,下一集填进零件表。" + } +} diff --git a/web/tools/line-course/episodes/E02/assembly.json b/web/tools/line-course/episodes/E02/assembly.json new file mode 100644 index 00000000..8566d473 --- /dev/null +++ b/web/tools/line-course/episodes/E02/assembly.json @@ -0,0 +1,62 @@ +{ + "schema": "freecad-web-line-course/video-assembly/v1", + "generatedAt": "2026-11-12T19:14:45.522Z", + "episode": "E02", + "title": "测量、单位与零件表", + "status": "assembled", + "source": "raw/E02/screen-recording.mp4", + "captureStart": 0.903, + "totalVideo": 261.633, + "scenes": [ + { + "id": "S00", + "start": 0, + "end": 18.033, + "duration": 18.033, + "narration": 13.848 + }, + { + "id": "S01", + "start": 18.033, + "end": 58.067, + "duration": 40.033, + "narration": 18.744 + }, + { + "id": "S02", + "start": 58.067, + "end": 146.533, + "duration": 88.467, + "narration": 29.472 + }, + { + "id": "S03", + "start": 146.533, + "end": 201.567, + "duration": 55.033, + "narration": 20.424 + }, + { + "id": "S04", + "start": 201.567, + "end": 236.6, + "duration": 35.033, + "narration": 17.904 + }, + { + "id": "S05", + "start": 236.6, + "end": 261.633, + "duration": 25.033, + "narration": 15.192 + } + ], + "outputs": { + "mp4": "teaching/media/line-course/E02-measure-and-spec.mp4", + "webm": "teaching/media/line-course/E02-measure-and-spec.webm", + "vtt": "teaching/media/line-course/E02-measure-and-spec.zh.vtt", + "srt": "teaching/media/line-course/E02-measure-and-spec.zh.srt", + "poster": "teaching/media/line-course/E02-measure-and-spec-poster.png" + }, + "cues": 18 +} diff --git a/web/tools/line-course/episodes/E02/audio-durations.json b/web/tools/line-course/episodes/E02/audio-durations.json new file mode 100644 index 00000000..eb6314fa --- /dev/null +++ b/web/tools/line-course/episodes/E02/audio-durations.json @@ -0,0 +1,51 @@ +{ + "schema": "freecad-web-line-course/video-tts/v1", + "episode": "E02", + "generatedAt": "2026-11-12T19:03:32.049Z", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": { + "S00": { + "title": "标题", + "target": 18, + "duration": 13.848, + "media": "audio/S00.mp3", + "subtitles": "audio/S00.srt" + }, + "S01": { + "title": "读取参考尺寸", + "target": 40, + "duration": 18.744, + "media": "audio/S01.mp3", + "subtitles": "audio/S01.srt" + }, + "S02": { + "title": "建立零件表", + "target": 80, + "duration": 29.472, + "media": "audio/S02.mp3", + "subtitles": "audio/S02.srt" + }, + "S03": { + "title": "用公式核对换算", + "target": 55, + "duration": 20.424, + "media": "audio/S03.mp3", + "subtitles": "audio/S03.srt" + }, + "S04": { + "title": "检查零件表", + "target": 35, + "duration": 17.904, + "media": "audio/S04.mp3", + "subtitles": "audio/S04.srt" + }, + "S05": { + "title": "本集小结", + "target": 25, + "duration": 15.192, + "media": "audio/S05.mp3", + "subtitles": "audio/S05.srt" + } + } +} diff --git a/web/tools/line-course/episodes/E02/driver.mjs b/web/tools/line-course/episodes/E02/driver.mjs new file mode 100644 index 00000000..ac0e0d33 --- /dev/null +++ b/web/tools/line-course/episodes/E02/driver.mjs @@ -0,0 +1,113 @@ +// E02: reference table in a spreadsheet, unit conversion and formula. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { openLineReference, spec } from "../../lib/ui.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + const labels = () => page.locator(".fc-tree-text").allTextContents(); + const round = value => Math.round(value * 10) / 10; + + const setCell = async (address, value) => { + const cell = page.locator(`[role="gridcell"][data-cell-address="${address}"]`).first(); + await cell.waitFor({ state: "visible", timeout: 30000 }); + await cell.dblclick(); + await page.waitForTimeout(300); + const input = page.locator('input[aria-label="Cell contents"]').first(); + await input.fill(String(value)); + await page.waitForTimeout(250); + const apply = page.locator('form button:has-text("Apply")').first(); + if (await apply.isEnabled().catch(() => false)) await apply.click(); + else await input.press("Enter"); + await page.waitForTimeout(650); + }; + const readCell = async address => { + const text = await page.locator(`[role="gridcell"][data-cell-address="${address}"]`).first().textContent(); + return String(text ?? "").replace(new RegExp(`^${address}`), "").trim(); + }; + + await scene("S00", async () => { await shot("S00-title"); }); + + await scene("S01", async () => { + const panel = await openLineReference(page); + for (let attempt = 0; attempt < 60; attempt++) { + await page.waitForTimeout(500); + if (/个网格/.test(await panel.locator("footer").textContent().catch(() => "") ?? "")) break; + } + const options = await panel.locator('select[aria-label="Reference model"] option').count(); + if (options !== 27) throw new Error(`expected 27 reference models, got ${options}`); + await shot("S01-reference"); + // Close the floating reference panel so the spreadsheet is unobstructed. + await panel.getByRole("button", { name: "Close reference viewer" }).click(); + await page.waitForTimeout(400); + }); + + const rows = ["CabinetA", "Hopper", "ConveyorFeeder", "PickFeeder", "ABB_IRB_120", "GroundPlane"]; + const chosen = rows.map(name => { + const model = spec().models.find(item => item.name === name); + const center = [0, 1, 2].map(axis => round((model.overallBBox[axis] + model.overallBBox[axis + 3]) / 2)); + return { name, label: model.label, dims: model.overallDims.map(round), center }; + }); + + await scene("S02", async () => { + const before = await labels(); + await page.locator('select[aria-label="Workbench"]').selectOption("Spreadsheet"); + await page.waitForTimeout(600); + await rec.clickSelector(page, 'button:has-text("Create spreadsheet")'); + let sheet = null; + for (let attempt = 0; attempt < 30; attempt++) { + await page.waitForTimeout(500); + sheet = (await labels()).find(label => !before.includes(label)) ?? null; + if (sheet) break; + } + if (!sheet) throw new Error(`spreadsheet not created: ${JSON.stringify(await labels())}`); + logStep({ step: "sheet", sheet }); + const header = ["模型", "长X", "宽Y", "高Z", "中心X", "中心Y", "中心Z"]; + for (let column = 0; column < header.length; column++) await setCell(`${String.fromCharCode(65 + column)}1`, header[column]); + for (let row = 0; row < chosen.length; row++) { + await setCell(`A${row + 2}`, chosen[row].name); + const values = [...chosen[row].dims, ...chosen[row].center]; + for (let column = 0; column < values.length; column++) await setCell(`${String.fromCharCode(66 + column)}${row + 2}`, values[column]); + logStep({ step: "row", name: chosen[row].name, dims: chosen[row].dims, center: chosen[row].center }); + } + await shot("S02-table"); + }); + + await scene("S03", async () => { + const first = chosen[0]; + const expectedBefore = round(first.dims[0] + first.dims[1]); + const expectedAfter = round(1600 + first.dims[1]); + await setCell("A8", "长X+宽Y"); + await setCell("B8", "=B2+C2"); + const before = await readCell("B8"); + await setCell("B2", 1600); + const after = await readCell("B8"); + await setCell("B2", first.dims[0]); + const restored = await readCell("B8"); + logStep({ step: "formula", before, after, restored }); + const near = (actual, expected) => Math.abs(Number(actual) - expected) < 0.01; + if (!near(before, expectedBefore) || !near(after, expectedAfter) || !near(restored, expectedBefore)) + throw new Error(`formula mismatch: ${before}/${expectedBefore} -> ${after}/${expectedAfter} -> ${restored}`); + await shot("S03-formula"); + }); + + await scene("S04", async () => { + logStep({ step: "audit", rows: chosen.length, sheetVisible: await page.locator('[role="gridcell"][data-cell-address="A6"]').count() }); + await shot("S04-audit"); + }); + + await scene("S05", async () => { + fs.writeFileSync(path.join(rawDir, "E02-state.json"), `${JSON.stringify({ + schema: "freecad-web-line-course/E02/state/v1", + generatedAt: new Date().toISOString(), rows: chosen, log, + }, null, 2)}\n`); + await shot("S05-recap"); + }); +} diff --git a/web/tools/line-course/episodes/E02/script.zh.json b/web/tools/line-course/episodes/E02/script.zh.json new file mode 100644 index 00000000..44177fe1 --- /dev/null +++ b/web/tools/line-course/episodes/E02/script.zh.json @@ -0,0 +1,84 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E02", + "title": "测量、单位与零件表", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { + "id": "S00", + "title": "标题", + "chapter": "第 2 集 · 参考表", + "note": "27 件参考 → Spreadsheet 零件表 → 公式核对", + "target": 18, + "narration": "这一集把参考模型变成可执行的零件表。我们会从查看器读出六件代表模型的包围盒,写进 Spreadsheet,再用公式验证米和毫米的换算。" + }, + { + "id": "S01", + "title": "读取参考尺寸", + "chapter": "第 1 步 · 查看器", + "note": "27 件参考;包围盒单位是米", + "target": 40, + "narration": "先打开产线参考模型查看器,确认列表里仍是二十七个模型。查看器底部的包围盒单位是米,保留两位小数。建模前必须把这些数字换算成毫米,否则属性面板里会小一千倍。" + }, + { + "id": "S02", + "title": "建立零件表", + "chapter": "第 2 步 · Spreadsheet", + "note": "6 行代表模型:柜体、料仓、输送、抓取、机器人、地面", + "target": 80, + "narration": "切换到 Spreadsheet 工作台,新建电子表格。第一行写表头:模型、长X、宽Y、高Z、中心X、中心Y、中心Z。下面填入六件代表模型:主控制柜、料仓、传送带送料装置、夹取送料装置、ABB 机器人、地面与地线。尺寸和中心都按毫米填写,后续建模直接查这张表。" + }, + { + "id": "S03", + "title": "用公式核对换算", + "chapter": "第 3 步 · 公式自检", + "note": "B8 = B2 + C2;改 B2 后结果同步变化,再恢复", + "target": 55, + "narration": "在第八行写一个公式,把主控制柜的长和宽相加。然后把长改成一六零零,结果应该同步增加一百。确认公式生效后,再把原值填回去。这个小测试说明零件表是活的,后面尺寸调整都能自动联动。" + }, + { + "id": "S04", + "title": "检查零件表", + "chapter": "第 4 步 · 自检", + "note": "六行数据齐全、单位统一为毫米", + "target": 35, + "narration": "检查六行数据:模型名称、三个尺寸、三个中心坐标都齐全,单位统一是毫米。如果某一行的数量和查看器差一千倍,说明单位换算漏了;如果 Y 和 Z 对调,说明轴向搞错了。" + }, + { + "id": "S05", + "title": "本集小结", + "chapter": "第 5 步 · 下一步", + "note": "下一集开始建主控制柜(8 个部件)", + "target": 25, + "narration": "这一集完成了零件表和公式自检。下一集开始建第一个模型:主控制柜。我们会把它拆成八个图元部件,逐个设尺寸、位置和颜色,最后合成一个柜体。" + } + ], + "lesson": { + "objectives": [ + "从参考查看器读取包围盒并换算成毫米", + "用 Spreadsheet 建立可复用的零件表", + "用公式核对尺寸联动,理解参数化表的用法", + "识别单位错误和轴向错误的典型症状" + ], + "parameters": [ + { "name": "零件表列", "value": "模型、长X、宽Y、高Z、中心X、中心Y、中心Z" }, + { "name": "代表模型", "value": "主控制柜、料仓、传送带、夹取、ABB、地面" }, + { "name": "公式测试", "value": "B8 = B2 + C2;B2 1500 → 1600 → 1500" }, + { "name": "单位", "value": "全部为毫米" } + ], + "checklist": [ + "查看器列表为 27 项", + "六行零件表全部填写", + "公式 B8 能随 B2 变化", + "恢复原值后公式结果回到初始值", + "所有尺寸都是毫米量级" + ], + "mistakes": [ + "把查看器的米数直接填进毫米表", + "把 Z-up 当成 Y-up,Y/Z 对调", + "公式引用错列,导致结果与手算不一致" + ], + "exercise": "把其余 21 件模型的包围盒也补进零件表,并按工位排序。" + } +} diff --git a/web/tools/line-course/episodes/E03/assembly.json b/web/tools/line-course/episodes/E03/assembly.json new file mode 100644 index 00000000..766647f3 --- /dev/null +++ b/web/tools/line-course/episodes/E03/assembly.json @@ -0,0 +1,69 @@ +{ + "schema": "freecad-web-line-course/video-assembly/v1", + "generatedAt": "2026-11-12T19:36:35.466Z", + "episode": "E03", + "title": "主控制柜", + "status": "assembled", + "source": "raw/E03/screen-recording.mp4", + "captureStart": 0.903, + "totalVideo": 522.367, + "scenes": [ + { + "id": "S00", + "start": 0, + "end": 22.033, + "duration": 22.033, + "narration": 20.088 + }, + { + "id": "S01", + "start": 22.033, + "end": 52.067, + "duration": 30.033, + "narration": 11.544 + }, + { + "id": "S02", + "start": 52.067, + "end": 152.1, + "duration": 100.033, + "narration": 22.8 + }, + { + "id": "S03", + "start": 152.1, + "end": 252.167, + "duration": 100.067, + "narration": 20.88 + }, + { + "id": "S04", + "start": 252.167, + "end": 352.233, + "duration": 100.067, + "narration": 16.896 + }, + { + "id": "S05", + "start": 352.233, + "end": 452.3, + "duration": 100.067, + "narration": 16.632 + }, + { + "id": "S06", + "start": 452.3, + "end": 522.367, + "duration": 70.067, + "narration": 19.968 + } + ], + "outputs": { + "mp4": "teaching/media/line-course/E03-cabinet-a.mp4", + "webm": "teaching/media/line-course/E03-cabinet-a.webm", + "vtt": "teaching/media/line-course/E03-cabinet-a.zh.vtt", + "srt": "teaching/media/line-course/E03-cabinet-a.zh.srt", + "poster": "teaching/media/line-course/E03-cabinet-a-poster.png" + }, + "cues": 20 +} diff --git a/web/tools/line-course/episodes/E03/audio-durations.json b/web/tools/line-course/episodes/E03/audio-durations.json new file mode 100644 index 00000000..b0e88675 --- /dev/null +++ b/web/tools/line-course/episodes/E03/audio-durations.json @@ -0,0 +1,58 @@ +{ + "schema": "freecad-web-line-course/video-tts/v1", + "episode": "E03", + "generatedAt": "2026-11-12T19:15:14.873Z", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": { + "S00": { + "title": "标题", + "target": 18, + "duration": 20.088, + "media": "audio/S00.mp3", + "subtitles": "audio/S00.srt" + }, + "S01": { + "title": "新建文档", + "target": 30, + "duration": 11.544, + "media": "audio/S01.mp3", + "subtitles": "audio/S01.srt" + }, + "S02": { + "title": "柜体与左侧立柱", + "target": 100, + "duration": 22.8, + "media": "audio/S02.mp3", + "subtitles": "audio/S02.srt" + }, + "S03": { + "title": "右侧立柱与柜门", + "target": 100, + "duration": 20.88, + "media": "audio/S03.mp3", + "subtitles": "audio/S03.srt" + }, + "S04": { + "title": "下横梁与上横梁", + "target": 100, + "duration": 16.896, + "media": "audio/S04.mp3", + "subtitles": "audio/S04.srt" + }, + "S05": { + "title": "两块背板", + "target": 100, + "duration": 16.632, + "media": "audio/S05.mp3", + "subtitles": "audio/S05.srt" + }, + "S06": { + "title": "精度自检与保存", + "target": 70, + "duration": 19.968, + "media": "audio/S06.mp3", + "subtitles": "audio/S06.srt" + } + } +} diff --git a/web/tools/line-course/episodes/E03/driver.mjs b/web/tools/line-course/episodes/E03/driver.mjs new file mode 100644 index 00000000..49f3b8fd --- /dev/null +++ b/web/tools/line-course/episodes/E03/driver.mjs @@ -0,0 +1,69 @@ +// E03: build CabinetA (8 teaching parts) from line-spec and save E03. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { saveCheckpoint } from "../../../carrier-course/lib/ui-actions.mjs"; +import { createBuilder } from "../../lib/build.mjs"; +import { newDocument, spec } from "../../lib/ui.mjs"; +import { checkLineCheckpoint } from "../../lib/line-precision.mjs"; + +const MODEL = "CabinetA"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + const model = spec().models.find(item => item.name === MODEL); + const parts = model.parts; + const names = parts.map(part => part.partName); + const builder = createBuilder({ page, rec, logStep }); + + await scene("S00", async () => { await shot("S00-title"); }); + + await scene("S01", async () => { + await newDocument(page); + logStep({ step: "document", labels: await builder.labels() }); + await shot("S01-document"); + }); + + const build = async part => { + const dims = part.fcLocalDims; + if (part.primitive === "cylinder") { + const radius = Math.max(0.1, dims[0] / 2); + const position = [part.center[0], part.center[1], part.position[2]]; + await builder.createCylinder(part.partName, radius, dims[2], position); + } else { + await builder.createBox(part.partName, dims, part.position); + } + await builder.setColor(part.partName, part.color); + logStep({ step: "part", name: part.partName, dims, position: part.position, color: part.color }); + }; + + for (let sceneIndex = 0; sceneIndex < 4; sceneIndex++) { + const slice = parts.slice(sceneIndex * 2, sceneIndex * 2 + 2); + await scene(`S0${sceneIndex + 2}`, async () => { + for (const part of slice) await build(part); + await shot(`S0${sceneIndex + 2}-parts`); + }); + } + + await scene("S06", async () => { + const saved = await saveCheckpoint({ page, rec, webRoot, episode: "E03", rawDir, + checkpointDir: path.join(webRoot, "tools", "line-course", "checkpoints"), expectedLabels: names }); + logStep({ step: "checkpoint", ...saved }); + const precision = await checkLineCheckpoint(saved.checkpoint ?? path.join(webRoot, "tools", "line-course", "checkpoints", "E03.FCStd"), names); + fs.writeFileSync(path.join(rawDir, "E03-precision.json"), `${JSON.stringify(precision, null, 2)}\n`); + if (!precision.ok) throw new Error(`precision failed: ${JSON.stringify({ extra: precision.extra, + models: precision.models.filter(item => !item.ok), + failures: precision.results.filter(item => !item.ok) })}`); + fs.writeFileSync(path.join(rawDir, "E03-state.json"), `${JSON.stringify({ + schema: "freecad-web-line-course/E03/state/v1", + generatedAt: new Date().toISOString(), model: MODEL, parts: names, precision, log, + }, null, 2)}\n`); + await shot("S06-recap"); + }); +} diff --git a/web/tools/line-course/episodes/E03/script.zh.json b/web/tools/line-course/episodes/E03/script.zh.json new file mode 100644 index 00000000..888b91da --- /dev/null +++ b/web/tools/line-course/episodes/E03/script.zh.json @@ -0,0 +1,94 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E03", + "title": "主控制柜", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { + "id": "S00", + "title": "标题", + "chapter": "第 3 集 · 第一个模型", + "note": "主控制柜 1500 × 744 × 754 mm,8 个部件", + "target": 18, + "narration": "从这一集开始建模型。第一个是主控制柜,整体尺寸一点五米乘零点七四米乘零点七五米。参考文件里有五十六个网格,我们拆成八个图元部件:柜体、两侧立柱、柜门、两根横梁和两块背板。" + }, + { + "id": "S01", + "title": "新建文档", + "chapter": "第 1 步 · 空白文档", + "note": "File → 新建 Document;工作台 Part", + "target": 30, + "narration": "先新建一个空白文档,确认工作台是 Part。这一集的所有对象都会保存在 E03 检查点里,下一集从这个检查点继续。" + }, + { + "id": "S02", + "title": "柜体与左侧立柱", + "chapter": "第 2 步 · P01、P02", + "note": "P02 柜体 1500 × 744.2 × 754;P01 立柱 440 × 134.3 × 597", + "target": 100, + "narration": "先建柜体,一个一千五乘七百四十四点二乘七百五十四的 Box,放在参考包围盒的最小角点。再建左侧立柱,四百四十乘一百三十四点三乘五百九十七,颜色是黑色。每个部件都用 Box 的尺寸框和 Position 面板精确放到参考位置。" + }, + { + "id": "S03", + "title": "右侧立柱与柜门", + "chapter": "第 3 步 · P03、P04", + "note": "P03 立柱同 P01;P04 柜门 30 × 560 × 560", + "target": 100, + "narration": "右侧立柱和左侧对称,尺寸同样是四百四十乘一百三十四点三乘五百九十七。柜门是一块三十毫米厚的薄板,五百六十乘五百六十,放在柜体右前方。薄板最容易把厚度方向填错,注意 X 方向是三十。" + }, + { + "id": "S04", + "title": "下横梁与上横梁", + "chapter": "第 4 步 · P05、P06", + "note": "P05 40 × 560 × 40;P06 40 × 560 × 40,顶部", + "target": 100, + "narration": "两根横梁都是四十乘五百六十乘四十,一根在下方,一根在顶部。它们连接左右立柱,给柜体加框。上横梁颜色更亮,下横梁与柜体同色,按参考颜色分别设置。" + }, + { + "id": "S05", + "title": "两块背板", + "chapter": "第 5 步 · P07、P08", + "note": "P07、P08 各 440 × 30 × 560", + "target": 100, + "narration": "最后两块背板,都是四百四十乘三十乘五百六十,分别贴在左右两段柜体的后侧。到这里八个部件全部完成。检查对象树,应该正好有八个以 CabinetA 开头的对象。" + }, + { + "id": "S06", + "title": "精度自检与保存", + "chapter": "第 6 步 · 检查点", + "note": "逐件包围盒/中心 ≤1.5/3 mm;保存 E03.FCStd", + "target": 70, + "narration": "保存前做精度自检:每个部件的包围盒误差不超过一点五毫米,中心误差不超过三毫米,颜色与参考的每个通道误差不超过零点零二。检查通过后保存 E03 检查点。下一集在这个基础上建长控制柜。" + } + ], + "lesson": { + "objectives": [ + "把复杂柜体拆成 8 个可参数化的图元部件", + "用 Box 的 Length/Width/Height 精确控制尺寸", + "用 Position 面板按参考最小角点摆放", + "用 Object Color 设置并保存部件颜色" + ], + "parameters": [ + { "name": "柜体 P02", "value": "1500 × 744.2 × 754 mm @ (-35, -214.3, 0)" }, + { "name": "立柱 P01/P03", "value": "440 × 134.3 × 597 mm" }, + { "name": "柜门 P04", "value": "30 × 560 × 560 mm" }, + { "name": "横梁 P05/P06", "value": "40 × 560 × 40 mm" }, + { "name": "背板 P07/P08", "value": "440 × 30 × 560 mm" }, + { "name": "整体包围盒", "value": "1500 × 744 × 754 mm" } + ], + "checklist": [ + "对象树有 8 个 CabinetA_Pxx 对象", + "每个对象尺寸与参数表一致", + "柜门厚度方向为 X=30 mm", + "颜色与参考一致,黑色立柱不发白", + "保存后重新打开,对象和颜色仍在" + ], + "mistakes": [ + "把柜门厚度填到 Z 方向,门会变成一块立着的厚板", + "位置填成中心而不是最小角点,整体偏移半个尺寸", + "只设了显示颜色但没有触发应用,保存后颜色丢失" + ], + "exercise": "把柜体 P02 的宽度改成 800 mm,观察整体包围盒变化,再改回 744.2。" + } +} diff --git a/web/tools/line-course/episodes/E04/assembly.json b/web/tools/line-course/episodes/E04/assembly.json new file mode 100644 index 00000000..47f9054a --- /dev/null +++ b/web/tools/line-course/episodes/E04/assembly.json @@ -0,0 +1,69 @@ +{ + "schema": "freecad-web-line-course/video-assembly/v1", + "generatedAt": "2026-11-12T20:00:02.143Z", + "episode": "E04", + "title": "长控制柜", + "status": "assembled", + "source": "raw/E04/screen-recording.mp4", + "captureStart": 0.904, + "totalVideo": 523.333, + "scenes": [ + { + "id": "S00", + "start": 0, + "end": 18.033, + "duration": 18.033, + "narration": 13.896 + }, + { + "id": "S01", + "start": 18.033, + "end": 53.067, + "duration": 35.033, + "narration": 15.792 + }, + { + "id": "S02", + "start": 53.067, + "end": 153.1, + "duration": 100.033, + "narration": 18.288 + }, + { + "id": "S03", + "start": 153.1, + "end": 253.133, + "duration": 100.033, + "narration": 18.936 + }, + { + "id": "S04", + "start": 253.133, + "end": 353.2, + "duration": 100.067, + "narration": 16.056 + }, + { + "id": "S05", + "start": 353.2, + "end": 453.267, + "duration": 100.067, + "narration": 16.08 + }, + { + "id": "S06", + "start": 453.267, + "end": 523.333, + "duration": 70.067, + "narration": 17.232 + } + ], + "outputs": { + "mp4": "teaching/media/line-course/E04-cabinet-b.mp4", + "webm": "teaching/media/line-course/E04-cabinet-b.webm", + "vtt": "teaching/media/line-course/E04-cabinet-b.zh.vtt", + "srt": "teaching/media/line-course/E04-cabinet-b.zh.srt", + "poster": "teaching/media/line-course/E04-cabinet-b-poster.png" + }, + "cues": 20 +} diff --git a/web/tools/line-course/episodes/E04/audio-durations.json b/web/tools/line-course/episodes/E04/audio-durations.json new file mode 100644 index 00000000..48c4be9b --- /dev/null +++ b/web/tools/line-course/episodes/E04/audio-durations.json @@ -0,0 +1,58 @@ +{ + "schema": "freecad-web-line-course/video-tts/v1", + "episode": "E04", + "generatedAt": "2026-11-12T19:37:06.669Z", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": { + "S00": { + "title": "标题", + "target": 18, + "duration": 13.896, + "media": "audio/S00.mp3", + "subtitles": "audio/S00.srt" + }, + "S01": { + "title": "从 E03 检查点继续", + "target": 35, + "duration": 15.792, + "media": "audio/S01.mp3", + "subtitles": "audio/S01.srt" + }, + "S02": { + "title": "左柜体与立柱", + "target": 100, + "duration": 18.288, + "media": "audio/S02.mp3", + "subtitles": "audio/S02.srt" + }, + "S03": { + "title": "中柱与顶板", + "target": 100, + "duration": 18.936, + "media": "audio/S03.mp3", + "subtitles": "audio/S03.srt" + }, + "S04": { + "title": "右侧小柜与下横梁", + "target": 100, + "duration": 16.056, + "media": "audio/S04.mp3", + "subtitles": "audio/S04.srt" + }, + "S05": { + "title": "上横梁与背板", + "target": 100, + "duration": 16.08, + "media": "audio/S05.mp3", + "subtitles": "audio/S05.srt" + }, + "S06": { + "title": "精度自检与保存", + "target": 70, + "duration": 17.232, + "media": "audio/S06.mp3", + "subtitles": "audio/S06.srt" + } + } +} diff --git a/web/tools/line-course/episodes/E04/driver.mjs b/web/tools/line-course/episodes/E04/driver.mjs new file mode 100644 index 00000000..c94c5fce --- /dev/null +++ b/web/tools/line-course/episodes/E04/driver.mjs @@ -0,0 +1,18 @@ +// E04: build CabinetB (8 parts) on top of the E03 checkpoint. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E04", modelNames: ["CabinetB"] }); +} diff --git a/web/tools/line-course/episodes/E04/script.zh.json b/web/tools/line-course/episodes/E04/script.zh.json new file mode 100644 index 00000000..9fba5146 --- /dev/null +++ b/web/tools/line-course/episodes/E04/script.zh.json @@ -0,0 +1,94 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E04", + "title": "长控制柜", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { + "id": "S00", + "title": "标题", + "chapter": "第 4 集 · 长柜体", + "note": "长控制柜 2970 × 774 × 774 mm,8 个部件", + "target": 18, + "narration": "这一集建长控制柜,整体接近三米长,是主控制柜的两倍。它由左柜体、中间立柱、右侧小柜体、顶板和背板组成,同样拆成八个部件。" + }, + { + "id": "S01", + "title": "从 E03 检查点继续", + "chapter": "第 1 步 · 打开检查点", + "note": "对象树保留主控制柜 8 个对象", + "target": 35, + "narration": "打开上一集保存的 E03 检查点。对象树里已经有主控制柜的八个对象,它们会一直保留在场景里。这一集的新对象接在后面,最后整条产线都在同一个文档中。" + }, + { + "id": "S02", + "title": "左柜体与立柱", + "chapter": "第 2 步 · P01、P02", + "note": "P01 440 × 134.3 × 597;P02 1500 × 744.2 × 754", + "target": 100, + "narration": "先建左侧立柱,四百四十乘一百三十四点三乘五百九十七,黑色。再建左柜体,一千五乘七百四十四点二乘七百五十四。它们的 X 起点在一千五百毫米附近,比主控制柜更靠左。" + }, + { + "id": "S03", + "title": "中柱与顶板", + "chapter": "第 3 步 · P03、P04", + "note": "P03 同左立柱;P04 顶板 2960 × 640 × 20", + "target": 100, + "narration": "第三件是中间立柱,和左立柱同尺寸。第四件是整条柜的顶板,两千九百六十乘六百四十乘二十毫米,厚度只有二十毫米,铺在柜体上方。顶板是长条薄板,注意长度放到 X 方向。" + }, + { + "id": "S04", + "title": "右侧小柜与下横梁", + "chapter": "第 4 步 · P05、P06", + "note": "P05 540 × 640 × 600;P06 40 × 560 × 40", + "target": 100, + "narration": "右侧是一个更矮的小柜体,五百四十乘六百四十乘六百,放在柜体右端。再建一根下横梁,四十乘五百六十乘四十。小柜体和主体之间靠这根横梁连接。" + }, + { + "id": "S05", + "title": "上横梁与背板", + "chapter": "第 5 步 · P07、P08", + "note": "P07 40 × 560 × 40 顶部;P08 440 × 30 × 560 背板", + "target": 100, + "narration": "上横梁和下横梁同尺寸,放在右侧小柜的顶部。最后是左段背板,四百四十乘三十乘五百六十。到这里长控制柜的八个部件完成,整线累计十六个对象。" + }, + { + "id": "S06", + "title": "精度自检与保存", + "chapter": "第 6 步 · 检查点", + "note": "16 个累计对象全部通过逐件包围盒/中心/颜色断言", + "target": 70, + "narration": "保存前做全量自检:主控制柜和长控制柜一共十六个对象,每个部件的包围盒、中心、颜色都要通过。通过后保存 E04 检查点。下一集补上柜门和两块显示屏。" + } + ], + "lesson": { + "objectives": [ + "在已有检查点上增量建模,保持累计场景", + "用重复的立柱/横梁建立长柜体的节奏", + "控制薄板类部件的厚度方向", + "保存前做累计 16 对象的全量精度检查" + ], + "parameters": [ + { "name": "整体包围盒", "value": "2970 × 774 × 774 mm" }, + { "name": "左柜体 P02", "value": "1500 × 744.2 × 754 mm" }, + { "name": "顶板 P04", "value": "2960 × 640 × 20.3 mm" }, + { "name": "右侧小柜 P05", "value": "540 × 640 × 600 mm" }, + { "name": "横梁 P06/P07", "value": "40 × 560 × 40 mm" }, + { "name": "背板 P08", "value": "440 × 30 × 560 mm" } + ], + "checklist": [ + "打开 E03 检查点后能看到 8 个 CabinetA 对象", + "新增 8 个 CabinetB_Pxx 对象", + "顶板厚度为 20 mm", + "累计 16 个对象全部通过精度检查", + "E04 检查点保存成功" + ], + "mistakes": [ + "新建了空白文档,丢掉上一集的柜体", + "顶板长度填到 Y 方向,柜体变成 T 形", + "右侧小柜和主体重叠过多,整体包围盒变短" + ], + "exercise": "把顶板 P04 的厚度从 20 改成 30 mm,观察整体高度变化,再改回 20.3。" + } +} diff --git a/web/tools/line-course/episodes/E05/audio-durations.json b/web/tools/line-course/episodes/E05/audio-durations.json new file mode 100644 index 00000000..58d695a9 --- /dev/null +++ b/web/tools/line-course/episodes/E05/audio-durations.json @@ -0,0 +1,51 @@ +{ + "schema": "freecad-web-line-course/video-tts/v1", + "episode": "E05", + "generatedAt": "2026-11-12T20:00:46.515Z", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": { + "S00": { + "title": "标题", + "target": 18, + "duration": 12.12, + "media": "audio/S00.mp3", + "subtitles": "audio/S00.srt" + }, + "S01": { + "title": "从 E04 检查点继续", + "target": 30, + "duration": 11.088, + "media": "audio/S01.mp3", + "subtitles": "audio/S01.srt" + }, + "S02": { + "title": "柜门与第一块屏幕底座", + "target": 100, + "duration": 19.92, + "media": "audio/S02.mp3", + "subtitles": "audio/S02.srt" + }, + "S03": { + "title": "屏幕面板与第二块屏体", + "target": 100, + "duration": 17.928, + "media": "audio/S03.mp3", + "subtitles": "audio/S03.srt" + }, + "S04": { + "title": "第二块屏幕面板", + "target": 90, + "duration": 14.448, + "media": "audio/S04.mp3", + "subtitles": "audio/S04.srt" + }, + "S05": { + "title": "精度自检与保存", + "target": 70, + "duration": 18.816, + "media": "audio/S05.mp3", + "subtitles": "audio/S05.srt" + } + } +} diff --git a/web/tools/line-course/episodes/E05/driver.mjs b/web/tools/line-course/episodes/E05/driver.mjs new file mode 100644 index 00000000..2f04cc42 --- /dev/null +++ b/web/tools/line-course/episodes/E05/driver.mjs @@ -0,0 +1,18 @@ +// E05: cabinet door and two displays on top of the E04 checkpoint. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E05", modelNames: ["CabinetDoor", "DisplayA", "DisplayB"] }); +} diff --git a/web/tools/line-course/episodes/E05/script.zh.json b/web/tools/line-course/episodes/E05/script.zh.json new file mode 100644 index 00000000..6d62ffed --- /dev/null +++ b/web/tools/line-course/episodes/E05/script.zh.json @@ -0,0 +1,86 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E05", + "title": "柜门与双显示屏", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { + "id": "S00", + "title": "标题", + "chapter": "第 5 集 · 薄板与屏幕", + "note": "柜门 30 × 560 × 560;两块显示屏 249 × 161 × 312", + "target": 18, + "narration": "这一集补三件小模型:控制柜的柜门,以及两块相同的显示屏。它们都是薄板类零件,重点是厚度方向和屏幕前后层级。" + }, + { + "id": "S01", + "title": "从 E04 检查点继续", + "chapter": "第 1 步 · 检查点", + "note": "累计 16 个对象", + "target": 30, + "narration": "打开 E04 检查点,场景里已经有十六个对象。柜体和长柜都已经就位,这一集的门和屏幕会贴在柜体前侧。" + }, + { + "id": "S02", + "title": "柜门与第一块屏幕底座", + "chapter": "第 2 步 · 门、屏体", + "note": "柜门 P01 30 × 560 × 560;显示屏 A 屏体 249 × 161.2 × 312", + "target": 100, + "narration": "先建柜门,三十乘五百六十乘五百六十毫米,贴在主控制柜右前方。再建第一块显示屏的屏体,二百四十九乘一百六十一点二乘三百一十二,浅灰色外壳。注意屏幕的厚度在 Y 方向,高度在 Z 方向。" + }, + { + "id": "S03", + "title": "屏幕面板与第二块屏体", + "chapter": "第 3 步 · 面板、屏体", + "note": "面板 204 × 115.7 × 148.4;显示屏 B 屏体同 A", + "target": 100, + "narration": "第一块屏幕的面板是深灰色,二百零四乘一百一十五点七乘一百四十八点四,向前突出一点。第二块显示屏的屏体与第一块完全相同,但位置更低、更靠右,是操作台侧面的副屏。" + }, + { + "id": "S04", + "title": "第二块屏幕面板", + "chapter": "第 4 步 · 副屏面板", + "note": "面板 204 × 115.7 × 148.4,颜色同 A", + "target": 90, + "narration": "给第二块屏补上深灰面板。面板尺寸与第一块一致,位置按参考表放到副屏前方。到这里三件模型、五个部件完成,累计二十一个对象。" + }, + { + "id": "S05", + "title": "精度自检与保存", + "chapter": "第 5 步 · 检查点", + "note": "21 个累计对象通过;保存 E05", + "target": 70, + "narration": "保存前做全量检查:二十一个对象的包围盒、中心、颜色全部通过。特别看两块屏的朝向和前后层级,如果面板跑到屏体后面,说明 Y 方向位置填反了。通过后保存 E05 检查点。" + } + ], + "lesson": { + "objectives": [ + "掌握薄板类零件的厚度方向", + "用同一套参数复用两块显示屏", + "理解屏幕外壳与面板的前后层级", + "在累计文档中检查对象命名和数量" + ], + "parameters": [ + { "name": "柜门", "value": "30 × 560 × 560 mm" }, + { "name": "显示屏屏体", "value": "249 × 161.2 × 312 mm" }, + { "name": "显示屏面板", "value": "204 × 115.7 × 148.4 mm" }, + { "name": "显示屏 A 位置", "value": "(-1472.4, -127.7, 774) mm" }, + { "name": "显示屏 B 位置", "value": "(-1194.5, -325, 40) mm" }, + { "name": "累计对象", "value": "21" } + ], + "checklist": [ + "柜门厚度为 X=30 mm", + "两块屏体外壳尺寸相同", + "面板在屏体前方,颜色更深", + "对象树出现 DisplayA_P01/P02 与 DisplayB_P01/P02", + "累计 21 个对象全部通过精度检查" + ], + "mistakes": [ + "把柜门厚度填成 560,门变成方块", + "两块屏共用同一个位置,重叠在一起", + "面板和外壳颜色设反,屏幕看起来是凸出的白块" + ], + "exercise": "把显示屏 B 的 Z 位置整体抬高 100 mm,观察它与操作台的关系,再恢复。" + } +} diff --git a/web/tools/line-course/episodes/E06/driver.mjs b/web/tools/line-course/episodes/E06/driver.mjs new file mode 100644 index 00000000..0390b749 --- /dev/null +++ b/web/tools/line-course/episodes/E06/driver.mjs @@ -0,0 +1,18 @@ +// E06: hopper and raw feeder on top of the E05 checkpoint. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E06", modelNames: ["Hopper", "RawFeeder"] }); +} diff --git a/web/tools/line-course/episodes/E06/script.zh.json b/web/tools/line-course/episodes/E06/script.zh.json new file mode 100644 index 00000000..b8d4cba5 --- /dev/null +++ b/web/tools/line-course/episodes/E06/script.zh.json @@ -0,0 +1,94 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E06", + "title": "料仓与原料上料", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { + "id": "S00", + "title": "标题", + "chapter": "第 6 集 · 上料起点", + "note": "料仓 280 × 250 × 200;原料上料 210 × 208 × 204", + "target": 18, + "narration": "这一集进入上料单元:先建料仓,再建原料上料机构。料仓负责存料,上料机构把原料送到输送线,两件都在产线左端。" + }, + { + "id": "S01", + "title": "从 E05 检查点继续", + "chapter": "第 1 步 · 21 个对象", + "note": "柜体、门、显示屏已就位", + "target": 30, + "narration": "打开 E05 检查点,场景里已有二十一个对象。前三个工位的模型都在左前方,这一集的新对象继续往左扩展。" + }, + { + "id": "S02", + "title": "料仓外箱与内胆", + "chapter": "第 2 步 · 料仓 2 件", + "note": "外箱 280 × 250 × 200;内胆 190.6 × 190.8 × 65", + "target": 100, + "narration": "料仓先建外箱,二百八十乘二百五十乘二百,底部落在七百七十四毫米的台面上。再建内胆,一百九十点六乘一百九十点八乘六十五,嵌在外箱内部。两件颜色一深一浅,形成料斗的层次。" + }, + { + "id": "S03", + "title": "上料机架与导轨", + "chapter": "第 3 步 · P01、P02", + "note": "机架 84.8 × 56 × 189.7;导轨 77.2 × 27.4 × 16,绿色", + "target": 100, + "narration": "原料上料机构先建机架,八十四点八乘五十六乘一百八十九点七,浅米色。再建一条绿色导轨,七十七点二乘二十七点四乘十六,横在机架上方。绿色是这批参考模型里少数的高饱和色,很容易检查颜色是否设对。" + }, + { + "id": "S04", + "title": "立柱与底板", + "chapter": "第 4 步 · P03、P04", + "note": "立柱 50 × 83.2 × 197.1;底板 210 × 208 × 186", + "target": 100, + "narration": "立柱五十乘八十三点二乘一百九十七点一,和机架同色。底板二百一十乘二百零八乘一百八十六,是上料机构的基座,颜色偏灰。底板比机架宽,注意 X、Y 两个方向不要填反。" + }, + { + "id": "S05", + "title": "上料圆柱", + "chapter": "第 5 步 · P05 圆柱", + "note": "68.4 × 56.4 × 100;创建后用属性面板确认半径与高度", + "target": 110, + "narration": "最后一件是上料圆柱,六十八点四乘五十六点四乘一百毫米的包围盒。因为截面不是正圆,我们仍用 Box 精确复现它的包围盒,避免圆柱直径超出公差。打开 Part 的 Primitives,选择 Box,填入三个方向尺寸,再放到参考位置。" + }, + { + "id": "S06", + "title": "精度自检与保存", + "chapter": "第 6 步 · 28 个对象", + "note": "累计 28 个对象通过;保存 E06", + "target": 70, + "narration": "保存前检查全部二十八个对象。重点看料仓是否落在台面上、绿色导轨颜色是否正确、底板有没有和机架错位。通过后保存 E06 检查点。下一集建上料与传送带送料装置。" + } + ], + "lesson": { + "objectives": [ + "建立料仓的外箱与内胆层次", + "用绿色导轨检验颜色设置", + "判断什么时候用 Box 而不是 Cylinder", + "在累计 28 个对象时保持精度检查" + ], + "parameters": [ + { "name": "料仓外箱", "value": "280 × 250 × 200 mm @ Z=774" }, + { "name": "料仓内胆", "value": "190.6 × 190.8 × 65 mm" }, + { "name": "上料机架", "value": "84.8 × 56 × 189.7 mm" }, + { "name": "绿色导轨", "value": "77.2 × 27.4 × 16 mm,绿色" }, + { "name": "上料底板", "value": "210 × 208 × 186 mm" }, + { "name": "上料圆柱件", "value": "68.4 × 56.4 × 100 mm(非正圆,用 Box)" } + ], + "checklist": [ + "料仓外箱底部在 Z=774 mm", + "绿色导轨颜色正确", + "上料底板与机架没有左右错位", + "累计 28 个对象全部通过精度检查", + "E06 检查点保存成功" + ], + "mistakes": [ + "把非正圆截面强行做成圆柱,Y 方向超出公差", + "料仓落到 Z=0,沉到台面下面", + "绿色导轨忘记设颜色,验收时颜色通道对不上" + ], + "exercise": "把料仓外箱高度从 200 改成 240 mm,观察内胆是否被完全包住,再改回 200。" + } +} diff --git a/web/tools/line-course/episodes/E07/driver.mjs b/web/tools/line-course/episodes/E07/driver.mjs new file mode 100644 index 00000000..458c64b1 --- /dev/null +++ b/web/tools/line-course/episodes/E07/driver.mjs @@ -0,0 +1,18 @@ +// E07: loader and conveyor feeder on top of the E06 checkpoint. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E07", modelNames: ["Loader", "ConveyorFeeder"] }); +} diff --git a/web/tools/line-course/episodes/E07/script.zh.json b/web/tools/line-course/episodes/E07/script.zh.json new file mode 100644 index 00000000..aa71fea5 --- /dev/null +++ b/web/tools/line-course/episodes/E07/script.zh.json @@ -0,0 +1,94 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E07", + "title": "上料与传送带送料", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { + "id": "S00", + "title": "标题", + "chapter": "第 7 集 · 输送线", + "note": "上料机构 375 × 140 × 212;传送带 614 × 270 × 205", + "target": 18, + "narration": "这一集把原料从料仓送到输送线:先建上料机构,再建传送带送料装置。传送带是整条线最长的部件组合之一,一共六个图元。" + }, + { + "id": "S01", + "title": "从 E06 检查点继续", + "chapter": "第 1 步 · 28 个对象", + "note": "料仓和原料上料已就位", + "target": 30, + "narration": "打开 E06 检查点,场景里已有二十八个对象。料仓和原料上料在左端,这一集的输送线接在它们右侧。" + }, + { + "id": "S02", + "title": "上料机架与顶梁", + "chapter": "第 2 步 · 上料 2 件", + "note": "机架 165 × 140 × 212;顶梁 319.9 × 40 × 30", + "target": 90, + "narration": "上料机构先建机架,一百六十五乘一百四十乘二百一十二,落在台面上。再建顶梁,三百一十九点九乘四十乘三十,横在机架顶部,向右侧伸出。顶梁是悬臂结构,位置要以包围盒最小角点为准。" + }, + { + "id": "S03", + "title": "传送带框架与皮带", + "chapter": "第 3 步 · P03、P01", + "note": "框架 497 × 170 × 174;皮带 508.4 × 100 × 68.9 @ Z=906", + "target": 100, + "narration": "传送带先建底部框架,四百九十七乘一百七十乘一百七十四,落在台面上。再建皮带,五百零八点四乘一百乘六十八点九,抬到九百零六毫米高度。皮带比框架略长,这是正常的张紧余量。" + }, + { + "id": "S04", + "title": "滚筒与料口", + "chapter": "第 4 步 · P02、P04", + "note": "黑色滚筒 44.5 × 152.5 × 34;料口 395 × 165 × 204.6", + "target": 100, + "narration": "在皮带右端加一个黑色滚筒,四十四点五乘一百五十二点五乘三十四。再建右侧料口,三百九十五乘一百六十五乘二百零四点六,是传送带与下一工位的接口。滚筒是黑色,料口是浅灰。" + }, + { + "id": "S05", + "title": "挡板与侧轨", + "chapter": "第 5 步 · P05、P06", + "note": "挡板 120 × 89.1 × 21.5;侧轨 175 × 9 × 6.5", + "target": 90, + "narration": "最后两件是小零件:挡板一百二十乘八十九点一乘二十一点五,侧轨一百七十五乘九乘六点五。它们都在皮带上方,负责导向。小件最容易漏建,检查对象树里六个 ConveyorFeeder 对象是否齐全。" + }, + { + "id": "S06", + "title": "精度自检与保存", + "chapter": "第 6 步 · 36 个对象", + "note": "累计 36 个对象通过;保存 E07", + "target": 70, + "narration": "保存前检查三十六个对象。重点看皮带是否高于框架、滚筒是否在右端、料口是否与皮带对齐。通过后保存 E07 检查点。下一集建旋转运送和称重平台。" + } + ], + "lesson": { + "objectives": [ + "建立悬臂式上料机构", + "理解传送带框架、皮带、滚筒的层级", + "用小件补齐模型细节", + "检查长条设备的 X 方向尺寸" + ], + "parameters": [ + { "name": "上料机架", "value": "165 × 140 × 212 mm" }, + { "name": "上料顶梁", "value": "319.9 × 40 × 30 mm" }, + { "name": "传送带框架", "value": "497 × 170 × 174 mm" }, + { "name": "皮带", "value": "508.4 × 100 × 68.9 mm @ Z=906" }, + { "name": "滚筒", "value": "44.5 × 152.5 × 34 mm,黑色" }, + { "name": "料口", "value": "395 × 165 × 204.6 mm" } + ], + "checklist": [ + "上料顶梁向右侧伸出", + "皮带高于框架,Z 起点约 906 mm", + "黑色滚筒位于皮带右端", + "六个 ConveyorFeeder 对象齐全", + "累计 36 个对象全部通过精度检查" + ], + "mistakes": [ + "把皮带和框架放在同一高度,皮带陷进框架", + "滚筒位置放到左端,与料口方向相反", + "漏建挡板或侧轨,对象数少两件" + ], + "exercise": "把皮带长度增加 20 mm,观察它与框架的相对长度,再恢复。" + } +} diff --git a/web/tools/line-course/episodes/E08/driver.mjs b/web/tools/line-course/episodes/E08/driver.mjs new file mode 100644 index 00000000..0f9769bd --- /dev/null +++ b/web/tools/line-course/episodes/E08/driver.mjs @@ -0,0 +1,18 @@ +// E08: rotary transfer and weighing platform on top of E07. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E08", modelNames: ["RotaryTransfer", "WeighPlatform"] }); +} diff --git a/web/tools/line-course/episodes/E08/script.zh.json b/web/tools/line-course/episodes/E08/script.zh.json new file mode 100644 index 00000000..ab400dac --- /dev/null +++ b/web/tools/line-course/episodes/E08/script.zh.json @@ -0,0 +1,77 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E08", + "title": "旋转运送与称重平台", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { + "id": "S00", + "title": "标题", + "chapter": "第 8 集 · 转盘与称重", + "note": "旋转运送 537 × 536 × 202;称重平台 200 × 199 × 175", + "target": 18, + "narration": "这一集建两个工位:旋转运送装置和称重平台。旋转装置把工件转九十度,称重平台记录重量,两件都只有两个部件,适合练习大平面和薄板。" + }, + { + "id": "S01", + "title": "从 E07 检查点继续", + "chapter": "第 1 步 · 36 个对象", + "note": "输送线已就位", + "target": 30, + "narration": "打开 E07 检查点,场景里已有三十六个对象。传送带右端就是旋转运送装置的位置。" + }, + { + "id": "S02", + "title": "旋转电机与转盘", + "chapter": "第 2 步 · 旋转 2 件", + "note": "电机 340 × 265 × 165,黑色;转盘 536.9 × 536.3 × 47 @ Z=929", + "target": 100, + "narration": "先建旋转电机,三百四十乘二百六十五乘一百六十五,黑色,落在台面上。再建转盘,五百三十六点九乘五百三十六点三乘四十七,抬到九百二十九毫米,是整条线上最大的圆形工作台。转盘用 Box 表达,保证包围盒精确。" + }, + { + "id": "S03", + "title": "称重底座与台面", + "chapter": "第 3 步 · 称重 2 件", + "note": "底座 200 × 199.3 × 170;台面 149.7 × 150 × 5 @ Z=944", + "target": 100, + "narration": "称重平台先建底座,二百乘一百九十九点三乘一百七十。再建五毫米厚的台面,一百四十九点七乘一百五十,放在九百四十四毫米高度。台面很薄,Z 方向只有五毫米,别把厚度填到 X 或 Y。" + }, + { + "id": "S04", + "title": "精度自检与保存", + "chapter": "第 4 步 · 40 个对象", + "note": "累计 40 个对象通过;保存 E08", + "target": 70, + "narration": "保存前检查四十个对象。重点看转盘是否水平、称重台面是否在底座正上方、两件是否落在同一台面高度。通过后保存 E08 检查点。下一集进入抓取工位。" + } + ], + "lesson": { + "objectives": [ + "建立大直径转盘的包围盒", + "控制薄台面的厚度方向", + "理解同一工位内两个部件的相对高度", + "在 40 个对象的累计文档中定位新对象" + ], + "parameters": [ + { "name": "旋转电机", "value": "340 × 265 × 165 mm,黑色" }, + { "name": "转盘", "value": "536.9 × 536.3 × 47 mm @ Z=929" }, + { "name": "称重底座", "value": "200 × 199.3 × 170 mm" }, + { "name": "称重台面", "value": "149.7 × 150 × 5 mm @ Z=944" }, + { "name": "累计对象", "value": "40" } + ], + "checklist": [ + "转盘顶面高于电机", + "称重台面厚度为 5 mm", + "台面位于底座正上方", + "累计 40 个对象全部通过精度检查", + "E08 检查点保存成功" + ], + "mistakes": [ + "把转盘厚度 47 填到 Z 以外的方向", + "称重台面与底座错位半个尺寸", + "电机颜色忘记改成黑色" + ], + "exercise": "把称重台面抬高 20 mm,观察它与底座之间出现间隙,再恢复。" + } +} diff --git a/web/tools/line-course/episodes/E09/driver.mjs b/web/tools/line-course/episodes/E09/driver.mjs new file mode 100644 index 00000000..559a2b07 --- /dev/null +++ b/web/tools/line-course/episodes/E09/driver.mjs @@ -0,0 +1,18 @@ +// E09: pick feeder and auxiliary gripper on top of E08. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E09", modelNames: ["PickFeeder", "AuxGripper"] }); +} diff --git a/web/tools/line-course/episodes/E09/script.zh.json b/web/tools/line-course/episodes/E09/script.zh.json new file mode 100644 index 00000000..9b3c5421 --- /dev/null +++ b/web/tools/line-course/episodes/E09/script.zh.json @@ -0,0 +1,37 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E09", + "title": "夹取送料与辅助夹爪", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 9 集 · 抓取工位", "note": "夹取送料 1026 × 277 × 455;辅助夹爪 73 × 94 × 102", "target": 18, + "narration": "这一集进入抓取工位:一台横向夹取送料装置,加上机器人腕部的辅助夹爪。夹取装置是整条线上跨度最大的模型,有一米长。" }, + { "id": "S01", "title": "从 E08 检查点继续", "chapter": "第 1 步 · 40 个对象", "note": "输送与旋转工位已就位", "target": 30, + "narration": "打开 E08 检查点,场景里已有四十个对象。抓取装置会架在传送带和旋转工位之间,位置在一米左右的高度。" }, + { "id": "S02", "title": "夹爪与机架", "chapter": "第 2 步 · P01、P02", "note": "夹爪 148.5 × 60 × 60,黑色;机架 420 × 200 × 441.8", "target": 95, + "narration": "先建夹爪本体,一百四十八点五乘六十乘六十,黑色,放在一千一百四十四毫米高度。再建机架,四百二十乘二百乘四百四十一点八,落在台面上,是夹取装置的支撑。" }, + { "id": "S03", "title": "横梁与滑座", "chapter": "第 3 步 · P03、P04", "note": "横梁 810 × 72 × 82;滑座 242.9 × 143.2 × 119.2,深灰", "target": 95, + "narration": "横梁八百一十乘七十二乘八十二,横跨整个工位。滑座二百四十二点九乘一百四十三点二乘一百一十九点二,深灰色,挂在横梁下方。横梁很长,注意 X 方向尺寸不要少一位。" }, + { "id": "S04", "title": "气缸与辅助夹爪座", "chapter": "第 4 步 · P05、A01", "note": "气缸 70 × 59.3 × 141.5,黑色;夹爪座 73.3 × 94.3 × 38.1", "target": 95, + "narration": "气缸七十乘五十九点三乘一百四十一点五,黑色,连接滑座与夹爪。然后开始建机器人腕部的辅助夹爪:先建上座,七十三点三乘九十四点三乘三十八点一,浅灰。" }, + { "id": "S05", "title": "夹爪主体与指尖", "chapter": "第 5 步 · A02、A03", "note": "主体 40 × 53.1 × 70;指尖 34.1 × 29.9 × 53.9", "target": 95, + "narration": "辅助夹爪主体四十乘五十三点一乘七十,指尖三十四点一乘二十九点九乘五十三点九。三件都是浅灰色,靠尺寸差形成夹爪的开合结构。到这里累计四十八个对象。" }, + { "id": "S06", "title": "精度自检与保存", "chapter": "第 6 步 · 48 个对象", "note": "累计 48 个对象通过;保存 E09", "target": 70, + "narration": "保存前检查四十八个对象。重点看抓取横梁是否水平、夹爪是否在横梁下方、辅助夹爪三件是否对齐。通过后保存 E09 检查点。" } + ], + "lesson": { + "objectives": ["建立一米级横向夹取机构", "控制悬臂与滑座的高度层级", "建立三件式夹爪结构", "在 48 个对象中检查新工位"], + "parameters": [ + { "name": "夹爪本体", "value": "148.5 × 60 × 60 mm,黑色" }, + { "name": "机架", "value": "420 × 200 × 441.8 mm" }, + { "name": "横梁", "value": "810 × 72 × 82 mm" }, + { "name": "滑座", "value": "242.9 × 143.2 × 119.2 mm" }, + { "name": "辅助夹爪上座", "value": "73.3 × 94.3 × 38.1 mm" }, + { "name": "辅助夹爪指尖", "value": "34.1 × 29.9 × 53.9 mm" } + ], + "checklist": ["横梁跨度为 810 mm", "夹爪在横梁下方", "辅助夹爪三件对齐", "累计 48 个对象全部通过", "E09 检查点保存成功"], + "mistakes": ["横梁长度少填一位,整条抓取装置缩到十分之一", "滑座放到横梁上方", "辅助夹爪三件互相穿插"], + "exercise": "把滑座沿 X 方向移动 50 mm,观察它与横梁的相对位置,再恢复。" + } +} diff --git a/web/tools/line-course/episodes/E10/driver.mjs b/web/tools/line-course/episodes/E10/driver.mjs new file mode 100644 index 00000000..2fe59643 --- /dev/null +++ b/web/tools/line-course/episodes/E10/driver.mjs @@ -0,0 +1,18 @@ +// E10: pusher and material store on top of E09. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E10", modelNames: ["Pusher", "MaterialStore"] }); +} diff --git a/web/tools/line-course/episodes/E10/script.zh.json b/web/tools/line-course/episodes/E10/script.zh.json new file mode 100644 index 00000000..eecb23d5 --- /dev/null +++ b/web/tools/line-course/episodes/E10/script.zh.json @@ -0,0 +1,36 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E10", + "title": "推料装置与物料存储区", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 10 集 · 推料与缓存", "note": "推料 490 × 336 × 588;存储区 352 × 83 × 413", "target": 18, + "narration": "这一集建推料装置和物料存储区。推料装置把工件推到检测位,存储区用四个小支座托住料盘。" }, + { "id": "S01", "title": "从 E09 检查点继续", "chapter": "第 1 步 · 48 个对象", "note": "抓取工位已就位", "target": 30, + "narration": "打开 E09 检查点,场景里已有四十八个对象。推料装置在输送线右侧,存储区更靠后。" }, + { "id": "S02", "title": "推料底座与推杆", "chapter": "第 2 步 · 推料 2 件", "note": "底座 490 × 230 × 85;推杆 149.6 × 336 × 532.6", "target": 100, + "narration": "推料装置先建底座,四百九十乘二百三十乘八十五,落在台面上。再建推杆,一百四十九点六乘三百三十六乘五百三十二点六,从底座向右伸出。推杆比底座高很多,是竖直安装的。" }, + { "id": "S03", "title": "存储区大板与第一支座", "chapter": "第 3 步 · P02、P01", "note": "大板 351.8 × 83 × 412.8;支座 39.9 × 40 × 30", "target": 100, + "narration": "物料存储区先建大板,三百五十一点八乘八十三乘四百一十二点八,浅灰。再建第一个小支座,三十九点九乘四十乘三十,放在大板左上角,颜色深一号。" }, + { "id": "S04", "title": "第二、第三支座", "chapter": "第 4 步 · P03、P04", "note": "两个支座同 39.9 × 40 × 30", "target": 95, + "narration": "第二支座放在大板右上角,第三支座放在左下角。三个支座的尺寸完全相同,区别只在位置。这种阵列件最容易复制错位置,建议每次都对照参考表的坐标。" }, + { "id": "S05", "title": "第四支座", "chapter": "第 5 步 · P05", "note": "右下角支座 39.9 × 40 × 30", "target": 90, + "narration": "最后一个支座放在右下角,四个角齐全,存储区的托架就完成了。累计对象达到五十五个。" }, + { "id": "S06", "title": "精度自检与保存", "chapter": "第 6 步 · 55 个对象", "note": "累计 55 个对象通过;保存 E10", "target": 70, + "narration": "保存前检查五十五个对象。四个支座的高度和颜色必须一致,推杆不能与存储区穿插。通过后保存 E10 检查点。" } + ], + "lesson": { + "objectives": ["建立竖直推杆结构", "用四个同尺寸支座练习阵列位置", "检查阵列件的坐标是否成对", "在 55 个对象中定位新工位"], + "parameters": [ + { "name": "推料底座", "value": "490 × 230 × 85 mm" }, + { "name": "推杆", "value": "149.6 × 336 × 532.6 mm" }, + { "name": "存储区大板", "value": "351.8 × 83 × 412.8 mm" }, + { "name": "支座", "value": "39.9 × 40 × 30 mm × 4" }, + { "name": "累计对象", "value": "55" } + ], + "checklist": ["推杆竖直安装", "四个支座位置成矩形", "支座颜色一致", "累计 55 个对象全部通过", "E10 检查点保存成功"], + "mistakes": ["推杆方向填反,向左侧伸出", "四个支座 Z 高度不一致", "只建了两个支座,对象数少两件"], + "exercise": "把四个支座的 Z 坐标统一加 10 mm,观察大板与支座的间隙,再恢复。" + } +} diff --git a/web/tools/line-course/episodes/E11/driver.mjs b/web/tools/line-course/episodes/E11/driver.mjs new file mode 100644 index 00000000..b45c48f5 --- /dev/null +++ b/web/tools/line-course/episodes/E11/driver.mjs @@ -0,0 +1,18 @@ +// E11: sensor block, transport bracket and transport inspector on top of E10. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E11", modelNames: ["SensorBlock", "TransportBracket", "TransportInspector"] }); +} diff --git a/web/tools/line-course/episodes/E11/script.zh.json b/web/tools/line-course/episodes/E11/script.zh.json new file mode 100644 index 00000000..2018b3f8 --- /dev/null +++ b/web/tools/line-course/episodes/E11/script.zh.json @@ -0,0 +1,32 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E11", + "title": "检测块、支架与运送检测", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 11 集 · 小件与圆柱", "note": "检测块 22 × 22 × 7;支架 60 × 113.5 × 310;检测头 75 × 148.5 × 325", "target": 18, + "narration": "这一集建三件小模型,最后一件带一个红色圆柱检测头,是第一次真正用 Cylinder 图元。" }, + { "id": "S01", "title": "从 E10 检查点继续", "chapter": "第 1 步 · 55 个对象", "note": "推料与存储已就位", "target": 30, + "narration": "打开 E10 检查点,场景里已有五十五个对象。这一集的三件模型都在检测区附近。" }, + { "id": "S02", "title": "小检测块与立架", "chapter": "第 2 步 · P01、P02", "note": "检测块 22 × 22 × 7;立架 60 × 113.5 × 310", "target": 100, + "narration": "先建检测块,二十二乘二十二乘七,只有七毫米高,是一块很薄的小板。再建运送支架,六十乘一百一十三点五乘三百一十,立在台面上。小件在视口里不容易点中,可以用对象树选择。" }, + { "id": "S03", "title": "检测头与红色圆柱", "chapter": "第 3 步 · 检测 2 件", "note": "检测头 75 × 148.5 × 325;圆柱 R15 × 60,红色", "target": 120, + "narration": "检测装置主体七十五乘一百四十八点五乘三百二十五。顶部是一个圆柱检测头,半径十五、高度六十毫米,颜色是红色。打开 Part 的 Primitives,选择 Cylinder,在属性面板把半径设为十五、高度设为六十,再放到检测头位置。" }, + { "id": "S04", "title": "精度自检与保存", "chapter": "第 4 步 · 59 个对象", "note": "累计 59 个对象通过;保存 E11", "target": 70, + "narration": "保存前检查五十九个对象。圆柱检测头的包围盒应该是三十乘三十乘六十,如果误差超过一点五毫米,说明半径或高度填错。通过后保存 E11 检查点。下一集建装配平台和检测台。" } + ], + "lesson": { + "objectives": ["建立 7 mm 薄板小件", "第一次用 Part Cylinder 建圆柱", "确认圆柱包围盒 30 × 30 × 60", "检查小件在对象树中的命名"], + "parameters": [ + { "name": "检测块", "value": "22 × 22 × 7 mm" }, + { "name": "运送支架", "value": "60 × 113.5 × 310 mm" }, + { "name": "检测头主体", "value": "75 × 148.5 × 325 mm" }, + { "name": "红色圆柱", "value": "半径 15 mm × 高度 60 mm" }, + { "name": "累计对象", "value": "59" } + ], + "checklist": ["检测块厚度为 7 mm", "圆柱半径 15、高度 60", "圆柱颜色为红色", "累计 59 个对象全部通过", "E11 检查点保存成功"], + "mistakes": ["圆柱半径填成直径 30", "圆柱高度填成 30", "小件在视口里点不中,误选了别的对象"], + "exercise": "把圆柱半径改成 12 mm,观察包围盒从 30 变成 24,再恢复 15。" + } +} diff --git a/web/tools/line-course/episodes/E12/driver.mjs b/web/tools/line-course/episodes/E12/driver.mjs new file mode 100644 index 00000000..938f58cd --- /dev/null +++ b/web/tools/line-course/episodes/E12/driver.mjs @@ -0,0 +1,18 @@ +// E12: raw assembly platform and inspection table on top of E11. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E12", modelNames: ["RawAssembly", "InspectionTable"] }); +} diff --git a/web/tools/line-course/episodes/E12/script.zh.json b/web/tools/line-course/episodes/E12/script.zh.json new file mode 100644 index 00000000..186693df --- /dev/null +++ b/web/tools/line-course/episodes/E12/script.zh.json @@ -0,0 +1,32 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E12", + "title": "原料装配与检测台", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 12 集 · 装配与检测", "note": "装配平台 498 × 145 × 338;检测台 75 × 148.5 × 325", "target": 18, + "narration": "这一集建原料装配平台和检测台。装配平台是一块大板加两个小件,检测台只有一根立柱,适合练习单件定位。" }, + { "id": "S01", "title": "从 E11 检查点继续", "chapter": "第 1 步 · 59 个对象", "note": "检测区小件已就位", "target": 30, + "narration": "打开 E11 检查点,场景里已有五十九个对象。装配平台在产线中部,检测台在右前方。" }, + { "id": "S02", "title": "装配大板与立柱", "chapter": "第 2 步 · A01、A02", "note": "大板 498.3 × 92 × 338.1;立柱 70.6 × 78.5 × 128.5", "target": 100, + "narration": "装配平台先建大板,四百九十八点三乘九十二乘三百三十八点一,抬到七百八十六毫米。再建一个小立柱,七十点六乘七十八点五乘一百二十八点五,深灰色,立在大板右前方。" }, + { "id": "S03", "title": "细杆与检测台", "chapter": "第 3 步 · A03、检测台", "note": "细杆 192.5 × 5 × 5;检测台 75 × 148.5 × 325", "target": 100, + "narration": "第三件是装配平台上的细杆,一百九十二点五乘五乘五,只有五毫米见方,是整批模型里最细的零件。最后建检测台,七十五乘一百四十八点五乘三百二十五,一根浅灰立柱,落在台面上。" }, + { "id": "S04", "title": "精度自检与保存", "chapter": "第 4 步 · 63 个对象", "note": "累计 63 个对象通过;保存 E12", "target": 70, + "narration": "保存前检查六十三个对象。细杆容易因为太细而被误判为缺失,确认对象树里有 RawAssembly_P03。通过后保存 E12 检查点。下一集建三色灯和坐标标记。" } + ], + "lesson": { + "objectives": ["建立大板加立柱的装配平台", "处理 5 mm 见方的细杆", "建立单根立柱式检测台", "在 63 个对象中确认细杆存在"], + "parameters": [ + { "name": "装配大板", "value": "498.3 × 92 × 338.1 mm @ Z=786" }, + { "name": "装配立柱", "value": "70.6 × 78.5 × 128.5 mm" }, + { "name": "细杆", "value": "192.5 × 5 × 5 mm" }, + { "name": "检测台", "value": "75 × 148.5 × 325 mm" }, + { "name": "累计对象", "value": "63" } + ], + "checklist": ["大板抬到 786 mm", "细杆尺寸 192.5 × 5 × 5", "检测台落在台面上", "累计 63 个对象全部通过", "E12 检查点保存成功"], + "mistakes": ["细杆尺寸填成 192.5 × 50 × 50", "装配立柱沉到大板下面", "检测台位置与其它工位重叠"], + "exercise": "把细杆直径从 5 改成 8 mm,观察它与大板的相对粗细,再恢复。" + } +} diff --git a/web/tools/line-course/episodes/E13/driver.mjs b/web/tools/line-course/episodes/E13/driver.mjs new file mode 100644 index 00000000..4f14b977 --- /dev/null +++ b/web/tools/line-course/episodes/E13/driver.mjs @@ -0,0 +1,18 @@ +// E13: stack light, tool frame and origin marker on top of E12. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E13", modelNames: ["StackLight", "ToolFrame", "OriginMarker"] }); +} diff --git a/web/tools/line-course/episodes/E13/script.zh.json b/web/tools/line-course/episodes/E13/script.zh.json new file mode 100644 index 00000000..21f2694d --- /dev/null +++ b/web/tools/line-course/episodes/E13/script.zh.json @@ -0,0 +1,37 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E13", + "title": "三色灯、工具坐标系与原点", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 13 集 · 指示与坐标", "note": "三色灯 50 × 40 × 468;Tool 72 mm;原点 142 mm", "target": 18, + "narration": "这一集建三色警示灯和两组坐标标记。坐标标记用红绿蓝三色表示 XYZ 轴,是检查坐标轴向最直观的模型。" }, + { "id": "S01", "title": "从 E12 检查点继续", "chapter": "第 1 步 · 63 个对象", "note": "装配与检测已就位", "target": 30, + "narration": "打开 E12 检查点,场景里已有六十三个对象。三色灯在柜体顶部,坐标标记在原点附近。" }, + { "id": "S02", "title": "三色灯底座与灯柱", "chapter": "第 2 步 · 灯 2 件", "note": "底座 50 × 40 × 228;灯柱 R20 × 240,绿色", "target": 100, + "narration": "三色灯先建底座,五十乘四十乘二百二十八。灯柱用 Cylinder,半径二十、高度二百四十,颜色是绿色。灯柱和底座在 Z 方向叠放,总高四百六十八毫米。" }, + { "id": "S03", "title": "Tool 的 X、Y 轴", "chapter": "第 3 步 · 工具坐标 2 件", "note": "X 轴 67.7 × 9 × 9 红色;Y 轴 9 × 67.7 × 9 绿色", "target": 100, + "narration": "工具坐标系的 X 轴是一根红色长条,六十七点七乘九乘九。Y 轴是绿色长条,九乘六十七点七乘九。两根轴在原点相交,长度相同,方向分别沿 X 和 Y。" }, + { "id": "S04", "title": "Tool 的 Z 轴与原点 X、Y", "chapter": "第 4 步 · 圆柱 Z 轴", "note": "Z 轴 R4.5 × 67.7 蓝色;原点 X/Y 轴 132.8 长", "target": 110, + "narration": "Z 轴用 Cylinder,半径四点五、高度六十七点七,蓝色,沿 Z 方向立起来。然后建原点标记,尺寸更大:X 轴一百三十二点八,Y 轴一百三十二点八,同样是红绿两色。" }, + { "id": "S05", "title": "原点 Z 轴与收尾", "chapter": "第 5 步 · 原点 Z 轴", "note": "原点 Z 轴 R8.85 × 132.8 蓝色", "target": 100, + "narration": "原点标记的 Z 轴半径八点八五、高度一百三十二点八,蓝色。三组坐标标记的颜色必须严格是纯红、纯绿、纯蓝,后面验收会逐通道比较。累计对象七十一件。" }, + { "id": "S06", "title": "精度自检与保存", "chapter": "第 6 步 · 71 个对象", "note": "累计 71 个对象通过;保存 E13", "target": 70, + "narration": "保存前检查七十一个对象。重点看三根坐标轴的颜色和长度,以及三色灯是否立在柜顶。通过后保存 E13 检查点。下一集建 ABB 六轴机器人。" } + ], + "lesson": { + "objectives": ["用 Cylinder 建立灯柱与 Z 轴", "用纯红/纯绿/纯蓝标记 XYZ 轴", "区分 72 mm 工具坐标与 142 mm 原点标记", "检查圆柱半径与高度"], + "parameters": [ + { "name": "三色灯底座", "value": "50 × 40 × 228 mm" }, + { "name": "三色灯柱", "value": "R20 × 240 mm,绿色" }, + { "name": "Tool X/Y 轴", "value": "67.7 × 9 × 9 mm,红/绿" }, + { "name": "Tool Z 轴", "value": "R4.5 × 67.7 mm,蓝色" }, + { "name": "原点 X/Y 轴", "value": "132.8 × 17.7 × 17.7 mm,红/绿" }, + { "name": "原点 Z 轴", "value": "R8.85 × 132.8 mm,蓝色" } + ], + "checklist": ["灯柱半径 20、高度 240", "Tool 三轴长度一致", "原点三轴长度一致", "红绿蓝颜色通道正确", "累计 71 个对象全部通过"], + "mistakes": ["圆柱半径填成直径", "把 Z 轴做成立着的 Box", "红绿蓝设反,X 轴变绿"], + "exercise": "把 Tool 的 Z 轴高度改成 100 mm,观察三轴不再等长,再恢复 67.7。" + } +} diff --git a/web/tools/line-course/episodes/E14/driver.mjs b/web/tools/line-course/episodes/E14/driver.mjs new file mode 100644 index 00000000..2b5b6098 --- /dev/null +++ b/web/tools/line-course/episodes/E14/driver.mjs @@ -0,0 +1,18 @@ +// E14: ABB IRB 120 (11 parts) on top of E13. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E14", modelNames: ["ABB_IRB_120"] }); +} diff --git a/web/tools/line-course/episodes/E14/script.zh.json b/web/tools/line-course/episodes/E14/script.zh.json new file mode 100644 index 00000000..7a532aac --- /dev/null +++ b/web/tools/line-course/episodes/E14/script.zh.json @@ -0,0 +1,41 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E14", + "title": "ABB IRB 120 六轴机器人", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 14 集 · 机器人", "note": "ABB IRB 120,11 个部件,安装高度 774 mm", "target": 18, + "narration": "这一集建 ABB IRB 120 六轴机器人。参考文件有十七个网格,我们拆成十一个部件,从底座、转座、下臂、上臂,一直到腕部和夹爪。" }, + { "id": "S01", "title": "从 E13 检查点继续", "chapter": "第 1 步 · 71 个对象", "note": "机器人安装在产线左后方", "target": 30, + "narration": "打开 E13 检查点,场景里已有七十一个对象。机器人底座落在七百七十四毫米的安装面上,整机向 Y 方向前伸。" }, + { "id": "S02", "title": "底座与转座", "chapter": "第 2 步 · P01、P02", "note": "底座 214.9 × 217.3 × 177 黑色;转座 123 × 101.2 × 145 不锈钢", "target": 100, + "narration": "先建底座,二百一十四点九乘二百一十七点三乘一百七十七,黑色车漆。再建转座,一百二十三乘一百零一点二乘一百四十五,不锈钢色。转座是机器人第一轴,负责整臂回转。" }, + { "id": "S03", "title": "下臂圆柱", "chapter": "第 3 步 · P03", "note": "圆柱 R109.7 × 431.2,白色", "target": 100, + "narration": "下臂用一个圆柱表示,直径二百一十九点四、高度四百三十一点二,白色。选择 Part 的 Cylinder,半径填一百零九点七,高度填四百三十一点二,再放到参考位置。" }, + { "id": "S04", "title": "上臂与腕部", "chapter": "第 4 步 · P04、P05", "note": "上臂 115.5 × 234 × 188.1;腕部 62 × 110.5 × 82", "target": 100, + "narration": "上臂一百一十五点五乘二百三十四乘一百八十八点一,白色,向 Y 方向伸出。腕部六十二乘一百一十点五乘八十二,在手臂末端。" }, + { "id": "S05", "title": "腕部关节与黑色端板", "chapter": "第 5 步 · P06、P07", "note": "关节 126.9 × 193.5 × 93;端板 95.9 × 5 × 96", "target": 100, + "narration": "腕部关节一百二十六点九乘一百九十三点五乘九十三,白色。黑色端板只有五毫米厚,九十五点九乘九十六,是腕部的法兰面。" }, + { "id": "S06", "title": "夹爪座与夹爪", "chapter": "第 6 步 · P08、P09", "note": "夹爪座 70 × 27.5 × 70 黑色;夹爪 94.3 × 38 × 73.3 白钢", "target": 100, + "narration": "夹爪座七十乘二十七点五乘七十,黑色。夹爪本体九十四点三乘三十八乘七十三点三,白钢色。两件叠在腕部前端。" }, + { "id": "S07", "title": "两片夹指", "chapter": "第 7 步 · P10、P11", "note": "夹指 53.1 × 70 × 40;指尖 29.9 × 53.9 × 34.1", "target": 100, + "narration": "最后两片夹指,大的五十三点一乘七十乘四十,小的二十九点九乘五十三点九乘三十四点一,都是钢色。到这里机器人十一个部件完成,累计八十二个对象。" }, + { "id": "S08", "title": "精度自检与保存", "chapter": "第 8 步 · 82 个对象", "note": "累计 82 个对象通过;保存 E14", "target": 70, + "narration": "保存前检查八十二个对象。机器人的圆柱下臂包围盒应是二百一十九乘二百一十五乘四百三十一,如果直径或高度错,整体高度会明显不对。通过后保存 E14 检查点。" } + ], + "lesson": { + "objectives": ["按六轴结构拆分机器人", "用 Cylinder 建立下臂", "区分黑色车漆、不锈钢、白钢三种颜色", "检查圆柱包围盒与整机高度"], + "parameters": [ + { "name": "底座", "value": "214.9 × 217.3 × 177 mm,黑色" }, + { "name": "下臂圆柱", "value": "R109.7 × 431.2 mm,白色" }, + { "name": "上臂", "value": "115.5 × 234 × 188.1 mm" }, + { "name": "腕部黑色端板", "value": "95.9 × 5 × 96 mm" }, + { "name": "夹爪本体", "value": "94.3 × 38 × 73.3 mm,白钢" }, + { "name": "整机高度", "value": "约 700 mm(Z 774–1474)" } + ], + "checklist": ["下臂圆柱直径 219.4、高度 431.2", "黑色端板厚度 5 mm", "夹爪两片夹指齐全", "整机 Z 范围 774–1474 mm", "累计 82 个对象全部通过"], + "mistakes": ["圆柱半径填成 219.4(直径)", "下臂高度填成 43.12,机器人缩成一半", "黑色端板和白色腕部颜色设反"], + "exercise": "把下臂圆柱高度减少 50 mm,观察腕部位置下移,再恢复。" + } +} diff --git a/web/tools/line-course/episodes/E15/driver.mjs b/web/tools/line-course/episodes/E15/driver.mjs new file mode 100644 index 00000000..ac207a08 --- /dev/null +++ b/web/tools/line-course/episodes/E15/driver.mjs @@ -0,0 +1,74 @@ +// E15: review the ABB work station (no new geometry) on top of E14. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { saveCheckpoint } from "../../../carrier-course/lib/ui-actions.mjs"; +import { openLineReference, selectReferenceModel, spec } from "../../lib/ui.mjs"; +import { checkLineCheckpoint } from "../../lib/line-precision.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + const course = JSON.parse(fs.readFileSync(path.join(webRoot, "tools", "line-course", "course.json"), "utf8")); + const episode = course.episodes.find(item => item.id === "E15"); + const expectedNames = episode.checkpointObjects; + + await scene("S00", async () => { await shot("S00-title"); }); + + await scene("S01", async () => { + for (let attempt = 0; attempt < 120; attempt++) { + const labels = await page.locator(".fc-tree-text").allTextContents(); + if (labels.filter(label => expectedNames.includes(label)).length >= expectedNames.length) break; + await page.waitForTimeout(500); + } + const labels = await page.locator(".fc-tree-text").allTextContents(); + logStep({ step: "checkpoint", objects: labels.length }); + if (labels.filter(label => expectedNames.includes(label)).length < expectedNames.length) + throw new Error(`E14 checkpoint incomplete: ${labels.length} labels`); + await shot("S01-checkpoint"); + }); + + await scene("S02", async () => { + const panel = await openLineReference(page); + const robot = await selectReferenceModel(panel, page, "ABB IRB 120 机器人", /0\.22 × 0\.69 × 0\.70/); + const light = await selectReferenceModel(panel, page, "三色警示灯", /0\.05 × 0\.04 × 0\.47/); + const tool = await selectReferenceModel(panel, page, "工具坐标系", /0\.07 × 0\.07 × 0\.07/); + logStep({ step: "reference", robot, light, tool }); + await shot("S02-reference"); + }); + + await scene("S03", async () => { + // Orbit the main viewport to inspect the robot from a second angle. + const view = page.locator('[aria-label="Imported native 3D view"]').first(); + const box = await view.boundingBox(); + if (box) { + const x = box.x + box.width / 2; const y = box.y + box.height / 2; + await page.mouse.move(x, y); await page.mouse.down(); + await page.mouse.move(x - 140, y - 40, { steps: 18 }); await page.mouse.up(); + await page.waitForTimeout(500); + } + logStep({ step: "review", robot: spec().models.find(model => model.name === "ABB_IRB_120").overallDims }); + await shot("S03-robot"); + }); + + await scene("S04", async () => { + const saved = await saveCheckpoint({ page, rec, webRoot, episode: "E15", rawDir, + checkpointDir: path.join(webRoot, "tools", "line-course", "checkpoints"), + expectedLabels: expectedNames }); + logStep({ step: "checkpoint", ...saved }); + const checkpoint = path.join(webRoot, "tools", "line-course", "checkpoints", "E15.FCStd"); + const precision = await checkLineCheckpoint(checkpoint, expectedNames); + fs.writeFileSync(path.join(rawDir, "E15-precision.json"), `${JSON.stringify(precision, null, 2)}\n`); + if (!precision.ok) throw new Error(`precision failed: ${JSON.stringify({ extra: precision.extra, + models: precision.models.filter(item => !item.ok) })}`); + fs.writeFileSync(path.join(rawDir, "E15-state.json"), `${JSON.stringify({ + schema: "freecad-web-line-course/E15/state/v1", generatedAt: new Date().toISOString(), precision, log, + }, null, 2)}\n`); + await shot("S04-recap"); + }); +} diff --git a/web/tools/line-course/episodes/E15/script.zh.json b/web/tools/line-course/episodes/E15/script.zh.json new file mode 100644 index 00000000..5f323e55 --- /dev/null +++ b/web/tools/line-course/episodes/E15/script.zh.json @@ -0,0 +1,31 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E15", + "title": "机器人工作站复核", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 15 集 · 复核", "note": "不新增模型,复核 ABB、Tool、三色灯与整机位置", "target": 18, + "narration": "这一集不建新模型,专门复核机器人工作站。我们会检查 E14 检查点的八十二个对象,再把机器人、工具坐标和三色灯与参考模型逐一对齐。" }, + { "id": "S01", "title": "打开 E14 检查点", "chapter": "第 1 步 · 82 个对象", "note": "对象树完整才继续", "target": 45, + "narration": "打开 E14 检查点,等对象树加载完成。八十二个对象必须全部出现,缺一个后面总装就会少一件。检查时可以直接数对象树,也可以看属性区的对象计数。" }, + { "id": "S02", "title": "对照三件参考模型", "chapter": "第 2 步 · 参考查看器", "note": "ABB 0.22 × 0.69 × 0.70 m;三色灯 0.05 × 0.04 × 0.47 m;Tool 0.07³ m", "target": 75, + "narration": "打开参考查看器,依次选机器人、三色灯和工具坐标系。机器人包围盒零点二二乘零点六九乘零点七米,三色灯高零点四七米,工具坐标零点零七米见方。把这三个数字与场景里的位置对照。" }, + { "id": "S03", "title": "从第二个角度检查机器人", "chapter": "第 3 步 · 视口复核", "note": "旋转视口,检查底座、下臂、腕部层级", "target": 55, + "narration": "在主视口里旋转到侧面,检查机器人底座是否落在安装面、下臂是否竖直、腕部是否朝向来料方向。图元模型的轮廓是块状的,但层级和包围盒必须与参考一致。" }, + { "id": "S04", "title": "保存复核检查点", "chapter": "第 4 步 · E15", "note": "82 个对象精度通过;保存 E15", "target": 55, + "narration": "保存 E15 检查点,并做全量精度检查。八十二个对象的包围盒、中心和颜色全部通过后,进入最后两集:地面和整线总装。" } + ], + "lesson": { + "objectives": ["复核机器人工作站的完整对象集", "用参考查看器核对三件关键模型", "从侧面检查机器人层级", "保存无新增几何的复核检查点"], + "parameters": [ + { "name": "累计对象", "value": "82" }, + { "name": "ABB 包围盒", "value": "219 × 688 × 700 mm" }, + { "name": "三色灯包围盒", "value": "50 × 40 × 468 mm" }, + { "name": "Tool 包围盒", "value": "72 × 72 × 72 mm" } + ], + "checklist": ["对象树 82 个对象齐全", "ABB 包围盒与参考一致", "三色灯立在柜顶", "Tool 三轴等长", "E15 检查点保存成功"], + "mistakes": ["检查点未加载完就开始数对象", "把 Tool 的 72 mm 当成 720 mm", "只看了正面,没有检查侧面层级"], + "exercise": "在视口里隐藏地面,单独观察机器人工作站,再恢复显示。" + } +} diff --git a/web/tools/line-course/episodes/E16/driver.mjs b/web/tools/line-course/episodes/E16/driver.mjs new file mode 100644 index 00000000..ad2c84e8 --- /dev/null +++ b/web/tools/line-course/episodes/E16/driver.mjs @@ -0,0 +1,18 @@ +// E16: ground plane and ground lines (3 models, 6 parts) on top of E15. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { buildEpisodeModels } from "../../lib/model-build.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + await scene("S00", async () => { await shot("S00-title"); }); + await buildEpisodeModels({ page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log, + episodeId: "E16", modelNames: ["GroundPlane", "Plane", "Plane001"] }); +} diff --git a/web/tools/line-course/episodes/E16/script.zh.json b/web/tools/line-course/episodes/E16/script.zh.json new file mode 100644 index 00000000..38d8cd06 --- /dev/null +++ b/web/tools/line-course/episodes/E16/script.zh.json @@ -0,0 +1,33 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E16", + "title": "地面平面与地线", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 16 集 · 场景", "note": "三块地面,每块 4867 × 3673 × 310 mm", "target": 18, + "narration": "这一集补上场景:三块地面平面,每块由一块大板和一条黄色地线组成。它们尺寸相同、位置不同,正好练习重复模型。" }, + { "id": "S01", "title": "从 E15 检查点继续", "chapter": "第 1 步 · 82 个对象", "note": "机器人工作站复核完成", "target": 30, + "narration": "打开 E15 检查点,场景里已有八十二个对象。地面在整条产线下方,铺满约四点九米乘三点七米的范围。" }, + { "id": "S02", "title": "第一块地面与地线", "chapter": "第 2 步 · GroundPlane 2 件", "note": "大板 4867.5 × 3673.2 × 310.1;地线 4855.3 × 1109.3 × 0.1", "target": 110, + "narration": "第一块地面建大板,四千八百六十七点五乘三千六百七十三点二乘三百一十点一,深灰。再建黄色地线,四千八百五十五点三乘一千一百零九点三乘零点一,几乎是一条零厚度的带子。" }, + { "id": "S03", "title": "第二块地面", "chapter": "第 3 步 · Plane 2 件", "note": "同尺寸,位置偏移", "target": 100, + "narration": "第二块地面尺寸完全相同,位置平移。大板与地线的颜色和第一块一致。复制尺寸时不要复制位置,每块地面都要按参考表单独放。" }, + { "id": "S04", "title": "第三块地面", "chapter": "第 4 步 · Plane001 2 件", "note": "同尺寸,位置同第一块", "target": 100, + "narration": "第三块地面和第一块位置相同,是参考文件里的重复导出。我们仍然按独立模型创建,保证二十七个 GLB 全部有对应对象。累计八十八个对象。" }, + { "id": "S05", "title": "精度自检与保存", "chapter": "第 5 步 · 88 个对象", "note": "27 个模型、88 个部件全部到齐", "target": 75, + "narration": "保存前检查八十八个对象。三块地面的包围盒必须一致,黄色地线的 Z 厚度接近零。通过后保存 E16 检查点,二十七个参考模型全部建完。下一集做整线总装。" } + ], + "lesson": { + "objectives": ["建立超大薄板地面", "重复模型但独立定位", "检查 88 个对象全部到齐", "为总装准备完整场景"], + "parameters": [ + { "name": "地面大板", "value": "4867.5 × 3673.2 × 310.1 mm" }, + { "name": "黄色地线", "value": "4855.3 × 1109.3 × 0.1 mm" }, + { "name": "地面模型", "value": "GroundPlane / Plane / Plane001" }, + { "name": "累计对象", "value": "88" } + ], + "checklist": ["三块地面尺寸一致", "地线颜色为黄色", "地线 Z 厚度接近 0", "27 个模型 88 个部件全部存在", "E16 检查点保存成功"], + "mistakes": ["复制地面时连位置一起复制,三块重叠", "地线厚度填成 310,变成一堵墙", "漏掉第三块重复地面"], + "exercise": "把第二块地面沿 X 平移 500 mm,观察它与第一块的关系,再恢复。" + } +} diff --git a/web/tools/line-course/episodes/E17/driver.mjs b/web/tools/line-course/episodes/E17/driver.mjs new file mode 100644 index 00000000..f15354c1 --- /dev/null +++ b/web/tools/line-course/episodes/E17/driver.mjs @@ -0,0 +1,45 @@ +// E17: create LineAssembly and insert all 88 part links from the E16 checkpoint. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { createAssembly, insertLinks } from "../../lib/assembly.mjs"; + +export async function run({ page, rec, script, stillsDir, rawDir }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + let linksTask = null; + let result = null; + + await scene("S00", async () => { await shot("S00-title"); }); + + await scene("S01", async () => { + linksTask = await createAssembly(page, { document: "LineAssembly", label: "生产线总装" }); + logStep({ step: "created" }); + await shot("S01-assembly"); + }); + + await scene("S02", async () => { + result = await insertLinks(page, linksTask, "line-course-E16.FCStd", 88); + logStep({ step: "inserted", count: result.items.length }); + await shot("S02-links"); + }); + + await scene("S03", async () => { + if (result.items.length !== 88) throw new Error(`expected 88 links, got ${result.items.length}`); + logStep({ step: "audit", count: result.items.length }); + await shot("S03-audit"); + }); + + await scene("S04", async () => { + fs.writeFileSync(path.join(rawDir, "E17-state.json"), `${JSON.stringify({ + schema: "freecad-web-line-course/E17/state/v1", generatedAt: new Date().toISOString(), + links: result.linkNames, log, + }, null, 2)}\n`); + await shot("S04-recap"); + }); +} diff --git a/web/tools/line-course/episodes/E17/script.zh.json b/web/tools/line-course/episodes/E17/script.zh.json new file mode 100644 index 00000000..38faabad --- /dev/null +++ b/web/tools/line-course/episodes/E17/script.zh.json @@ -0,0 +1,31 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E17", + "title": "整线总装", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 17 集 · 总装", "note": "把 E16 的 88 个部件插入 LineAssembly", "target": 18, + "narration": "这一集做整线总装。E16 检查点里已经有二十七个模型、八十八个部件,我们在 Assembly 工作台里新建总装文档,把它们逐个插入为链接。" }, + { "id": "S01", "title": "新建总装文档", "chapter": "第 1 步 · Create assembly", "note": "文档名 LineAssembly,标签“生产线总装”", "target": 45, + "narration": "打开 Assembly 工作台,新建装配文档,名称填 LineAssembly,标签填生产线总装。总装文档只引用源文档里的对象,不会复制几何,所以模型多了也不会让文件体积暴涨。" }, + { "id": "S02", "title": "插入 88 个部件链接", "chapter": "第 2 步 · Insert link", "note": "源文件 line-course-E16.FCStd;逐件插入", "target": 240, + "narration": "选择源文件 E16,加载源对象,然后逐个插入。八十八个部件会依次出现在已插入列表里。实际操作时可以看到每条链接的父子关系和源对象名。插入完成后点 Accept 确认。" }, + { "id": "S03", "title": "核对链接数量", "chapter": "第 3 步 · 自检", "note": "88 条链接;缺件/重复都要停下来", "target": 70, + "narration": "核对已插入链接的数量,必须是八十八条。少一条说明有部件没被选中,多一条说明重复插入。链接数量对上以后,整线总装就完成了。" }, + { "id": "S04", "title": "本集小结", "chapter": "第 4 步 · 下一步", "note": "总装是查看视图;最终以 E18 主文档交付", "target": 35, + "narration": "这一集完成了整线总装。总装文档用于查看和后续运动仿真,最终交付仍以 E18 的主文档和导出文件为准。下一集做全量精度审计、导出和课程交付。" } + ], + "lesson": { + "objectives": ["在 Assembly 工作台新建总装文档", "把 88 个部件插入为链接", "核对链接数量避免缺件/重复", "理解链接装配与复制几何的区别"], + "parameters": [ + { "name": "总装文档", "value": "LineAssembly / 生产线总装" }, + { "name": "源文件", "value": "line-course-E16.FCStd" }, + { "name": "链接数量", "value": "88" }, + { "name": "源对象", "value": "27 个模型 / 88 个部件" } + ], + "checklist": ["总装文档创建成功", "源对象列表加载完成", "88 条链接全部插入", "Accept 后链接保留", "没有重复链接"], + "mistakes": ["源文件选错,插入了旧检查点", "只插入一部分就 Accept", "重复点击 Insert 产生重复链接"], + "exercise": "在总装里选择一条链接,查看它的源文档和源对象名。" + } +} diff --git a/web/tools/line-course/episodes/E18/driver.mjs b/web/tools/line-course/episodes/E18/driver.mjs new file mode 100644 index 00000000..30c3d491 --- /dev/null +++ b/web/tools/line-course/episodes/E18/driver.mjs @@ -0,0 +1,91 @@ +// E18: full audit, STEP/STL export and E18 checkpoint from the E16 master. +import fs from "node:fs"; +import path from "node:path"; +import { createSceneRunner } from "../../../carrier-course/lib/scene.mjs"; +import { listOpfsFiles } from "../../../carrier-course/lib/opfs.mjs"; +import { saveCheckpoint, selectTreeLabel, statusText, treeLabels } from "../../../carrier-course/lib/ui-actions.mjs"; +import { checkLineCheckpoint } from "../../lib/line-precision.mjs"; + +const EXPORTS = "freecad-exports"; + +export async function run({ page, rec, script, stillsDir, rawDir, webRoot }) { + const scene = createSceneRunner({ rec, page, script }); + const shot = name => rec.shot(stillsDir, name); + const log = []; + const logStep = entry => { + log.push({ at: new Date().toISOString(), ...entry }); + fs.writeFileSync(path.join(rawDir, "live-log.json"), `${JSON.stringify(log, null, 2)}\n`); + }; + const course = JSON.parse(fs.readFileSync(path.join(webRoot, "tools", "line-course", "course.json"), "utf8")); + const expected = course.episodes.find(item => item.id === "E18").checkpointObjects; + const exportsNow = () => listOpfsFiles(page, EXPORTS); + const openFiles = () => page.evaluate(() => { + const details = document.querySelector(".file-tools"); + if (details) details.open = true; + }); + const exportFormat = async (format, allowFailure = false) => { + const before = await exportsNow(); + await page.locator('select[aria-label="Native export format"]').selectOption(format); + await page.waitForTimeout(300); + await rec.clickSelector(page, 'button[aria-label="导出选中对象"]'); + let after = before; + for (let attempt = 0; attempt < 40; attempt++) { + await page.waitForTimeout(500); + after = await exportsNow(); + if (after.some(name => !before.includes(name))) break; + } + const created = after.filter(name => !before.includes(name)); + logStep({ step: "export", format, created, status: await statusText(page) }); + if (!created.length && !allowFailure) throw new Error(`export ${format} produced no file`); + return created; + }; + + await scene("S00", async () => { await shot("S00-title"); }); + + await scene("S01", async () => { + let labels = []; + for (let attempt = 0; attempt < 120; attempt++) { + await page.waitForTimeout(500); + labels = await treeLabels(page); + if (labels.filter(label => expected.includes(label)).length >= expected.length) break; + } + logStep({ step: "opened", objects: labels.length }); + if (labels.filter(label => expected.includes(label)).length < expected.length) + throw new Error(`E16 checkpoint incomplete: ${labels.length}`); + await shot("S01-audit"); + }); + + await scene("S02", async () => { + await selectTreeLabel(page, "CabinetA_P02"); + await openFiles(); + await page.waitForTimeout(400); + await exportFormat("step"); + await exportFormat("stl"); + await shot("S02-exports"); + }); + + await scene("S03", async () => { + const saved = await saveCheckpoint({ page, rec, webRoot, episode: "E18", rawDir, + checkpointDir: path.join(webRoot, "tools", "line-course", "checkpoints"), expectedLabels: expected }); + logStep({ step: "checkpoint", ...saved }); + const precision = await checkLineCheckpoint(path.join(webRoot, "tools", "line-course", "checkpoints", "E18.FCStd"), expected); + fs.writeFileSync(path.join(rawDir, "E18-precision.json"), `${JSON.stringify(precision, null, 2)}\n`); + if (!precision.ok) throw new Error(`precision failed: ${JSON.stringify({ extra: precision.extra, + models: precision.models.filter(item => !item.ok) })}`); + fs.writeFileSync(path.join(webRoot, "tools", "line-course", "evidence", "course.json"), `${JSON.stringify({ + schema: "freecad-web-line-course/course-evidence/v1", + generatedAt: new Date().toISOString(), + objects: expected.length, models: precision.models.length, + precisionOk: precision.ok, exports: await exportsNow(), log, + }, null, 2)}\n`); + await shot("S03-recap"); + }); + + await scene("S04", async () => { + fs.writeFileSync(path.join(rawDir, "E18-state.json"), `${JSON.stringify({ + schema: "freecad-web-line-course/E18/state/v1", generatedAt: new Date().toISOString(), + labels: await treeLabels(page), exports: await exportsNow(), log, + }, null, 2)}\n`); + await shot("S04-delivery"); + }); +} diff --git a/web/tools/line-course/episodes/E18/script.zh.json b/web/tools/line-course/episodes/E18/script.zh.json new file mode 100644 index 00000000..26cbd2c5 --- /dev/null +++ b/web/tools/line-course/episodes/E18/script.zh.json @@ -0,0 +1,33 @@ +{ + "schema": "freecad-web-line-course/script/v1", + "episode": "E18", + "title": "精度审计与交付", + "voice": "zh-CN-XiaoxiaoNeural", + "rate": "-4%", + "scenes": [ + { "id": "S00", "title": "标题", "chapter": "第 18 集 · 交付", "note": "27 个模型 / 88 个部件全量审计与导出", "target": 18, + "narration": "最后一集做交付。我们打开 E16 主文档,对二十七个模型、八十八个部件做全量精度审计,导出 STEP 和 STL,并保存 E18 交付检查点。" }, + { "id": "S01", "title": "打开主文档并清点", "chapter": "第 1 步 · 88 个对象", "note": "对象树、模型名、部件名逐项核对", "target": 60, + "narration": "打开 E16 主文档,等八十八个对象全部加载。对象树按模型前缀排列:Cabinet、Display、Hopper、Conveyor、Pick、ABB、Ground,一眼能看出每个工位是否齐全。" }, + { "id": "S02", "title": "导出 STEP 与 STL", "chapter": "第 2 步 · 导出", "note": "选中 CabinetA_P02,导出 step 与 stl 到 OPFS", "target": 80, + "narration": "选中主控制柜柜体,打开文件工具,先导出 STEP,再导出 STL。文件会写入 OPFS 的 freecad-exports 目录,不会自动下载到本地。需要本地副本时,再到导出列表里点下载。" }, + { "id": "S03", "title": "全量精度审计与保存", "chapter": "第 3 步 · 审计", "note": "88 件包围盒/中心/颜色;保存 E18", "target": 90, + "narration": "运行全量精度审计:八十八个部件的包围盒误差不超过一点五毫米,中心误差不超过三毫米,颜色每个通道误差不超过零点零二。审计通过后保存 E18 检查点,并写入课程证据。" }, + { "id": "S04", "title": "交付清单", "chapter": "第 4 步 · 收尾", "note": "FCStd + STEP/STL + 课程页 + 交互页", "target": 55, + "narration": "交付内容有四类:E18 检查点 FCStd,导出的 STEP 和 STL,图文课程页,以及整线交互查看页。GLB 原生导出在当前内核仍被拦截,这一点如实记录在缺口文档里,不影响交付。" } + ], + "lesson": { + "objectives": ["对 27 个模型 88 个部件做全量审计", "从 UI 导出 STEP/STL 到 OPFS", "保存 E18 交付检查点与证据", "理解 OPFS 与本地下载的边界"], + "parameters": [ + { "name": "模型数", "value": "27" }, + { "name": "部件数", "value": "88" }, + { "name": "部件包围盒容差", "value": "1.5 mm" }, + { "name": "中心容差", "value": "3 mm" }, + { "name": "颜色容差", "value": "每通道 0.02" }, + { "name": "导出目录", "value": "OPFS freecad-exports" } + ], + "checklist": ["88 个对象全部加载", "STEP 导出成功", "STL 导出成功", "全量精度审计通过", "E18 检查点与课程证据写入"], + "mistakes": ["未选中对象就点导出,得到空文件", "把 OPFS 文件当成已下载到本地", "审计时只检查新对象,漏掉前面工位"], + "exercise": "在 freecad-exports 列表里找到刚导出的 STEP/STL,记录文件名与大小。" + } +} diff --git a/web/tools/line-course/evidence/E01/ffprobe.json b/web/tools/line-course/evidence/E01/ffprobe.json new file mode 100644 index 00000000..a62bd245 --- /dev/null +++ b/web/tools/line-course/evidence/E01/ffprobe.json @@ -0,0 +1,259 @@ +{ + "mp4": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 3719168, + "duration": "242.133333", + "bit_rate": "267139", + "bits_per_raw_sample": "8", + "nb_frames": "7264", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 11625504, + "duration": "242.198000", + "bit_rate": "99482", + "nb_frames": "11355", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + ], + "format": { + "filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.mp4", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "mov,mp4,m4a,3gp,3g2,mj2", + "format_long_name": "QuickTime / MOV", + "start_time": "0.000000", + "duration": "242.198000", + "size": "11365401", + "bit_rate": "375408", + "probe_score": 100, + "tags": { + "major_brand": "isom", + "minor_version": "512", + "compatible_brands": "isomiso2avc1mp41", + "encoder": "Lavf60.16.100" + } + } + }, + "webm": { + "streams": [ + { + "index": 0, + "codec_name": "vp9", + "codec_long_name": "Google VP9", + "profile": "Profile 0", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": -99, + "color_range": "tv", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "VideoHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libvpx-vp9", + "DURATION": "00:04:02.133000000" + } + }, + { + "index": 1, + "codec_name": "opus", + "codec_long_name": "Opus (Opus Interactive Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 312, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": -7, + "start_time": "-0.007000", + "extradata_size": 19, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "SoundHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libopus", + "DURATION": "00:04:02.226000000" + } + } + ], + "format": { + "filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.webm", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "-0.007000", + "duration": "242.226000", + "size": "5437171", + "bit_rate": "179573", + "probe_score": 100, + "tags": { + "COMPATIBLE_BRANDS": "isomiso2avc1mp41", + "MAJOR_BRAND": "isom", + "MINOR_VERSION": "512", + "ENCODER": "Lavf60.16.100" + } + } + } +} diff --git a/web/tools/line-course/evidence/E01/verification.json b/web/tools/line-course/evidence/E01/verification.json new file mode 100644 index 00000000..85a357f7 --- /dev/null +++ b/web/tools/line-course/evidence/E01/verification.json @@ -0,0 +1,512 @@ +{ + "schema": "freecad-web-line-course/video-verification/v1", + "generatedAt": "2026-11-12T20:05:45.261Z", + "episode": "E01", + "title": "界面与产线参考模型", + "status": "passed", + "checks": [ + { + "name": "mp4 exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.mp4" + }, + { + "name": "webm exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.webm" + }, + { + "name": "vtt exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.zh.vtt" + }, + { + "name": "srt exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference.zh.srt" + }, + { + "name": "poster exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E01-ui-and-reference-poster.png" + }, + { + "name": "mp4 h264 1600x900", + "passed": true, + "detail": { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 3719168, + "duration": "242.133333", + "bit_rate": "267139", + "bits_per_raw_sample": "8", + "nb_frames": "7264", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + } + }, + { + "name": "mp4 aac audio", + "passed": true, + "detail": { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 11625504, + "duration": "242.198000", + "bit_rate": "99482", + "nb_frames": "11355", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + }, + { + "name": "webm vp9/opus", + "passed": true, + "detail": { + "video": "vp9", + "audio": "opus" + } + }, + { + "name": "duration in range", + "passed": true, + "detail": { + "duration": 242.198, + "range": [ + 180, + 480 + ] + } + }, + { + "name": "audio not silent", + "passed": true, + "detail": { + "mean": -25, + "max": -5.3 + } + }, + { + "name": "vtt cues", + "passed": true, + "detail": 21 + }, + { + "name": "media HTTP 200", + "passed": true, + "detail": { + "status": 200, + "type": "video/mp4", + "ranges": "bytes" + } + }, + { + "name": "media MIME", + "passed": true, + "detail": "video/mp4" + }, + { + "name": "media Accept-Ranges", + "passed": true, + "detail": "bytes" + }, + { + "name": "media Range 206", + "passed": true, + "detail": 206 + }, + { + "name": "media bad Range 416", + "passed": true, + "detail": 416 + }, + { + "name": "session exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/raw/E01/session.json" + }, + { + "name": "0 pageErrors", + "passed": true, + "detail": [] + }, + { + "name": "0 consoleErrors", + "passed": true, + "detail": [] + }, + { + "name": "stills exist", + "passed": true, + "detail": 6 + } + ], + "duration": 242.198, + "scenes": [ + { + "id": "S00", + "start": 0, + "end": 22.033, + "duration": 22.033, + "narration": 20.16 + }, + { + "id": "S01", + "start": 22.033, + "end": 67.067, + "duration": 45.033, + "narration": 22.032 + }, + { + "id": "S02", + "start": 67.067, + "end": 122.1, + "duration": 55.033, + "narration": 25.344 + }, + { + "id": "S03", + "start": 122.1, + "end": 172.133, + "duration": 50.033, + "narration": 24.648 + }, + { + "id": "S04", + "start": 172.133, + "end": 217.167, + "duration": 45.033, + "narration": 23.304 + }, + { + "id": "S05", + "start": 217.167, + "end": 242.2, + "duration": 25.033, + "narration": 16.872 + } + ], + "cues": 21, + "audio": { + "mean": -25, + "max": -5.3 + }, + "stills": [ + "S00-title.png", + "S01-interface.png", + "S02-reference.png", + "S03-cabinet.png", + "S04-units.png", + "S05-recap.png" + ], + "precision": null, + "checkpoint": null, + "mp4": { + "video": { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 3719168, + "duration": "242.133333", + "bit_rate": "267139", + "bits_per_raw_sample": "8", + "nb_frames": "7264", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + }, + "audio": { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 11625504, + "duration": "242.198000", + "bit_rate": "99482", + "nb_frames": "11355", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + }, + "webm": { + "video": { + "index": 0, + "codec_name": "vp9", + "codec_long_name": "Google VP9", + "profile": "Profile 0", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": -99, + "color_range": "tv", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "VideoHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libvpx-vp9", + "DURATION": "00:04:02.133000000" + } + }, + "audio": { + "index": 1, + "codec_name": "opus", + "codec_long_name": "Opus (Opus Interactive Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 312, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": -7, + "start_time": "-0.007000", + "extradata_size": 19, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "SoundHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libopus", + "DURATION": "00:04:02.226000000" + } + } + } +} diff --git a/web/tools/line-course/evidence/E02/ffprobe.json b/web/tools/line-course/evidence/E02/ffprobe.json new file mode 100644 index 00000000..2be6d560 --- /dev/null +++ b/web/tools/line-course/evidence/E02/ffprobe.json @@ -0,0 +1,259 @@ +{ + "mp4": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 4017664, + "duration": "261.566667", + "bit_rate": "492427", + "bits_per_raw_sample": "8", + "nb_frames": "7847", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 12558336, + "duration": "261.632000", + "bit_rate": "81042", + "nb_frames": "12265", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + ], + "format": { + "filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.mp4", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "mov,mp4,m4a,3gp,3g2,mj2", + "format_long_name": "QuickTime / MOV", + "start_time": "0.000000", + "duration": "261.632000", + "size": "19039999", + "bit_rate": "582191", + "probe_score": 100, + "tags": { + "major_brand": "isom", + "minor_version": "512", + "compatible_brands": "isomiso2avc1mp41", + "encoder": "Lavf60.16.100" + } + } + }, + "webm": { + "streams": [ + { + "index": 0, + "codec_name": "vp9", + "codec_long_name": "Google VP9", + "profile": "Profile 0", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": -99, + "color_range": "tv", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "VideoHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libvpx-vp9", + "DURATION": "00:04:21.566000000" + } + }, + { + "index": 1, + "codec_name": "opus", + "codec_long_name": "Opus (Opus Interactive Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 312, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": -7, + "start_time": "-0.007000", + "extradata_size": 19, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "SoundHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libopus", + "DURATION": "00:04:21.640000000" + } + } + ], + "format": { + "filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.webm", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "-0.007000", + "duration": "261.640000", + "size": "9592905", + "bit_rate": "293316", + "probe_score": 100, + "tags": { + "COMPATIBLE_BRANDS": "isomiso2avc1mp41", + "MAJOR_BRAND": "isom", + "MINOR_VERSION": "512", + "ENCODER": "Lavf60.16.100" + } + } + } +} diff --git a/web/tools/line-course/evidence/E02/verification.json b/web/tools/line-course/evidence/E02/verification.json new file mode 100644 index 00000000..747a116e --- /dev/null +++ b/web/tools/line-course/evidence/E02/verification.json @@ -0,0 +1,512 @@ +{ + "schema": "freecad-web-line-course/video-verification/v1", + "generatedAt": "2026-11-12T19:14:53.728Z", + "episode": "E02", + "title": "测量、单位与零件表", + "status": "passed", + "checks": [ + { + "name": "mp4 exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.mp4" + }, + { + "name": "webm exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.webm" + }, + { + "name": "vtt exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.zh.vtt" + }, + { + "name": "srt exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec.zh.srt" + }, + { + "name": "poster exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E02-measure-and-spec-poster.png" + }, + { + "name": "mp4 h264 1600x900", + "passed": true, + "detail": { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 4017664, + "duration": "261.566667", + "bit_rate": "492427", + "bits_per_raw_sample": "8", + "nb_frames": "7847", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + } + }, + { + "name": "mp4 aac audio", + "passed": true, + "detail": { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 12558336, + "duration": "261.632000", + "bit_rate": "81042", + "nb_frames": "12265", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + }, + { + "name": "webm vp9/opus", + "passed": true, + "detail": { + "video": "vp9", + "audio": "opus" + } + }, + { + "name": "duration in range", + "passed": true, + "detail": { + "duration": 261.632, + "range": [ + 180, + 480 + ] + } + }, + { + "name": "audio not silent", + "passed": true, + "detail": { + "mean": -26.1, + "max": -5.3 + } + }, + { + "name": "vtt cues", + "passed": true, + "detail": 18 + }, + { + "name": "media HTTP 200", + "passed": true, + "detail": { + "status": 200, + "type": "video/mp4", + "ranges": "bytes" + } + }, + { + "name": "media MIME", + "passed": true, + "detail": "video/mp4" + }, + { + "name": "media Accept-Ranges", + "passed": true, + "detail": "bytes" + }, + { + "name": "media Range 206", + "passed": true, + "detail": 206 + }, + { + "name": "media bad Range 416", + "passed": true, + "detail": 416 + }, + { + "name": "session exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/raw/E02/session.json" + }, + { + "name": "0 pageErrors", + "passed": true, + "detail": [] + }, + { + "name": "0 consoleErrors", + "passed": true, + "detail": [] + }, + { + "name": "stills exist", + "passed": true, + "detail": 6 + } + ], + "duration": 261.632, + "scenes": [ + { + "id": "S00", + "start": 0, + "end": 18.033, + "duration": 18.033, + "narration": 13.848 + }, + { + "id": "S01", + "start": 18.033, + "end": 58.067, + "duration": 40.033, + "narration": 18.744 + }, + { + "id": "S02", + "start": 58.067, + "end": 146.533, + "duration": 88.467, + "narration": 29.472 + }, + { + "id": "S03", + "start": 146.533, + "end": 201.567, + "duration": 55.033, + "narration": 20.424 + }, + { + "id": "S04", + "start": 201.567, + "end": 236.6, + "duration": 35.033, + "narration": 17.904 + }, + { + "id": "S05", + "start": 236.6, + "end": 261.633, + "duration": 25.033, + "narration": 15.192 + } + ], + "cues": 18, + "audio": { + "mean": -26.1, + "max": -5.3 + }, + "stills": [ + "S00-title.png", + "S01-reference.png", + "S02-table.png", + "S03-formula.png", + "S04-audit.png", + "S05-recap.png" + ], + "precision": null, + "checkpoint": null, + "mp4": { + "video": { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 4017664, + "duration": "261.566667", + "bit_rate": "492427", + "bits_per_raw_sample": "8", + "nb_frames": "7847", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + }, + "audio": { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 12558336, + "duration": "261.632000", + "bit_rate": "81042", + "nb_frames": "12265", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + }, + "webm": { + "video": { + "index": 0, + "codec_name": "vp9", + "codec_long_name": "Google VP9", + "profile": "Profile 0", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": -99, + "color_range": "tv", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "VideoHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libvpx-vp9", + "DURATION": "00:04:21.566000000" + } + }, + "audio": { + "index": 1, + "codec_name": "opus", + "codec_long_name": "Opus (Opus Interactive Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 312, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": -7, + "start_time": "-0.007000", + "extradata_size": 19, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "SoundHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libopus", + "DURATION": "00:04:21.640000000" + } + } + } +} diff --git a/web/tools/line-course/evidence/E03/ffprobe.json b/web/tools/line-course/evidence/E03/ffprobe.json new file mode 100644 index 00000000..1fab3d2a --- /dev/null +++ b/web/tools/line-course/evidence/E03/ffprobe.json @@ -0,0 +1,259 @@ +{ + "mp4": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 8023552, + "duration": "522.366667", + "bit_rate": "363911", + "bits_per_raw_sample": "8", + "nb_frames": "15671", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 25072608, + "duration": "522.346000", + "bit_rate": "46149", + "nb_frames": "24486", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + ], + "format": { + "filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.mp4", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "mov,mp4,m4a,3gp,3g2,mj2", + "format_long_name": "QuickTime / MOV", + "start_time": "0.000000", + "duration": "522.366667", + "size": "27350199", + "bit_rate": "418865", + "probe_score": 100, + "tags": { + "major_brand": "isom", + "minor_version": "512", + "compatible_brands": "isomiso2avc1mp41", + "encoder": "Lavf60.16.100" + } + } + }, + "webm": { + "streams": [ + { + "index": 0, + "codec_name": "vp9", + "codec_long_name": "Google VP9", + "profile": "Profile 0", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": -99, + "color_range": "tv", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "VideoHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libvpx-vp9", + "DURATION": "00:08:42.366000000" + } + }, + { + "index": 1, + "codec_name": "opus", + "codec_long_name": "Opus (Opus Interactive Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 312, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": -7, + "start_time": "-0.007000", + "extradata_size": 19, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "SoundHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libopus", + "DURATION": "00:08:42.354000000" + } + } + ], + "format": { + "filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.webm", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "-0.007000", + "duration": "522.366000", + "size": "14954458", + "bit_rate": "229026", + "probe_score": 100, + "tags": { + "COMPATIBLE_BRANDS": "isomiso2avc1mp41", + "MAJOR_BRAND": "isom", + "MINOR_VERSION": "512", + "ENCODER": "Lavf60.16.100" + } + } + } +} diff --git a/web/tools/line-course/evidence/E03/verification.json b/web/tools/line-course/evidence/E03/verification.json new file mode 100644 index 00000000..dad98ff8 --- /dev/null +++ b/web/tools/line-course/evidence/E03/verification.json @@ -0,0 +1,615 @@ +{ + "schema": "freecad-web-line-course/video-verification/v1", + "generatedAt": "2026-11-12T19:36:51.981Z", + "episode": "E03", + "title": "主控制柜", + "status": "passed", + "checks": [ + { + "name": "mp4 exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.mp4" + }, + { + "name": "webm exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.webm" + }, + { + "name": "vtt exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.zh.vtt" + }, + { + "name": "srt exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a.zh.srt" + }, + { + "name": "poster exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E03-cabinet-a-poster.png" + }, + { + "name": "mp4 h264 1600x900", + "passed": true, + "detail": { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 8023552, + "duration": "522.366667", + "bit_rate": "363911", + "bits_per_raw_sample": "8", + "nb_frames": "15671", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + } + }, + { + "name": "mp4 aac audio", + "passed": true, + "detail": { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 25072608, + "duration": "522.346000", + "bit_rate": "46149", + "nb_frames": "24486", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + }, + { + "name": "webm vp9/opus", + "passed": true, + "detail": { + "video": "vp9", + "audio": "opus" + } + }, + { + "name": "duration in range", + "passed": true, + "detail": { + "duration": 522.366667, + "range": [ + 300, + 900 + ] + } + }, + { + "name": "audio not silent", + "passed": true, + "detail": { + "mean": -28.7, + "max": -4.4 + } + }, + { + "name": "vtt cues", + "passed": true, + "detail": 20 + }, + { + "name": "media HTTP 200", + "passed": true, + "detail": { + "status": 200, + "type": "video/mp4", + "ranges": "bytes" + } + }, + { + "name": "media MIME", + "passed": true, + "detail": "video/mp4" + }, + { + "name": "media Accept-Ranges", + "passed": true, + "detail": "bytes" + }, + { + "name": "media Range 206", + "passed": true, + "detail": 206 + }, + { + "name": "media bad Range 416", + "passed": true, + "detail": 416 + }, + { + "name": "session exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/raw/E03/session.json" + }, + { + "name": "0 pageErrors", + "passed": true, + "detail": [] + }, + { + "name": "0 consoleErrors", + "passed": true, + "detail": [] + }, + { + "name": "stills exist", + "passed": true, + "detail": 7 + }, + { + "name": "checkpoint exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/checkpoints/E03.FCStd" + }, + { + "name": "precision profile", + "passed": true, + "detail": { + "objectCount": 8, + "extra": [], + "models": [], + "failures": [] + } + } + ], + "duration": 522.366667, + "scenes": [ + { + "id": "S00", + "start": 0, + "end": 22.033, + "duration": 22.033, + "narration": 20.088 + }, + { + "id": "S01", + "start": 22.033, + "end": 52.067, + "duration": 30.033, + "narration": 11.544 + }, + { + "id": "S02", + "start": 52.067, + "end": 152.1, + "duration": 100.033, + "narration": 22.8 + }, + { + "id": "S03", + "start": 152.1, + "end": 252.167, + "duration": 100.067, + "narration": 20.88 + }, + { + "id": "S04", + "start": 252.167, + "end": 352.233, + "duration": 100.067, + "narration": 16.896 + }, + { + "id": "S05", + "start": 352.233, + "end": 452.3, + "duration": 100.067, + "narration": 16.632 + }, + { + "id": "S06", + "start": 452.3, + "end": 522.367, + "duration": 70.067, + "narration": 19.968 + } + ], + "cues": 20, + "audio": { + "mean": -28.7, + "max": -4.4 + }, + "stills": [ + "S00-title.png", + "S01-document.png", + "S02-parts.png", + "S03-parts.png", + "S04-parts.png", + "S05-parts.png", + "S06-recap.png" + ], + "precision": { + "schema": "freecad-web-line-course/precision/v1", + "objectCount": 8, + "extra": [], + "results": [ + { + "name": "CabinetA_P01", + "label": "主控制柜 部件 1", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P02", + "label": "主控制柜 部件 2", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P03", + "label": "主控制柜 部件 3", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P04", + "label": "ZX-JX02-02-02A______________¹___001", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P05", + "label": "ZX-JX02-02-03____²_______________¹___097", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P06", + "label": "ZX-JX02-02-03____²_______________¹___105", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P07", + "label": "ZX-JX02-02-80______013", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P08", + "label": "ZX-JX02-02-80______015", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + } + ], + "models": [ + { + "name": "CabinetA", + "label": "主控制柜", + "parts": 8, + "ok": true, + "issues": [] + } + ], + "ok": true + }, + "checkpoint": "checkpoints/E03.FCStd", + "mp4": { + "video": { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 8023552, + "duration": "522.366667", + "bit_rate": "363911", + "bits_per_raw_sample": "8", + "nb_frames": "15671", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + }, + "audio": { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 25072608, + "duration": "522.346000", + "bit_rate": "46149", + "nb_frames": "24486", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + }, + "webm": { + "video": { + "index": 0, + "codec_name": "vp9", + "codec_long_name": "Google VP9", + "profile": "Profile 0", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": -99, + "color_range": "tv", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "VideoHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libvpx-vp9", + "DURATION": "00:08:42.366000000" + } + }, + "audio": { + "index": 1, + "codec_name": "opus", + "codec_long_name": "Opus (Opus Interactive Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 312, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": -7, + "start_time": "-0.007000", + "extradata_size": 19, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "SoundHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libopus", + "DURATION": "00:08:42.354000000" + } + } + } +} diff --git a/web/tools/line-course/evidence/E04/ffprobe.json b/web/tools/line-course/evidence/E04/ffprobe.json new file mode 100644 index 00000000..44390794 --- /dev/null +++ b/web/tools/line-course/evidence/E04/ffprobe.json @@ -0,0 +1,259 @@ +{ + "mp4": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 8036864, + "duration": "523.233333", + "bit_rate": "408909", + "bits_per_raw_sample": "8", + "nb_frames": "15697", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 25119984, + "duration": "523.333000", + "bit_rate": "41545", + "nb_frames": "24533", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + ], + "format": { + "filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.mp4", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "mov,mp4,m4a,3gp,3g2,mj2", + "format_long_name": "QuickTime / MOV", + "start_time": "0.000000", + "duration": "523.333000", + "size": "30037875", + "bit_rate": "459177", + "probe_score": 100, + "tags": { + "major_brand": "isom", + "minor_version": "512", + "compatible_brands": "isomiso2avc1mp41", + "encoder": "Lavf60.16.100" + } + } + }, + "webm": { + "streams": [ + { + "index": 0, + "codec_name": "vp9", + "codec_long_name": "Google VP9", + "profile": "Profile 0", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": -99, + "color_range": "tv", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "VideoHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libvpx-vp9", + "DURATION": "00:08:43.233000000" + } + }, + { + "index": 1, + "codec_name": "opus", + "codec_long_name": "Opus (Opus Interactive Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 312, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": -7, + "start_time": "-0.007000", + "extradata_size": 19, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "SoundHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libopus", + "DURATION": "00:08:43.357000000" + } + } + ], + "format": { + "filename": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.webm", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "-0.007000", + "duration": "523.357000", + "size": "16364008", + "bit_rate": "250139", + "probe_score": 100, + "tags": { + "COMPATIBLE_BRANDS": "isomiso2avc1mp41", + "MAJOR_BRAND": "isom", + "MINOR_VERSION": "512", + "ENCODER": "Lavf60.16.100" + } + } + } +} diff --git a/web/tools/line-course/evidence/E04/verification.json b/web/tools/line-course/evidence/E04/verification.json new file mode 100644 index 00000000..5ee4986b --- /dev/null +++ b/web/tools/line-course/evidence/E04/verification.json @@ -0,0 +1,686 @@ +{ + "schema": "freecad-web-line-course/video-verification/v1", + "generatedAt": "2026-11-12T20:00:33.833Z", + "episode": "E04", + "title": "长控制柜", + "status": "passed", + "checks": [ + { + "name": "mp4 exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.mp4" + }, + { + "name": "webm exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.webm" + }, + { + "name": "vtt exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.zh.vtt" + }, + { + "name": "srt exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b.zh.srt" + }, + { + "name": "poster exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/teaching/media/line-course/E04-cabinet-b-poster.png" + }, + { + "name": "mp4 h264 1600x900", + "passed": true, + "detail": { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 8036864, + "duration": "523.233333", + "bit_rate": "408909", + "bits_per_raw_sample": "8", + "nb_frames": "15697", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + } + }, + { + "name": "mp4 aac audio", + "passed": true, + "detail": { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 25119984, + "duration": "523.333000", + "bit_rate": "41545", + "nb_frames": "24533", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + }, + { + "name": "webm vp9/opus", + "passed": true, + "detail": { + "video": "vp9", + "audio": "opus" + } + }, + { + "name": "duration in range", + "passed": true, + "detail": { + "duration": 523.333, + "range": [ + 300, + 900 + ] + } + }, + { + "name": "audio not silent", + "passed": true, + "detail": { + "mean": -29.4, + "max": -5.4 + } + }, + { + "name": "vtt cues", + "passed": true, + "detail": 20 + }, + { + "name": "media HTTP 200", + "passed": true, + "detail": { + "status": 200, + "type": "video/mp4", + "ranges": "bytes" + } + }, + { + "name": "media MIME", + "passed": true, + "detail": "video/mp4" + }, + { + "name": "media Accept-Ranges", + "passed": true, + "detail": "bytes" + }, + { + "name": "media Range 206", + "passed": true, + "detail": 206 + }, + { + "name": "media bad Range 416", + "passed": true, + "detail": 416 + }, + { + "name": "session exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/raw/E04/session.json" + }, + { + "name": "0 pageErrors", + "passed": true, + "detail": [] + }, + { + "name": "0 consoleErrors", + "passed": true, + "detail": [] + }, + { + "name": "stills exist", + "passed": true, + "detail": 7 + }, + { + "name": "checkpoint exists", + "passed": true, + "detail": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/checkpoints/E04.FCStd" + }, + { + "name": "precision profile", + "passed": true, + "detail": { + "objectCount": 16, + "extra": [], + "models": [], + "failures": [] + } + } + ], + "duration": 523.333, + "scenes": [ + { + "id": "S00", + "start": 0, + "end": 18.033, + "duration": 18.033, + "narration": 13.896 + }, + { + "id": "S01", + "start": 18.033, + "end": 53.067, + "duration": 35.033, + "narration": 15.792 + }, + { + "id": "S02", + "start": 53.067, + "end": 153.1, + "duration": 100.033, + "narration": 18.288 + }, + { + "id": "S03", + "start": 153.1, + "end": 253.133, + "duration": 100.033, + "narration": 18.936 + }, + { + "id": "S04", + "start": 253.133, + "end": 353.2, + "duration": 100.067, + "narration": 16.056 + }, + { + "id": "S05", + "start": 353.2, + "end": 453.267, + "duration": 100.067, + "narration": 16.08 + }, + { + "id": "S06", + "start": 453.267, + "end": 523.333, + "duration": 70.067, + "narration": 17.232 + } + ], + "cues": 20, + "audio": { + "mean": -29.4, + "max": -5.4 + }, + "stills": [ + "S00-title.png", + "S01-start.png", + "S02-parts.png", + "S03-parts.png", + "S04-parts.png", + "S05-parts.png", + "S06-recap.png" + ], + "precision": { + "schema": "freecad-web-line-course/precision/v1", + "objectCount": 16, + "extra": [], + "results": [ + { + "name": "CabinetA_P01", + "label": "主控制柜 部件 1", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P02", + "label": "主控制柜 部件 2", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P03", + "label": "主控制柜 部件 3", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P04", + "label": "ZX-JX02-02-02A______________¹___001", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P05", + "label": "ZX-JX02-02-03____²_______________¹___097", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P06", + "label": "ZX-JX02-02-03____²_______________¹___105", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P07", + "label": "ZX-JX02-02-80______013", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetA_P08", + "label": "ZX-JX02-02-80______015", + "model": "CabinetA", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetB_P01", + "label": "长控制柜 部件 1", + "model": "CabinetB", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetB_P02", + "label": "长控制柜 部件 2", + "model": "CabinetB", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetB_P03", + "label": "长控制柜 部件 3", + "model": "CabinetB", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetB_P04", + "label": "ZX-JX02-02-02A______________¹___135", + "model": "CabinetB", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetB_P05", + "label": "长控制柜 部件 5", + "model": "CabinetB", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetB_P06", + "label": "ZX-JX02-02-03____²_______________¹___129", + "model": "CabinetB", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetB_P07", + "label": "ZX-JX02-02-03____²_______________¹___142", + "model": "CabinetB", + "tolerance": 1.5, + "ok": true, + "issues": [] + }, + { + "name": "CabinetB_P08", + "label": "ZX-JX02-02-80______016", + "model": "CabinetB", + "tolerance": 1.5, + "ok": true, + "issues": [] + } + ], + "models": [ + { + "name": "CabinetA", + "label": "主控制柜", + "parts": 8, + "ok": true, + "issues": [] + }, + { + "name": "CabinetB", + "label": "长控制柜", + "parts": 8, + "ok": true, + "issues": [] + } + ], + "ok": true + }, + "checkpoint": "checkpoints/E04.FCStd", + "mp4": { + "video": { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "pix_fmt": "yuv420p", + "level": 42, + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "id": "0x1", + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/15360", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 8036864, + "duration": "523.233333", + "bit_rate": "408909", + "bits_per_raw_sample": "8", + "nb_frames": "15697", + "extradata_size": 46, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]", + "encoder": "Lavc60.31.102 libx264" + } + }, + "audio": { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 0, + "id": "0x2", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 25119984, + "duration": "523.333000", + "bit_rate": "41545", + "nb_frames": "24533", + "extradata_size": 5, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + }, + "webm": { + "video": { + "index": 0, + "codec_name": "vp9", + "codec_long_name": "Google VP9", + "profile": "Profile 0", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1600, + "height": 900, + "coded_width": 1600, + "coded_height": 900, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": -99, + "color_range": "tv", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "r_frame_rate": "30/1", + "avg_frame_rate": "30/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "VideoHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libvpx-vp9", + "DURATION": "00:08:43.233000000" + } + }, + "audio": { + "index": 1, + "codec_name": "opus", + "codec_long_name": "Opus (Opus Interactive Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "initial_padding": 312, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": -7, + "start_time": "-0.007000", + "extradata_size": 19, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "non_diegetic": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "SoundHandler", + "VENDOR_ID": "[0][0][0][0]", + "ENCODER": "Lavc60.31.102 libopus", + "DURATION": "00:08:43.357000000" + } + } + } +} diff --git a/web/tools/line-course/evidence/assembly-page.json b/web/tools/line-course/evidence/assembly-page.json new file mode 100644 index 00000000..1dfbd447 --- /dev/null +++ b/web/tools/line-course/evidence/assembly-page.json @@ -0,0 +1,12 @@ +{ + "schema": "freecad-web-line-course/assembly-page/v1", + "url": "http://127.0.0.1:5190/cases/production-line-assembly.html", + "errors": [], + "failed": [], + "stats": { + "loaded": 88, + "models": 27 + }, + "filters": 28, + "ok": true +} diff --git a/web/tools/line-course/evidence/course-audit.json b/web/tools/line-course/evidence/course-audit.json new file mode 100644 index 00000000..f3bff430 --- /dev/null +++ b/web/tools/line-course/evidence/course-audit.json @@ -0,0 +1,588 @@ +{ + "schema": "freecad-web-line-course/course-audit/v1", + "generatedAt": "2026-11-12T19:33:10.216Z", + "models": 27, + "parts": 88, + "episodes": 18, + "mediaPassed": 2, + "verificationPassed": 2, + "pending": [ + "E03", + "E04", + "E05", + "E06", + "E07", + "E08", + "E09", + "E10", + "E11", + "E12", + "E13", + "E14", + "E15", + "E16", + "E17", + "E18" + ], + "detail": [ + { + "id": "E01", + "slug": "ui-and-reference", + "objects": 0, + "media": [ + { + "suffix": ".mp4", + "exists": true + }, + { + "suffix": ".webm", + "exists": true + }, + { + "suffix": ".zh.vtt", + "exists": true + }, + { + "suffix": ".zh.srt", + "exists": true + }, + { + "suffix": "-poster.png", + "exists": true + } + ], + "mediaOk": true, + "verification": "passed", + "checkpoint": null, + "ok": true + }, + { + "id": "E02", + "slug": "measure-and-spec", + "objects": 0, + "media": [ + { + "suffix": ".mp4", + "exists": true + }, + { + "suffix": ".webm", + "exists": true + }, + { + "suffix": ".zh.vtt", + "exists": true + }, + { + "suffix": ".zh.srt", + "exists": true + }, + { + "suffix": "-poster.png", + "exists": true + } + ], + "mediaOk": true, + "verification": "passed", + "checkpoint": null, + "ok": true + }, + { + "id": "E03", + "slug": "cabinet-a", + "objects": 8, + "media": [ + { + "suffix": ".mp4", + "exists": true + }, + { + "suffix": ".webm", + "exists": true + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E04", + "slug": "cabinet-b", + "objects": 8, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E05", + "slug": "doors-and-displays", + "objects": 5, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E06", + "slug": "hopper-and-raw-feeder", + "objects": 7, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E07", + "slug": "loader-and-conveyor", + "objects": 8, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E08", + "slug": "rotary-and-weigh", + "objects": 4, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E09", + "slug": "pick-feeder-and-gripper", + "objects": 8, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E10", + "slug": "pusher-and-store", + "objects": 7, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E11", + "slug": "sensor-bracket-inspector", + "objects": 4, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E12", + "slug": "assembly-and-inspection", + "objects": 4, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E13", + "slug": "lights-and-origin", + "objects": 8, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E14", + "slug": "abb-robot", + "objects": 11, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E15", + "slug": "robot-station-review", + "objects": 0, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E16", + "slug": "ground-and-lines", + "objects": 6, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + }, + { + "id": "E17", + "slug": "line-assembly", + "objects": 0, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": null, + "ok": false + }, + { + "id": "E18", + "slug": "audit-and-delivery", + "objects": 0, + "media": [ + { + "suffix": ".mp4", + "exists": false + }, + { + "suffix": ".webm", + "exists": false + }, + { + "suffix": ".zh.vtt", + "exists": false + }, + { + "suffix": ".zh.srt", + "exists": false + }, + { + "suffix": "-poster.png", + "exists": false + } + ], + "mediaOk": false, + "verification": null, + "checkpoint": true, + "ok": false + } + ], + "ok": false +} diff --git a/web/tools/line-course/evidence/course-page.json b/web/tools/line-course/evidence/course-page.json new file mode 100644 index 00000000..f1cf3dd8 --- /dev/null +++ b/web/tools/line-course/evidence/course-page.json @@ -0,0 +1,44 @@ +{ + "schema": "freecad-web-line-course/course-page/v1", + "generatedAt": "2026-11-12T19:32:57.513Z", + "viewports": [ + { + "viewport": { + "width": 1600, + "height": 900 + }, + "status": 200, + "errors": [], + "failed": [ + "404 http://127.0.0.1:5190/media/line-course/E03-cabinet-a-poster.png", + "404 http://127.0.0.1:5190/media/line-course/E03-cabinet-a.zh.vtt" + ], + "videos": 3, + "sources": 6, + "tracks": 3, + "episodes": 18, + "pending": 15, + "checkboxes": 18, + "overflow": 0 + }, + { + "viewport": { + "width": 390, + "height": 844 + }, + "status": 200, + "errors": [], + "failed": [ + "404 http://127.0.0.1:5190/media/line-course/E03-cabinet-a-poster.png", + "404 http://127.0.0.1:5190/media/line-course/E03-cabinet-a.zh.vtt" + ], + "videos": 3, + "sources": 6, + "tracks": 3, + "episodes": 18, + "pending": 15, + "checkboxes": 18, + "overflow": 0 + } + ] +} diff --git a/web/tools/line-course/evidence/course.json b/web/tools/line-course/evidence/course.json new file mode 100644 index 00000000..045eb26b --- /dev/null +++ b/web/tools/line-course/evidence/course.json @@ -0,0 +1,43 @@ +{ + "schema": "freecad-web-line-course/course-evidence/v1", + "generatedAt": "2026-11-12T18:52:22.645Z", + "objects": 88, + "models": 27, + "precisionOk": true, + "exports": [ + "Box001.step", + "Box001.stl" + ], + "log": [ + { + "at": "2026-11-12T18:52:03.285Z", + "step": "opened", + "objects": 88 + }, + { + "at": "2026-11-12T18:52:08.190Z", + "step": "export", + "format": "step", + "created": [ + "Box001.step" + ], + "status": "已写入 OPFS:Box001.step (7179 bytes)" + }, + { + "at": "2026-11-12T18:52:11.243Z", + "step": "export", + "format": "stl", + "created": [ + "Box001.stl" + ], + "status": "已写入 OPFS:Box001.stl (3052 bytes)" + }, + { + "at": "2026-11-12T18:52:16.270Z", + "step": "checkpoint", + "savedName": "web_project_document_3.FCStd", + "bytes": 89483, + "checkpoint": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/checkpoints/E18.FCStd" + } + ] +} diff --git a/web/tools/line-course/evidence/p0/reference-smoke.json b/web/tools/line-course/evidence/p0/reference-smoke.json new file mode 100644 index 00000000..1967a521 --- /dev/null +++ b/web/tools/line-course/evidence/p0/reference-smoke.json @@ -0,0 +1,23 @@ +{ + "ok": true, + "steps": [ + { + "step": "document", + "status": "Active document: project-document-3" + }, + { + "step": "panel", + "options": 27, + "footer": "17 个网格 · 包围盒 0.22 × 0.69 × 0.70 m" + }, + { + "step": "ground", + "footer": "6 个网格 · 包围盒 4.87 × 3.67 × 0.31 m" + } + ], + "options": 27, + "groundFooter": "6 个网格 · 包围盒 4.87 × 3.67 × 0.31 m", + "pageErrors": [], + "consoleErrors": [], + "screenshot": "/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course/spikes/line-reference-smoke.png" +} diff --git a/web/tools/line-course/evidence/reference-page.json b/web/tools/line-course/evidence/reference-page.json new file mode 100644 index 00000000..c87ab830 --- /dev/null +++ b/web/tools/line-course/evidence/reference-page.json @@ -0,0 +1,28 @@ +{ + "schema": "freecad-web-line-course/reference-page/v1", + "url": "http://127.0.0.1:5190/cases/production-line-reference.html", + "errors": [], + "failed": [], + "options": 27, + "first": { + "file": "ABB_IRB_120.glb", + "meshes": 17, + "size": [ + 0.21935981968278861, + 0.6875670778062306, + 0.6995870320032749 + ], + "stats": "17 个网格 · 包围盒 0.22 × 0.69 × 0.70 m" + }, + "ground": { + "file": "地面平面.glb", + "meshes": 6, + "size": [ + 4.86748194694519, + 3.673230024902511, + 0.3100616609702115 + ], + "stats": "6 个网格 · 包围盒 4.87 × 3.67 × 0.31 m" + }, + "ok": true +} diff --git a/web/tools/line-course/finalize-course.sh b/web/tools/line-course/finalize-course.sh new file mode 100644 index 00000000..8ec76bbf --- /dev/null +++ b/web/tools/line-course/finalize-course.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# After the E02-E18 media batch: re-record E01 with the menu fix, rebuild the +# course page, run the three page checks and the course audit. +set -u +ROOT=/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course +LOG="$ROOT/evidence/finalize.log" +: > "$LOG" +echo "=== E01 TTS $(date -Iseconds) ===" >> "$LOG" +node "$ROOT/generate-tts.mjs" --episode E01 >> "$LOG" 2>&1 || { echo "E01 TTS FAILED" >> "$LOG"; exit 1; } +echo "=== E01 RECORD $(date -Iseconds) ===" >> "$LOG" +DISPLAY=:2 node "$ROOT/record.mjs" --episode E01 >> "$LOG" 2>&1 || { echo "E01 RECORD FAILED" >> "$LOG"; exit 1; } +node "$ROOT/assemble.mjs" --episode E01 >> "$LOG" 2>&1 || { echo "E01 ASSEMBLE FAILED" >> "$LOG"; exit 1; } +node "$ROOT/verify.mjs" --episode E01 >> "$LOG" 2>&1 || { echo "E01 VERIFY FAILED" >> "$LOG"; exit 1; } +echo "=== E01 DONE $(date -Iseconds) ===" >> "$LOG" +node "$ROOT/build-course-page.mjs" >> "$LOG" 2>&1 +node "$ROOT/spikes/course-page-check.mjs" >> "$LOG" 2>&1 +node "$ROOT/spikes/reference-page-check.mjs" >> "$LOG" 2>&1 +node "$ROOT/spikes/assembly-page-check.mjs" >> "$LOG" 2>&1 +node "$ROOT/audit-course.mjs" >> "$LOG" 2>&1 +echo "=== ALL FINALIZED $(date -Iseconds) ===" >> "$LOG" diff --git a/web/tools/line-course/generate-tts.mjs b/web/tools/line-course/generate-tts.mjs new file mode 100644 index 00000000..b8d63149 --- /dev/null +++ b/web/tools/line-course/generate-tts.mjs @@ -0,0 +1,77 @@ +#!/usr/bin/env node +// Generates Chinese narration for one episode (or all) with edge-tts. +// Audio/SRT are cached per scene; durations feed assemble.mjs. +import fs from "node:fs"; +import path from "node:path"; +import { spawnSync } from "node:child_process"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const args = process.argv.slice(2); +const option = (name, fallback = "") => { + const index = args.indexOf(name); + return index < 0 ? fallback : args[index + 1] ?? fallback; +}; +const tts = "/home/mes123456/FreeCADWasmDev/working/FreeCAD/.venv-video/bin/edge-tts"; +const ffprobe = "ffprobe"; +const voices = ["zh-CN-XiaoxiaoNeural", "zh-CN-YunjianNeural", "zh-CN-YunxiNeural"]; + +function episodeIds() { + const requested = option("--episode"); + if (requested) return [requested]; + const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8")); + return course.episodes.map(episode => episode.id); +} + +function synthesize(episode) { + const episodeDir = path.join(here, "episodes", episode); + const scriptPath = path.join(episodeDir, "script.zh.json"); + if (!fs.existsSync(scriptPath)) throw new Error(`missing script ${scriptPath}`); + const script = JSON.parse(fs.readFileSync(scriptPath, "utf8")); + const audioDir = path.join(episodeDir, "audio"); + fs.mkdirSync(audioDir, { recursive: true }); + const durations = {}; + const voiceList = [script.voice, ...voices].filter(Boolean); + for (const scene of script.scenes) { + const media = path.join(audioDir, `${scene.id}.mp3`); + const subtitles = path.join(audioDir, `${scene.id}.srt`); + let ok = fs.existsSync(media) && fs.statSync(media).size > 1000 && fs.existsSync(subtitles); + let lastError = ""; + for (const voice of voiceList) { + for (let attempt = 0; attempt < 2 && !ok; attempt++) { + const result = spawnSync(tts, ["--voice", voice, `--rate=${script.rate ?? "-4%"}`, + "--text", scene.narration, "--write-media", media, "--write-subtitles", subtitles], + { encoding: "utf8", timeout: 120000 }); + if (result.status === 0 && fs.existsSync(media) && fs.statSync(media).size > 1000) { + ok = true; + console.log(JSON.stringify({ episode, scene: scene.id, voice, bytes: fs.statSync(media).size })); + } else { + lastError = `${result.status}: ${(result.stderr || result.stdout || "").slice(-300)}`; + console.log(JSON.stringify({ episode, scene: scene.id, voice, attempt, error: lastError })); + } + } + if (ok) break; + } + if (!ok) throw new Error(`TTS failed for ${episode}/${scene.id}: ${lastError}`); + const probe = spawnSync(ffprobe, ["-v", "error", "-show_entries", "format=duration", + "-of", "default=nw=1:nk=1", media], { encoding: "utf8" }); + const duration = Number(probe.stdout.trim()); + if (!Number.isFinite(duration) || duration <= 0) throw new Error(`Invalid duration for ${episode}/${scene.id}`); + durations[scene.id] = { + title: scene.title, target: scene.target, duration: Math.round(duration * 1000) / 1000, + media: path.relative(episodeDir, media), subtitles: path.relative(episodeDir, subtitles), + }; + } + fs.writeFileSync(path.join(episodeDir, "audio-durations.json"), `${JSON.stringify({ + schema: "freecad-web-line-course/video-tts/v1", + episode, generatedAt: new Date().toISOString(), + voice: script.voice, rate: script.rate, scenes: durations, + }, null, 2)}\n`); + return durations; +} + +const results = {}; +for (const episode of episodeIds()) { + results[episode] = synthesize(episode); +} +console.log(JSON.stringify({ ok: true, episodes: Object.keys(results), scenes: Object.values(results).reduce((sum, item) => sum + Object.keys(item).length, 0) })); diff --git a/web/tools/line-course/lib/assembly.mjs b/web/tools/line-course/lib/assembly.mjs new file mode 100644 index 00000000..40458b92 --- /dev/null +++ b/web/tools/line-course/lib/assembly.mjs @@ -0,0 +1,57 @@ +// Assembly helpers shared by the line-course E17 episode. +export async function executeCommand(page, command, payload, timeout = 300000) { + const before = await page.evaluate(() => window.__freecadWorkbenchState?.response?.requestId ?? null); + await page.locator(`button[data-help-page="${command}"]`).first().click(); + await page.locator("#payload-editor").fill(JSON.stringify(payload)); + await page.getByRole("button", { name: "执行选中命令" }).click(); + await page.waitForFunction(id => { + const response = window.__freecadWorkbenchState?.response; + return Boolean(response) && response.requestId !== id; + }, before, { timeout }); + const response = await page.evaluate(() => window.__freecadWorkbenchState?.response); + if (response?.kind !== "result") throw new Error(`${command}: ${response?.error?.code} ${response?.error?.message}`); + return response.result?.records?.find(record => record.status === "exposed")?.result ?? response.result; +} + +export async function createAssembly(page, { document = "LineAssembly", label = "生产线总装" } = {}) { + const create = page.getByRole("region", { name: "Create assembly" }); + await create.waitFor({ state: "visible", timeout: 60000 }); + await page.locator('input[aria-label="Assembly document name"]').fill(document); + await page.locator('input[aria-label="Assembly label"]').fill(label); + await create.getByRole("button", { name: "Create", exact: true }).click(); + const linksTask = page.getByRole("region", { name: "Insert assembly link" }); + await linksTask.waitFor({ state: "visible", timeout: 120000 }); + return linksTask; +} + +export async function insertLinks(page, linksTask, source = "line-course-E16.FCStd", expectedLinks = 27) { + await page.locator('select[aria-label="Insert link source file"]').selectOption(source); + await linksTask.getByRole("button", { name: "Load source", exact: true }).click(); + await page.waitForFunction(() => { + const select = document.querySelector('select[aria-label="Insert link source object"]'); + return select && select.options.length > 1; + }, null, { timeout: 180000 }); + const options = (await page.locator('select[aria-label="Insert link source object"] option').allTextContents()) + .filter(option => option && !option.startsWith("Choose")); + const select = page.locator('select[aria-label="Insert link source object"]'); + const list = linksTask.locator('ul[aria-label="Inserted links"] li'); + for (const option of options) { + await select.selectOption({ label: option }); + await page.waitForTimeout(350); + await linksTask.getByRole("button", { name: "Insert", exact: true }).click(); + await page.waitForTimeout(600); + } + await page.waitForTimeout(1200); + await linksTask.getByRole("button", { name: "Accept", exact: true }).click(); + await page.waitForTimeout(1500); + const items = await list.allTextContents(); + const linkNames = items.map(text => /→\s+([^(]+?)\s+\(/.exec(text)?.[1]?.trim()).filter(Boolean); + if (items.length !== expectedLinks) throw new Error(`expected ${expectedLinks} links, got ${items.length}`); + return { linkNames, items }; +} + +export async function buildAssembly(page, options = {}) { + const linksTask = await createAssembly(page, options); + const result = await insertLinks(page, linksTask, options.source, options.expectedLinks ?? 27); + return { document: options.document ?? "LineAssembly", ...result }; +} diff --git a/web/tools/line-course/lib/build.mjs b/web/tools/line-course/lib/build.mjs new file mode 100644 index 00000000..fa723c2e --- /dev/null +++ b/web/tools/line-course/lib/build.mjs @@ -0,0 +1,159 @@ +// Shared UI building blocks for the production-line course drivers. +import { closeTask, openGroup, openPartMenu, removeObject, renameSelected, + selectTreeLabel, simpleCopy, treeLabels } from "../../carrier-course/lib/ui-actions.mjs"; + +export const hex = color => `#${color.map(value => + Math.round(Math.min(1, Math.max(0, value)) * 255).toString(16).padStart(2, "0")).join("")}`; + +export function createBuilder({ page, rec, logStep }) { + const labels = () => treeLabels(page); + const pause = ms => page.waitForTimeout(ms); + + const applyLabel = async (from, to) => { + await selectTreeLabel(page, from); + const input = page.locator('input[aria-label="Object Label"]').first(); + await input.fill(to); + await input.press("Enter"); + await pause(700); + }; + + const place = async (label, part) => { + await selectTreeLabel(page, label); + await rec.clickSelector(page, 'button:has-text("Position")'); + await page.locator('input[aria-label="Position X"]').first().fill(String(part.position[0])); + await page.locator('input[aria-label="Position Y"]').first().fill(String(part.position[1])); + await page.locator('input[aria-label="Position Z"]').first().fill(String(part.position[2])); + const [ax, ay, az] = part.rotation.axis; + await page.locator('input[aria-label="Rotation axis X"]').first().fill(String(ax)); + await page.locator('input[aria-label="Rotation axis Y"]').first().fill(String(ay)); + await page.locator('input[aria-label="Rotation axis Z"]').first().fill(String(az)); + await page.locator('input[aria-label="Rotation angle"]').first().fill(String(part.rotation.angleDeg)); + await rec.clickSelector(page, 'button[aria-label="应用位置与旋转"]'); + await pause(1600); + await closeTask(page); + }; + + const setColor = async (label, color) => { + await selectTreeLabel(page, label); + const input = page.locator('input[aria-label="Object Color"]').first(); + if (await input.count()) { + await input.fill(hex(color)); + await input.dispatchEvent("change"); + await pause(500); + } + }; + + const createBox = async (label, dims, localPosition, rotation) => { + const before = await labels(); + await openPartMenu(page, rec); + await openGroup(page, "Primitives"); + await rec.clickSelector(page, 'button[data-command="Part_Box"]'); + await pause(800); + let created = null; + for (let attempt = 0; attempt < 20 && !created; attempt++) { + await pause(300); + created = (await labels()).find(item => !before.includes(item)) ?? null; + } + if (!created) throw new Error(`box ${label} not created`); + await selectTreeLabel(page, created); + await pause(300); + await page.locator('input[aria-label="Length"]').first().fill(String(dims[0])); + await page.locator('input[aria-label="Width"]').first().fill(String(dims[1])); + await page.locator('input[aria-label="Height"]').first().fill(String(dims[2])); + await rec.clickSelector(page, 'button:has-text("应用尺寸并重算")'); + await pause(1400); + await closeTask(page); + await applyLabel(created, label); + if (localPosition) { + await selectTreeLabel(page, label); + await rec.clickSelector(page, 'button:has-text("Position")'); + await page.locator('input[aria-label="Position X"]').first().fill(String(localPosition[0])); + await page.locator('input[aria-label="Position Y"]').first().fill(String(localPosition[1])); + await page.locator('input[aria-label="Position Z"]').first().fill(String(localPosition[2])); + if (rotation) { + await page.locator('input[aria-label="Rotation axis X"]').first().fill(String(rotation.axis[0])); + await page.locator('input[aria-label="Rotation axis Y"]').first().fill(String(rotation.axis[1])); + await page.locator('input[aria-label="Rotation axis Z"]').first().fill(String(rotation.axis[2])); + await page.locator('input[aria-label="Rotation angle"]').first().fill(String(rotation.angleDeg)); + } + await rec.clickSelector(page, 'button[aria-label="应用位置与旋转"]'); + await pause(900); + await closeTask(page); + } + logStep?.({ step: "box", label, dims, localPosition }); + return label; + }; + + const createCylinder = async (label, radius, height, localPosition, rotation) => { + const before = await labels(); + await openPartMenu(page, rec); + await openGroup(page, "Primitives"); + await rec.clickSelector(page, 'button[data-command="Part_Cylinder"]'); + await pause(800); + let created = null; + for (let attempt = 0; attempt < 20 && !created; attempt++) { + await pause(300); + created = (await labels()).find(item => !before.includes(item)) ?? null; + } + if (!created) throw new Error(`cylinder ${label} not created`); + await selectTreeLabel(page, created); + await applyLabel(created, label); + await selectTreeLabel(page, label); + for (const [name, value] of [["Property Radius", radius], ["Property Height", height]]) { + const input = page.locator(`input[aria-label="${name}"]`).first(); + if (await input.count()) { await input.fill(String(value)); await input.press("Tab"); await pause(600); } + } + await closeTask(page); + if (localPosition) { + await selectTreeLabel(page, label); + await rec.clickSelector(page, 'button:has-text("Position")'); + await page.locator('input[aria-label="Position X"]').first().fill(String(localPosition[0])); + await page.locator('input[aria-label="Position Y"]').first().fill(String(localPosition[1])); + await page.locator('input[aria-label="Position Z"]').first().fill(String(localPosition[2])); + if (rotation) { + await page.locator('input[aria-label="Rotation axis X"]').first().fill(String(rotation.axis[0])); + await page.locator('input[aria-label="Rotation axis Y"]').first().fill(String(rotation.axis[1])); + await page.locator('input[aria-label="Rotation axis Z"]').first().fill(String(rotation.axis[2])); + await page.locator('input[aria-label="Rotation angle"]').first().fill(String(rotation.angleDeg)); + } + await rec.clickSelector(page, 'button[aria-label="应用位置与旋转"]'); + await pause(900); + await closeTask(page); + } + logStep?.({ step: "cylinder", label, radius, height, localPosition }); + return label; + }; + + const compoundCopy = async (sources, name, baseLabels) => { + await openPartMenu(page, rec); + const group = page.locator("details.part-submenu").filter({ has: page.locator("summary", { hasText: /^Compound$/ }) }).first(); + if (!(await group.evaluate(element => element.open))) { await group.locator(":scope > summary").click(); await pause(300); } + await rec.clickSelector(page, '.part-command-menu button[data-command="Part_Compound"]'); + const task = page.getByRole("region", { name: "Compound tools" }); + await task.waitFor({ state: "visible", timeout: 30000 }); + for (const source of sources) { + const box = task.locator("label").filter({ hasText: source }).first().locator('input[type="checkbox"]').first(); + if (!(await box.isChecked())) await box.click(); + await pause(250); + } + await task.getByRole("button", { name: "Create compound feature", exact: true }).click(); + await pause(1400); + await closeTask(page); + const after = await labels(); + const compound = after.find(label => !baseLabels.includes(label) && !sources.includes(label)) ?? null; + if (!compound) throw new Error(`compound not created: ${JSON.stringify(after)}`); + await selectTreeLabel(page, compound); + await simpleCopy({ page, rec, source: compound }); + const copied = await labels(); + const copy = copied.find(label => label !== compound && label.startsWith(compound)) ?? null; + if (!copy) throw new Error(`compound copy not found: ${JSON.stringify(copied)}`); + await selectTreeLabel(page, copy); + await renameSelected(page, name); + await removeObject(page, rec, compound); + for (const source of sources) await removeObject(page, rec, source); + logStep?.({ step: "compound", compound, copy, name, labels: await labels() }); + return name; + }; + + return { labels, pause, place, setColor, createBox, createCylinder, compoundCopy, applyLabel }; +} diff --git a/web/tools/line-course/lib/line-precision.mjs b/web/tools/line-course/lib/line-precision.mjs new file mode 100644 index 00000000..ffc06643 --- /dev/null +++ b/web/tools/line-course/lib/line-precision.mjs @@ -0,0 +1,109 @@ +// Compares a built line-course checkpoint with line-spec.json. +// Geometry/centre come from the Node WASM probe (inspectFcstd); colours come +// from Document.xml's WebDisplayColor property, which the Web save persists. +import fs from "node:fs"; +import path from "node:path"; +import { execFileSync } from "node:child_process"; +import { fileURLToPath } from "node:url"; +import { inspectFcstd } from "../../carrier-course/lib/inspect.mjs"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const spec = JSON.parse(fs.readFileSync(path.join(here, "..", "line-spec.json"), "utf8")); +const partByName = new Map(spec.models.flatMap(model => + model.parts.map(part => [part.partName, { ...part, model: model.name }]))); +const modelByName = new Map(spec.models.map(model => [model.name, model])); + +const nearArray = (actual, expected, tolerance, label, issues) => { + if (!Array.isArray(actual) || actual.length !== expected.length) { + issues.push({ name: label, detail: { actual, expected } }); + return; + } + const worst = Math.max(...actual.map((value, index) => Math.abs(Number(value) - Number(expected[index])))); + if (!Number.isFinite(worst) || worst > tolerance) + issues.push({ name: label, detail: { actual, expected, worst, tolerance } }); +}; + +const parseHex = hex => { + const match = /^#?([0-9a-f]{6})$/i.exec(String(hex ?? "").trim()); + if (!match) return null; + const value = parseInt(match[1], 16); + return [(value >> 16) & 255, (value >> 8) & 255, value & 255].map(channel => channel / 255); +}; + +const readDocumentColors = filePath => { + const xml = execFileSync("/usr/bin/unzip", ["-p", filePath, "Document.xml"], + { encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }); + const colors = new Map(); + const objects = xml.split("]*>\s*]*>\s* Math.abs(value - expectedColor[index]))); + if (worst > 0.02) issues.push({ name: "color", detail: { actual: actualColor, expected: expectedColor, worst } }); + } + return { name: expected.partName, label: expected.label, model: expected.model, + tolerance: 1.5, ok: issues.length === 0, issues }; +} + +export async function checkLineCheckpoint(filePath, expectedNames) { + const { objects } = await inspectFcstd(filePath); + const byLabel = new Map(objects.map(object => [object.label, object])); + const colors = readDocumentColors(filePath); + const results = []; + for (const name of expectedNames) { + const expected = partByName.get(name); + if (!expected) throw new Error(`line-spec has no part ${name}`); + const actual = byLabel.get(name) ?? objects.find(object => object.name === name); + if (!actual) { + results.push({ name, ok: false, issues: [{ name: "missing", detail: expected.label }] }); + continue; + } + results.push(compareLinePart(expected, actual, colors.get(actual.label) ?? colors.get(actual.name))); + } + const extra = objects.filter(object => !expectedNames.includes(object.label)).map(object => object.label); + const built = objects.filter(object => expectedNames.includes(object.label)); + + const models = []; + for (const model of spec.models) { + const names = model.parts.map(part => part.partName).filter(partName => expectedNames.includes(partName)); + if (!names.length) continue; + const builtParts = built.filter(object => names.includes(object.label)); + const issues = []; + nearArray( + builtParts.length ? [0, 1, 2].map(axis => Math.min(...builtParts.map(object => object.bbox[axis]))) + .concat([0, 1, 2].map(axis => Math.max(...builtParts.map(object => object.bbox[axis + 3])))) : [], + [model.overallBBox[0], model.overallBBox[1], model.overallBBox[2], + model.overallBBox[3], model.overallBBox[4], model.overallBBox[5]], + model.parts.length <= 2 ? 2 : 5, "model-bbox", issues); + models.push({ name: model.name, label: model.label, parts: names.length, ok: issues.length === 0, issues }); + } + + return { + schema: "freecad-web-line-course/precision/v1", + objectCount: objects.length, + extra, + results, + models, + ok: results.every(result => result.ok) && extra.length === 0 && models.every(model => model.ok), + }; +} + +export function loadLineSpec() { return spec; } +export function lineModel(name) { return modelByName.get(name); } diff --git a/web/tools/line-course/lib/model-build.mjs b/web/tools/line-course/lib/model-build.mjs new file mode 100644 index 00000000..c285fa39 --- /dev/null +++ b/web/tools/line-course/lib/model-build.mjs @@ -0,0 +1,92 @@ +// Shared "build models -> save checkpoint -> precision" flow for line episodes. +// Scene ids: S00 title (driver), S01 document/checkpoint, S02.. build chunks of +// two parts, then S save. Episode scripts use the same ids. +import fs from "node:fs"; +import path from "node:path"; +import { saveCheckpoint } from "../../carrier-course/lib/ui-actions.mjs"; +import { createBuilder } from "./build.mjs"; +import { newDocument, spec } from "./ui.mjs"; +import { checkLineCheckpoint } from "./line-precision.mjs"; + +export async function buildEpisodeModels({ + page, rec, webRoot, rawDir, stillsDir, scene, shot, logStep, log = [], + episodeId, modelNames, freshDocument = false, +}) { + const course = JSON.parse(fs.readFileSync(path.join(webRoot, "tools", "line-course", "course.json"), "utf8")); + const episode = course.episodes.find(item => item.id === episodeId); + if (!episode) throw new Error(`course.json has no episode ${episodeId}`); + const parts = modelNames.flatMap(name => { + const model = spec().models.find(item => item.name === name); + if (!model) throw new Error(`line-spec has no model ${name}`); + return model.parts; + }); + const expectedNames = episode.checkpointObjects; + const builder = createBuilder({ page, rec, logStep }); + + await scene("S01", async () => { + if (freshDocument) { + await newDocument(page); + } else { + // Checkpoint loading is asynchronous; wait for the expected number of + // previous objects before creating anything, otherwise the new Box can + // be confused with an existing object (seen with COURSE_FAST=1). + const priorCount = expectedNames.length - parts.length; + for (let attempt = 0; attempt < 120; attempt++) { + const labels = await builder.labels(); + if (labels.filter(label => expectedNames.includes(label)).length >= priorCount) break; + await page.waitForTimeout(500); + } + } + logStep({ step: "start", episode: episodeId, labels: await builder.labels(), freshDocument }); + await shot("S01-start"); + }); + + const buildPart = async part => { + const dims = part.fcLocalDims; + if (part.primitive === "cylinder") { + // Use the average radius so slightly elliptical references stay inside + // the 1.5 mm bbox tolerance on both axes (ABB_P03: 219.36 x 214.92). + const radius = Math.max(0.1, (dims[0] + dims[1]) / 4); + const position = [part.center[0], part.center[1], part.position[2]]; + await builder.createCylinder(part.partName, radius, dims[2], position); + } else { + await builder.createBox(part.partName, dims, part.position); + } + await builder.setColor(part.partName, part.color); + logStep({ step: "part", name: part.partName, dims, position: part.position, + primitive: part.primitive, color: part.color }); + }; + + const sceneIds = []; + for (let index = 0; index < parts.length; index += 2) { + const id = `S${String(2 + index / 2).padStart(2, "0")}`; + sceneIds.push(id); + const slice = parts.slice(index, index + 2); + await scene(id, async () => { + for (const part of slice) await buildPart(part); + await shot(`${id}-parts`); + }); + } + + const saveId = `S${String(2 + sceneIds.length).padStart(2, "0")}`; + await scene(saveId, async () => { + const saved = await saveCheckpoint({ page, rec, webRoot, episode: episodeId, rawDir, + checkpointDir: path.join(webRoot, "tools", "line-course", "checkpoints"), + expectedLabels: expectedNames }); + logStep({ step: "checkpoint", ...saved }); + const checkpoint = path.join(webRoot, "tools", "line-course", "checkpoints", `${episodeId}.FCStd`); + const precision = await checkLineCheckpoint(checkpoint, expectedNames); + fs.writeFileSync(path.join(rawDir, `${episodeId}-precision.json`), `${JSON.stringify(precision, null, 2)}\n`); + if (!precision.ok) throw new Error(`precision failed: ${JSON.stringify({ extra: precision.extra, + models: precision.models.filter(item => !item.ok), + failures: precision.results.filter(item => !item.ok) })}`); + fs.writeFileSync(path.join(rawDir, `${episodeId}-state.json`), `${JSON.stringify({ + schema: `freecad-web-line-course/${episodeId}/state/v1`, + generatedAt: new Date().toISOString(), models: modelNames, parts: parts.map(part => part.partName), + precision, log, + }, null, 2)}\n`); + await shot(`${saveId}-recap`); + }); + + return { parts, expectedNames, sceneIds, saveId }; +} diff --git a/web/tools/line-course/lib/ui.mjs b/web/tools/line-course/lib/ui.mjs new file mode 100644 index 00000000..1383f5dc --- /dev/null +++ b/web/tools/line-course/lib/ui.mjs @@ -0,0 +1,81 @@ +// Shared project-page actions for the production-line course drivers. +import fs from "node:fs"; +import { fileURLToPath } from "node:url"; + +export const REFERENCE_DIR = "/home/mes123456/FreeCADWasmDev/working/GLTFmodel"; + +export const footerStatus = page => page.locator('footer [role="status"]').textContent().catch(() => ""); +export const treeLabels = page => page.locator(".fc-tree-text").allTextContents(); + +export async function newDocument(page) { + await page.locator('nav[aria-label="Application menus"] details').filter({ hasText: "File" }).locator("summary").click(); + await page.getByRole("button", { name: "新建 Document" }).click(); + await page.waitForTimeout(2000); + // The File details menu stays open otherwise and covers the tree/toolbar in + // every subsequent still; close it after creating the document. + await page.evaluate(() => { + for (const details of document.querySelectorAll('nav[aria-label="Application menus"] details[open]')) details.open = false; + }); + await page.waitForTimeout(250); +} + +export async function openFiles(page) { + await page.evaluate(() => { + const details = document.querySelector(".file-tools"); + if (details) details.open = true; + }); + await page.waitForTimeout(300); +} + +export async function importReference(page, file, timeoutSeconds = 180) { + await openFiles(page); + await page.locator('input[aria-label="Import SCAD, CSG, JT, PLMXML, STEPZ, 3MF or shape files"]').setInputFiles(file); + let status = ""; + for (let attempt = 0; attempt < timeoutSeconds; attempt++) { + await page.waitForTimeout(1000); + status = await footerStatus(page); + if (/Imported|failed|error|requires|cancel/i.test(status ?? "")) break; + } + return status; +} + +export async function orbit(page, dx, dy) { + const view = page.locator('[aria-label="Imported native 3D view"]').first(); + const box = await view.boundingBox(); + if (!box) return false; + const x = box.x + box.width / 2; const y = box.y + box.height / 2; + await page.mouse.move(x, y); + await page.mouse.down(); + await page.mouse.move(x + dx, y + dy, { steps: 18 }); + await page.mouse.up(); + await page.waitForTimeout(400); + return true; +} + +export const spec = () => JSON.parse(fs.readFileSync( + fileURLToPath(new URL("../line-spec.json", import.meta.url)), "utf8")); + +export const modelParts = name => { + const model = spec().models.find(item => item.name === name); + if (!model) throw new Error(`line-spec has no model ${name}`); + return model.parts; +}; + +export async function openLineReference(page) { + await page.getByRole("button", { name: "Toggle line reference viewer" }).click(); + const panel = page.getByRole("complementary", { name: "Line reference viewer" }); + await panel.waitFor({ state: "visible", timeout: 30000 }); + return panel; +} + +export async function selectReferenceModel(panel, page, label, expected = /个网格/) { + const select = panel.locator('select[aria-label="Reference model"]'); + await select.selectOption({ label }); + let footer = ""; + for (let attempt = 0; attempt < 100; attempt++) { + await page.waitForTimeout(500); + footer = await panel.locator("footer").textContent().catch(() => ""); + if (expected.test(footer ?? "")) return footer; + } + return footer; +} diff --git a/web/tools/line-course/line-inventory.md b/web/tools/line-course/line-inventory.md new file mode 100644 index 00000000..d6a30f97 --- /dev/null +++ b/web/tools/line-course/line-inventory.md @@ -0,0 +1,35 @@ +# 生产线参考零件表 + +生成时间:2026-11-12T18:03:40.094Z +模型数:27,教学部件数:88,三角面:996148 +整线包围盒(mm):-2439.8, -2032.8, -1039.2, 2714.3, 1844.2, 1473.6 + +| 模型 | 文件 | 部件 | 尺寸 mm | 部件明细 | +|---|---|---|---|---| +| ABB IRB 120 机器人 | ABB_IRB_120.glb | 11 | 219×688×700 | ABB_IRB_120_P01(box,215×217×177); ABB_IRB_120_P02(box,123×101×145); ABB_IRB_120_P03(cylinder,219×215×431); ABB_IRB_120_P04(box,116×234×188); ABB_IRB_120_P05(box,62×111×82); ABB_IRB_120_P06(box,127×193×93); ABB_IRB_120_P07(box,96×5×96); ABB_IRB_120_P08(box,70×28×70); ABB_IRB_120_P09(box,94×38×73); ABB_IRB_120_P10(box,53×70×40); ABB_IRB_120_P11(box,30×54×34) | +| 工具坐标系 | Tool.glb | 3 | 72×72×72 | ToolFrame_P01(box,68×9×9); ToolFrame_P02(box,9×68×9); ToolFrame_P03(cylinder,9×9×68) | +| 主控制柜 | 三柜子.glb | 8 | 1500×744×754 | CabinetA_P01(box,440×134×597); CabinetA_P02(box,1500×744×754); CabinetA_P03(box,440×134×597); CabinetA_P04(box,30×560×560); CabinetA_P05(box,40×560×40); CabinetA_P06(box,40×560×40); CabinetA_P07(box,440×30×560); CabinetA_P08(box,440×30×560) | +| 长控制柜 | 三柜子1.glb | 8 | 2970×774×774 | CabinetB_P01(box,440×134×597); CabinetB_P02(box,1500×744×754); CabinetB_P03(box,440×134×597); CabinetB_P04(box,2960×640×20); CabinetB_P05(box,540×640×600); CabinetB_P06(box,40×560×40); CabinetB_P07(box,40×560×40); CabinetB_P08(box,440×30×560) | +| 三色警示灯 | 三色灯.glb | 2 | 50×40×468 | StackLight_P01(box,50×40×228); StackLight_P02(cylinder,40×40×240) | +| 上料机构 | 上料.glb | 2 | 375×140×212 | Loader_P01(box,165×140×212); Loader_P02(box,320×40×30) | +| 传送带送料装置 | 传送带送料装置.glb | 6 | 614×270×205 | ConveyorFeeder_P01(box,508×100×69); ConveyorFeeder_P02(box,45×153×34); ConveyorFeeder_P03(box,497×170×174); ConveyorFeeder_P04(box,395×165×205); ConveyorFeeder_P05(box,120×89×22); ConveyorFeeder_P06(box,175×9×7) | +| 原料上料装置 | 原料上料.glb | 5 | 210×208×204 | RawFeeder_P01(box,85×56×190); RawFeeder_P02(box,77×27×16); RawFeeder_P03(box,50×83×197); RawFeeder_P04(box,210×208×186); RawFeeder_P05(box,68×56×100) | +| 原料装配平台 | 原料装配.glb | 3 | 498×145×338 | RawAssembly_P01(box,498×92×338); RawAssembly_P02(box,71×79×128); RawAssembly_P03(box,193×5×5) | +| 原点标记 | 原点.glb | 3 | 142×142×142 | OriginMarker_P01(box,133×18×18); OriginMarker_P02(box,18×133×18); OriginMarker_P03(cylinder,18×18×133) | +| 地面与地线 | 地面平面.glb | 2 | 4867×3673×310 | GroundPlane_P01(box,4867×3673×310); GroundPlane_P02(box,4855×1109×0) | +| 夹取送料装置 | 夹取送料装置.glb | 5 | 1026×277×455 | PickFeeder_P01(box,149×60×60); PickFeeder_P02(box,420×200×442); PickFeeder_P03(box,810×72×82); PickFeeder_P04(box,243×143×119); PickFeeder_P05(box,70×59×141) | +| 地面平面 001 | 平面.001.glb | 2 | 4867×3673×310 | Plane001_P01(box,4867×3673×310); Plane001_P02(box,4855×1109×0) | +| 地面平面 | 平面.glb | 2 | 4867×3673×310 | Plane_P01(box,4867×3673×310); Plane_P02(box,4855×1109×0) | +| 推料装置 | 推料装置.glb | 2 | 490×336×588 | Pusher_P01(box,490×230×85); Pusher_P02(box,150×336×533) | +| 料仓 | 料仓.glb | 2 | 280×250×200 | Hopper_P01(box,191×191×65); Hopper_P02(box,280×250×200) | +| 新版检测块 | 新版2.glb | 1 | 22×22×7 | SensorBlock_P01(box,22×22×7) | +| 旋转运送装置 | 旋转运送装置.glb | 2 | 537×536×202 | RotaryTransfer_P01(box,340×265×165); RotaryTransfer_P02(box,537×536×47) | +| 显示屏 A | 显示屏.glb | 2 | 249×161×312 | DisplayA_P01(box,249×161×312); DisplayA_P02(box,204×116×148) | +| 显示屏 B | 显示屏1.glb | 2 | 249×161×312 | DisplayB_P01(box,249×161×312); DisplayB_P02(box,204×116×148) | +| 柜门 | 柜门.glb | 1 | 30×560×560 | CabinetDoor_P01(box,30×560×560) | +| 检测台 | 检测台.glb | 1 | 75×148×325 | InspectionTable_P01(box,75×148×325) | +| 物料存储区 | 物料存储区.glb | 5 | 352×83×413 | MaterialStore_P01(box,40×40×30); MaterialStore_P02(box,352×83×413); MaterialStore_P03(box,40×40×30); MaterialStore_P04(box,40×40×30); MaterialStore_P05(box,40×40×30) | +| 称重平台 | 称重平台.glb | 2 | 200×199×175 | WeighPlatform_P01(box,200×199×170); WeighPlatform_P02(box,150×150×5) | +| 辅助夹爪 | 辅助夹爪.glb | 3 | 73×94×102 | AuxGripper_P01(box,73×94×38); AuxGripper_P02(box,40×53×70); AuxGripper_P03(box,34×30×54) | +| 运送支架 | 运送支架.glb | 1 | 60×114×310 | TransportBracket_P01(box,60×114×310) | +| 运送检测装置 | 运送检测装置.glb | 2 | 75×148×325 | TransportInspector_P01(box,75×148×325); TransportInspector_P02(cylinder,30×30×60) | diff --git a/web/tools/line-course/line-spec.json b/web/tools/line-course/line-spec.json new file mode 100644 index 00000000..9b6ffd19 --- /dev/null +++ b/web/tools/line-course/line-spec.json @@ -0,0 +1,5916 @@ +{ + "schema": "freecad-web-line-course/spec/v1", + "generatedAt": "2026-11-12T18:03:40.094Z", + "sourceDir": "/home/mes123456/FreeCADWasmDev/working/GLTFmodel", + "units": { + "sourceNumerics": "meters", + "target": "mm", + "upAxis": "Z-up (identity map, x*1000,y*1000,z*1000)" + }, + "modelCount": 27, + "partCount": 88, + "triangleCount": 996148, + "sceneBBox": [ + -2439.842, + -2032.821, + -1039.203, + 2714.334, + 1844.211, + 1473.587 + ], + "warnings": [], + "models": [ + { + "file": "ABB_IRB_120.glb", + "name": "ABB_IRB_120", + "label": "ABB IRB 120 机器人", + "sha256": "c5800d1b1c5b9e3efb45f09541cbd77a667e3f21d55c967967c4402a7d1d45ea", + "meshCount": 17, + "triangleCount": 102260, + "partBudget": 11, + "overallBBox": [ + -965.303, + -335.358, + 774, + -745.943, + 352.209, + 1473.587 + ], + "overallDims": [ + 219.36, + 687.567, + 699.587 + ], + "parts": [ + { + "partName": "ABB_IRB_120_P01", + "label": "ABB_IRB_120_JT1", + "primitive": "box", + "fcLocalDims": [ + 214.889, + 217.312, + 177 + ], + "position": [ + -963.333, + 33.697, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -963.333, + 33.697, + 774, + -748.444, + 251.009, + 951 + ], + "center": [ + -855.888, + 142.353, + 862.5 + ], + "color": [ + 0.0667, + 0.0667, + 0.0667 + ], + "colorLinear": [ + 0.0056, + 0.0056, + 0.0056 + ], + "colorSource": "textureAvg", + "material": "黑色车漆_Baked.001", + "meshCount": 1, + "triangleCount": 7665, + "nodeNames": [ + "ABB_IRB_120_JT1" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1" + ] + }, + { + "partName": "ABB_IRB_120_P02", + "label": "ABB IRB 120 机器人 部件 2", + "primitive": "box", + "fcLocalDims": [ + 123, + 101.2, + 145 + ], + "position": [ + -917.373, + 251.009, + 778.001 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -917.373, + 251.009, + 778.001, + -794.373, + 352.209, + 923.001 + ], + "center": [ + -855.873, + 301.609, + 850.501 + ], + "color": [ + 0.4744, + 0.4744, + 0.4744 + ], + "colorLinear": [ + 0.1911, + 0.1911, + 0.1911 + ], + "colorSource": "textureAvg", + "material": "清洁不锈钢", + "meshCount": 2, + "triangleCount": 20586, + "nodeNames": [ + "Entity-149001", + "Entity-149001_1" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "Mesh_1223497002", + "Entity-149001" + ] + }, + { + "partName": "ABB_IRB_120_P03", + "label": "ABB IRB 120 机器人 部件 3", + "primitive": "cylinder", + "fcLocalDims": [ + 219.36, + 214.92, + 431.168 + ], + "position": [ + -965.303, + 33.549, + 951 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -965.303, + 33.549, + 951, + -745.943, + 248.469, + 1382.168 + ], + "center": [ + -855.623, + 141.009, + 1166.584 + ], + "color": [ + 0.8, + 0.8, + 0.8 + ], + "colorLinear": [ + 0.6038, + 0.6038, + 0.6038 + ], + "colorSource": "baseColorFactor", + "material": "abb白色高粗糙度", + "meshCount": 2, + "triangleCount": 18207, + "nodeNames": [ + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2" + ] + }, + { + "partName": "ABB_IRB_120_P04", + "label": "ABB IRB 120 机器人 部件 4", + "primitive": "box", + "fcLocalDims": [ + 115.5, + 234.013, + 188.114 + ], + "position": [ + -921.373, + -3.591, + 1285.473 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -921.373, + -3.591, + 1285.473, + -805.873, + 230.422, + 1473.587 + ], + "center": [ + -863.623, + 113.416, + 1379.53 + ], + "color": [ + 0.8, + 0.8, + 0.8 + ], + "colorLinear": [ + 0.6038, + 0.6038, + 0.6038 + ], + "colorSource": "baseColorFactor", + "material": "abb白色高粗糙度.002", + "meshCount": 2, + "triangleCount": 16136, + "nodeNames": [ + "ABB_IRB_120_JT4", + "Mesh_198026002" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4" + ] + }, + { + "partName": "ABB_IRB_120_P05", + "label": "ABB_IRB_120_JT6", + "primitive": "box", + "fcLocalDims": [ + 62, + 110.5, + 82 + ], + "position": [ + -886.873, + -205.491, + 1363 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -886.873, + -205.491, + 1363, + -824.873, + -94.991, + 1445 + ], + "center": [ + -855.873, + -150.241, + 1404 + ], + "color": [ + 0.8, + 0.8, + 0.8 + ], + "colorLinear": [ + 0.6038, + 0.6038, + 0.6038 + ], + "colorSource": "baseColorFactor", + "material": "abb白色高粗糙度.004", + "meshCount": 1, + "triangleCount": 5158, + "nodeNames": [ + "ABB_IRB_120_JT6" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6" + ] + }, + { + "partName": "ABB_IRB_120_P06", + "label": "ABB IRB 120 机器人 部件 6", + "primitive": "box", + "fcLocalDims": [ + 126.943, + 193.48, + 92.955 + ], + "position": [ + -919.81, + -201.071, + 1358.045 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -919.81, + -201.071, + 1358.045, + -792.867, + -7.591, + 1451 + ], + "center": [ + -856.338, + -104.331, + 1404.523 + ], + "color": [ + 0.8, + 0.8, + 0.8 + ], + "colorLinear": [ + 0.6038, + 0.6038, + 0.6038 + ], + "colorSource": "baseColorFactor", + "material": "abb白色高粗糙度.003", + "meshCount": 2, + "triangleCount": 10208, + "nodeNames": [ + "Entity-119001", + "Entity-119001_1" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "Entity-119001" + ] + }, + { + "partName": "ABB_IRB_120_P07", + "label": "Mesh_195968002", + "primitive": "box", + "fcLocalDims": [ + 95.916, + 5, + 95.958 + ], + "position": [ + -913.373, + -8.591, + 1356.021 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -913.373, + -8.591, + 1356.021, + -817.457, + -3.591, + 1451.979 + ], + "center": [ + -865.415, + -6.091, + 1404 + ], + "color": [ + 0.0667, + 0.0667, + 0.0667 + ], + "colorLinear": [ + 0.0056, + 0.0056, + 0.0056 + ], + "colorSource": "textureAvg", + "material": "黑色车漆_Baked.004", + "meshCount": 1, + "triangleCount": 224, + "nodeNames": [ + "Mesh_195968002" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "Mesh_195968002" + ] + }, + { + "partName": "ABB_IRB_120_P08", + "label": "ABB IRB 120 机器人 部件 8", + "primitive": "box", + "fcLocalDims": [ + 69.984, + 27.5, + 70 + ], + "position": [ + -890.857, + -232.991, + 1369 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -890.857, + -232.991, + 1369, + -820.873, + -205.491, + 1439 + ], + "center": [ + -855.865, + -219.241, + 1404 + ], + "color": [ + 0.0667, + 0.0667, + 0.0667 + ], + "colorLinear": [ + 0.0056, + 0.0056, + 0.0056 + ], + "colorSource": "textureAvg", + "material": "黑色车漆_Baked.003", + "meshCount": 2, + "triangleCount": 7176, + "nodeNames": [ + "ABB_IRB_120_JT7", + "Mesh_1327679002" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6", + "ABB_IRB_120_JT7" + ] + }, + { + "partName": "ABB_IRB_120_P09", + "label": "机器人夹爪", + "primitive": "box", + "fcLocalDims": [ + 94.258, + 38.04, + 73.312 + ], + "position": [ + -903, + -271.031, + 1367.344 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -903, + -271.031, + 1367.344, + -808.742, + -232.991, + 1440.656 + ], + "center": [ + -855.871, + -252.011, + 1404 + ], + "color": [ + 0.8633, + 0.9046, + 0.9386 + ], + "colorLinear": [ + 0.7167, + 0.7965, + 0.866 + ], + "colorSource": "baseColorFactor", + "material": "白钢.002", + "meshCount": 1, + "triangleCount": 13214, + "nodeNames": [ + "机器人夹爪" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6", + "ABB_IRB_120_JT7", + "机器人夹爪" + ] + }, + { + "partName": "ABB_IRB_120_P10", + "label": "ABB IRB 120 机器人 部件 10", + "primitive": "box", + "fcLocalDims": [ + 53.072, + 70.027, + 40 + ], + "position": [ + -888.057, + -335.358, + 1385.037 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -888.057, + -335.358, + 1385.037, + -834.985, + -265.331, + 1425.037 + ], + "center": [ + -861.521, + -300.345, + 1405.037 + ], + "color": [ + 0.7146, + 0.7145, + 0.7145 + ], + "colorLinear": [ + 0.4691, + 0.4689, + 0.4689 + ], + "colorSource": "baseColorFactor", + "material": "钢", + "meshCount": 2, + "triangleCount": 2218, + "nodeNames": [ + "夹爪003", + "机器人的料001" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6", + "ABB_IRB_120_JT7", + "机器人夹爪", + "夹爪003" + ] + }, + { + "partName": "ABB_IRB_120_P11", + "label": "夹爪1002", + "primitive": "box", + "fcLocalDims": [ + 29.874, + 53.9, + 34.133 + ], + "position": [ + -853.297, + -319.231, + 1387.817 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -853.297, + -319.231, + 1387.817, + -823.423, + -265.331, + 1421.95 + ], + "center": [ + -838.36, + -292.281, + 1404.884 + ], + "color": [ + 0.7146, + 0.7145, + 0.7145 + ], + "colorLinear": [ + 0.4691, + 0.4689, + 0.4689 + ], + "colorSource": "baseColorFactor", + "material": "钢.001", + "meshCount": 1, + "triangleCount": 1468, + "nodeNames": [ + "夹爪1002" + ], + "chain": [ + "ABB_IRB_120", + "ABB_IRB_120_JT1", + "ABB_IRB_120_JT2", + "ABB_IRB_120_JT3", + "ABB_IRB_120_JT4", + "ABB_IRB_120_JT5", + "ABB_IRB_120_JT6", + "ABB_IRB_120_JT7", + "机器人夹爪", + "夹爪1002" + ] + } + ] + }, + { + "file": "Tool.glb", + "name": "ToolFrame", + "label": "工具坐标系", + "sha256": "b477e465100b57f3ac70a33a4d73256499b245f21c1645b9afcf5b6ebde1f8c2", + "meshCount": 6, + "triangleCount": 108, + "partBudget": 3, + "overallBBox": [ + -4.515, + -4.515, + -4.515, + 67.729, + 67.729, + 67.729 + ], + "overallDims": [ + 72.244, + 72.244, + 72.244 + ], + "parts": [ + { + "partName": "ToolFrame_P01", + "label": "X", + "primitive": "box", + "fcLocalDims": [ + 67.729, + 9.03, + 9.03 + ], + "position": [ + 0, + -4.515, + -4.515 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 0, + -4.515, + -4.515, + 67.729, + 4.515, + 4.515 + ], + "center": [ + 33.865, + 0, + 0 + ], + "color": [ + 1, + 0, + 0 + ], + "colorLinear": [ + 1, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "material-1", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "X" + ], + "chain": [ + "Tool", + "X" + ] + }, + { + "partName": "ToolFrame_P02", + "label": "Y", + "primitive": "box", + "fcLocalDims": [ + 9.03, + 67.729, + 9.03 + ], + "position": [ + -4.515, + 0, + -4.515 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -4.515, + 0, + -4.515, + 4.515, + 67.729, + 4.515 + ], + "center": [ + 0, + 33.865, + 0 + ], + "color": [ + 0, + 1, + 0 + ], + "colorLinear": [ + 0, + 1, + 0 + ], + "colorSource": "baseColorFactor", + "material": "material-3", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "Y" + ], + "chain": [ + "Tool", + "Y" + ] + }, + { + "partName": "ToolFrame_P03", + "label": "Z", + "primitive": "cylinder", + "fcLocalDims": [ + 9.03, + 9.03, + 67.729 + ], + "position": [ + -4.515, + -4.515, + 0 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -4.515, + -4.515, + 0, + 4.515, + 4.515, + 67.729 + ], + "center": [ + 0, + 0, + 33.865 + ], + "color": [ + 0, + 0, + 1 + ], + "colorLinear": [ + 0, + 0, + 1 + ], + "colorSource": "baseColorFactor", + "material": "material-5", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "Z" + ], + "chain": [ + "Tool", + "Z" + ] + } + ] + }, + { + "file": "三柜子.glb", + "name": "CabinetA", + "label": "主控制柜", + "sha256": "fe87a0f121346b2eb3cebad29c460bee80446c1993c8551af95bdef85401bbcb", + "meshCount": 56, + "triangleCount": 194304, + "partBudget": 8, + "overallBBox": [ + -34.991, + -214.285, + 0, + 1464.941, + 529.94, + 754 + ], + "overallDims": [ + 1499.932, + 744.225, + 754 + ], + "parts": [ + { + "partName": "CabinetA_P01", + "label": "主控制柜 部件 1", + "primitive": "box", + "fcLocalDims": [ + 440, + 134.284, + 597 + ], + "position": [ + 15.003, + -214.285, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 15.003, + -214.285, + 154, + 455.003, + -80.001, + 751 + ], + "center": [ + 235.003, + -147.143, + 452.5 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.010", + "meshCount": 16, + "triangleCount": 44624, + "nodeNames": [ + "__22_______P740865012", + "__22_______P740865012_1", + "__22_______P740865012_2", + "__22_______P740865012_3", + "__22_______P740865012_4", + "__22_______P740865012_5", + "__22___P2053", + "KONGQIKG025", + "KONGQIKG026", + "ZX-JX02-02-63____¹_____013", + "ZX-JX02-02-22____¹_____049", + "ZX-JX02-02-22____¹_____052" + ], + "chain": [ + "三柜子", + "__22_______P013", + "__22_______P740865012" + ] + }, + { + "partName": "CabinetA_P02", + "label": "主控制柜 部件 2", + "primitive": "box", + "fcLocalDims": [ + 1499.932, + 744.225, + 754 + ], + "position": [ + -34.991, + -214.285, + 0 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -34.991, + -214.285, + 0, + 1464.941, + 529.94, + 754 + ], + "center": [ + 714.975, + 157.828, + 377 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.004", + "meshCount": 20, + "triangleCount": 99424, + "nodeNames": [ + "__22_______P740865013", + "__22_______P740865013_1", + "__22_______P740865013_2", + "__22_______P740865013_3", + "__22_______P740865013_4", + "__22_______P740865013_5", + "__22___P2054", + "KONGQIKG027", + "ZX-JX02-02-22____¹_____053", + "ZX-JX02-02-22____¹_____056", + "KONGQIKG028", + "zb4_bk1213690782027" + ], + "chain": [ + "三柜子", + "__22_______P014", + "__22_______P740865013" + ] + }, + { + "partName": "CabinetA_P03", + "label": "主控制柜 部件 3", + "primitive": "box", + "fcLocalDims": [ + 440, + 134.284, + 597 + ], + "position": [ + 975.003, + -214.285, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 975.003, + -214.285, + 154, + 1415.003, + -80.001, + 751 + ], + "center": [ + 1195.003, + -147.143, + 452.5 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.012", + "meshCount": 15, + "triangleCount": 43044, + "nodeNames": [ + "__22_______P740865014", + "__22_______P740865014_1", + "__22_______P740865014_2", + "__22_______P740865014_3", + "__22_______P740865014_4", + "__22_______P740865014_5", + "__22___P2057", + "KONGQIKG029", + "ZX-JX02-02-22____¹_____057", + "ZX-JX02-02-22____¹_____060", + "KONGQIKG030", + "zb4_bk1213690782028" + ], + "chain": [ + "三柜子", + "__22_______P015", + "__22_______P740865014" + ] + }, + { + "partName": "CabinetA_P04", + "label": "ZX-JX02-02-02A______________¹___001", + "primitive": "box", + "fcLocalDims": [ + 30, + 560, + 560 + ], + "position": [ + 1425.003, + -80.001, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1425.003, + -80.001, + 154, + 1455.003, + 479.999, + 714 + ], + "center": [ + 1440.003, + 199.999, + 434 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.006", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-02A______________¹___001" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-02A______________¹___001" + ] + }, + { + "partName": "CabinetA_P05", + "label": "ZX-JX02-02-03____²_______________¹___097", + "primitive": "box", + "fcLocalDims": [ + 40, + 560, + 40 + ], + "position": [ + -24.997, + -80.001, + 114 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -24.997, + -80.001, + 114, + 15.003, + 479.999, + 154 + ], + "center": [ + -4.997, + 199.999, + 134 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.005", + "meshCount": 1, + "triangleCount": 1728, + "nodeNames": [ + "ZX-JX02-02-03____²_______________¹___097" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-03____²_______________¹___097" + ] + }, + { + "partName": "CabinetA_P06", + "label": "ZX-JX02-02-03____²_______________¹___105", + "primitive": "box", + "fcLocalDims": [ + 40, + 560, + 40 + ], + "position": [ + 935.003, + -80.001, + 714 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 935.003, + -80.001, + 714, + 975.003, + 479.999, + 754 + ], + "center": [ + 955.003, + 199.999, + 734 + ], + "color": [ + 0.898, + 0.9137, + 0.9255 + ], + "colorLinear": [ + 0.7835, + 0.8148, + 0.8388 + ], + "colorSource": "baseColorFactor", + "material": "Material27.014", + "meshCount": 1, + "triangleCount": 1728, + "nodeNames": [ + "ZX-JX02-02-03____²_______________¹___105" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-03____²_______________¹___105" + ] + }, + { + "partName": "CabinetA_P07", + "label": "ZX-JX02-02-80______013", + "primitive": "box", + "fcLocalDims": [ + 440, + 30, + 560 + ], + "position": [ + 15.003, + 489.999, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 15.003, + 489.999, + 154, + 455.003, + 519.999, + 714 + ], + "center": [ + 235.003, + 504.999, + 434 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.010", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-80______013" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-80______013" + ] + }, + { + "partName": "CabinetA_P08", + "label": "ZX-JX02-02-80______015", + "primitive": "box", + "fcLocalDims": [ + 440, + 30, + 560 + ], + "position": [ + 975.003, + 489.999, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 975.003, + 489.999, + 154, + 1415.003, + 519.999, + 714 + ], + "center": [ + 1195.003, + 504.999, + 434 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.012", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-80______015" + ], + "chain": [ + "三柜子", + "ZX-JX02-02-80______015" + ] + } + ] + }, + { + "file": "三柜子1.glb", + "name": "CabinetB", + "label": "长控制柜", + "sha256": "555eed4ab247c5cf01095ce1eafc77208f48082bb889cbc57fda9058c7ced7df", + "meshCount": 53, + "triangleCount": 209556, + "partBudget": 8, + "overallBBox": [ + -1514.908, + -214.241, + 0, + 1455.086, + 560.042, + 774.001 + ], + "overallDims": [ + 2969.994, + 774.283, + 774.001 + ], + "parts": [ + { + "partName": "CabinetB_P01", + "label": "长控制柜 部件 1", + "primitive": "box", + "fcLocalDims": [ + 440, + 134.283, + 597 + ], + "position": [ + -1464.914, + -214.241, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1464.914, + -214.241, + 154, + -1024.914, + -79.958, + 751 + ], + "center": [ + -1244.914, + -147.099, + 452.5 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.001", + "meshCount": 13, + "triangleCount": 45364, + "nodeNames": [ + "__22_______P740865015", + "__22_______P740865015_1", + "__22___P3063", + "________018", + "KA016", + "KONGQIKG031", + "ZX-JX02-02-63____¹_____016", + "KONGQIKG032", + "ZX-JX02-02-22____¹_____061", + "ZX-JX02-02-22____¹_____064", + "zb4_bk1213690782032", + "zb4_bk1213690782032_1" + ], + "chain": [ + "三柜子1", + "__22_______P016", + "__22_______P740865015" + ] + }, + { + "partName": "CabinetB_P02", + "label": "长控制柜 部件 2", + "primitive": "box", + "fcLocalDims": [ + 1499.932, + 744.224, + 754 + ], + "position": [ + -1514.908, + -214.241, + 0 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1514.908, + -214.241, + 0, + -14.976, + 529.983, + 754 + ], + "center": [ + -764.942, + 157.871, + 377 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.001", + "meshCount": 17, + "triangleCount": 98216, + "nodeNames": [ + "__22_______P740865016", + "__22_______P740865016_1", + "__22___P3064", + "KA017", + "KONGQIKG033", + "ZX-JX02-02-63____¹_____017", + "KONGQIKG034", + "ZX-JX02-02-22____¹_____065", + "ZX-JX02-02-22____¹_____068", + "zb4_bk1213690782031", + "zb4_bk1213690782031_1", + "________019" + ], + "chain": [ + "三柜子1", + "__22_______P017", + "__22_______P740865016" + ] + }, + { + "partName": "CabinetB_P03", + "label": "长控制柜 部件 3", + "primitive": "box", + "fcLocalDims": [ + 440, + 134.283, + 597 + ], + "position": [ + -504.914, + -214.241, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -504.914, + -214.241, + 154, + -64.914, + -79.958, + 751 + ], + "center": [ + -284.914, + -147.099, + 452.5 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑", + "meshCount": 15, + "triangleCount": 47208, + "nodeNames": [ + "__22_______P740865017", + "__22_______P740865017_1", + "__22___P2069", + "KA018", + "KONGQIKG035", + "ZX-JX02-02-63____¹_____018", + "KONGQIKG036", + "ZX-JX02-02-22____¹_____069", + "ZX-JX02-02-22____¹_____072", + "ZX-JX02-02-64PLC¹_____006", + "zb4_bk1213690782034", + "zb4_bk1213690782034_1" + ], + "chain": [ + "三柜子1", + "__22_______P018", + "__22_______P740865017" + ] + }, + { + "partName": "CabinetB_P04", + "label": "ZX-JX02-02-02A______________¹___135", + "primitive": "box", + "fcLocalDims": [ + 2960, + 640.057, + 20.345 + ], + "position": [ + -1504.914, + -120.015, + 753.656 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1504.914, + -120.015, + 753.656, + 1455.086, + 520.042, + 774.001 + ], + "center": [ + -24.914, + 200.014, + 763.829 + ], + "color": [ + 0.5445, + 0.5445, + 0.5445 + ], + "colorLinear": [ + 0.2576, + 0.2576, + 0.2576 + ], + "colorSource": "textureAvg", + "material": "普通钢.003", + "meshCount": 1, + "triangleCount": 7488, + "nodeNames": [ + "ZX-JX02-02-02A______________¹___135" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-02A______________¹___135" + ] + }, + { + "partName": "CabinetB_P05", + "label": "长控制柜 部件 5", + "primitive": "box", + "fcLocalDims": [ + 540, + 640, + 600 + ], + "position": [ + -564.914, + -79.958, + 114 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -564.914, + -79.958, + 114, + -24.914, + 560.042, + 714 + ], + "center": [ + -294.914, + 240.042, + 414 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.003", + "meshCount": 4, + "triangleCount": 6572, + "nodeNames": [ + "ZX-JX02-02-03______003", + "ZX-JX02-02-03____²_______________¹___139", + "ZX-JX02-02-03____²_______________¹___135", + "ZX-JX02-02-80______018" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-03______003" + ] + }, + { + "partName": "CabinetB_P06", + "label": "ZX-JX02-02-03____²_______________¹___129", + "primitive": "box", + "fcLocalDims": [ + 40, + 560, + 40 + ], + "position": [ + -544.914, + -79.958, + 714 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -544.914, + -79.958, + 714, + -504.914, + 480.042, + 754 + ], + "center": [ + -524.914, + 200.042, + 734 + ], + "color": [ + 0.898, + 0.9137, + 0.9255 + ], + "colorLinear": [ + 0.7835, + 0.8148, + 0.8388 + ], + "colorSource": "baseColorFactor", + "material": "Material27.019", + "meshCount": 1, + "triangleCount": 1728, + "nodeNames": [ + "ZX-JX02-02-03____²_______________¹___129" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-03____²_______________¹___129" + ] + }, + { + "partName": "CabinetB_P07", + "label": "ZX-JX02-02-03____²_______________¹___142", + "primitive": "box", + "fcLocalDims": [ + 40, + 560, + 40 + ], + "position": [ + -1024.914, + -79.958, + 714 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1024.914, + -79.958, + 714, + -984.914, + 480.042, + 754 + ], + "center": [ + -1004.914, + 200.042, + 734 + ], + "color": [ + 0.898, + 0.9137, + 0.9255 + ], + "colorLinear": [ + 0.7835, + 0.8148, + 0.8388 + ], + "colorSource": "baseColorFactor", + "material": "Material27.022", + "meshCount": 1, + "triangleCount": 1728, + "nodeNames": [ + "ZX-JX02-02-03____²_______________¹___142" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-03____²_______________¹___142" + ] + }, + { + "partName": "CabinetB_P08", + "label": "ZX-JX02-02-80______016", + "primitive": "box", + "fcLocalDims": [ + 440, + 30.001, + 560 + ], + "position": [ + -1464.914, + 490.042, + 154 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1464.914, + 490.042, + 154, + -1024.914, + 520.043, + 714 + ], + "center": [ + -1244.914, + 505.043, + 434 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.005", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-80______016" + ], + "chain": [ + "三柜子1", + "ZX-JX02-02-80______016" + ] + } + ] + }, + { + "file": "三色灯.glb", + "name": "StackLight", + "label": "三色警示灯", + "sha256": "f372bb327fb2b4aee528e05f7898560777e925a8e9146583e7684227fca83d29", + "meshCount": 7, + "triangleCount": 2118, + "partBudget": 2, + "overallBBox": [ + -1506.999, + 420.001, + 726, + -1456.999, + 460.001, + 1194 + ], + "overallDims": [ + 50, + 40, + 468 + ], + "parts": [ + { + "partName": "StackLight_P01", + "label": "三色警示灯 部件 1", + "primitive": "box", + "fcLocalDims": [ + 50, + 40, + 228 + ], + "position": [ + -1506.999, + 420.001, + 726 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1506.999, + 420.001, + 726, + -1456.999, + 460.001, + 954 + ], + "center": [ + -1481.999, + 440.001, + 840 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.008", + "meshCount": 4, + "triangleCount": 1674, + "nodeNames": [ + "工位1三色灯_1", + "__________________M20__1_GB__T_808-1988_003", + "__________________M20__1_GB__T_808-1988_001", + "____001" + ], + "chain": [ + "三色灯", + "工位1三色灯_1" + ] + }, + { + "partName": "StackLight_P02", + "label": "三色警示灯 部件 2", + "primitive": "cylinder", + "fcLocalDims": [ + 40, + 39.989, + 240 + ], + "position": [ + -1496.999, + 420.006, + 954 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1496.999, + 420.006, + 954, + -1456.999, + 459.995, + 1194 + ], + "center": [ + -1476.999, + 440.001, + 1074 + ], + "color": [ + 0.1137, + 0.2196, + 0.1098 + ], + "colorLinear": [ + 0.0123, + 0.0395, + 0.0116 + ], + "colorSource": "textureAvg", + "material": "深绿色光泽_Baked.002", + "meshCount": 3, + "triangleCount": 444, + "nodeNames": [ + "____003", + "_____001", + "____005" + ], + "chain": [ + "三色灯", + "工位1三色灯_1", + "____003" + ] + } + ] + }, + { + "file": "上料.glb", + "name": "Loader", + "label": "上料机构", + "sha256": "2c64f1f97caa53b8e9b29b96b4ce9adb1aab9d5960f930728566ea13de584397", + "meshCount": 9, + "triangleCount": 13952, + "partBudget": 2, + "overallBBox": [ + -1414.432, + 67, + 774, + -1039.5, + 207, + 986 + ], + "overallDims": [ + 374.932, + 140, + 212 + ], + "parts": [ + { + "partName": "Loader_P01", + "label": "ZX-JX01-02-05001", + "primitive": "box", + "fcLocalDims": [ + 165, + 140, + 212 + ], + "position": [ + -1204.5, + 67, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1204.5, + 67, + 774, + -1039.5, + 207, + 986 + ], + "center": [ + -1122, + 137, + 880 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.009", + "meshCount": 1, + "triangleCount": 7952, + "nodeNames": [ + "ZX-JX01-02-05001" + ], + "chain": [ + "上料", + "ZX-JX01-02-05001" + ] + }, + { + "partName": "Loader_P02", + "label": "上料机构 部件 2", + "primitive": "box", + "fcLocalDims": [ + 319.864, + 40, + 30 + ], + "position": [ + -1414.432, + 117, + 946 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1414.432, + 117, + 946, + -1094.568, + 157, + 976 + ], + "center": [ + -1254.5, + 137, + 961 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.001", + "meshCount": 8, + "triangleCount": 6000, + "nodeNames": [ + "物料零件集合", + "物料零件", + "物料零件001", + "物料零件002", + "物料零件003", + "物料零件004", + "物料零件005", + "物料零件006" + ], + "chain": [ + "上料", + "物料零件集合" + ] + } + ] + }, + { + "file": "传送带送料装置.glb", + "name": "ConveyorFeeder", + "label": "传送带送料装置", + "sha256": "d5ca0aed7bf6f69981da90ee1df3ff44118690743e071aada673b8635516879c", + "meshCount": 11, + "triangleCount": 69240, + "partBudget": 6, + "overallBBox": [ + 368.033, + 51, + 774, + 982, + 321.043, + 978.607 + ], + "overallDims": [ + 613.967, + 270.043, + 204.607 + ], + "parts": [ + { + "partName": "ConveyorFeeder_P01", + "label": "传送带送料装置 部件 1", + "primitive": "box", + "fcLocalDims": [ + 508.364, + 100, + 68.879 + ], + "position": [ + 370.068, + 100, + 906 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 370.068, + 100, + 906, + 878.432, + 200, + 974.879 + ], + "center": [ + 624.25, + 150, + 940.44 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.011", + "meshCount": 5, + "triangleCount": 2416, + "nodeNames": [ + "传送带", + "新版1_1", + "新版1001", + "新版2", + "新版1001_1" + ], + "chain": [ + "传送带送料装置", + "传送带" + ] + }, + { + "partName": "ConveyorFeeder_P02", + "label": "传送带送料装置 部件 2", + "primitive": "box", + "fcLocalDims": [ + 44.5, + 152.501, + 34 + ], + "position": [ + 805, + 168.542, + 943 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 805, + 168.542, + 943, + 849.5, + 321.043, + 977 + ], + "center": [ + 827.25, + 244.793, + 960 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.019", + "meshCount": 2, + "triangleCount": 11332, + "nodeNames": [ + "工位5传送带送料装置JT1", + "工位5传送带送料装置JT2" + ], + "chain": [ + "传送带送料装置", + "工位5传送带送料装置JT1" + ] + }, + { + "partName": "ConveyorFeeder_P03", + "label": "LH-C06-01083425002", + "primitive": "box", + "fcLocalDims": [ + 496.967, + 170, + 174 + ], + "position": [ + 368.033, + 51, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 368.033, + 51, + 774, + 865, + 221, + 948 + ], + "center": [ + 616.517, + 136, + 861 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.011", + "meshCount": 1, + "triangleCount": 35932, + "nodeNames": [ + "LH-C06-01083425002" + ], + "chain": [ + "传送带送料装置", + "工位5传送带送料装置传送", + "LH-C06-01083425002" + ] + }, + { + "partName": "ConveyorFeeder_P04", + "label": "工位5传送带送料装置底座", + "primitive": "box", + "fcLocalDims": [ + 395, + 165, + 204.607 + ], + "position": [ + 587, + 106, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 587, + 106, + 774, + 982, + 271, + 978.607 + ], + "center": [ + 784.5, + 188.5, + 876.304 + ], + "color": [ + 0.8389, + 0.8664, + 0.8978 + ], + "colorLinear": [ + 0.6719, + 0.7226, + 0.7831 + ], + "colorSource": "textureAvg", + "material": "抛光金属1.006", + "meshCount": 1, + "triangleCount": 13896, + "nodeNames": [ + "工位5传送带送料装置底座" + ], + "chain": [ + "传送带送料装置", + "工位5传送带送料装置底座" + ] + }, + { + "partName": "ConveyorFeeder_P05", + "label": "工位5传送带送料装置料口", + "primitive": "box", + "fcLocalDims": [ + 120, + 89.131, + 21.5 + ], + "position": [ + 845, + 105.434, + 941 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 845, + 105.434, + 941, + 965, + 194.565, + 962.5 + ], + "center": [ + 905, + 150, + 951.75 + ], + "color": [ + 0.7444, + 0.7565, + 0.7586 + ], + "colorLinear": [ + 0.5138, + 0.5327, + 0.536 + ], + "colorSource": "textureAvg", + "material": "划痕钢.004", + "meshCount": 1, + "triangleCount": 1464, + "nodeNames": [ + "工位5传送带送料装置料口" + ], + "chain": [ + "传送带送料装置", + "工位5传送带送料装置料口" + ] + }, + { + "partName": "ConveyorFeeder_P06", + "label": "工位5轨道", + "primitive": "box", + "fcLocalDims": [ + 175, + 9, + 6.5 + ], + "position": [ + 807, + 244, + 941 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 807, + 244, + 941, + 982, + 253, + 947.5 + ], + "center": [ + 894.5, + 248.5, + 944.25 + ], + "color": [ + 0.7614, + 0.734, + 0.6948 + ], + "colorLinear": [ + 0.5405, + 0.4979, + 0.4406 + ], + "colorSource": "textureAvg", + "material": "划伤金属.005", + "meshCount": 1, + "triangleCount": 4200, + "nodeNames": [ + "工位5轨道" + ], + "chain": [ + "传送带送料装置", + "工位5轨道" + ] + } + ] + }, + { + "file": "原料上料.glb", + "name": "RawFeeder", + "label": "原料上料装置", + "sha256": "c364b31cd40599a69bd87a315b817ba507fbbce518039b5ece46a701682d8723", + "meshCount": 22, + "triangleCount": 103275, + "partBudget": 5, + "overallBBox": [ + -730.014, + 196, + 774, + -520.014, + 404, + 978.1 + ], + "overallDims": [ + 210, + 208, + 204.1 + ], + "parts": [ + { + "partName": "RawFeeder_P01", + "label": "原料上料装置 部件 1", + "primitive": "box", + "fcLocalDims": [ + 84.818, + 56, + 189.727 + ], + "position": [ + -644.514, + 236.943, + 777 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -644.514, + 236.943, + 777, + -559.696, + 292.943, + 966.727 + ], + "center": [ + -602.105, + 264.943, + 871.863 + ], + "color": [ + 0.7614, + 0.734, + 0.6948 + ], + "colorLinear": [ + 0.5405, + 0.4979, + 0.4406 + ], + "colorSource": "textureAvg", + "material": "划伤金属.002", + "meshCount": 18, + "triangleCount": 56762, + "nodeNames": [ + "ATP16XL037_A_N12_A001", + "TM-GZCS-02-06__001", + "原料上料-JT1", + "原料1", + "原料10", + "原料10001", + "原料10002", + "原料10003", + "原料10004", + "原料10005", + "原料10006", + "原料2" + ], + "chain": [ + "原料上料", + "ATP16XL037_A_N12_A001" + ] + }, + { + "partName": "RawFeeder_P02", + "label": "GEWINDESTIFT_DIN_913___M4X3_001", + "primitive": "box", + "fcLocalDims": [ + 77.175, + 27.352, + 16 + ], + "position": [ + -688.014, + 247.324, + 791 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -688.014, + 247.324, + 791, + -610.839, + 274.676, + 807 + ], + "center": [ + -649.426, + 261, + 799 + ], + "color": [ + 0, + 0.1274, + 0 + ], + "colorLinear": [ + 0, + 0.0148, + 0 + ], + "colorSource": "baseColorFactor", + "material": "深绿色", + "meshCount": 1, + "triangleCount": 6354, + "nodeNames": [ + "GEWINDESTIFT_DIN_913___M4X3_001" + ], + "chain": [ + "原料上料", + "GEWINDESTIFT_DIN_913___M4X3_001" + ] + }, + { + "partName": "RawFeeder_P03", + "label": "工位2原料上料支杆", + "primitive": "box", + "fcLocalDims": [ + 50, + 83.234, + 197.1 + ], + "position": [ + -602.514, + 219.383, + 781 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -602.514, + 219.383, + 781, + -552.514, + 302.617, + 978.1 + ], + "center": [ + -577.514, + 261, + 879.55 + ], + "color": [ + 0.7614, + 0.734, + 0.6948 + ], + "colorLinear": [ + 0.5405, + 0.4979, + 0.4406 + ], + "colorSource": "textureAvg", + "material": "划伤金属.001", + "meshCount": 1, + "triangleCount": 20271, + "nodeNames": [ + "工位2原料上料支杆" + ], + "chain": [ + "原料上料", + "工位2原料上料支杆" + ] + }, + { + "partName": "RawFeeder_P04", + "label": "工位2原料上料架体", + "primitive": "box", + "fcLocalDims": [ + 210, + 208, + 186 + ], + "position": [ + -730.014, + 196, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -730.014, + 196, + 774, + -520.014, + 404, + 960 + ], + "center": [ + -625.014, + 300, + 867 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.012", + "meshCount": 1, + "triangleCount": 16104, + "nodeNames": [ + "工位2原料上料架体" + ], + "chain": [ + "原料上料", + "工位2原料上料架体" + ] + }, + { + "partName": "RawFeeder_P05", + "label": "工位2原料上料电机", + "primitive": "box", + "fcLocalDims": [ + 68.4, + 56.4, + 100 + ], + "position": [ + -716.214, + 232.8, + 789 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -716.214, + 232.8, + 789, + -647.814, + 289.2, + 889 + ], + "center": [ + -682.014, + 261, + 839 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.020", + "meshCount": 1, + "triangleCount": 3784, + "nodeNames": [ + "工位2原料上料电机" + ], + "chain": [ + "原料上料", + "工位2原料上料电机" + ] + } + ] + }, + { + "file": "原料装配.glb", + "name": "RawAssembly", + "label": "原料装配平台", + "sha256": "545d0b4d48be65c887ba3b6859fe15185dc9012175e54ac477529f3b95ba08ea", + "meshCount": 12, + "triangleCount": 40676, + "partBudget": 3, + "overallBBox": [ + -872.299, + 250.071, + 786.001, + -373.999, + 395, + 1124.126 + ], + "overallDims": [ + 498.3, + 144.929, + 338.125 + ], + "parts": [ + { + "partName": "RawAssembly_P01", + "label": "原料装配平台", + "primitive": "box", + "fcLocalDims": [ + 498.3, + 92, + 338.125 + ], + "position": [ + -872.299, + 303, + 786.001 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -872.299, + 303, + 786.001, + -373.999, + 395, + 1124.126 + ], + "center": [ + -623.149, + 349, + 955.064 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.013", + "meshCount": 1, + "triangleCount": 19608, + "nodeNames": [ + "原料装配平台" + ], + "chain": [ + "原料装配", + "原料装配平台" + ] + }, + { + "partName": "RawAssembly_P02", + "label": "原料装配平台 部件 2", + "primitive": "box", + "fcLocalDims": [ + 70.599, + 78.529, + 128.485 + ], + "position": [ + -608.07, + 250.071, + 991.563 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -608.07, + 250.071, + 991.563, + -537.471, + 328.6, + 1120.048 + ], + "center": [ + -572.771, + 289.336, + 1055.806 + ], + "color": [ + 0.5445, + 0.5445, + 0.5445 + ], + "colorLinear": [ + 0.2576, + 0.2576, + 0.2576 + ], + "colorSource": "textureAvg", + "material": "普通钢.009", + "meshCount": 10, + "triangleCount": 20944, + "nodeNames": [ + "原料装配-JT1", + "工位2原料装配升降装置", + "工位2原料装配-JT2", + "柱体", + "柱体001", + "爪子安放的地方", + "工位2夹爪001", + "原料1001", + "夹爪002", + "夹爪001" + ], + "chain": [ + "原料装配", + "原料装配平台", + "原料装配-JT1" + ] + }, + { + "partName": "RawAssembly_P03", + "label": "柱体002", + "primitive": "box", + "fcLocalDims": [ + 192.545, + 4.999, + 4.999 + ], + "position": [ + -780.978, + 312, + 1050.588 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -780.978, + 312, + 1050.588, + -588.433, + 316.999, + 1055.587 + ], + "center": [ + -684.705, + 314.5, + 1053.088 + ], + "color": [ + 0.7614, + 0.734, + 0.6948 + ], + "colorLinear": [ + 0.5405, + 0.4979, + 0.4406 + ], + "colorSource": "textureAvg", + "material": "划伤金属.004", + "meshCount": 1, + "triangleCount": 124, + "nodeNames": [ + "柱体002" + ], + "chain": [ + "原料装配", + "原料装配平台", + "原料装配-JT1", + "柱体002" + ] + } + ] + }, + { + "file": "原点.glb", + "name": "OriginMarker", + "label": "原点标记", + "sha256": "e4c898890d5fe49c9fd4345d62e92bfd2101d50ce8524abdf6a3be76b802b45a", + "meshCount": 6, + "triangleCount": 108, + "partBudget": 3, + "overallBBox": [ + -8.855, + -8.855, + -8.855, + 132.827, + 132.827, + 132.827 + ], + "overallDims": [ + 141.682, + 141.682, + 141.682 + ], + "parts": [ + { + "partName": "OriginMarker_P01", + "label": "X", + "primitive": "box", + "fcLocalDims": [ + 132.827, + 17.71, + 17.71 + ], + "position": [ + 0, + -8.855, + -8.855 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 0, + -8.855, + -8.855, + 132.827, + 8.855, + 8.855 + ], + "center": [ + 66.414, + 0, + 0 + ], + "color": [ + 1, + 0, + 0 + ], + "colorLinear": [ + 1, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "material-1", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "X" + ], + "chain": [ + "原点", + "X" + ] + }, + { + "partName": "OriginMarker_P02", + "label": "Y", + "primitive": "box", + "fcLocalDims": [ + 17.71, + 132.827, + 17.71 + ], + "position": [ + -8.855, + 0, + -8.855 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -8.855, + 0, + -8.855, + 8.855, + 132.827, + 8.855 + ], + "center": [ + 0, + 66.414, + 0 + ], + "color": [ + 0, + 1, + 0 + ], + "colorLinear": [ + 0, + 1, + 0 + ], + "colorSource": "baseColorFactor", + "material": "material-3", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "Y" + ], + "chain": [ + "原点", + "Y" + ] + }, + { + "partName": "OriginMarker_P03", + "label": "Z", + "primitive": "cylinder", + "fcLocalDims": [ + 17.71, + 17.71, + 132.827 + ], + "position": [ + -8.855, + -8.855, + 0 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -8.855, + -8.855, + 0, + 8.855, + 8.855, + 132.827 + ], + "center": [ + 0, + 0, + 66.414 + ], + "color": [ + 0, + 0, + 1 + ], + "colorLinear": [ + 0, + 0, + 1 + ], + "colorSource": "baseColorFactor", + "material": "material-5", + "meshCount": 2, + "triangleCount": 36, + "nodeNames": [ + "Z" + ], + "chain": [ + "原点", + "Z" + ] + } + ] + }, + { + "file": "地面平面.glb", + "name": "GroundPlane", + "label": "地面与地线", + "sha256": "2cfabda80de37b5fe9364aeb525c8156b6fc58b5321083b3329d15bdfa34efc1", + "meshCount": 6, + "triangleCount": 66, + "partBudget": 2, + "overallBBox": [ + -2153.148, + -2032.821, + -1039.203, + 2714.334, + 1640.409, + -729.142 + ], + "overallDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "parts": [ + { + "partName": "GroundPlane_P01", + "label": "地面与地线 部件 1", + "primitive": "box", + "fcLocalDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "position": [ + -2153.148, + -2032.821, + -1039.203 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2153.148, + -2032.821, + -1039.203, + 2714.334, + 1640.409, + -729.142 + ], + "center": [ + 280.593, + -196.206, + -884.172 + ], + "color": [ + 0.3801, + 0.3753, + 0.3698 + ], + "colorLinear": [ + 0.1193, + 0.1162, + 0.1127 + ], + "colorSource": "textureAvg", + "material": "环氧涂料.001", + "meshCount": 3, + "triangleCount": 16, + "nodeNames": [ + "1_1", + "平面_1", + "平面_1001" + ], + "chain": [ + "地面平面", + "1_1" + ] + }, + { + "partName": "GroundPlane_P02", + "label": "地面与地线 部件 2", + "primitive": "box", + "fcLocalDims": [ + 4855.255, + 1109.334, + 0.122 + ], + "position": [ + -2140.94, + -2032.819, + -739.025 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2140.94, + -2032.819, + -739.025, + 2714.315, + -923.485, + -738.903 + ], + "center": [ + 286.688, + -1478.152, + -738.964 + ], + "color": [ + 0.7137, + 0.6392, + 0.2431 + ], + "colorLinear": [ + 0.4677, + 0.3662, + 0.0482 + ], + "colorSource": "textureAvg", + "material": "黄色光泽_Baked.002", + "meshCount": 3, + "triangleCount": 50, + "nodeNames": [ + "地线_1", + "地线_1001", + "地线_1003" + ], + "chain": [ + "地面平面", + "地线_1" + ] + } + ] + }, + { + "file": "夹取送料装置.glb", + "name": "PickFeeder", + "label": "夹取送料装置", + "sha256": "3039c5ca2934a59f49cbfb18bf9cbfd90d433400325dec0d14a5b9fb004901ac", + "meshCount": 13, + "triangleCount": 81279, + "partBudget": 5, + "overallBBox": [ + -277.5, + 122.743, + 774, + 748.5, + 400, + 1229.018 + ], + "overallDims": [ + 1026, + 277.257, + 455.018 + ], + "parts": [ + { + "partName": "PickFeeder_P01", + "label": "_0_4_kWith_key_and_end_of_tapNo_body_2001", + "primitive": "box", + "fcLocalDims": [ + 148.5, + 60, + 60 + ], + "position": [ + 600, + 199.5, + 1144.8 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 600, + 199.5, + 1144.8, + 748.5, + 259.5, + 1204.8 + ], + "center": [ + 674.25, + 229.5, + 1174.8 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.025", + "meshCount": 1, + "triangleCount": 12970, + "nodeNames": [ + "_0_4_kWith_key_and_end_of_tapNo_body_2001" + ], + "chain": [ + "夹取送料装置", + "_0_4_kWith_key_and_end_of_tapNo_body_2001" + ] + }, + { + "partName": "PickFeeder_P02", + "label": "A-L024001", + "primitive": "box", + "fcLocalDims": [ + 420, + 200, + 441.8 + ], + "position": [ + -30, + 200, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -30, + 200, + 774, + 390, + 400, + 1215.8 + ], + "center": [ + 180, + 300, + 994.9 + ], + "color": [ + 0.6146, + 0.6349, + 0.6463 + ], + "colorLinear": [ + 0.3359, + 0.3608, + 0.3753 + ], + "colorSource": "textureAvg", + "material": "铁", + "meshCount": 1, + "triangleCount": 42480, + "nodeNames": [ + "A-L024001" + ], + "chain": [ + "夹取送料装置", + "A-L024001" + ] + }, + { + "partName": "PickFeeder_P03", + "label": "AT68-R1616-7901426108001", + "primitive": "box", + "fcLocalDims": [ + 810, + 72, + 82 + ], + "position": [ + -180, + 198, + 1133.8 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -180, + 198, + 1133.8, + 630, + 270, + 1215.8 + ], + "center": [ + 225, + 234, + 1174.8 + ], + "color": [ + 0.6146, + 0.6349, + 0.6463 + ], + "colorLinear": [ + 0.3359, + 0.3608, + 0.3753 + ], + "colorSource": "textureAvg", + "material": "铁.001", + "meshCount": 1, + "triangleCount": 3356, + "nodeNames": [ + "AT68-R1616-7901426108001" + ], + "chain": [ + "夹取送料装置", + "AT68-R1616-790001", + "AT68-R1616-7901426108001" + ] + }, + { + "partName": "PickFeeder_P04", + "label": "夹取送料装置 部件 4", + "primitive": "box", + "fcLocalDims": [ + 242.917, + 143.2, + 119.2 + ], + "position": [ + -277.5, + 125.943, + 1109.818 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -277.5, + 125.943, + 1109.818, + -34.583, + 269.143, + 1229.018 + ], + "center": [ + -156.041, + 197.543, + 1169.418 + ], + "color": [ + 0.3725, + 0.3725, + 0.3725 + ], + "colorLinear": [ + 0.1144, + 0.1144, + 0.1144 + ], + "colorSource": "textureAvg", + "material": "中灰色光泽_Baked", + "meshCount": 5, + "triangleCount": 15635, + "nodeNames": [ + "夹取送料装置JT1", + "夹取送料装置JT2002", + "工位4夹取送", + "工位4夹取送料装置JT2001", + "工位4夹取送料装置JT3" + ], + "chain": [ + "夹取送料装置", + "夹取送料装置JT1" + ] + }, + { + "partName": "PickFeeder_P05", + "label": "夹取送料装置 部件 5", + "primitive": "box", + "fcLocalDims": [ + 70, + 59.275, + 141.469 + ], + "position": [ + -227.746, + 122.743, + 972.659 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -227.746, + 122.743, + 972.659, + -157.746, + 182.018, + 1114.128 + ], + "center": [ + -192.746, + 152.38, + 1043.393 + ], + "color": [ + 0, + 0, + 0 + ], + "colorLinear": [ + 0, + 0, + 0 + ], + "colorSource": "baseColorFactor", + "material": "黑.022", + "meshCount": 5, + "triangleCount": 6838, + "nodeNames": [ + "夹取送料装置气缸JT2", + "夹爪", + "新版1005", + "新版3", + "夹爪1" + ], + "chain": [ + "夹取送料装置", + "夹取送料装置JT1", + "工位4夹取送", + "工位4夹取送料装置JT2001", + "夹取送料装置气缸JT2" + ] + } + ] + }, + { + "file": "平面.001.glb", + "name": "Plane001", + "label": "地面平面 001", + "sha256": "e4d0e3ccdf362bfa41e2135ef08c02d4e1c2c737f7e7ada1382238adc554e41b", + "meshCount": 6, + "triangleCount": 66, + "partBudget": 2, + "overallBBox": [ + -2153.148, + -2032.821, + -1039.203, + 2714.334, + 1640.409, + -729.142 + ], + "overallDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "parts": [ + { + "partName": "Plane001_P01", + "label": "地面平面 001 部件 1", + "primitive": "box", + "fcLocalDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "position": [ + -2153.148, + -2032.821, + -1039.203 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2153.148, + -2032.821, + -1039.203, + 2714.334, + 1640.409, + -729.142 + ], + "center": [ + 280.593, + -196.206, + -884.172 + ], + "color": [ + 0.3801, + 0.3753, + 0.3698 + ], + "colorLinear": [ + 0.1193, + 0.1162, + 0.1127 + ], + "colorSource": "textureAvg", + "material": "环氧涂料.001", + "meshCount": 3, + "triangleCount": 16, + "nodeNames": [ + "1_1", + "平面_1", + "平面_1001" + ], + "chain": [ + "地面平面", + "1_1" + ] + }, + { + "partName": "Plane001_P02", + "label": "地面平面 001 部件 2", + "primitive": "box", + "fcLocalDims": [ + 4855.255, + 1109.334, + 0.122 + ], + "position": [ + -2140.94, + -2032.819, + -739.025 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2140.94, + -2032.819, + -739.025, + 2714.315, + -923.485, + -738.903 + ], + "center": [ + 286.688, + -1478.152, + -738.964 + ], + "color": [ + 0.7137, + 0.6392, + 0.2431 + ], + "colorLinear": [ + 0.4677, + 0.3662, + 0.0482 + ], + "colorSource": "textureAvg", + "material": "黄色光泽_Baked.002", + "meshCount": 3, + "triangleCount": 50, + "nodeNames": [ + "地线_1", + "地线_1001", + "地线_1003" + ], + "chain": [ + "地面平面", + "地线_1" + ] + } + ] + }, + { + "file": "平面.glb", + "name": "Plane", + "label": "地面平面", + "sha256": "5aad2f7cac080b6a3b9657537152b20a0ce8c166c6e97beb7cd57d348582f8c8", + "meshCount": 6, + "triangleCount": 66, + "partBudget": 2, + "overallBBox": [ + -2439.842, + -1829.019, + -300, + 2427.64, + 1844.211, + 10.061 + ], + "overallDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "parts": [ + { + "partName": "Plane_P01", + "label": "地面平面 部件 1", + "primitive": "box", + "fcLocalDims": [ + 4867.482, + 3673.23, + 310.061 + ], + "position": [ + -2439.842, + -1829.019, + -300 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2439.842, + -1829.019, + -300, + 2427.64, + 1844.211, + 10.061 + ], + "center": [ + -6.101, + 7.596, + -144.969 + ], + "color": [ + 0.3801, + 0.3753, + 0.3698 + ], + "colorLinear": [ + 0.1193, + 0.1162, + 0.1127 + ], + "colorSource": "textureAvg", + "material": "环氧涂料.001", + "meshCount": 3, + "triangleCount": 16, + "nodeNames": [ + "1_1", + "平面_1", + "平面_1001" + ], + "chain": [ + "平面", + "1_1" + ] + }, + { + "partName": "Plane_P02", + "label": "地面平面 部件 2", + "primitive": "box", + "fcLocalDims": [ + 4855.255, + 1109.334, + 0.122 + ], + "position": [ + -2427.634, + -1829.017, + 0.178 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -2427.634, + -1829.017, + 0.178, + 2427.621, + -719.683, + 0.3 + ], + "center": [ + -0.006, + -1274.35, + 0.239 + ], + "color": [ + 0.7137, + 0.6392, + 0.2431 + ], + "colorLinear": [ + 0.4677, + 0.3662, + 0.0482 + ], + "colorSource": "textureAvg", + "material": "黄色光泽_Baked.002", + "meshCount": 3, + "triangleCount": 50, + "nodeNames": [ + "地线_1", + "地线_1001", + "地线_1003" + ], + "chain": [ + "平面", + "地线_1" + ] + } + ] + }, + { + "file": "推料装置.glb", + "name": "Pusher", + "label": "推料装置", + "sha256": "5a70fa850278cda7b13bdce66a7e4acd4067acfbdb0d6ca9567ae80738dd14d8", + "meshCount": 6, + "triangleCount": 49825, + "partBudget": 2, + "overallBBox": [ + 955, + -138.7, + 774, + 1445, + 197.3, + 1361.8 + ], + "overallDims": [ + 490, + 336, + 587.8 + ], + "parts": [ + { + "partName": "Pusher_P01", + "label": "工位6推料装置底板", + "primitive": "box", + "fcLocalDims": [ + 490, + 230, + 85 + ], + "position": [ + 955, + -35, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 955, + -35, + 774, + 1445, + 195, + 859 + ], + "center": [ + 1200, + 80, + 816.5 + ], + "color": [ + 0.7144, + 0.7301, + 0.734 + ], + "colorLinear": [ + 0.4688, + 0.4921, + 0.4979 + ], + "colorSource": "textureAvg", + "material": "银", + "meshCount": 1, + "triangleCount": 6170, + "nodeNames": [ + "工位6推料装置底板" + ], + "chain": [ + "推料装置", + "工位6推料装置底板" + ] + }, + { + "partName": "Pusher_P02", + "label": "推料装置 部件 2", + "primitive": "box", + "fcLocalDims": [ + 149.64, + 336, + 532.6 + ], + "position": [ + 965.008, + -138.7, + 829.2 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 965.008, + -138.7, + 829.2, + 1114.648, + 197.3, + 1361.8 + ], + "center": [ + 1039.828, + 29.3, + 1095.5 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.015", + "meshCount": 5, + "triangleCount": 43655, + "nodeNames": [ + "推料装置JT1", + "推料装置JT2", + "推料装置JT3", + "物料零件007", + "新版2001" + ], + "chain": [ + "推料装置", + "推料装置JT1" + ] + } + ] + }, + { + "file": "料仓.glb", + "name": "Hopper", + "label": "料仓", + "sha256": "9d65919f9268958501b0b2e9a445559efc6045a320e51e13d6a2792b1fe0690e", + "meshCount": 2, + "triangleCount": 11772, + "partBudget": 2, + "overallBBox": [ + -1485, + 90, + 774, + -1205, + 340, + 974 + ], + "overallDims": [ + 280, + 250, + 200 + ], + "parts": [ + { + "partName": "Hopper_P01", + "label": "hex_nuts__style_1-grades_ab_gb_GB_FASTENER_NUT_SNAB1_M12-N_013", + "primitive": "box", + "fcLocalDims": [ + 190.563, + 190.767, + 65 + ], + "position": [ + -1480.282, + 119.617, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1480.282, + 119.617, + 774, + -1289.719, + 310.384, + 839 + ], + "center": [ + -1385, + 215.001, + 806.5 + ], + "color": [ + 0.5445, + 0.5445, + 0.5445 + ], + "colorLinear": [ + 0.2576, + 0.2576, + 0.2576 + ], + "colorSource": "textureAvg", + "material": "普通钢.013", + "meshCount": 1, + "triangleCount": 6900, + "nodeNames": [ + "hex_nuts__style_1-grades_ab_gb_GB_FASTENER_NUT_SNAB1_M12-N_013" + ], + "chain": [ + "料仓", + "hex_nuts__style_1-grades_ab_gb_GB_FASTENER_NUT_SNAB1_M12-N_013" + ] + }, + { + "partName": "Hopper_P02", + "label": "M12____007", + "primitive": "box", + "fcLocalDims": [ + 280, + 250, + 200 + ], + "position": [ + -1485, + 90, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1485, + 90, + 774, + -1205, + 340, + 974 + ], + "center": [ + -1345, + 215, + 874 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.001", + "meshCount": 1, + "triangleCount": 4872, + "nodeNames": [ + "M12____007" + ], + "chain": [ + "料仓", + "M12____007" + ] + } + ] + }, + { + "file": "新版2.glb", + "name": "SensorBlock", + "label": "新版检测块", + "sha256": "66a6a34f8a4a4776a2c0dd990baa8b82f7e9151daeb36f85d55635243657afa5", + "meshCount": 1, + "triangleCount": 298, + "partBudget": 1, + "overallBBox": [ + 277.521, + -80.054, + 43.684, + 299.513, + -58.087, + 50.684 + ], + "overallDims": [ + 21.992, + 21.967, + 7 + ], + "parts": [ + { + "partName": "SensorBlock_P01", + "label": "新版1001_1", + "primitive": "box", + "fcLocalDims": [ + 21.992, + 21.967, + 7 + ], + "position": [ + 277.521, + -80.054, + 43.684 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 277.521, + -80.054, + 43.684, + 299.513, + -58.087, + 50.684 + ], + "center": [ + 288.517, + -69.071, + 47.184 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.014", + "meshCount": 1, + "triangleCount": 298, + "nodeNames": [ + "新版1001_1" + ], + "chain": [ + "新版2", + "新版1001_1" + ] + } + ] + }, + { + "file": "旋转运送装置.glb", + "name": "RotaryTransfer", + "label": "旋转运送装置", + "sha256": "aa7cd835229d028624d5cd21da1531bb48f64dc1e8129eb32910e9d106b2bcff", + "meshCount": 8, + "triangleCount": 44387, + "partBudget": 2, + "overallBBox": [ + -611.434, + -131.634, + 774, + -74.565, + 404.634, + 976 + ], + "overallDims": [ + 536.869, + 536.268, + 202 + ], + "parts": [ + { + "partName": "RotaryTransfer_P01", + "label": "旋转运送装置电机", + "primitive": "box", + "fcLocalDims": [ + 340, + 265, + 165 + ], + "position": [ + -473, + -20, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -473, + -20, + 774, + -133, + 245, + 939 + ], + "center": [ + -303, + 112.5, + 856.5 + ], + "color": [ + 0.0667, + 0.0667, + 0.0667 + ], + "colorLinear": [ + 0.0056, + 0.0056, + 0.0056 + ], + "colorSource": "textureAvg", + "material": "黑色车漆_Baked", + "meshCount": 1, + "triangleCount": 29295, + "nodeNames": [ + "旋转运送装置电机" + ], + "chain": [ + "旋转运送装置", + "旋转运送装置电机" + ] + }, + { + "partName": "RotaryTransfer_P02", + "label": "旋转运送装置 部件 2", + "primitive": "box", + "fcLocalDims": [ + 536.869, + 536.268, + 47 + ], + "position": [ + -611.434, + -131.634, + 929 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -611.434, + -131.634, + 929, + -74.565, + 404.634, + 976 + ], + "center": [ + -342.999, + 136.5, + 952.5 + ], + "color": [ + 0.6352, + 0.6509, + 0.6786 + ], + "colorLinear": [ + 0.3612, + 0.3812, + 0.4181 + ], + "colorSource": "textureAvg", + "material": "拉丝铝1.016", + "meshCount": 7, + "triangleCount": 15092, + "nodeNames": [ + "转盘", + "转盘零件1", + "转盘零件1-1", + "转盘零件2", + "转盘零件2-1", + "转盘零件3", + "转盘零件3-1" + ], + "chain": [ + "旋转运送装置", + "转盘" + ] + } + ] + }, + { + "file": "显示屏.glb", + "name": "DisplayA", + "label": "显示屏 A", + "sha256": "936f33b84ad6a91e8583289fe64469f474641e1196af3009a7332b2054aac8bb", + "meshCount": 2, + "triangleCount": 4502, + "partBudget": 2, + "overallBBox": [ + -1472.405, + -127.694, + 774, + -1223.405, + 33.506, + 1086 + ], + "overallDims": [ + 249, + 161.2, + 312 + ], + "parts": [ + { + "partName": "DisplayA_P01", + "label": "IH-C-07-031792213", + "primitive": "box", + "fcLocalDims": [ + 249, + 161.2, + 312 + ], + "position": [ + -1472.405, + -127.694, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1472.405, + -127.694, + 774, + -1223.405, + 33.506, + 1086 + ], + "center": [ + -1347.905, + -47.094, + 930 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.002", + "meshCount": 1, + "triangleCount": 4138, + "nodeNames": [ + "IH-C-07-031792213" + ], + "chain": [ + "显示屏", + "IH-C-07-03001", + "IH-C-07-031792213" + ] + }, + { + "partName": "DisplayA_P02", + "label": "IH-C-07-031792213_1", + "primitive": "box", + "fcLocalDims": [ + 204, + 115.676, + 148.432 + ], + "position": [ + -1451.405, + -120.077, + 923.324 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1451.405, + -120.077, + 923.324, + -1247.405, + -4.401, + 1071.756 + ], + "center": [ + -1349.405, + -62.239, + 997.54 + ], + "color": [ + 0.4604, + 0.4727, + 0.4823 + ], + "colorLinear": [ + 0.1792, + 0.1896, + 0.198 + ], + "colorSource": "textureAvg", + "material": "材质", + "meshCount": 1, + "triangleCount": 364, + "nodeNames": [ + "IH-C-07-031792213_1" + ], + "chain": [ + "显示屏", + "IH-C-07-03001", + "IH-C-07-031792213_1" + ] + } + ] + }, + { + "file": "显示屏1.glb", + "name": "DisplayB", + "label": "显示屏 B", + "sha256": "72eb3ee957160c52ca223d1604c6af4f670c4a5fc6eb5f5e706d93f6238b0c36", + "meshCount": 2, + "triangleCount": 4502, + "partBudget": 2, + "overallBBox": [ + -1194.5, + -325, + 40, + -945.5, + -163.8, + 352 + ], + "overallDims": [ + 249, + 161.2, + 312 + ], + "parts": [ + { + "partName": "DisplayB_P01", + "label": "IH-C-07-031792213", + "primitive": "box", + "fcLocalDims": [ + 249, + 161.2, + 312 + ], + "position": [ + -1194.5, + -325, + 40 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1194.5, + -325, + 40, + -945.5, + -163.8, + 352 + ], + "center": [ + -1070, + -244.4, + 196 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.002", + "meshCount": 1, + "triangleCount": 4138, + "nodeNames": [ + "IH-C-07-031792213" + ], + "chain": [ + "显示屏", + "IH-C-07-03001", + "IH-C-07-031792213" + ] + }, + { + "partName": "DisplayB_P02", + "label": "IH-C-07-031792213_1", + "primitive": "box", + "fcLocalDims": [ + 204, + 115.676, + 148.432 + ], + "position": [ + -1173.5, + -317.383, + 189.324 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1173.5, + -317.383, + 189.324, + -969.5, + -201.707, + 337.756 + ], + "center": [ + -1071.5, + -259.545, + 263.54 + ], + "color": [ + 0.4604, + 0.4727, + 0.4823 + ], + "colorLinear": [ + 0.1792, + 0.1896, + 0.198 + ], + "colorSource": "textureAvg", + "material": "材质", + "meshCount": 1, + "triangleCount": 364, + "nodeNames": [ + "IH-C-07-031792213_1" + ], + "chain": [ + "显示屏", + "IH-C-07-03001", + "IH-C-07-031792213_1" + ] + } + ] + }, + { + "file": "柜门.glb", + "name": "CabinetDoor", + "label": "柜门", + "sha256": "5ab62fd4d919ea6343f765c96ee637a6cf915143acddb248f43afc51eda676ea", + "meshCount": 1, + "triangleCount": 1252, + "partBudget": 1, + "overallBBox": [ + -1505, + -80, + 155, + -1475, + 480, + 715 + ], + "overallDims": [ + 30, + 560, + 560 + ], + "parts": [ + { + "partName": "CabinetDoor_P01", + "label": "ZX-JX02-02-23²_____006", + "primitive": "box", + "fcLocalDims": [ + 30, + 560, + 560 + ], + "position": [ + -1505, + -80, + 155 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -1505, + -80, + 155, + -1475, + 480, + 715 + ], + "center": [ + -1490, + 200, + 435 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.015", + "meshCount": 1, + "triangleCount": 1252, + "nodeNames": [ + "ZX-JX02-02-23²_____006" + ], + "chain": [ + "柜门", + "ZX-JX02-02-23²_____006" + ] + } + ] + }, + { + "file": "检测台.glb", + "name": "InspectionTable", + "label": "检测台", + "sha256": "51a0efdda45a6b4aef066cd1e5d659d6b39f4e4a059d4524fb7194f814a544ef", + "meshCount": 1, + "triangleCount": 5888, + "partBudget": 1, + "overallBBox": [ + 837.73, + -2.484, + 774, + 912.73, + 146.002, + 1099 + ], + "overallDims": [ + 75, + 148.486, + 325 + ], + "parts": [ + { + "partName": "InspectionTable_P01", + "label": "RP-0B03-02-02001", + "primitive": "box", + "fcLocalDims": [ + 75, + 148.486, + 325 + ], + "position": [ + 837.73, + -2.484, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 837.73, + -2.484, + 774, + 912.73, + 146.002, + 1099 + ], + "center": [ + 875.23, + 71.759, + 936.5 + ], + "color": [ + 0.7444, + 0.7565, + 0.7586 + ], + "colorLinear": [ + 0.5138, + 0.5327, + 0.536 + ], + "colorSource": "textureAvg", + "material": "划痕钢.002", + "meshCount": 1, + "triangleCount": 5888, + "nodeNames": [ + "RP-0B03-02-02001" + ], + "chain": [ + "检测台", + "RP-0B03-02-02001" + ] + } + ] + }, + { + "file": "物料存储区.glb", + "name": "MaterialStore", + "label": "物料存储区", + "sha256": "37697c7e53062e819758940f671bcafe9c7165ad42a24c40253083e95fc3ed9c", + "meshCount": 33, + "triangleCount": 18558, + "partBudget": 5, + "overallBBox": [ + 1038.935, + 199.25, + 774, + 1390.75, + 282.229, + 1186.75 + ], + "overallDims": [ + 351.815, + 82.979, + 412.75 + ], + "parts": [ + { + "partName": "MaterialStore_P01", + "label": "物料存储区 部件 1", + "primitive": "box", + "fcLocalDims": [ + 39.864, + 40, + 30 + ], + "position": [ + 1065.108, + 221.846, + 1104.741 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1065.108, + 221.846, + 1104.741, + 1104.972, + 261.846, + 1134.741 + ], + "center": [ + 1085.04, + 241.846, + 1119.741 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.029", + "meshCount": 2, + "triangleCount": 1048, + "nodeNames": [ + "新版101", + "新版101_1" + ], + "chain": [ + "物料存储区", + "新版101" + ] + }, + { + "partName": "MaterialStore_P02", + "label": "物料存储区 部件 2", + "primitive": "box", + "fcLocalDims": [ + 351.815, + 82.979, + 412.75 + ], + "position": [ + 1038.935, + 199.25, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1038.935, + 199.25, + 774, + 1390.75, + 282.229, + 1186.75 + ], + "center": [ + 1214.843, + 240.74, + 980.375 + ], + "color": [ + 0.7725, + 0.7725, + 0.7725 + ], + "colorLinear": [ + 0.5583, + 0.5583, + 0.5583 + ], + "colorSource": "textureAvg", + "material": "纯白色车漆_Baked.016", + "meshCount": 25, + "triangleCount": 14366, + "nodeNames": [ + "新版102", + "新版102_1", + "新版201", + "新版201_1", + "新版202", + "新版202_1", + "新版302", + "新版302_1", + "ZX-JX02-02-21____1354724", + "新版303", + "新版303_1", + "新版203" + ], + "chain": [ + "物料存储区", + "新版102" + ] + }, + { + "partName": "MaterialStore_P03", + "label": "物料存储区 部件 3", + "primitive": "box", + "fcLocalDims": [ + 39.864, + 40, + 30 + ], + "position": [ + 1328.422, + 221.846, + 1104.741 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1328.422, + 221.846, + 1104.741, + 1368.286, + 261.846, + 1134.741 + ], + "center": [ + 1348.354, + 241.846, + 1119.741 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.036", + "meshCount": 2, + "triangleCount": 1048, + "nodeNames": [ + "新版104", + "新版104_1" + ], + "chain": [ + "物料存储区", + "新版104" + ] + }, + { + "partName": "MaterialStore_P04", + "label": "物料存储区 部件 4", + "primitive": "box", + "fcLocalDims": [ + 39.864, + 40, + 30 + ], + "position": [ + 1065.108, + 221.846, + 860.235 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1065.108, + 221.846, + 860.235, + 1104.972, + 261.846, + 890.235 + ], + "center": [ + 1085.04, + 241.846, + 875.235 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.034", + "meshCount": 2, + "triangleCount": 1048, + "nodeNames": [ + "新版401", + "新版401_1" + ], + "chain": [ + "物料存储区", + "新版401" + ] + }, + { + "partName": "MaterialStore_P05", + "label": "物料存储区 部件 5", + "primitive": "box", + "fcLocalDims": [ + 39.863, + 40, + 30 + ], + "position": [ + 1329.24, + 221.846, + 858.6 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 1329.24, + 221.846, + 858.6, + 1369.103, + 261.846, + 888.6 + ], + "center": [ + 1349.172, + 241.846, + 873.6 + ], + "color": [ + 0.6013, + 0.6027, + 0.6031 + ], + "colorLinear": [ + 0.3201, + 0.3217, + 0.3222 + ], + "colorSource": "textureAvg", + "material": "普通钢2.059", + "meshCount": 2, + "triangleCount": 1048, + "nodeNames": [ + "新版404", + "新版404_1" + ], + "chain": [ + "物料存储区", + "新版404" + ] + } + ] + }, + { + "file": "称重平台.glb", + "name": "WeighPlatform", + "label": "称重平台", + "sha256": "f6d584d958dc75e7ea1591b9a6b97a36212fcb699f3e10a0d9cde7540776066b", + "meshCount": 2, + "triangleCount": 12880, + "partBudget": 2, + "overallBBox": [ + 65.002, + 50.341, + 774, + 265.002, + 249.657, + 949 + ], + "overallDims": [ + 200, + 199.316, + 175 + ], + "parts": [ + { + "partName": "WeighPlatform_P01", + "label": "NA1_¹________001", + "primitive": "box", + "fcLocalDims": [ + 200, + 199.316, + 170 + ], + "position": [ + 65.002, + 50.341, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 65.002, + 50.341, + 774, + 265.002, + 249.657, + 944 + ], + "center": [ + 165.002, + 149.999, + 859 + ], + "color": [ + 0.8633, + 0.9046, + 0.9386 + ], + "colorLinear": [ + 0.7167, + 0.7965, + 0.866 + ], + "colorSource": "baseColorFactor", + "material": "白钢.001", + "meshCount": 1, + "triangleCount": 11986, + "nodeNames": [ + "NA1_¹________001" + ], + "chain": [ + "称重平台", + "NA1_¹________001" + ] + }, + { + "partName": "WeighPlatform_P02", + "label": "旋转送料装置JT1", + "primitive": "box", + "fcLocalDims": [ + 149.665, + 149.982, + 5 + ], + "position": [ + 90.17, + 75.008, + 944 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + 90.17, + 75.008, + 944, + 239.835, + 224.99, + 949 + ], + "center": [ + 165.003, + 149.999, + 946.5 + ], + "color": [ + 0.8633, + 0.9046, + 0.9386 + ], + "colorLinear": [ + 0.7167, + 0.7965, + 0.866 + ], + "colorSource": "baseColorFactor", + "material": "白钢.003", + "meshCount": 1, + "triangleCount": 894, + "nodeNames": [ + "旋转送料装置JT1" + ], + "chain": [ + "称重平台", + "旋转送料装置JT1" + ] + } + ] + }, + { + "file": "辅助夹爪.glb", + "name": "AuxGripper", + "label": "辅助夹爪", + "sha256": "df0c62dfb59264cbbc7dd995e989f93784e8c7e75824f5c9aea65e948136a53d", + "meshCount": 4, + "triangleCount": 16900, + "partBudget": 3, + "overallBBox": [ + -530.519, + 80.32, + 945.984, + -457.207, + 174.592, + 1048.378 + ], + "overallDims": [ + 73.312, + 94.272, + 102.394 + ], + "parts": [ + { + "partName": "AuxGripper_P01", + "label": "机器人夹爪_1", + "primitive": "box", + "fcLocalDims": [ + 73.312, + 94.272, + 38.077 + ], + "position": [ + -530.519, + 80.32, + 1010.301 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -530.519, + 80.32, + 1010.301, + -457.207, + 174.592, + 1048.378 + ], + "center": [ + -493.863, + 127.456, + 1029.34 + ], + "color": [ + 0.8389, + 0.8664, + 0.8978 + ], + "colorLinear": [ + 0.6719, + 0.7226, + 0.7831 + ], + "colorSource": "textureAvg", + "material": "抛光金属1.011", + "meshCount": 1, + "triangleCount": 13214, + "nodeNames": [ + "机器人夹爪_1" + ], + "chain": [ + "辅助夹爪", + "机器人夹爪_1" + ] + }, + { + "partName": "AuxGripper_P02", + "label": "辅助夹爪 部件 2", + "primitive": "box", + "fcLocalDims": [ + 40, + 53.077, + 70.048 + ], + "position": [ + -512.825, + 95.245, + 945.984 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -512.825, + 95.245, + 945.984, + -472.825, + 148.322, + 1016.032 + ], + "center": [ + -492.825, + 121.784, + 981.008 + ], + "color": [ + 0.8389, + 0.8664, + 0.8978 + ], + "colorLinear": [ + 0.6719, + 0.7226, + 0.7831 + ], + "colorSource": "textureAvg", + "material": "抛光金属1.013", + "meshCount": 2, + "triangleCount": 2218, + "nodeNames": [ + "夹爪003001", + "机器人的料001001" + ], + "chain": [ + "辅助夹爪", + "机器人夹爪_1", + "夹爪003001" + ] + }, + { + "partName": "AuxGripper_P03", + "label": "夹爪1002001", + "primitive": "box", + "fcLocalDims": [ + 34.134, + 29.894, + 53.912 + ], + "position": [ + -510.046, + 130.005, + 962.107 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -510.046, + 130.005, + 962.107, + -475.912, + 159.899, + 1016.019 + ], + "center": [ + -492.979, + 144.952, + 989.063 + ], + "color": [ + 0.8389, + 0.8664, + 0.8978 + ], + "colorLinear": [ + 0.6719, + 0.7226, + 0.7831 + ], + "colorSource": "textureAvg", + "material": "抛光金属1.012", + "meshCount": 1, + "triangleCount": 1468, + "nodeNames": [ + "夹爪1002001" + ], + "chain": [ + "辅助夹爪", + "机器人夹爪_1", + "夹爪1002001" + ] + } + ] + }, + { + "file": "运送支架.glb", + "name": "TransportBracket", + "label": "运送支架", + "sha256": "8a8bc9d0c2b7f6f0a6a2236a91d264e3345ed7114c2f026467f9e1acde6af682", + "meshCount": 1, + "triangleCount": 2360, + "partBudget": 1, + "overallBBox": [ + -280, + -100, + 774, + -220, + 13.5, + 1084 + ], + "overallDims": [ + 60, + 113.5, + 310 + ], + "parts": [ + { + "partName": "TransportBracket_P01", + "label": "IH-C-08-01001", + "primitive": "box", + "fcLocalDims": [ + 60, + 113.5, + 310 + ], + "position": [ + -280, + -100, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -280, + -100, + 774, + -220, + 13.5, + 1084 + ], + "center": [ + -250, + -43.25, + 929 + ], + "color": [ + 0.7444, + 0.7565, + 0.7586 + ], + "colorLinear": [ + 0.5138, + 0.5327, + 0.536 + ], + "colorSource": "textureAvg", + "material": "划痕钢.001", + "meshCount": 1, + "triangleCount": 2360, + "nodeNames": [ + "IH-C-08-01001" + ], + "chain": [ + "运送支架", + "IH-C-08-01001" + ] + } + ] + }, + { + "file": "运送检测装置.glb", + "name": "TransportInspector", + "label": "运送检测装置", + "sha256": "4762f3404fddf8086e8b4b9f1f17c9d261df08882bad0dc918f06145f650b5e0", + "meshCount": 2, + "triangleCount": 5950, + "partBudget": 2, + "overallBBox": [ + -312.488, + 253.99, + 774, + -237.488, + 402.476, + 1099 + ], + "overallDims": [ + 75, + 148.486, + 325 + ], + "parts": [ + { + "partName": "TransportInspector_P01", + "label": "RP-0B03-02-02003", + "primitive": "box", + "fcLocalDims": [ + 75, + 148.486, + 325 + ], + "position": [ + -312.488, + 253.99, + 774 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -312.488, + 253.99, + 774, + -237.488, + 402.476, + 1099 + ], + "center": [ + -274.988, + 328.233, + 936.5 + ], + "color": [ + 0.7444, + 0.7565, + 0.7586 + ], + "colorLinear": [ + 0.5138, + 0.5327, + 0.536 + ], + "colorSource": "textureAvg", + "material": "划痕钢.003", + "meshCount": 1, + "triangleCount": 5888, + "nodeNames": [ + "RP-0B03-02-02003" + ], + "chain": [ + "运送检测装置", + "RP-0B03-02-02003" + ] + }, + { + "partName": "TransportInspector_P02", + "label": "扫描光线1_1", + "primitive": "cylinder", + "fcLocalDims": [ + 30, + 30, + 60 + ], + "position": [ + -289.988, + 254.976, + 968.182 + ], + "rotation": { + "axis": [ + 0, + 0, + 1 + ], + "angleDeg": 0 + }, + "worldBBox": [ + -289.988, + 254.976, + 968.182, + -259.988, + 284.976, + 1028.182 + ], + "center": [ + -274.988, + 269.976, + 998.182 + ], + "color": [ + 0.5946, + 0.0016, + 0.0016 + ], + "colorLinear": [ + 0.3123, + 0.0001, + 0.0001 + ], + "colorSource": "baseColorFactor", + "material": "红灯", + "meshCount": 1, + "triangleCount": 62, + "nodeNames": [ + "扫描光线1_1" + ], + "chain": [ + "运送检测装置", + "扫描光线1_1" + ] + } + ] + } + ] +} diff --git a/web/tools/line-course/material-colors.json b/web/tools/line-course/material-colors.json new file mode 100644 index 00000000..fa9ec882 --- /dev/null +++ b/web/tools/line-course/material-colors.json @@ -0,0 +1,2429 @@ +{ + "schema": "freecad-web-line-course/material-colors/v1", + "sourceDir": "/home/mes123456/FreeCADWasmDev/working/GLTFmodel", + "files": { + "ABB_IRB_120.glb": { + "0": { + "srgb": [ + 0.0667, + 0.0667, + 0.0667 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.8, + 0.8, + 0.8 + ], + "source": "baseColorFactor" + }, + "2": { + "srgb": [ + 0.8, + 0.8, + 0.8 + ], + "source": "baseColorFactor" + }, + "3": { + "srgb": [ + 0.8, + 0.8, + 0.8 + ], + "source": "baseColorFactor" + }, + "4": { + "srgb": [ + 0.8, + 0.8, + 0.8 + ], + "source": "baseColorFactor" + }, + "5": { + "srgb": [ + 0.5272, + 0.5271, + 0.5271 + ], + "source": "baseColorFactor" + }, + "6": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "7": { + "srgb": [ + 0.7146, + 0.7145, + 0.7145 + ], + "source": "baseColorFactor" + }, + "8": { + "srgb": [ + 0.7146, + 0.7145, + 0.7145 + ], + "source": "baseColorFactor" + }, + "9": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "10": { + "srgb": [ + 0.0667, + 0.0667, + 0.0667 + ], + "source": "textureAvg" + }, + "11": { + "srgb": [ + 0.8, + 0.8, + 0.8 + ], + "source": "baseColorFactor" + }, + "12": { + "srgb": [ + 1, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "13": { + "srgb": [ + 0.0667, + 0.0667, + 0.0667 + ], + "source": "textureAvg" + }, + "14": { + "srgb": [ + 0.8, + 0.8, + 0.8 + ], + "source": "baseColorFactor" + }, + "15": { + "srgb": [ + 0.0667, + 0.0667, + 0.0667 + ], + "source": "textureAvg" + }, + "16": { + "srgb": [ + 0.4744, + 0.4744, + 0.4744 + ], + "source": "textureAvg" + } + }, + "Tool.glb": { + "0": { + "srgb": [ + 1, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "1": { + "srgb": [ + 1, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "2": { + "srgb": [ + 0, + 1, + 0 + ], + "source": "baseColorFactor" + }, + "3": { + "srgb": [ + 0, + 1, + 0 + ], + "source": "baseColorFactor" + }, + "4": { + "srgb": [ + 0, + 0, + 1 + ], + "source": "baseColorFactor" + }, + "5": { + "srgb": [ + 0, + 0, + 1 + ], + "source": "baseColorFactor" + } + }, + "三柜子.glb": { + "0": { + "srgb": [ + 0.5529, + 0.0078, + 0.0 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.251, + 0.0084, + 0.0165 + ], + "source": "baseColorFactor" + }, + "2": { + "srgb": [ + 0.0196, + 0.3098, + 0.4667 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.9059, + 0.4431, + 0.0314 + ], + "source": "baseColorFactor" + }, + "4": { + "srgb": [ + 0.502, + 0.7922, + 1 + ], + "source": "baseColorFactor" + }, + "5": { + "srgb": [ + 0.502, + 0.502, + 0.502 + ], + "source": "baseColorFactor" + }, + "6": { + "srgb": [ + 0.5529, + 0.0078, + 0.0 + ], + "source": "textureAvg" + }, + "7": { + "srgb": [ + 0.251, + 0.0084, + 0.0165 + ], + "source": "baseColorFactor" + }, + "8": { + "srgb": [ + 0.0196, + 0.3098, + 0.4667 + ], + "source": "textureAvg" + }, + "9": { + "srgb": [ + 0.9059, + 0.4431, + 0.0314 + ], + "source": "baseColorFactor" + }, + "10": { + "srgb": [ + 0.502, + 0.7922, + 1 + ], + "source": "baseColorFactor" + }, + "11": { + "srgb": [ + 0.502, + 0.502, + 0.502 + ], + "source": "baseColorFactor" + }, + "12": { + "srgb": [ + 0.5529, + 0.0078, + 0.0 + ], + "source": "textureAvg" + }, + "13": { + "srgb": [ + 0.251, + 0.0084, + 0.0165 + ], + "source": "baseColorFactor" + }, + "14": { + "srgb": [ + 0.0196, + 0.3098, + 0.4667 + ], + "source": "textureAvg" + }, + "15": { + "srgb": [ + 0.9059, + 0.4431, + 0.0314 + ], + "source": "baseColorFactor" + }, + "16": { + "srgb": [ + 0.502, + 0.7922, + 1 + ], + "source": "baseColorFactor" + }, + "17": { + "srgb": [ + 0.502, + 0.502, + 0.502 + ], + "source": "baseColorFactor" + }, + "18": { + "srgb": [ + 0.016, + 0.2582, + 0.016 + ], + "source": "baseColorFactor" + }, + "19": { + "srgb": [ + 0.016, + 0.2582, + 0.016 + ], + "source": "baseColorFactor" + }, + "20": { + "srgb": [ + 0.016, + 0.2582, + 0.016 + ], + "source": "baseColorFactor" + }, + "21": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "22": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "23": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "24": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "25": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "26": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "27": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "28": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "29": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "30": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "31": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "32": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "33": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "34": { + "srgb": [ + 0.8196, + 0.3686, + 0.1255 + ], + "source": "textureAvg" + }, + "35": { + "srgb": [ + 0.1059, + 0.1059, + 0.1059 + ], + "source": "baseColorFactor" + }, + "36": { + "srgb": [ + 0.8196, + 0.3686, + 0.1255 + ], + "source": "textureAvg" + }, + "37": { + "srgb": [ + 0.1059, + 0.1059, + 0.1059 + ], + "source": "baseColorFactor" + }, + "38": { + "srgb": [ + 0.8196, + 0.3686, + 0.1255 + ], + "source": "textureAvg" + }, + "39": { + "srgb": [ + 0.1059, + 0.1059, + 0.1059 + ], + "source": "baseColorFactor" + }, + "40": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "41": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "42": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "43": { + "srgb": [ + 0.898, + 0.9137, + 0.9255 + ], + "source": "baseColorFactor" + }, + "44": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "45": { + "srgb": [ + 0.898, + 0.9137, + 0.9255 + ], + "source": "baseColorFactor" + }, + "46": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "47": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "48": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "49": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "50": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "51": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "52": { + "srgb": [ + 0.7922, + 0.8196, + 0.9294 + ], + "source": "baseColorFactor" + }, + "53": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "54": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "55": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + } + }, + "三柜子1.glb": { + "0": { + "srgb": [ + 0.5529, + 0.0078, + 0.0 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.0196, + 0.3098, + 0.4667 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.5529, + 0.0078, + 0.0 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.0196, + 0.3098, + 0.4667 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.5529, + 0.0078, + 0.0 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0.0196, + 0.3098, + 0.4667 + ], + "source": "textureAvg" + }, + "6": { + "srgb": [ + 0.016, + 0.2582, + 0.016 + ], + "source": "baseColorFactor" + }, + "7": { + "srgb": [ + 0.016, + 0.2582, + 0.016 + ], + "source": "baseColorFactor" + }, + "8": { + "srgb": [ + 0.016, + 0.2582, + 0.016 + ], + "source": "baseColorFactor" + }, + "9": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "10": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "11": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "12": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "13": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "14": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "15": { + "srgb": [ + 0.7922, + 0.8196, + 0.9294 + ], + "source": "baseColorFactor" + }, + "16": { + "srgb": [ + 0.7922, + 0.8196, + 0.9294 + ], + "source": "baseColorFactor" + }, + "17": { + "srgb": [ + 0.7922, + 0.8196, + 0.9294 + ], + "source": "baseColorFactor" + }, + "18": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "19": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "20": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "21": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "22": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "23": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "24": { + "srgb": [ + 0.8196, + 0.3686, + 0.1255 + ], + "source": "textureAvg" + }, + "25": { + "srgb": [ + 0.0273, + 0.0273, + 0.0273 + ], + "source": "baseColorFactor" + }, + "26": { + "srgb": [ + 0.8196, + 0.3686, + 0.1255 + ], + "source": "textureAvg" + }, + "27": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "28": { + "srgb": [ + 0.8196, + 0.3686, + 0.1255 + ], + "source": "textureAvg" + }, + "29": { + "srgb": [ + 0.1059, + 0.1059, + 0.1059 + ], + "source": "baseColorFactor" + }, + "30": { + "srgb": [ + 0.8196, + 0.3686, + 0.1255 + ], + "source": "textureAvg" + }, + "31": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "32": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "33": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "34": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "35": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "36": { + "srgb": [ + 0.898, + 0.9137, + 0.9255 + ], + "source": "baseColorFactor" + }, + "37": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "38": { + "srgb": [ + 0.898, + 0.9137, + 0.9255 + ], + "source": "baseColorFactor" + }, + "39": { + "srgb": [ + 0.898, + 0.9137, + 0.9255 + ], + "source": "baseColorFactor" + }, + "40": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "41": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "42": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "43": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "44": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "45": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "46": { + "srgb": [ + 0.7922, + 0.8196, + 0.9294 + ], + "source": "baseColorFactor" + }, + "47": { + "srgb": [ + 0.7922, + 0.8196, + 0.9294 + ], + "source": "baseColorFactor" + }, + "48": { + "srgb": [ + 0.7922, + 0.8196, + 0.9294 + ], + "source": "baseColorFactor" + }, + "49": { + "srgb": [ + 0.7922, + 0.8196, + 0.9294 + ], + "source": "baseColorFactor" + }, + "50": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "51": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "52": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + } + }, + "三色灯.glb": { + "0": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.1137, + 0.2196, + 0.1098 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.5529, + 0.0078, + 0.0 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.7137, + 0.6392, + 0.2431 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "6": { + "srgb": [ + 0.749, + 0.749, + 0.749 + ], + "source": "baseColorFactor" + } + }, + "上料.glb": { + "0": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "6": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "7": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "8": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + } + }, + "传送带送料装置.glb": { + "0": { + "srgb": [ + 0.0039, + 0.1765, + 0.102 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "6": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "7": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "8": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "9": { + "srgb": [ + 0.7444, + 0.7565, + 0.7586 + ], + "source": "textureAvg" + }, + "10": { + "srgb": [ + 0.7614, + 0.734, + 0.6948 + ], + "source": "textureAvg" + } + }, + "原料上料.glb": { + "0": { + "srgb": [ + 0.7614, + 0.734, + 0.6948 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0, + 0.1274, + 0 + ], + "source": "baseColorFactor" + }, + "2": { + "srgb": [ + 0.7614, + 0.734, + 0.6948 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "5": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "6": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "7": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "8": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "9": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "10": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "11": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "12": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "13": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "14": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "15": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "16": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "17": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "18": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "19": { + "srgb": [ + 0.7614, + 0.734, + 0.6948 + ], + "source": "textureAvg" + }, + "20": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "21": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + } + }, + "原料装配.glb": { + "0": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "3": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 1.0, + 1.0, + 1.0 + ], + "source": "baseColorFactor" + }, + "5": { + "srgb": [ + 1.0, + 1.0, + 1.0 + ], + "source": "baseColorFactor" + }, + "6": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "7": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "8": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "9": { + "srgb": [ + 0.106, + 0.1059, + 0.1059 + ], + "source": "textureAvg" + }, + "10": { + "srgb": [ + 0.106, + 0.1059, + 0.1059 + ], + "source": "textureAvg" + }, + "11": { + "srgb": [ + 0.7614, + 0.734, + 0.6948 + ], + "source": "textureAvg" + } + }, + "原点.glb": { + "0": { + "srgb": [ + 1, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "1": { + "srgb": [ + 1, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "2": { + "srgb": [ + 0, + 1, + 0 + ], + "source": "baseColorFactor" + }, + "3": { + "srgb": [ + 0, + 1, + 0 + ], + "source": "baseColorFactor" + }, + "4": { + "srgb": [ + 0, + 0, + 1 + ], + "source": "baseColorFactor" + }, + "5": { + "srgb": [ + 0, + 0, + 1 + ], + "source": "baseColorFactor" + } + }, + "地面平面.glb": { + "0": { + "srgb": [ + 0.0561, + 0.0561, + 0.0561 + ], + "source": "baseColorFactor" + }, + "1": { + "srgb": [ + 0.7137, + 0.6392, + 0.2431 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.7137, + 0.6392, + 0.2431 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.3801, + 0.3753, + 0.3698 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.3801, + 0.3753, + 0.3698 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0.2182, + 0.2867, + 0.1794 + ], + "source": "textureAvg" + } + }, + "夹取送料装置.glb": { + "0": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "1": { + "srgb": [ + 0.6146, + 0.6349, + 0.6463 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.6146, + 0.6349, + 0.6463 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "5": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "6": { + "srgb": [ + 0.3725, + 0.3725, + 0.3725 + ], + "source": "textureAvg" + }, + "7": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "8": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "9": { + "srgb": [ + 0, + 0, + 0 + ], + "source": "baseColorFactor" + }, + "10": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "11": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "12": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + } + }, + "平面.001.glb": { + "0": { + "srgb": [ + 0.0561, + 0.0561, + 0.0561 + ], + "source": "baseColorFactor" + }, + "1": { + "srgb": [ + 0.7137, + 0.6392, + 0.2431 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.7137, + 0.6392, + 0.2431 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.3801, + 0.3753, + 0.3698 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.3801, + 0.3753, + 0.3698 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0.2182, + 0.2867, + 0.1794 + ], + "source": "textureAvg" + } + }, + "平面.glb": { + "0": { + "srgb": [ + 0.0561, + 0.0561, + 0.0561 + ], + "source": "baseColorFactor" + }, + "1": { + "srgb": [ + 0.7137, + 0.6392, + 0.2431 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.7137, + 0.6392, + 0.2431 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.3801, + 0.3753, + 0.3698 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.3801, + 0.3753, + 0.3698 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0.2182, + 0.2867, + 0.1794 + ], + "source": "textureAvg" + } + }, + "推料装置.glb": { + "0": { + "srgb": [ + 0.7144, + 0.7301, + 0.734 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.7444, + 0.7565, + 0.7586 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + } + }, + "料仓.glb": { + "0": { + "srgb": [ + 0.5445, + 0.5445, + 0.5445 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + } + }, + "新版2.glb": { + "0": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + } + }, + "旋转运送装置.glb": { + "0": { + "srgb": [ + 0.0667, + 0.0667, + 0.0667 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.6352, + 0.6509, + 0.6786 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "6": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "7": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + } + }, + "显示屏.glb": { + "0": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.4604, + 0.4727, + 0.4823 + ], + "source": "textureAvg" + } + }, + "显示屏1.glb": { + "0": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.4604, + 0.4727, + 0.4823 + ], + "source": "textureAvg" + } + }, + "柜门.glb": { + "0": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + } + }, + "检测台.glb": { + "0": { + "srgb": [ + 0.7444, + 0.7565, + 0.7586 + ], + "source": "textureAvg" + } + }, + "物料存储区.glb": { + "0": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "4": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "5": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "6": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "7": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "8": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "9": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "10": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "11": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "12": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "13": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "14": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "15": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "16": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "17": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "18": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "19": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "20": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "21": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "22": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "23": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "24": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "25": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "26": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "27": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "28": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "29": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "30": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "31": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + }, + "32": { + "srgb": [ + 0.7725, + 0.7725, + 0.7725 + ], + "source": "textureAvg" + } + }, + "称重平台.glb": { + "0": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + }, + "1": { + "srgb": [ + 0.8633, + 0.9046, + 0.9386 + ], + "source": "baseColorFactor" + } + }, + "辅助夹爪.glb": { + "0": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "2": { + "srgb": [ + 0.8389, + 0.8664, + 0.8978 + ], + "source": "textureAvg" + }, + "3": { + "srgb": [ + 0.6013, + 0.6027, + 0.6031 + ], + "source": "textureAvg" + } + }, + "运送支架.glb": { + "0": { + "srgb": [ + 0.7444, + 0.7565, + 0.7586 + ], + "source": "textureAvg" + } + }, + "运送检测装置.glb": { + "0": { + "srgb": [ + 0.7444, + 0.7565, + 0.7586 + ], + "source": "textureAvg" + }, + "1": { + "srgb": [ + 0.5946, + 0.0016, + 0.0016 + ], + "source": "baseColorFactor" + } + } + }, + "failures": [] +} \ No newline at end of file diff --git a/web/tools/line-course/overrides.json b/web/tools/line-course/overrides.json new file mode 100644 index 00000000..f0a702ce --- /dev/null +++ b/web/tools/line-course/overrides.json @@ -0,0 +1,32 @@ +{ + "schema": "freecad-web-line-course/overrides/v1", + "models": { + "ABB_IRB_120.glb": { "courseName": "ABB_IRB_120", "label": "ABB IRB 120 机器人", "budget": 11 }, + "Tool.glb": { "courseName": "ToolFrame", "label": "工具坐标系", "budget": 3, "groupBy": "axis" }, + "原点.glb": { "courseName": "OriginMarker", "label": "原点标记", "budget": 3, "groupBy": "axis" }, + "三柜子.glb": { "courseName": "CabinetA", "label": "主控制柜", "budget": 8 }, + "三柜子1.glb": { "courseName": "CabinetB", "label": "长控制柜", "budget": 8 }, + "三色灯.glb": { "courseName": "StackLight", "label": "三色警示灯", "budget": 2 }, + "上料.glb": { "courseName": "Loader", "label": "上料机构", "budget": 2 }, + "传送带送料装置.glb": { "courseName": "ConveyorFeeder", "label": "传送带送料装置", "budget": 6 }, + "原料上料.glb": { "courseName": "RawFeeder", "label": "原料上料装置", "budget": 5 }, + "原料装配.glb": { "courseName": "RawAssembly", "label": "原料装配平台", "budget": 3 }, + "地面平面.glb": { "courseName": "GroundPlane", "label": "地面与地线", "budget": 2, "groupBy": "prefix", "prefixes": ["平面", "地线"] }, + "夹取送料装置.glb": { "courseName": "PickFeeder", "label": "夹取送料装置", "budget": 5 }, + "平面.001.glb": { "courseName": "Plane001", "label": "地面平面 001", "budget": 2, "groupBy": "prefix", "prefixes": ["平面", "地线"] }, + "平面.glb": { "courseName": "Plane", "label": "地面平面", "budget": 2, "groupBy": "prefix", "prefixes": ["平面", "地线"] }, + "推料装置.glb": { "courseName": "Pusher", "label": "推料装置", "budget": 2 }, + "料仓.glb": { "courseName": "Hopper", "label": "料仓", "budget": 2 }, + "新版2.glb": { "courseName": "SensorBlock", "label": "新版检测块", "budget": 1 }, + "旋转运送装置.glb": { "courseName": "RotaryTransfer", "label": "旋转运送装置", "budget": 2 }, + "显示屏.glb": { "courseName": "DisplayA", "label": "显示屏 A", "budget": 2 }, + "显示屏1.glb": { "courseName": "DisplayB", "label": "显示屏 B", "budget": 2 }, + "柜门.glb": { "courseName": "CabinetDoor", "label": "柜门", "budget": 1 }, + "检测台.glb": { "courseName": "InspectionTable", "label": "检测台", "budget": 1 }, + "物料存储区.glb": { "courseName": "MaterialStore", "label": "物料存储区", "budget": 5 }, + "称重平台.glb": { "courseName": "WeighPlatform", "label": "称重平台", "budget": 2 }, + "辅助夹爪.glb": { "courseName": "AuxGripper", "label": "辅助夹爪", "budget": 3 }, + "运送支架.glb": { "courseName": "TransportBracket", "label": "运送支架", "budget": 1 }, + "运送检测装置.glb": { "courseName": "TransportInspector", "label": "运送检测装置", "budget": 2 } + } +} diff --git a/web/tools/line-course/record.mjs b/web/tools/line-course/record.mjs new file mode 100644 index 00000000..22c85e0c --- /dev/null +++ b/web/tools/line-course/record.mjs @@ -0,0 +1,141 @@ +#!/usr/bin/env node +// Generic course episode recorder. Usage: +// DISPLAY=:2 node .../record.mjs --episode E01 [--smoke] +// The episode driver performs the real UI actions; this file owns browser, +// OPFS seeding, X11 capture, markers and session evidence. +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath, pathToFileURL } from "node:url"; +import { createCourseRecording } from "../carrier-course/lib/recording.mjs"; +import { seedOpfsFromBytes, listOpfsFiles } from "../carrier-course/lib/opfs.mjs"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../.."); +const args = process.argv.slice(2); +const option = (name, fallback = "") => { + const index = args.indexOf(name); + return index < 0 ? fallback : args[index + 1] ?? fallback; +}; +const smoke = args.includes("--smoke"); +const episodeId = option("--episode"); +if (!episodeId) throw new Error("--episode is required (for example --episode E01)"); + +const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8")); +const episode = course.episodes.find(item => item.id === episodeId); +if (!episode) throw new Error(`unknown episode ${episodeId}`); +const driverPath = path.join(here, "episodes", episodeId, "driver.mjs"); +if (!fs.existsSync(driverPath)) throw new Error(`missing driver ${driverPath}`); +const script = JSON.parse(fs.readFileSync(path.join(here, "episodes", episodeId, "script.zh.json"), "utf8")); +// A scene must stay on screen at least as long as its narration; otherwise the +// assembler trims the tail of the voice-over. Run generate-tts before recording. +const durationsFile = path.join(here, "episodes", episodeId, "audio-durations.json"); +if (fs.existsSync(durationsFile)) { + const durations = JSON.parse(fs.readFileSync(durationsFile, "utf8")).scenes ?? {}; + for (const scene of script.scenes) { + const audio = durations[scene.id]?.duration; + if (typeof audio === "number") scene.target = Math.max(scene.target ?? 0, Math.ceil(audio + 1.5)); + } +} +const rawDir = path.join(here, "raw", episodeId); +const stillsDir = path.join(here, "stills", episodeId); +fs.mkdirSync(rawDir, { recursive: true }); +fs.mkdirSync(stillsDir, { recursive: true }); + +const appOrigin = course.appOrigin; +const projectUrl = `${appOrigin}/project.html?workbench=${encodeURIComponent(episode.workbench)}`; +const pageForEpisode = () => { + if (episode.page === "project") return projectUrl; + if (episode.page === "assembly") return `${appOrigin}/workbench.html?module=Assembly&command=Assembly_CreateAssembly`; + if (episode.page === "techdraw") return `${appOrigin}/workbench.html?module=TechDraw&command=TechDraw_PageDefault`; + if (episode.page === "fem") return `${appOrigin}/workbench.html?module=Fem&document=FemDeck`; + return projectUrl; +}; +const checkpointName = episode.checkpointIn ? `line-course-${episode.checkpointIn}.FCStd` : null; +const referenceGlbDir = "/home/mes123456/FreeCADWasmDev/working/GLTFmodel"; +const targetUrl = checkpointName + ? `${pageForEpisode()}&fcstd=${encodeURIComponent(checkpointName)}` + : pageForEpisode(); + +const rec = createCourseRecording({ + rawDir, + schema: `freecad-web-line-course/${episodeId}`, + url: `${appOrigin}/project.html`, + smoke, +}); +const page = await rec.open(); +// Reference GLBs stay in working/GLTFmodel and are fulfilled per request, so +// the 197 MB set is never copied into public/ or dist/. +await page.route("**/line-glb/*.glb", route => { + const name = decodeURIComponent(new URL(route.request().url()).pathname.split("/").pop() ?? ""); + const file = path.join(referenceGlbDir, name); + if (!fs.existsSync(file)) return route.fulfill({ status: 404, body: "missing" }); + return route.fulfill({ status: 200, contentType: "model/gltf-binary", body: fs.readFileSync(file) }); +}); +const driver = await import(pathToFileURL(driverPath).href); +if (typeof driver.run !== "function") throw new Error(`${driverPath} must export run(context)`); + +async function waitForProjectReady() { + if (episode.page && episode.page !== "project") { + await page.waitForFunction(() => Boolean(window.__freecadWorkbenchState), null, { timeout: 180000 }); + await page.waitForTimeout(800); + return; + } + await page.waitForSelector('select[aria-label="Workbench"]', { timeout: 180000 }); + await page.waitForSelector('[aria-label="Imported native 3D view"]', { timeout: 180000 }); + await page.waitForTimeout(800); +} + +try { + await page.waitForLoadState("domcontentloaded", { timeout: 180000 }); + await page.waitForTimeout(600); + if (checkpointName) { + const checkpointPath = path.join(here, "checkpoints", `${episodeId}-in.FCStd`); + const fallback = path.join(here, "checkpoints", `${episode.checkpointIn}.FCStd`); + const file = fs.existsSync(checkpointPath) ? checkpointPath : fallback; + if (!fs.existsSync(file)) throw new Error(`missing checkpoint for ${episodeId}: ${file}`); + await seedOpfsFromBytes(page, checkpointName, fs.readFileSync(file)); + console.log(JSON.stringify({ seeded: checkpointName, bytes: fs.statSync(file).size })); + } + await page.goto(targetUrl, { waitUntil: "domcontentloaded", timeout: 180000 }); + await waitForProjectReady(); + if (!smoke) await rec.startCapture(); + + const context = { page, rec, episode, course, script, stillsDir, rawDir, webRoot, appOrigin, smoke }; + rec.mark("episode-start", { episode: episodeId, url: targetUrl }); + await driver.run(context); + rec.mark("end", { episode: episodeId }); + + const opfsDocs = await listOpfsFiles(page, "freecad-documents").catch(() => []); + fs.writeFileSync(path.join(rawDir, "session.json"), `${JSON.stringify({ + schema: `freecad-web-line-course/${episodeId}/session/v1`, + generatedAt: new Date().toISOString(), + episode: episodeId, + title: episode.title, + url: targetUrl, + smoke, + markers: rec.state.markers.length, + pageErrors: rec.state.pageErrors, + consoleErrors: rec.state.consoleErrors, + failedResponses: rec.state.failedResponses, + opfsDocuments: opfsDocs, + }, null, 2)}\n`); + await rec.close(); + console.log(JSON.stringify({ + ok: true, + episode: episodeId, + markers: rec.state.markers.length, + pageErrors: rec.state.pageErrors.length, + consoleErrors: rec.state.consoleErrors.length, + opfsDocuments: opfsDocs, + capture: rec.state.capturePath, + })); + process.exitCode = rec.state.pageErrors.length ? 1 : 0; +} catch (error) { + rec.mark("failure", { message: String(error?.message ?? error).slice(0, 400) }); + await page.screenshot({ path: path.join(rawDir, "failure.png"), fullPage: false }).catch(() => {}); + const labels = await page.locator(".fc-tree-text").allTextContents().catch(() => []); + const status = await page.locator("p.status").first().textContent().catch(() => ""); + console.error(JSON.stringify({ ok: false, episode: episodeId, error: String(error?.stack ?? error), labels, status })); + await rec.close().catch(() => {}); + process.exitCode = 1; +} diff --git a/web/tools/line-course/run-media-batch.sh b/web/tools/line-course/run-media-batch.sh new file mode 100644 index 00000000..b77fcab6 --- /dev/null +++ b/web/tools/line-course/run-media-batch.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Sequential TTS -> record -> assemble -> verify for the remaining line episodes. +# Run in the background; each step appends to evidence/media-batch.log. +set -u +ROOT=/home/mes123456/FreeCADWasmDev/working/FreeCAD/web/tools/line-course +LOG="$ROOT/evidence/media-batch.log" +mkdir -p "$ROOT/evidence" +: > "$LOG" +for ep in E02 E03 E04 E05 E06 E07 E08 E09 E10 E11 E12 E13 E14 E15 E16 E17 E18; do + echo "=== $ep start $(date -Iseconds) ===" >> "$LOG" + if ! node "$ROOT/generate-tts.mjs" --episode "$ep" >> "$LOG" 2>&1; then + echo "=== $ep TTS FAILED ===" >> "$LOG"; continue + fi + if ! DISPLAY=:2 node "$ROOT/record.mjs" --episode "$ep" >> "$LOG" 2>&1; then + echo "=== $ep RECORD FAILED ===" >> "$LOG"; continue + fi + if ! node "$ROOT/assemble.mjs" --episode "$ep" >> "$LOG" 2>&1; then + echo "=== $ep ASSEMBLE FAILED ===" >> "$LOG"; continue + fi + if ! node "$ROOT/verify.mjs" --episode "$ep" >> "$LOG" 2>&1; then + echo "=== $ep VERIFY FAILED ===" >> "$LOG"; continue + fi + echo "=== $ep DONE $(date -Iseconds) ===" >> "$LOG" +done +echo "=== ALL DONE $(date -Iseconds) ===" >> "$LOG" diff --git a/web/tools/line-course/sample-material-colors.py b/web/tools/line-course/sample-material-colors.py new file mode 100644 index 00000000..fa7e4aa6 --- /dev/null +++ b/web/tools/line-course/sample-material-colors.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +"""Samples embedded GLB base-color textures to representative sRGB colours. + +Most line GLBs reference a baseColorTexture without a baseColorFactor, so the +material colour cannot be read from the JSON alone. This script decodes each +embedded image with Pillow, averages it (after downsampling), multiplies by the +factor when present, and writes material-colors.json for build-line-spec.mjs. + +Usage: python3 -I sample-material-colors.py [sourceDir] [outFile] +""" +import io +import json +import os +import struct +import sys + +from PIL import Image + +here = os.path.dirname(os.path.abspath(__file__)) +source_dir = sys.argv[1] if len(sys.argv) > 1 else "/home/mes123456/FreeCADWasmDev/working/GLTFmodel" +out_file = sys.argv[2] if len(sys.argv) > 2 else os.path.join(here, "material-colors.json") + + +def read_glb(path): + with open(path, "rb") as handle: + handle.read(12) + gltf = None + binary = b"" + while True: + header = handle.read(8) + if len(header) < 8: + break + length, kind = struct.unpack(" errors.push(String(error))); +page.on("console", message => { if (message.type() === "error") errors.push(message.text().slice(0, 200)); }); +page.on("response", response => { if (response.status() >= 400) failed.push(`${response.status()} ${response.url()}`); }); +const report = { schema: "freecad-web-line-course/assembly-page/v1", url, errors, failed }; +await page.goto(url, { waitUntil: "load", timeout: 120000 }); +await page.waitForFunction(() => window.__lineAssemblyReady === true, null, { timeout: 180000 }); +await page.waitForTimeout(1200); +report.stats = await page.evaluate(() => window.__lineAssemblyStats); +report.filters = await page.locator('select[aria-label="Filter model"] option').count(); +await page.screenshot({ path: path.join(webRoot, "teaching", "cases", "production-line-assembly.png") }); +report.ok = report.stats?.loaded === 88 && report.stats?.models === 27 && report.filters === 28 + && errors.length === 0 && failed.length === 0; +fs.writeFileSync(path.join(here, "..", "evidence", "assembly-page.json"), `${JSON.stringify(report, null, 2)}\n`); +console.log(JSON.stringify(report)); +await browser.close(); diff --git a/web/tools/line-course/spikes/course-page-check.mjs b/web/tools/line-course/spikes/course-page-check.mjs new file mode 100644 index 00000000..02010f8e --- /dev/null +++ b/web/tools/line-course/spikes/course-page-check.mjs @@ -0,0 +1,34 @@ +// Checks the generated production-line-course.html on desktop and mobile viewports. +import fs from "node:fs"; +import path from "node:path"; +import { createRequire } from "node:module"; +import { fileURLToPath } from "node:url"; +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../../.."); +const require = createRequire(path.join(webRoot, "package.json")); +const { chromium } = require("playwright"); +const url = "http://127.0.0.1:5190/cases/production-line-course.html"; +const browser = await chromium.launch({ executablePath: "/usr/bin/google-chrome", headless: true, args: ["--no-sandbox"] }); +const report = { schema: "freecad-web-line-course/course-page/v1", generatedAt: new Date().toISOString(), viewports: [] }; +for (const viewport of [{ width: 1600, height: 900 }, { width: 390, height: 844 }]) { + const page = await browser.newPage({ viewport }); + const errors = []; const failed = []; + page.on("pageerror", error => errors.push(String(error))); + page.on("response", response => { if (response.status() >= 400) failed.push(`${response.status()} ${response.url()}`); }); + const response = await page.goto(url, { waitUntil: "load", timeout: 60000 }); + await page.waitForTimeout(800); + const metrics = await page.evaluate(() => ({ + videos: document.querySelectorAll("video").length, + sources: document.querySelectorAll("video source").length, + tracks: document.querySelectorAll("track").length, + episodes: document.querySelectorAll("article.episode").length, + pending: document.querySelectorAll("article.episode.pending").length, + checkboxes: document.querySelectorAll("input[data-progress]").length, + overflow: document.documentElement.scrollWidth - document.documentElement.clientWidth, + })); + report.viewports.push({ viewport, status: response?.status(), errors, failed, ...metrics }); + await page.close(); +} +await browser.close(); +fs.writeFileSync(path.join(here, "..", "evidence", "course-page.json"), `${JSON.stringify(report, null, 2)}\n`); +console.log(JSON.stringify(report)); diff --git a/web/tools/line-course/spikes/export-line-stls.mjs b/web/tools/line-course/spikes/export-line-stls.mjs new file mode 100644 index 00000000..0b3d74aa --- /dev/null +++ b/web/tools/line-course/spikes/export-line-stls.mjs @@ -0,0 +1,56 @@ +// Exports one STL per built part from E18.FCStd into teaching/cases/line-parts/. +import fs from "node:fs"; +import path from "node:path"; +import { createRequire } from "node:module"; +import { fileURLToPath } from "node:url"; +import { seedOpfsFromBytes, listOpfsFiles, readOpfsFile } from "../../carrier-course/lib/opfs.mjs"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../../.."); +const require = createRequire(path.join(webRoot, "package.json")); +const { chromium } = require("playwright"); +const spec = JSON.parse(fs.readFileSync(path.join(webRoot, "tools/line-course/line-spec.json"), "utf8")); +const checkpoint = path.join(webRoot, "tools/line-course/checkpoints/E18.FCStd"); +const outDir = path.join(webRoot, "teaching/cases/line-parts"); +fs.mkdirSync(outDir, { recursive: true }); +const browser = await chromium.launch({ executablePath: "/usr/bin/google-chrome", headless: true, + args: ["--no-sandbox", "--disable-dev-shm-usage", "--enable-unsafe-swiftshader", "--use-gl=angle", + "--use-angle=swiftshader", "--window-size=1600,900"] }); +const page = await browser.newPage({ viewport: { width: 1600, height: 900 } }); +const mapping = {}; +try { + await page.goto("http://127.0.0.1:5181/project.html", { waitUntil: "domcontentloaded", timeout: 120000 }); + await page.waitForTimeout(1200); + await seedOpfsFromBytes(page, "line-course-E18.FCStd", fs.readFileSync(checkpoint)); + await page.goto("http://127.0.0.1:5181/project.html?workbench=Part&fcstd=line-course-E18.FCStd", { waitUntil: "domcontentloaded", timeout: 120000 }); + await page.waitForSelector('select[aria-label="Workbench"]', { timeout: 120000 }); + for (let attempt = 0; attempt < 120; attempt++) { + await page.waitForTimeout(500); + if ((await page.locator(".fc-tree-text").count()) >= 88) break; + } + await page.evaluate(() => { const details = document.querySelector(".file-tools"); if (details) details.open = true; }); + await page.locator('select[aria-label="Native export format"]').selectOption("stl"); + for (const model of spec.models) for (const part of model.parts) { + const row = page.locator(".fc-tree-text", { hasText: part.partName }).first(); + if (!(await row.count())) { console.log("missing row", part.partName); continue; } + await row.click(); + await page.waitForTimeout(250); + const before = await listOpfsFiles(page, "freecad-exports"); + await page.locator('button[aria-label="导出选中对象"]').click(); + let created = []; + for (let attempt = 0; attempt < 30; attempt++) { + await page.waitForTimeout(300); + const after = await listOpfsFiles(page, "freecad-exports"); + created = after.filter(name => !before.includes(name)); + if (created.length) break; + } + if (!created.length) { console.log("no export", part.partName); continue; } + const file = created[0]; + const bytes = (await readOpfsFile(page, file, "freecad-exports")).bytes; + fs.writeFileSync(path.join(outDir, `${part.partName}.stl`), Buffer.from(bytes)); + mapping[part.partName] = file; + console.log("exported", part.partName, file, bytes.byteLength); + } + fs.writeFileSync(path.join(outDir, "mapping.json"), `${JSON.stringify(mapping, null, 2)}\n`); +} catch (error) { console.log("error", String(error)); } +await browser.close(); diff --git a/web/tools/line-course/spikes/export-stls-node.mjs b/web/tools/line-course/spikes/export-stls-node.mjs new file mode 100644 index 00000000..25dec603 --- /dev/null +++ b/web/tools/line-course/spikes/export-stls-node.mjs @@ -0,0 +1,47 @@ +// Exports one STL per part from E18.FCStd using the Node WASM probe (no browser). +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { loadWasmProbe } from "../../../../tools/wasm-probe-runtime.mjs"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../../.."); +const checkpoint = path.join(webRoot, "tools", "line-course", "checkpoints", "E18.FCStd"); +const outDir = path.join(webRoot, "teaching", "cases", "line-parts"); +fs.mkdirSync(outDir, { recursive: true }); +const document = "LineCourseExport"; +const { kernel } = await loadWasmProbe(path.join(webRoot, "public/kernel"), "FreeCADWebDocumentProbe"); +const raw = (cmd, args) => JSON.parse(kernel.ccall("fc_web_dispatch_json", "string", ["string"], + [JSON.stringify({ cmd, args })])); +kernel.FS.writeFile(`/tmp/${document}.FCStd`, new Uint8Array(fs.readFileSync(checkpoint))); +const opened = raw("part.document", { document, action: "open", path: `/tmp/${document}.FCStd`, includeMesh: false }); +if (!opened.ok) throw new Error(`open failed: ${JSON.stringify(opened)}`); +const py = String.raw` +import FreeCAD as App, Mesh, os, json +d = App.getDocument('${document}') +os.makedirs('/tmp/line-stl', exist_ok=True) +rows = [] +for o in d.Objects: + s = getattr(o, 'Shape', None) + if s is None or s.isNull(): + continue + path = '/tmp/line-stl/' + o.Label + '.stl' + Mesh.export([o], path) + rows.append({'label': o.Label, 'bytes': os.path.getsize(path)}) +open('/tmp/line-stl/rows.json', 'w').write(json.dumps(rows)) +`; +const executed = raw("part.documentViewCommand", { + owner: "DocumentProbe", document, command: "Std_CommandLine", + parameters: { operation: "submit", source: `exec(${JSON.stringify(py)})` }, +}); +if (!executed.ok) throw new Error(`python failed: ${JSON.stringify(executed)}`); +const rows = JSON.parse(kernel.FS.readFile("/tmp/line-stl/rows.json", { encoding: "utf8" })); +const mapping = {}; +for (const row of rows) { + const bytes = kernel.FS.readFile(`/tmp/line-stl/${row.label}.stl`); + fs.writeFileSync(path.join(outDir, `${row.label}.stl`), Buffer.from(bytes)); + mapping[row.label] = row.bytes; +} +fs.writeFileSync(path.join(outDir, "mapping.json"), `${JSON.stringify(mapping, null, 2)}\n`); +kernel.PThread?.terminateAllThreads?.(); +console.log(JSON.stringify({ ok: rows.length > 0, files: rows.length, outDir, totalBytes: rows.reduce((sum, row) => sum + row.bytes, 0) })); diff --git a/web/tools/line-course/spikes/line-reference-smoke.mjs b/web/tools/line-course/spikes/line-reference-smoke.mjs new file mode 100644 index 00000000..68a44389 --- /dev/null +++ b/web/tools/line-course/spikes/line-reference-smoke.mjs @@ -0,0 +1,73 @@ +// Smoke: open the production-line reference panel and fetch GLBs from the +// working reference directory via Playwright route interception (no public copy). +import fs from "node:fs"; +import path from "node:path"; +import { createRequire } from "node:module"; +import { fileURLToPath } from "node:url"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../../.."); +const require = createRequire(path.join(webRoot, "package.json")); +const { chromium } = require("playwright"); +const sourceDir = "/home/mes123456/FreeCADWasmDev/working/GLTFmodel"; +const shot = path.join(here, "line-reference-smoke.png"); + +const browser = await chromium.launch({ executablePath: "/usr/bin/google-chrome", headless: true, + args: ["--no-sandbox", "--disable-dev-shm-usage", "--enable-unsafe-swiftshader", "--use-gl=angle", "--use-angle=swiftshader"] }); +const page = await browser.newPage({ viewport: { width: 1600, height: 900 } }); +const errors = []; const consoleErrors = []; +page.on("pageerror", error => errors.push(String(error))); +page.on("console", message => { if (message.type() === "error") consoleErrors.push(message.text().slice(0, 200)); }); +await page.route("**/line-glb/*.glb", route => { + const name = decodeURIComponent(new URL(route.request().url()).pathname.split("/").pop() ?? ""); + const file = path.join(sourceDir, name); + if (!fs.existsSync(file)) return route.fulfill({ status: 404, body: "missing" }); + return route.fulfill({ status: 200, contentType: "model/gltf-binary", body: fs.readFileSync(file) }); +}); + +const result = { ok: false, steps: [] }; +try { + await page.goto("http://127.0.0.1:5181/project.html?workbench=Part", { waitUntil: "domcontentloaded", timeout: 120000 }); + await page.waitForSelector('select[aria-label="Workbench"]', { timeout: 120000 }); + await page.waitForTimeout(1200); + await page.locator('nav[aria-label="Application menus"] details').filter({ hasText: "File" }).locator("summary").click(); + await page.getByRole("button", { name: "新建 Document" }).click(); + await page.waitForTimeout(2200); + result.steps.push({ step: "document", status: await page.locator('footer [role="status"]').textContent().catch(() => "") }); + await page.getByRole("button", { name: "Toggle line reference viewer" }).click(); + const panel = page.getByRole("complementary", { name: "Line reference viewer" }); + await panel.waitFor({ state: "visible", timeout: 30000 }); + const select = panel.locator('select[aria-label="Reference model"]'); + await select.waitFor({ state: "visible", timeout: 30000 }); + for (let attempt = 0; attempt < 60; attempt++) { + await page.waitForTimeout(500); + const footer = await panel.locator("footer").textContent().catch(() => ""); + if (/个网格/.test(footer ?? "")) break; + } + const options = await select.locator("option").allTextContents(); + result.steps.push({ step: "panel", options: options.length, + footer: await panel.locator("footer").textContent() }); + await select.selectOption({ label: "地面与地线" }); + let ground = ""; + for (let attempt = 0; attempt < 80; attempt++) { + await page.waitForTimeout(500); + ground = await panel.locator("footer").textContent().catch(() => ""); + if (/4\.8[0-9]/.test(ground ?? "")) break; + } + result.steps.push({ step: "ground", footer: ground }); + await panel.screenshot({ path: shot }); + result.options = options.length; + result.groundFooter = ground; + result.ok = options.length === 27 && /4\.8[0-9] × 3\.6[0-9] × 0\.3[0-9]/.test(ground ?? "") + && errors.length === 0 && consoleErrors.length === 0; +} catch (error) { + result.error = String(error?.stack ?? error); +} finally { + result.pageErrors = errors; result.consoleErrors = consoleErrors; + result.screenshot = shot; + const evidenceDir = path.join(here, "..", "evidence", "p0"); + fs.mkdirSync(evidenceDir, { recursive: true }); + fs.writeFileSync(path.join(evidenceDir, "reference-smoke.json"), `${JSON.stringify(result, null, 2)}\n`); + console.log(JSON.stringify(result, null, 2)); + await browser.close(); +} diff --git a/web/tools/line-course/spikes/line-reference-smoke.png b/web/tools/line-course/spikes/line-reference-smoke.png new file mode 100644 index 00000000..8da66341 Binary files /dev/null and b/web/tools/line-course/spikes/line-reference-smoke.png differ diff --git a/web/tools/line-course/spikes/reference-page-check.mjs b/web/tools/line-course/spikes/reference-page-check.mjs new file mode 100644 index 00000000..578079df --- /dev/null +++ b/web/tools/line-course/spikes/reference-page-check.mjs @@ -0,0 +1,33 @@ +// Checks production-line-reference.html and captures the hero screenshot. +import fs from "node:fs"; +import path from "node:path"; +import { createRequire } from "node:module"; +import { fileURLToPath } from "node:url"; +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../../.."); +const require = createRequire(path.join(webRoot, "package.json")); +const { chromium } = require("playwright"); +const url = "http://127.0.0.1:5190/cases/production-line-reference.html"; +const browser = await chromium.launch({ executablePath: "/usr/bin/google-chrome", headless: true, + args: ["--no-sandbox", "--enable-unsafe-swiftshader", "--use-gl=angle", "--use-angle=swiftshader"] }); +const page = await browser.newPage({ viewport: { width: 1600, height: 900 } }); +const errors = []; const failed = []; +page.on("pageerror", error => errors.push(String(error))); +page.on("console", message => { if (message.type() === "error") errors.push(message.text().slice(0, 200)); }); +page.on("response", response => { if (response.status() >= 400) failed.push(`${response.status()} ${response.url()}`); }); +const report = { schema: "freecad-web-line-course/reference-page/v1", url, errors, failed }; +await page.goto(url, { waitUntil: "load", timeout: 120000 }); +await page.waitForFunction(() => window.__lineReferenceReady === true, null, { timeout: 120000 }); +await page.waitForTimeout(800); +report.options = await page.locator('select[aria-label="Reference model"] option').count(); +report.first = await page.evaluate(() => window.__lineReferenceStats); +await page.locator('select[aria-label="Reference model"]').selectOption({ label: "地面与地线" }); +await page.waitForFunction(() => window.__lineReferenceStats?.file === "地面平面.glb", null, { timeout: 120000 }); +await page.waitForTimeout(600); +report.ground = await page.evaluate(() => window.__lineReferenceStats); +await page.screenshot({ path: path.join(webRoot, "teaching", "cases", "production-line-reference.png") }); +report.ok = report.options === 27 && errors.length === 0 && failed.length === 0 + && /4\.8[0-9] × 3\.6[0-9] × 0\.3[0-9]/.test(report.ground.stats); +fs.writeFileSync(path.join(here, "..", "evidence", "reference-page.json"), `${JSON.stringify(report, null, 2)}\n`); +console.log(JSON.stringify(report)); +await browser.close(); diff --git a/web/tools/line-course/stills/E01/S00-title.png b/web/tools/line-course/stills/E01/S00-title.png new file mode 100644 index 00000000..483ff323 Binary files /dev/null and b/web/tools/line-course/stills/E01/S00-title.png differ diff --git a/web/tools/line-course/stills/E01/S01-interface.png b/web/tools/line-course/stills/E01/S01-interface.png new file mode 100644 index 00000000..3efeac70 Binary files /dev/null and b/web/tools/line-course/stills/E01/S01-interface.png differ diff --git a/web/tools/line-course/stills/E01/S02-reference.png b/web/tools/line-course/stills/E01/S02-reference.png new file mode 100644 index 00000000..27da3e0c Binary files /dev/null and b/web/tools/line-course/stills/E01/S02-reference.png differ diff --git a/web/tools/line-course/stills/E01/S03-cabinet.png b/web/tools/line-course/stills/E01/S03-cabinet.png new file mode 100644 index 00000000..192e2c21 Binary files /dev/null and b/web/tools/line-course/stills/E01/S03-cabinet.png differ diff --git a/web/tools/line-course/stills/E01/S04-units.png b/web/tools/line-course/stills/E01/S04-units.png new file mode 100644 index 00000000..abfe24a4 Binary files /dev/null and b/web/tools/line-course/stills/E01/S04-units.png differ diff --git a/web/tools/line-course/stills/E01/S05-recap.png b/web/tools/line-course/stills/E01/S05-recap.png new file mode 100644 index 00000000..2d428f4d Binary files /dev/null and b/web/tools/line-course/stills/E01/S05-recap.png differ diff --git a/web/tools/line-course/stills/E02/S00-title.png b/web/tools/line-course/stills/E02/S00-title.png new file mode 100644 index 00000000..685d5a6f Binary files /dev/null and b/web/tools/line-course/stills/E02/S00-title.png differ diff --git a/web/tools/line-course/stills/E02/S01-reference.png b/web/tools/line-course/stills/E02/S01-reference.png new file mode 100644 index 00000000..81b7199b Binary files /dev/null and b/web/tools/line-course/stills/E02/S01-reference.png differ diff --git a/web/tools/line-course/stills/E02/S02-table.png b/web/tools/line-course/stills/E02/S02-table.png new file mode 100644 index 00000000..1b976854 Binary files /dev/null and b/web/tools/line-course/stills/E02/S02-table.png differ diff --git a/web/tools/line-course/stills/E02/S03-formula.png b/web/tools/line-course/stills/E02/S03-formula.png new file mode 100644 index 00000000..10366d8d Binary files /dev/null and b/web/tools/line-course/stills/E02/S03-formula.png differ diff --git a/web/tools/line-course/stills/E02/S04-audit.png b/web/tools/line-course/stills/E02/S04-audit.png new file mode 100644 index 00000000..4cf31896 Binary files /dev/null and b/web/tools/line-course/stills/E02/S04-audit.png differ diff --git a/web/tools/line-course/stills/E02/S05-recap.png b/web/tools/line-course/stills/E02/S05-recap.png new file mode 100644 index 00000000..8812a8f1 Binary files /dev/null and b/web/tools/line-course/stills/E02/S05-recap.png differ diff --git a/web/tools/line-course/stills/E03/S00-title.png b/web/tools/line-course/stills/E03/S00-title.png new file mode 100644 index 00000000..ba666556 Binary files /dev/null and b/web/tools/line-course/stills/E03/S00-title.png differ diff --git a/web/tools/line-course/stills/E03/S01-document.png b/web/tools/line-course/stills/E03/S01-document.png new file mode 100644 index 00000000..946d0c9e Binary files /dev/null and b/web/tools/line-course/stills/E03/S01-document.png differ diff --git a/web/tools/line-course/stills/E03/S02-parts.png b/web/tools/line-course/stills/E03/S02-parts.png new file mode 100644 index 00000000..eb9a18f8 Binary files /dev/null and b/web/tools/line-course/stills/E03/S02-parts.png differ diff --git a/web/tools/line-course/stills/E03/S03-parts.png b/web/tools/line-course/stills/E03/S03-parts.png new file mode 100644 index 00000000..e15938e5 Binary files /dev/null and b/web/tools/line-course/stills/E03/S03-parts.png differ diff --git a/web/tools/line-course/stills/E03/S04-parts.png b/web/tools/line-course/stills/E03/S04-parts.png new file mode 100644 index 00000000..7cba5b51 Binary files /dev/null and b/web/tools/line-course/stills/E03/S04-parts.png differ diff --git a/web/tools/line-course/stills/E03/S05-parts.png b/web/tools/line-course/stills/E03/S05-parts.png new file mode 100644 index 00000000..d4b4c515 Binary files /dev/null and b/web/tools/line-course/stills/E03/S05-parts.png differ diff --git a/web/tools/line-course/stills/E03/S06-recap.png b/web/tools/line-course/stills/E03/S06-recap.png new file mode 100644 index 00000000..79a70172 Binary files /dev/null and b/web/tools/line-course/stills/E03/S06-recap.png differ diff --git a/web/tools/line-course/stills/E04/S00-title.png b/web/tools/line-course/stills/E04/S00-title.png new file mode 100644 index 00000000..bdacf3f3 Binary files /dev/null and b/web/tools/line-course/stills/E04/S00-title.png differ diff --git a/web/tools/line-course/stills/E04/S01-start.png b/web/tools/line-course/stills/E04/S01-start.png new file mode 100644 index 00000000..9b171dc3 Binary files /dev/null and b/web/tools/line-course/stills/E04/S01-start.png differ diff --git a/web/tools/line-course/stills/E04/S02-parts.png b/web/tools/line-course/stills/E04/S02-parts.png new file mode 100644 index 00000000..d0cdd88d Binary files /dev/null and b/web/tools/line-course/stills/E04/S02-parts.png differ diff --git a/web/tools/line-course/stills/E04/S03-parts.png b/web/tools/line-course/stills/E04/S03-parts.png new file mode 100644 index 00000000..0e962c2f Binary files /dev/null and b/web/tools/line-course/stills/E04/S03-parts.png differ diff --git a/web/tools/line-course/stills/E04/S04-parts.png b/web/tools/line-course/stills/E04/S04-parts.png new file mode 100644 index 00000000..80c4c7e4 Binary files /dev/null and b/web/tools/line-course/stills/E04/S04-parts.png differ diff --git a/web/tools/line-course/stills/E04/S05-parts.png b/web/tools/line-course/stills/E04/S05-parts.png new file mode 100644 index 00000000..8f445648 Binary files /dev/null and b/web/tools/line-course/stills/E04/S05-parts.png differ diff --git a/web/tools/line-course/stills/E04/S06-recap.png b/web/tools/line-course/stills/E04/S06-recap.png new file mode 100644 index 00000000..9cb568c3 Binary files /dev/null and b/web/tools/line-course/stills/E04/S06-recap.png differ diff --git a/web/tools/line-course/stills/E05/S00-title.png b/web/tools/line-course/stills/E05/S00-title.png new file mode 100644 index 00000000..43b7667a Binary files /dev/null and b/web/tools/line-course/stills/E05/S00-title.png differ diff --git a/web/tools/line-course/stills/E05/S01-start.png b/web/tools/line-course/stills/E05/S01-start.png new file mode 100644 index 00000000..6a1d1883 Binary files /dev/null and b/web/tools/line-course/stills/E05/S01-start.png differ diff --git a/web/tools/line-course/stills/E05/S02-parts.png b/web/tools/line-course/stills/E05/S02-parts.png new file mode 100644 index 00000000..29416f35 Binary files /dev/null and b/web/tools/line-course/stills/E05/S02-parts.png differ diff --git a/web/tools/line-course/stills/E05/S03-parts.png b/web/tools/line-course/stills/E05/S03-parts.png new file mode 100644 index 00000000..07e78222 Binary files /dev/null and b/web/tools/line-course/stills/E05/S03-parts.png differ diff --git a/web/tools/line-course/stills/E05/S04-parts.png b/web/tools/line-course/stills/E05/S04-parts.png new file mode 100644 index 00000000..b91f6bcf Binary files /dev/null and b/web/tools/line-course/stills/E05/S04-parts.png differ diff --git a/web/tools/line-course/stills/E05/S05-recap.png b/web/tools/line-course/stills/E05/S05-recap.png new file mode 100644 index 00000000..bff1c944 Binary files /dev/null and b/web/tools/line-course/stills/E05/S05-recap.png differ diff --git a/web/tools/line-course/stills/E06/S00-title.png b/web/tools/line-course/stills/E06/S00-title.png new file mode 100644 index 00000000..1d52f745 Binary files /dev/null and b/web/tools/line-course/stills/E06/S00-title.png differ diff --git a/web/tools/line-course/stills/E06/S01-start.png b/web/tools/line-course/stills/E06/S01-start.png new file mode 100644 index 00000000..0645f864 Binary files /dev/null and b/web/tools/line-course/stills/E06/S01-start.png differ diff --git a/web/tools/line-course/stills/E06/S02-parts.png b/web/tools/line-course/stills/E06/S02-parts.png new file mode 100644 index 00000000..9ca39806 Binary files /dev/null and b/web/tools/line-course/stills/E06/S02-parts.png differ diff --git a/web/tools/line-course/stills/E06/S03-parts.png b/web/tools/line-course/stills/E06/S03-parts.png new file mode 100644 index 00000000..b2e2ccf2 Binary files /dev/null and b/web/tools/line-course/stills/E06/S03-parts.png differ diff --git a/web/tools/line-course/stills/E06/S04-parts.png b/web/tools/line-course/stills/E06/S04-parts.png new file mode 100644 index 00000000..1020f592 Binary files /dev/null and b/web/tools/line-course/stills/E06/S04-parts.png differ diff --git a/web/tools/line-course/stills/E06/S05-parts.png b/web/tools/line-course/stills/E06/S05-parts.png new file mode 100644 index 00000000..705a2285 Binary files /dev/null and b/web/tools/line-course/stills/E06/S05-parts.png differ diff --git a/web/tools/line-course/stills/E06/S06-recap.png b/web/tools/line-course/stills/E06/S06-recap.png new file mode 100644 index 00000000..58883bec Binary files /dev/null and b/web/tools/line-course/stills/E06/S06-recap.png differ diff --git a/web/tools/line-course/stills/E07/S00-title.png b/web/tools/line-course/stills/E07/S00-title.png new file mode 100644 index 00000000..2edffc57 Binary files /dev/null and b/web/tools/line-course/stills/E07/S00-title.png differ diff --git a/web/tools/line-course/stills/E07/S01-start.png b/web/tools/line-course/stills/E07/S01-start.png new file mode 100644 index 00000000..d9891af9 Binary files /dev/null and b/web/tools/line-course/stills/E07/S01-start.png differ diff --git a/web/tools/line-course/stills/E07/S02-parts.png b/web/tools/line-course/stills/E07/S02-parts.png new file mode 100644 index 00000000..3f539eb9 Binary files /dev/null and b/web/tools/line-course/stills/E07/S02-parts.png differ diff --git a/web/tools/line-course/stills/E07/S03-parts.png b/web/tools/line-course/stills/E07/S03-parts.png new file mode 100644 index 00000000..e7b4a3cf Binary files /dev/null and b/web/tools/line-course/stills/E07/S03-parts.png differ diff --git a/web/tools/line-course/stills/E07/S04-parts.png b/web/tools/line-course/stills/E07/S04-parts.png new file mode 100644 index 00000000..ecd7e8c2 Binary files /dev/null and b/web/tools/line-course/stills/E07/S04-parts.png differ diff --git a/web/tools/line-course/stills/E07/S05-parts.png b/web/tools/line-course/stills/E07/S05-parts.png new file mode 100644 index 00000000..a998e334 Binary files /dev/null and b/web/tools/line-course/stills/E07/S05-parts.png differ diff --git a/web/tools/line-course/stills/E07/S06-recap.png b/web/tools/line-course/stills/E07/S06-recap.png new file mode 100644 index 00000000..d21a7cc8 Binary files /dev/null and b/web/tools/line-course/stills/E07/S06-recap.png differ diff --git a/web/tools/line-course/stills/E08/S00-title.png b/web/tools/line-course/stills/E08/S00-title.png new file mode 100644 index 00000000..421d2596 Binary files /dev/null and b/web/tools/line-course/stills/E08/S00-title.png differ diff --git a/web/tools/line-course/stills/E08/S01-start.png b/web/tools/line-course/stills/E08/S01-start.png new file mode 100644 index 00000000..afa38a47 Binary files /dev/null and b/web/tools/line-course/stills/E08/S01-start.png differ diff --git a/web/tools/line-course/stills/E08/S02-parts.png b/web/tools/line-course/stills/E08/S02-parts.png new file mode 100644 index 00000000..4dd61adf Binary files /dev/null and b/web/tools/line-course/stills/E08/S02-parts.png differ diff --git a/web/tools/line-course/stills/E08/S03-parts.png b/web/tools/line-course/stills/E08/S03-parts.png new file mode 100644 index 00000000..2ebfbca2 Binary files /dev/null and b/web/tools/line-course/stills/E08/S03-parts.png differ diff --git a/web/tools/line-course/stills/E08/S04-recap.png b/web/tools/line-course/stills/E08/S04-recap.png new file mode 100644 index 00000000..a03c4a14 Binary files /dev/null and b/web/tools/line-course/stills/E08/S04-recap.png differ diff --git a/web/tools/line-course/stills/E09/S00-title.png b/web/tools/line-course/stills/E09/S00-title.png new file mode 100644 index 00000000..b8d273aa Binary files /dev/null and b/web/tools/line-course/stills/E09/S00-title.png differ diff --git a/web/tools/line-course/stills/E09/S01-start.png b/web/tools/line-course/stills/E09/S01-start.png new file mode 100644 index 00000000..d5ed37d8 Binary files /dev/null and b/web/tools/line-course/stills/E09/S01-start.png differ diff --git a/web/tools/line-course/stills/E09/S02-parts.png b/web/tools/line-course/stills/E09/S02-parts.png new file mode 100644 index 00000000..f55c8602 Binary files /dev/null and b/web/tools/line-course/stills/E09/S02-parts.png differ diff --git a/web/tools/line-course/stills/E09/S03-parts.png b/web/tools/line-course/stills/E09/S03-parts.png new file mode 100644 index 00000000..3a1f3c34 Binary files /dev/null and b/web/tools/line-course/stills/E09/S03-parts.png differ diff --git a/web/tools/line-course/stills/E09/S04-parts.png b/web/tools/line-course/stills/E09/S04-parts.png new file mode 100644 index 00000000..1fb64f10 Binary files /dev/null and b/web/tools/line-course/stills/E09/S04-parts.png differ diff --git a/web/tools/line-course/stills/E09/S05-parts.png b/web/tools/line-course/stills/E09/S05-parts.png new file mode 100644 index 00000000..7bf0f087 Binary files /dev/null and b/web/tools/line-course/stills/E09/S05-parts.png differ diff --git a/web/tools/line-course/stills/E09/S06-recap.png b/web/tools/line-course/stills/E09/S06-recap.png new file mode 100644 index 00000000..b6235e59 Binary files /dev/null and b/web/tools/line-course/stills/E09/S06-recap.png differ diff --git a/web/tools/line-course/stills/E10/S00-title.png b/web/tools/line-course/stills/E10/S00-title.png new file mode 100644 index 00000000..5a2d4863 Binary files /dev/null and b/web/tools/line-course/stills/E10/S00-title.png differ diff --git a/web/tools/line-course/stills/E10/S01-start.png b/web/tools/line-course/stills/E10/S01-start.png new file mode 100644 index 00000000..91b6941c Binary files /dev/null and b/web/tools/line-course/stills/E10/S01-start.png differ diff --git a/web/tools/line-course/stills/E10/S02-parts.png b/web/tools/line-course/stills/E10/S02-parts.png new file mode 100644 index 00000000..9bc1d9a7 Binary files /dev/null and b/web/tools/line-course/stills/E10/S02-parts.png differ diff --git a/web/tools/line-course/stills/E10/S03-parts.png b/web/tools/line-course/stills/E10/S03-parts.png new file mode 100644 index 00000000..426eb779 Binary files /dev/null and b/web/tools/line-course/stills/E10/S03-parts.png differ diff --git a/web/tools/line-course/stills/E10/S04-parts.png b/web/tools/line-course/stills/E10/S04-parts.png new file mode 100644 index 00000000..60d74f0d Binary files /dev/null and b/web/tools/line-course/stills/E10/S04-parts.png differ diff --git a/web/tools/line-course/stills/E10/S05-parts.png b/web/tools/line-course/stills/E10/S05-parts.png new file mode 100644 index 00000000..1d42a8f9 Binary files /dev/null and b/web/tools/line-course/stills/E10/S05-parts.png differ diff --git a/web/tools/line-course/stills/E10/S06-recap.png b/web/tools/line-course/stills/E10/S06-recap.png new file mode 100644 index 00000000..38462ec1 Binary files /dev/null and b/web/tools/line-course/stills/E10/S06-recap.png differ diff --git a/web/tools/line-course/stills/E11/S00-title.png b/web/tools/line-course/stills/E11/S00-title.png new file mode 100644 index 00000000..0e16ab07 Binary files /dev/null and b/web/tools/line-course/stills/E11/S00-title.png differ diff --git a/web/tools/line-course/stills/E11/S01-start.png b/web/tools/line-course/stills/E11/S01-start.png new file mode 100644 index 00000000..db746c48 Binary files /dev/null and b/web/tools/line-course/stills/E11/S01-start.png differ diff --git a/web/tools/line-course/stills/E11/S02-parts.png b/web/tools/line-course/stills/E11/S02-parts.png new file mode 100644 index 00000000..c4d91f0b Binary files /dev/null and b/web/tools/line-course/stills/E11/S02-parts.png differ diff --git a/web/tools/line-course/stills/E11/S03-parts.png b/web/tools/line-course/stills/E11/S03-parts.png new file mode 100644 index 00000000..a101aed5 Binary files /dev/null and b/web/tools/line-course/stills/E11/S03-parts.png differ diff --git a/web/tools/line-course/stills/E11/S04-recap.png b/web/tools/line-course/stills/E11/S04-recap.png new file mode 100644 index 00000000..02689867 Binary files /dev/null and b/web/tools/line-course/stills/E11/S04-recap.png differ diff --git a/web/tools/line-course/stills/E12/S00-title.png b/web/tools/line-course/stills/E12/S00-title.png new file mode 100644 index 00000000..5e994080 Binary files /dev/null and b/web/tools/line-course/stills/E12/S00-title.png differ diff --git a/web/tools/line-course/stills/E12/S01-start.png b/web/tools/line-course/stills/E12/S01-start.png new file mode 100644 index 00000000..321c2a46 Binary files /dev/null and b/web/tools/line-course/stills/E12/S01-start.png differ diff --git a/web/tools/line-course/stills/E12/S02-parts.png b/web/tools/line-course/stills/E12/S02-parts.png new file mode 100644 index 00000000..4a625a6a Binary files /dev/null and b/web/tools/line-course/stills/E12/S02-parts.png differ diff --git a/web/tools/line-course/stills/E12/S03-parts.png b/web/tools/line-course/stills/E12/S03-parts.png new file mode 100644 index 00000000..d527e861 Binary files /dev/null and b/web/tools/line-course/stills/E12/S03-parts.png differ diff --git a/web/tools/line-course/stills/E12/S04-recap.png b/web/tools/line-course/stills/E12/S04-recap.png new file mode 100644 index 00000000..4d18c4d1 Binary files /dev/null and b/web/tools/line-course/stills/E12/S04-recap.png differ diff --git a/web/tools/line-course/stills/E13/S00-title.png b/web/tools/line-course/stills/E13/S00-title.png new file mode 100644 index 00000000..53999dc2 Binary files /dev/null and b/web/tools/line-course/stills/E13/S00-title.png differ diff --git a/web/tools/line-course/stills/E13/S01-start.png b/web/tools/line-course/stills/E13/S01-start.png new file mode 100644 index 00000000..b228e26e Binary files /dev/null and b/web/tools/line-course/stills/E13/S01-start.png differ diff --git a/web/tools/line-course/stills/E13/S02-parts.png b/web/tools/line-course/stills/E13/S02-parts.png new file mode 100644 index 00000000..2028a43b Binary files /dev/null and b/web/tools/line-course/stills/E13/S02-parts.png differ diff --git a/web/tools/line-course/stills/E13/S03-parts.png b/web/tools/line-course/stills/E13/S03-parts.png new file mode 100644 index 00000000..4a9a73af Binary files /dev/null and b/web/tools/line-course/stills/E13/S03-parts.png differ diff --git a/web/tools/line-course/stills/E13/S04-parts.png b/web/tools/line-course/stills/E13/S04-parts.png new file mode 100644 index 00000000..fee9d660 Binary files /dev/null and b/web/tools/line-course/stills/E13/S04-parts.png differ diff --git a/web/tools/line-course/stills/E13/S05-parts.png b/web/tools/line-course/stills/E13/S05-parts.png new file mode 100644 index 00000000..fba45919 Binary files /dev/null and b/web/tools/line-course/stills/E13/S05-parts.png differ diff --git a/web/tools/line-course/stills/E13/S06-recap.png b/web/tools/line-course/stills/E13/S06-recap.png new file mode 100644 index 00000000..b35984f8 Binary files /dev/null and b/web/tools/line-course/stills/E13/S06-recap.png differ diff --git a/web/tools/line-course/stills/E14/S00-title.png b/web/tools/line-course/stills/E14/S00-title.png new file mode 100644 index 00000000..57e66688 Binary files /dev/null and b/web/tools/line-course/stills/E14/S00-title.png differ diff --git a/web/tools/line-course/stills/E14/S01-start.png b/web/tools/line-course/stills/E14/S01-start.png new file mode 100644 index 00000000..902b36f3 Binary files /dev/null and b/web/tools/line-course/stills/E14/S01-start.png differ diff --git a/web/tools/line-course/stills/E14/S02-parts.png b/web/tools/line-course/stills/E14/S02-parts.png new file mode 100644 index 00000000..19cc8e5b Binary files /dev/null and b/web/tools/line-course/stills/E14/S02-parts.png differ diff --git a/web/tools/line-course/stills/E14/S03-parts.png b/web/tools/line-course/stills/E14/S03-parts.png new file mode 100644 index 00000000..580dcc5e Binary files /dev/null and b/web/tools/line-course/stills/E14/S03-parts.png differ diff --git a/web/tools/line-course/stills/E14/S04-parts.png b/web/tools/line-course/stills/E14/S04-parts.png new file mode 100644 index 00000000..73e7f2b4 Binary files /dev/null and b/web/tools/line-course/stills/E14/S04-parts.png differ diff --git a/web/tools/line-course/stills/E14/S05-parts.png b/web/tools/line-course/stills/E14/S05-parts.png new file mode 100644 index 00000000..582be594 Binary files /dev/null and b/web/tools/line-course/stills/E14/S05-parts.png differ diff --git a/web/tools/line-course/stills/E14/S06-parts.png b/web/tools/line-course/stills/E14/S06-parts.png new file mode 100644 index 00000000..e3f1d1bb Binary files /dev/null and b/web/tools/line-course/stills/E14/S06-parts.png differ diff --git a/web/tools/line-course/stills/E14/S07-parts.png b/web/tools/line-course/stills/E14/S07-parts.png new file mode 100644 index 00000000..39bbd7fd Binary files /dev/null and b/web/tools/line-course/stills/E14/S07-parts.png differ diff --git a/web/tools/line-course/stills/E14/S08-recap.png b/web/tools/line-course/stills/E14/S08-recap.png new file mode 100644 index 00000000..dc9d78d2 Binary files /dev/null and b/web/tools/line-course/stills/E14/S08-recap.png differ diff --git a/web/tools/line-course/stills/E15/S00-title.png b/web/tools/line-course/stills/E15/S00-title.png new file mode 100644 index 00000000..b60299d5 Binary files /dev/null and b/web/tools/line-course/stills/E15/S00-title.png differ diff --git a/web/tools/line-course/stills/E15/S01-checkpoint.png b/web/tools/line-course/stills/E15/S01-checkpoint.png new file mode 100644 index 00000000..2fcd1bbb Binary files /dev/null and b/web/tools/line-course/stills/E15/S01-checkpoint.png differ diff --git a/web/tools/line-course/stills/E15/S02-reference.png b/web/tools/line-course/stills/E15/S02-reference.png new file mode 100644 index 00000000..a7e7d9e1 Binary files /dev/null and b/web/tools/line-course/stills/E15/S02-reference.png differ diff --git a/web/tools/line-course/stills/E15/S03-robot.png b/web/tools/line-course/stills/E15/S03-robot.png new file mode 100644 index 00000000..4422143c Binary files /dev/null and b/web/tools/line-course/stills/E15/S03-robot.png differ diff --git a/web/tools/line-course/stills/E15/S04-recap.png b/web/tools/line-course/stills/E15/S04-recap.png new file mode 100644 index 00000000..a09738da Binary files /dev/null and b/web/tools/line-course/stills/E15/S04-recap.png differ diff --git a/web/tools/line-course/stills/E16/S00-title.png b/web/tools/line-course/stills/E16/S00-title.png new file mode 100644 index 00000000..b1bdb844 Binary files /dev/null and b/web/tools/line-course/stills/E16/S00-title.png differ diff --git a/web/tools/line-course/stills/E16/S01-start.png b/web/tools/line-course/stills/E16/S01-start.png new file mode 100644 index 00000000..ad3054bf Binary files /dev/null and b/web/tools/line-course/stills/E16/S01-start.png differ diff --git a/web/tools/line-course/stills/E16/S02-parts.png b/web/tools/line-course/stills/E16/S02-parts.png new file mode 100644 index 00000000..8825f269 Binary files /dev/null and b/web/tools/line-course/stills/E16/S02-parts.png differ diff --git a/web/tools/line-course/stills/E16/S03-parts.png b/web/tools/line-course/stills/E16/S03-parts.png new file mode 100644 index 00000000..47e6005d Binary files /dev/null and b/web/tools/line-course/stills/E16/S03-parts.png differ diff --git a/web/tools/line-course/stills/E16/S04-parts.png b/web/tools/line-course/stills/E16/S04-parts.png new file mode 100644 index 00000000..8685fb8a Binary files /dev/null and b/web/tools/line-course/stills/E16/S04-parts.png differ diff --git a/web/tools/line-course/stills/E16/S05-recap.png b/web/tools/line-course/stills/E16/S05-recap.png new file mode 100644 index 00000000..1d2ec21e Binary files /dev/null and b/web/tools/line-course/stills/E16/S05-recap.png differ diff --git a/web/tools/line-course/stills/E17/S00-title.png b/web/tools/line-course/stills/E17/S00-title.png new file mode 100644 index 00000000..b49cd83e Binary files /dev/null and b/web/tools/line-course/stills/E17/S00-title.png differ diff --git a/web/tools/line-course/stills/E17/S01-assembly.png b/web/tools/line-course/stills/E17/S01-assembly.png new file mode 100644 index 00000000..f8acabaa Binary files /dev/null and b/web/tools/line-course/stills/E17/S01-assembly.png differ diff --git a/web/tools/line-course/stills/E17/S02-links.png b/web/tools/line-course/stills/E17/S02-links.png new file mode 100644 index 00000000..df51fa76 Binary files /dev/null and b/web/tools/line-course/stills/E17/S02-links.png differ diff --git a/web/tools/line-course/stills/E17/S03-audit.png b/web/tools/line-course/stills/E17/S03-audit.png new file mode 100644 index 00000000..f059251d Binary files /dev/null and b/web/tools/line-course/stills/E17/S03-audit.png differ diff --git a/web/tools/line-course/stills/E17/S04-recap.png b/web/tools/line-course/stills/E17/S04-recap.png new file mode 100644 index 00000000..f545c41f Binary files /dev/null and b/web/tools/line-course/stills/E17/S04-recap.png differ diff --git a/web/tools/line-course/stills/E18/S00-title.png b/web/tools/line-course/stills/E18/S00-title.png new file mode 100644 index 00000000..67d54136 Binary files /dev/null and b/web/tools/line-course/stills/E18/S00-title.png differ diff --git a/web/tools/line-course/stills/E18/S01-audit.png b/web/tools/line-course/stills/E18/S01-audit.png new file mode 100644 index 00000000..ccc4b507 Binary files /dev/null and b/web/tools/line-course/stills/E18/S01-audit.png differ diff --git a/web/tools/line-course/stills/E18/S02-exports.png b/web/tools/line-course/stills/E18/S02-exports.png new file mode 100644 index 00000000..b5b3a73f Binary files /dev/null and b/web/tools/line-course/stills/E18/S02-exports.png differ diff --git a/web/tools/line-course/stills/E18/S03-recap.png b/web/tools/line-course/stills/E18/S03-recap.png new file mode 100644 index 00000000..eea2e6ea Binary files /dev/null and b/web/tools/line-course/stills/E18/S03-recap.png differ diff --git a/web/tools/line-course/stills/E18/S04-delivery.png b/web/tools/line-course/stills/E18/S04-delivery.png new file mode 100644 index 00000000..369493d2 Binary files /dev/null and b/web/tools/line-course/stills/E18/S04-delivery.png differ diff --git a/web/tools/line-course/verify.mjs b/web/tools/line-course/verify.mjs new file mode 100644 index 00000000..8837b8ad --- /dev/null +++ b/web/tools/line-course/verify.mjs @@ -0,0 +1,130 @@ +#!/usr/bin/env node +// Verifies one course episode: media codecs/duration/audio, subtitles, HTTP +// range, page errors, stills and checkpoint presence. Writes evidence JSON. +import fs from "node:fs"; +import path from "node:path"; +import { spawnSync } from "node:child_process"; +import { fileURLToPath } from "node:url"; +import { checkLineCheckpoint } from "./lib/line-precision.mjs"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const webRoot = path.resolve(here, "../.."); +const args = process.argv.slice(2); +const option = (name, fallback = "") => { + const index = args.indexOf(name); + return index < 0 ? fallback : args[index + 1] ?? fallback; +}; +const episodeId = option("--episode"); +if (!episodeId) throw new Error("--episode is required"); +const course = JSON.parse(fs.readFileSync(path.join(here, "course.json"), "utf8")); +const episode = course.episodes.find(item => item.id === episodeId); +if (!episode) throw new Error(`unknown episode ${episodeId}`); +const episodeDir = path.join(here, "episodes", episodeId); +const rawDir = path.join(here, "raw", episodeId); +const evidenceDir = path.join(here, "evidence", episodeId); +fs.mkdirSync(evidenceDir, { recursive: true }); +const base = `${episode.id}-${episode.slug}`; +const mediaDir = path.join(webRoot, "teaching", "media", "line-course"); +const mp4 = path.join(mediaDir, `${base}.mp4`); +const webm = path.join(mediaDir, `${base}.webm`); +const vtt = path.join(mediaDir, `${base}.zh.vtt`); +const srt = path.join(mediaDir, `${base}.zh.srt`); +const poster = path.join(mediaDir, `${base}-poster.png`); +const checks = []; +const check = (name, passed, detail) => { + checks.push({ name, passed: Boolean(passed), detail }); + if (!passed) throw new Error(`${name}: ${JSON.stringify(detail)}`); +}; +const probe = file => { + const result = spawnSync("ffprobe", ["-v", "error", "-show_streams", "-show_format", "-of", "json", file], { encoding: "utf8", maxBuffer: 32 * 1024 * 1024 }); + if (result.status !== 0) throw new Error(`ffprobe failed for ${file}: ${result.stderr}`); + return JSON.parse(result.stdout); +}; +const volume = file => { + const result = spawnSync("ffmpeg", ["-hide_banner", "-i", file, "-af", "volumedetect", "-f", "null", "-"], { encoding: "utf8", maxBuffer: 32 * 1024 * 1024 }); + const text = `${result.stderr || ""}`; + const mean = Number(/mean_volume:\s*(-?\d+(?:\.\d+)?) dB/.exec(text)?.[1]); + const max = Number(/max_volume:\s*(-?\d+(?:\.\d+)?) dB/.exec(text)?.[1]); + return { mean, max }; +}; +const fetchHead = async url => { + const response = await fetch(url, { method: "HEAD" }); + return { status: response.status, type: response.headers.get("content-type"), ranges: response.headers.get("accept-ranges") }; +}; + +check("mp4 exists", fs.existsSync(mp4), mp4); +check("webm exists", fs.existsSync(webm), webm); +check("vtt exists", fs.existsSync(vtt), vtt); +check("srt exists", fs.existsSync(srt), srt); +check("poster exists", fs.existsSync(poster), poster); +const mp4Probe = probe(mp4); +const webmProbe = probe(webm); +const video = mp4Probe.streams.find(stream => stream.codec_type === "video"); +const audio = mp4Probe.streams.find(stream => stream.codec_type === "audio"); +const webmVideo = webmProbe.streams.find(stream => stream.codec_type === "video"); +const webmAudio = webmProbe.streams.find(stream => stream.codec_type === "audio"); +const duration = Number(mp4Probe.format.duration); +check("mp4 h264 1600x900", video?.codec_name === "h264" && video.width === 1600 && video.height === 900, video); +check("mp4 aac audio", audio?.codec_name === "aac", audio); +check("webm vp9/opus", webmVideo?.codec_name === "vp9" && webmAudio?.codec_name === "opus", { video: webmVideo?.codec_name, audio: webmAudio?.codec_name }); +const [minDuration, maxDuration] = episode.durationRange ?? [60, 1800]; +check("duration in range", duration >= minDuration && duration <= maxDuration, { duration, range: [minDuration, maxDuration] }); +const levels = volume(mp4); +check("audio not silent", levels.mean > -50 && levels.max > -9, levels); +const cueCount = (fs.readFileSync(vtt, "utf8").match(/-->/g) ?? []).length; +check("vtt cues", cueCount > 0, cueCount); + +const mediaUrl = `http://127.0.0.1:5190/media/line-course/${base}.mp4`; +const head = await fetchHead(mediaUrl); +check("media HTTP 200", head.status === 200, head); +check("media MIME", /video\/mp4/.test(head.type ?? ""), head.type); +check("media Accept-Ranges", /bytes/.test(head.ranges ?? ""), head.ranges); +const range = await fetch(mediaUrl, { headers: { Range: "bytes=0-1023" } }); +check("media Range 206", range.status === 206, range.status); +const badRange = await fetch(mediaUrl, { headers: { Range: "bytes=999999999-" } }); +check("media bad Range 416", badRange.status === 416, badRange.status); + +const sessionPath = path.join(rawDir, "session.json"); +const session = fs.existsSync(sessionPath) ? JSON.parse(fs.readFileSync(sessionPath, "utf8")) : null; +check("session exists", Boolean(session), sessionPath); +check("0 pageErrors", (session?.pageErrors?.length ?? 0) === 0, session?.pageErrors); +check("0 consoleErrors", (session?.consoleErrors?.length ?? 0) === 0, session?.consoleErrors); +const stills = fs.existsSync(path.join(here, "stills", episodeId)) + ? fs.readdirSync(path.join(here, "stills", episodeId)).filter(name => name.endsWith(".png")) + : []; +check("stills exist", stills.length > 0, stills.length); +const checkpoint = path.join(here, "checkpoints", `${episodeId}.FCStd`); +if (episode.expectedObjects !== null && episode.expectedObjects !== undefined) { + check("checkpoint exists", fs.existsSync(checkpoint), checkpoint); +} +let precision = null; +const expectedObjects = episode.checkpointObjects ?? episode.objects; +if (fs.existsSync(checkpoint) && Array.isArray(expectedObjects) && expectedObjects.length) { + precision = await checkLineCheckpoint(checkpoint, expectedObjects); + check("precision profile", precision.ok, { + objectCount: precision.objectCount, + extra: precision.extra, + models: precision.models.filter(model => !model.ok), + failures: precision.results.filter(result => !result.ok).map(result => ({ name: result.name, issues: result.issues })), + }); +} +const report = { + schema: "freecad-web-line-course/video-verification/v1", + generatedAt: new Date().toISOString(), + episode: episodeId, + title: episode.title, + status: "passed", + checks, + duration, + scenes: JSON.parse(fs.readFileSync(path.join(episodeDir, "assembly.json"), "utf8")).scenes, + cues: cueCount, + audio: levels, + stills, + precision, + checkpoint: fs.existsSync(checkpoint) ? path.relative(here, checkpoint) : null, + mp4: { video, audio }, + webm: { video: webmVideo, audio: webmAudio }, +}; +fs.writeFileSync(path.join(evidenceDir, "verification.json"), `${JSON.stringify(report, null, 2)}\n`); +fs.writeFileSync(path.join(evidenceDir, "ffprobe.json"), `${JSON.stringify({ mp4: mp4Probe, webm: webmProbe }, null, 2)}\n`); +console.log(JSON.stringify({ ok: true, episode: episodeId, duration, checks: checks.length, cues: cueCount, stills: stills.length })); diff --git a/web/vite.config.ts b/web/vite.config.ts new file mode 100644 index 00000000..010ff10a --- /dev/null +++ b/web/vite.config.ts @@ -0,0 +1,115 @@ +import { defineConfig } from "vite"; +import { fastPublicAssets } from "./tools/fast-public-assets.ts"; + +const isolationHeaders = { + "Cross-Origin-Opener-Policy": "same-origin", + "Cross-Origin-Embedder-Policy": "require-corp", +}; + +export default defineConfig({ + server: { headers: isolationHeaders }, + preview: { headers: isolationHeaders }, + plugins: [...(process.env.FREECAD_WEB_FAST_LINK === "ON" ? [fastPublicAssets()] : []), { + name: "freecad-web-csp", + transformIndexHtml(html) { + const policy = "default-src 'self'; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' blob:; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https: http:; connect-src 'self' https: http: blob:; frame-src 'self' blob:; font-src 'self' blob: data:; media-src 'self' blob: data:; object-src 'none'; base-uri 'self'"; + return { + html, + tags: [ + { tag: "meta", attrs: { "http-equiv": "Content-Security-Policy", content: policy }, injectTo: "head" }, + { tag: "script", attrs: { type: "module", src: "/module-preload.js" }, injectTo: "head-prepend" }, + ], + }; + }, + }], + build: { + rollupOptions: { + input: { + main: "index.html", + core: "core.html", + mcp: "mcp.html", + document: "document.html", + "main-chain": "main-chain.html", + project: "project.html", + full: "full.html", + workbench: "workbench.html", + python: "python.html", + assembly: "assembly.html", + bim: "bim.html", + "bim-workshop": "bim-workshop.html", + carrier: "carrier.html", + cam: "cam.html", + cloud: "cloud.html", + draft: "draft.html", + fem: "fem.html", + help: "help.html", + import: "import.html", + inspection: "inspection.html", + jtreader: "jtreader.html", + material: "material.html", + measure: "measure.html", + mesh: "mesh.html", + meshpart: "meshpart.html", + openscad: "openscad.html", + part: "part.html", + "part-io": "part-io.html", + "part-inspect": "part-inspect.html", + "part-python": "part-python.html", + "part-save": "part-save.html", + "partdesign-save": "partdesign-save.html", + partdesign: "partdesign.html", + "partdesign-inspect": "partdesign-inspect.html", + "partdesign-python": "partdesign-python.html", + "points-save": "points-save.html", + points: "points.html", + sandbox: "sandbox.html", + "sandbox-inspect": "sandbox-inspect.html", + "sandbox-python": "sandbox-python.html", + "sandbox-save": "sandbox-save.html", + sketcher: "sketcher.html", + "sketcher-persistence": "sketcher-persistence.html", + "plot-python": "plot-python.html", + "reverseengineering-inspect": "reverseengineering-inspect.html", + "reverseengineering-python": "reverseengineering-python.html", + "reverseengineering-save": "reverseengineering-save.html", + "reverseengineering-create": "reverseengineering-create.html", + "robot-create": "robot-create.html", + "robot-save": "robot-save.html", + "robot-inspect": "robot-inspect.html", + "robot-python": "robot-python.html", + spreadsheet: "spreadsheet.html", + "spreadsheet-inspect": "spreadsheet-inspect.html", + "spreadsheet-python": "spreadsheet-python.html", + "spreadsheet-save": "spreadsheet-save.html", + "surface-save": "surface-save.html", + start: "start.html", + "start-inspect": "start-inspect.html", + "start-python": "start-python.html", + templatepymod: "templatepymod.html", + "templatepymod-python": "templatepymod-python.html", + "templatepymod-family": "templatepymod-family.html", + web: "web.html", + test: "test.html", + "web-action-03": "web-persistence.html", + tux: "tux.html", + techdraw: "techdraw.html", + "techdraw-native": "techdraw-native.html", + "techdraw-inspect": "techdraw-inspect.html", + "techdraw-python": "techdraw-python.html", + "techdraw-save": "techdraw-save.html", + surface: "surface.html", + "surface-object-contract": "surface-object-contract.html", + "surface-inspect": "surface-inspect.html", + "surface-python": "surface-python.html", + "show-inspect": "show-inspect.html", + "show-python": "show-python.html", + "show-python-family": "show-python-family.html", + "show-visibility": "show-visibility.html", + "sketcher-inspect": "sketcher-inspect.html", + "sketcher-python": "sketcher-python.html", + "points-inspect": "points-inspect.html", + "points-python": "points-python.html", + }, + }, + }, +});