replicator-workshop 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. replicator/__init__.py +6 -0
  2. replicator/app.py +204 -0
  3. replicator/config.py +48 -0
  4. replicator/core/__init__.py +0 -0
  5. replicator/core/assembly.py +117 -0
  6. replicator/core/blender_link.py +161 -0
  7. replicator/core/critique.py +594 -0
  8. replicator/core/drawing.py +389 -0
  9. replicator/core/dxf.py +120 -0
  10. replicator/core/evaluate.py +439 -0
  11. replicator/core/explain.py +139 -0
  12. replicator/core/export.py +96 -0
  13. replicator/core/fit.py +170 -0
  14. replicator/core/importers.py +185 -0
  15. replicator/core/materials.py +104 -0
  16. replicator/core/ops_advanced.py +496 -0
  17. replicator/core/ops_engineering.py +223 -0
  18. replicator/core/physics.py +147 -0
  19. replicator/core/printers.py +100 -0
  20. replicator/core/program.py +298 -0
  21. replicator/core/render.py +145 -0
  22. replicator/core/reverse.py +350 -0
  23. replicator/core/robot.py +153 -0
  24. replicator/core/step.py +245 -0
  25. replicator/fixtures/gaming_pc_liquid.json +2259 -0
  26. replicator/fixtures/gas_generator_rocket.json +876 -0
  27. replicator/fixtures/gas_generator_rocket_aero.json +861 -0
  28. replicator/fixtures/house_two_bed.json +979 -0
  29. replicator/fixtures/quadcopter_drone.json +687 -0
  30. replicator/fixtures/raspberry_pi_5.json +884 -0
  31. replicator/fixtures/rocket_engine.json +652 -0
  32. replicator/fixtures/turbofan.json +931 -0
  33. replicator/fixtures/vector_engine.json +314 -0
  34. replicator/gpu.py +81 -0
  35. replicator/image3d/__init__.py +0 -0
  36. replicator/image3d/comfy.py +181 -0
  37. replicator/image3d/pipeline.py +208 -0
  38. replicator/image3d/sheet.py +154 -0
  39. replicator/knowledge/__init__.py +61 -0
  40. replicator/knowledge/car_wheel_corner.md +21 -0
  41. replicator/knowledge/desk_lamp.md +21 -0
  42. replicator/knowledge/desktop_pc.md +20 -0
  43. replicator/knowledge/electronics_board.md +21 -0
  44. replicator/knowledge/exoskeleton.md +21 -0
  45. replicator/knowledge/house.md +22 -0
  46. replicator/knowledge/light_aircraft.md +22 -0
  47. replicator/knowledge/multirotor_drone.md +25 -0
  48. replicator/knowledge/print_replica.md +13 -0
  49. replicator/knowledge/rocket_engine.md +27 -0
  50. replicator/knowledge/turbofan.md +23 -0
  51. replicator/llm/__init__.py +0 -0
  52. replicator/llm/client.py +424 -0
  53. replicator/llm/prompts/blueprint.md +28 -0
  54. replicator/llm/prompts/edit.md +15 -0
  55. replicator/llm/prompts/explain.md +37 -0
  56. replicator/llm/prompts/name_parts.md +13 -0
  57. replicator/llm/prompts/program.md +72 -0
  58. replicator/llm/prompts/research_queries.md +8 -0
  59. replicator/mcp_server.py +307 -0
  60. replicator/qml/Main.qml +874 -0
  61. replicator/qml/Replicator/UI/Chip.qml +17 -0
  62. replicator/qml/Replicator/UI/DockHeader.qml +27 -0
  63. replicator/qml/Replicator/UI/Icon.qml +118 -0
  64. replicator/qml/Replicator/UI/IconButton.qml +31 -0
  65. replicator/qml/Replicator/UI/Kbd.qml +18 -0
  66. replicator/qml/Replicator/UI/NumField.qml +69 -0
  67. replicator/qml/Replicator/UI/Pill.qml +28 -0
  68. replicator/qml/Replicator/UI/RCombo.qml +51 -0
  69. replicator/qml/Replicator/UI/RMenu.qml +42 -0
  70. replicator/qml/Replicator/UI/RSlider.qml +23 -0
  71. replicator/qml/Replicator/UI/Segmented.qml +63 -0
  72. replicator/qml/Replicator/UI/Swatch.qml +47 -0
  73. replicator/qml/Replicator/UI/Theme.qml +149 -0
  74. replicator/qml/Replicator/UI/qmldir +14 -0
  75. replicator/qml/panels/AgentPrompt.qml +53 -0
  76. replicator/qml/panels/AttributeManager.qml +171 -0
  77. replicator/qml/panels/Commander.qml +136 -0
  78. replicator/qml/panels/HolodeckPanel.qml +117 -0
  79. replicator/qml/panels/IssuesCard.qml +78 -0
  80. replicator/qml/panels/LedgerPanel.qml +110 -0
  81. replicator/qml/panels/MaterialShelf.qml +97 -0
  82. replicator/qml/panels/ObjectManager.qml +107 -0
  83. replicator/qml/panels/Preferences.qml +211 -0
  84. replicator/qml/panels/Presenter.qml +316 -0
  85. replicator/qml/panels/StatusBar.qml +77 -0
  86. replicator/qml/panels/Timeline.qml +149 -0
  87. replicator/qml/panels/Welcome.qml +126 -0
  88. replicator/qml/viewport/Callouts.qml +87 -0
  89. replicator/qml/viewport/EdgeMaterial.qml +16 -0
  90. replicator/qml/viewport/GridMaterial.qml +16 -0
  91. replicator/qml/viewport/HoloMaterial.qml +23 -0
  92. replicator/qml/viewport/NavGizmo.qml +72 -0
  93. replicator/qml/viewport/ReferenceMaterial.qml +17 -0
  94. replicator/qml/viewport/Viewport.qml +583 -0
  95. replicator/qt/__init__.py +0 -0
  96. replicator/qt/bridge.py +1427 -0
  97. replicator/qt/drawing_sheet.py +33 -0
  98. replicator/qt/envmap.py +40 -0
  99. replicator/qt/library.py +68 -0
  100. replicator/qt/mesh_geometry.py +167 -0
  101. replicator/qt/svg.py +41 -0
  102. replicator/research/__init__.py +0 -0
  103. replicator/research/lane.py +281 -0
  104. replicator/shaders/edge.frag +9 -0
  105. replicator/shaders/edge.vert +7 -0
  106. replicator/shaders/grid.frag +52 -0
  107. replicator/shaders/grid.vert +6 -0
  108. replicator/shaders/holo.frag +41 -0
  109. replicator/shaders/reference.frag +15 -0
  110. replicator/shaders/reference.vert +6 -0
  111. replicator/voice.py +120 -0
  112. replicator_workshop-0.1.0.dist-info/METADATA +410 -0
  113. replicator_workshop-0.1.0.dist-info/RECORD +118 -0
  114. replicator_workshop-0.1.0.dist-info/WHEEL +5 -0
  115. replicator_workshop-0.1.0.dist-info/entry_points.txt +3 -0
  116. replicator_workshop-0.1.0.dist-info/licenses/LICENSE +21 -0
  117. replicator_workshop-0.1.0.dist-info/licenses/vendor/mcp-for-blender/LICENSE +21 -0
  118. replicator_workshop-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,78 @@
1
+ import QtQuick
2
+ import QtQuick.Layouts
3
+ import Replicator.UI
4
+
5
+ // The accuracy critic's findings for the current build, measured from the geometry. A "fix" issue is a real defect
6
+ // (wrong axis, floating, buried); a "warn" is worth a look. Click one to select and frame its part.
7
+ Rectangle {
8
+ id: card
9
+ property bool open: false
10
+ signal chosen(string cid)
11
+ readonly property var issues: studio.issues
12
+ readonly property int fixes: issues.filter(i => i.severity === "fix").length
13
+ readonly property bool fixing: studio.busy.indexOf("Fixing") === 0
14
+ readonly property color tone: fixes ? Theme.danger : issues.length ? Theme.inferred : Theme.observed
15
+ width: open ? 380 : head.implicitWidth + 22
16
+ height: open ? Math.min(col.implicitHeight + 16, 340) : 28
17
+ radius: open ? Theme.r3 : 14
18
+ color: Theme.glass
19
+ border.color: Qt.rgba(tone.r, tone.g, tone.b, 0.55)
20
+ clip: true
21
+ Behavior on height { enabled: !boot.shot; NumberAnimation { duration: Theme.fast } }
22
+
23
+ ColumnLayout {
24
+ id: col
25
+ x: 11; y: 6; width: card.width - 22
26
+ spacing: 6
27
+ RowLayout {
28
+ id: head
29
+ spacing: 6
30
+ Icon { name: card.issues.length ? "alert" : "check"; size: 14; color: card.tone; opacity: studio.measuring ? 0.5 : 1 }
31
+ Text {
32
+ text: card.fixing ? "Agent is fixing…" : studio.measuring ? "Measuring…" : card.issues.length === 0 ? "Accuracy checks pass"
33
+ : (card.fixes ? card.fixes + " to fix" : "") + (card.fixes && card.issues.length > card.fixes ? ", " : "")
34
+ + (card.issues.length > card.fixes ? (card.issues.length - card.fixes) + " to review" : "")
35
+ color: Theme.viewText; font.pixelSize: Theme.fsSmall; font.family: Theme.sans; font.weight: Font.DemiBold
36
+ }
37
+ Icon { visible: card.issues.length > 0; name: card.open ? "chevronDown" : "chevronRight"; size: 11; color: Theme.viewDim }
38
+ MouseArea { Layout.fillWidth: true; implicitHeight: 1 }
39
+ }
40
+ Repeater {
41
+ model: card.open ? card.issues : []
42
+ delegate: Rectangle {
43
+ id: it
44
+ required property var modelData
45
+ Layout.fillWidth: true
46
+ implicitHeight: msg.implicitHeight + 10
47
+ radius: Theme.r1
48
+ color: ima.containsMouse ? Theme.hover : "transparent"
49
+ readonly property bool isFix: it.modelData.severity === "fix"
50
+ readonly property color sevColor: isFix ? Theme.danger : Theme.inferred
51
+ Rectangle { x: 0; y: 5; width: 2; height: parent.height - 10; radius: 1; color: it.sevColor }
52
+ Text {
53
+ id: msg
54
+ x: 9; y: 5; width: parent.width - 12
55
+ text: "<b><font color='" + it.sevColor + "'>" + (it.isFix ? "FIX" : "REVIEW") + "</font></b> "
56
+ + it.modelData.message.replace(/&/g, "&amp;").replace(/</g, "&lt;")
57
+ textFormat: Text.RichText; wrapMode: Text.WordWrap
58
+ color: Theme.viewText; font.pixelSize: Theme.fsTiny; font.family: Theme.sans
59
+ }
60
+ MouseArea { id: ima; anchors.fill: parent; hoverEnabled: true; enabled: it.modelData.subject !== ""
61
+ cursorShape: Qt.PointingHandCursor; onClicked: card.chosen(it.modelData.subject) }
62
+ }
63
+ }
64
+ Pill {
65
+ visible: card.open && card.fixes > 0
66
+ text: card.fixing ? "Fixing…" : "Fix with the agent"
67
+ icon: "sparkle"; primary: true
68
+ enabled: studio.busy === "" && !studio.measuring
69
+ onHit: studio.fixIssues()
70
+ }
71
+ }
72
+ MouseArea {
73
+ width: card.width; height: 28
74
+ enabled: card.issues.length > 0
75
+ cursorShape: Qt.PointingHandCursor
76
+ onClicked: card.open = !card.open
77
+ }
78
+ }
@@ -0,0 +1,110 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+ import QtQuick.Layouts
4
+ import Replicator.UI
5
+
6
+ // Reverse engineering: the evidence ledger (observed / inferred / unknown, each with its evidence) and the
7
+ // checklist of questions with their status. A guess is never shown as a measurement.
8
+ Rectangle {
9
+ id: lp
10
+ color: Theme.panel
11
+ signal importRequested()
12
+ signal disassemble()
13
+
14
+ ColumnLayout {
15
+ anchors.fill: parent
16
+ anchors.margins: 10
17
+ spacing: 8
18
+ Flow {
19
+ Layout.fillWidth: true
20
+ spacing: 6
21
+ Pill { text: "Import model…"; icon: "importIn"; primary: true; onHit: lp.importRequested() }
22
+ Pill { text: "Disassemble"; icon: "playBack"; onHit: lp.disassemble() }
23
+ Pill {
24
+ visible: studio.reportInput.suggested_scale !== undefined && studio.dimensions.length === 3
25
+ && Math.max(studio.dimensions[0], studio.dimensions[1], studio.dimensions[2]) < 2
26
+ icon: "ruler"
27
+ text: "Metres → mm (×1000)"
28
+ enabled: studio.busy === ""
29
+ onHit: studio.rescale(studio.reportInput.suggested_scale)
30
+ }
31
+ Pill {
32
+ icon: "sparkle"
33
+ text: studio.busy.indexOf("Naming") === 0 ? "Naming…" : "Name parts"
34
+ enabled: studio.busy === "" && studio.components.length > 0
35
+ onHit: studio.nameParts()
36
+ }
37
+ }
38
+ Text {
39
+ text: (studio.reportInput.file || "No model") + (studio.reportInput.format ? " · " + studio.reportInput.format : "")
40
+ color: Theme.text; font.pixelSize: Theme.fs; font.family: Theme.sans; font.weight: Font.DemiBold
41
+ elide: Text.ElideMiddle; Layout.fillWidth: true
42
+ }
43
+ Text {
44
+ text: "CHECKLIST"; color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; font.weight: Font.DemiBold; font.letterSpacing: Theme.caps
45
+ }
46
+ Repeater {
47
+ model: studio.checklist
48
+ delegate: RowLayout {
49
+ required property var modelData
50
+ Layout.fillWidth: true
51
+ spacing: 6
52
+ Rectangle {
53
+ width: 8; height: 8; radius: 4
54
+ color: modelData.status.indexOf("unresolved") === 0 ? Theme.unknown
55
+ : modelData.status.indexOf("partly") === 0 ? Theme.inferred : Theme.observed
56
+ }
57
+ Text { text: modelData.q; color: Theme.text; font.pixelSize: Theme.fsSmall; Layout.fillWidth: true; elide: Text.ElideRight }
58
+ Text { text: modelData.status; color: Theme.dim; font.pixelSize: 10 }
59
+ }
60
+ }
61
+ Text { text: "EVIDENCE LEDGER"; color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; font.weight: Font.DemiBold; font.letterSpacing: Theme.caps; Layout.topMargin: 6 }
62
+ ListView {
63
+ Layout.fillWidth: true
64
+ Layout.fillHeight: true
65
+ clip: true
66
+ spacing: 4
67
+ model: studio.ledger
68
+ ScrollBar.vertical: ScrollBar {}
69
+ delegate: Rectangle {
70
+ required property var modelData
71
+ width: ListView.view.width - 8
72
+ height: body.implicitHeight + 10
73
+ radius: Theme.r2
74
+ color: Theme.panel2
75
+ border.color: studio.selected !== "" && modelData.subject === studio.selected ? Theme.amber : Theme.lineSoft
76
+ Rectangle { // evidence class stripe
77
+ x: 0; y: 6; width: 2; height: parent.height - 12; radius: 1
78
+ color: modelData.kind === "observed" ? Theme.observed : modelData.kind === "inferred" ? Theme.inferred : Theme.unknown
79
+ }
80
+ ColumnLayout {
81
+ id: body
82
+ x: 8; y: 5; width: parent.width - 16
83
+ spacing: 2
84
+ RowLayout {
85
+ spacing: 6
86
+ Rectangle {
87
+ implicitWidth: tag.implicitWidth + 10; implicitHeight: 15; radius: 3
88
+ readonly property color kc: modelData.kind === "observed" ? Theme.observed : modelData.kind === "inferred" ? Theme.inferred : Theme.unknown
89
+ color: Qt.rgba(kc.r, kc.g, kc.b, 0.16)
90
+ Text {
91
+ id: tag; anchors.centerIn: parent; text: modelData.kind.toUpperCase()
92
+ color: modelData.kind === "observed" ? Theme.observed : modelData.kind === "inferred" ? Theme.inferred : Theme.unknown
93
+ font.pixelSize: 9; font.bold: true; font.letterSpacing: 1
94
+ }
95
+ }
96
+ Text {
97
+ visible: modelData.confidence !== undefined
98
+ text: "conf " + (modelData.confidence !== undefined ? modelData.confidence.toFixed(2) : "")
99
+ color: Theme.faint; font.pixelSize: 9; font.family: Theme.mono
100
+ }
101
+ Text { visible: modelData.subject !== ""; text: modelData.subject; color: Theme.faint; font.pixelSize: 9; font.family: Theme.mono }
102
+ }
103
+ Text { text: modelData.claim; color: Theme.text; font.pixelSize: Theme.fsSmall; font.family: Theme.sans; wrapMode: Text.WordWrap; Layout.fillWidth: true }
104
+ Text { text: "← " + modelData.evidence; color: Theme.dim; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; wrapMode: Text.WordWrap; Layout.fillWidth: true }
105
+ }
106
+ MouseArea { anchors.fill: parent; onClicked: if (modelData.subject && modelData.subject.indexOf("pattern") < 0) studio.select(modelData.subject) }
107
+ }
108
+ }
109
+ }
110
+ }
@@ -0,0 +1,97 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+ import QtQuick.Layouts
4
+ import Replicator.UI
5
+
6
+ // The material shelf: the materials this build already uses, then the library by family. Click a ball to paint
7
+ // the selected part (or every part of the selected component). With nothing selected, click a material in this build
8
+ // to start a variant, then a replacement: every part made of it changes. Each edit is one undo step.
9
+ Rectangle {
10
+ id: ms
11
+ color: Theme.panel
12
+ property string swapFrom: ""
13
+ readonly property bool canPaint: studio.selected !== "" || swapFrom !== ""
14
+ function choose(row, group) {
15
+ if (swapFrom !== "") { studio.swapMaterial(swapFrom, row.id); swapFrom = ""; return }
16
+ if (studio.selected !== "") { studio.applyMaterial(row.id); return }
17
+ if (group === "In this build") swapFrom = row.id
18
+ }
19
+ readonly property var groups: {
20
+ const out = []
21
+ const mine = studio.programMaterials
22
+ if (mine.length) out.push({ name: "In this build", rows: mine })
23
+ const by = {}
24
+ for (const m of studio.materialLibrary) { (by[m.group] = by[m.group] || []).push(m) }
25
+ for (const g of ["Aerospace", "Metal", "Polymer", "Paint", "Glow"]) if (by[g]) out.push({ name: g, rows: by[g] })
26
+ return out
27
+ }
28
+
29
+ Flickable {
30
+ anchors.fill: parent
31
+ contentHeight: col.implicitHeight + 20
32
+ clip: true
33
+ boundsBehavior: Flickable.StopAtBounds
34
+ ScrollBar.vertical: ScrollBar {}
35
+ ColumnLayout {
36
+ id: col
37
+ x: Theme.pad; y: 10
38
+ width: ms.width - Theme.pad * 2
39
+ spacing: 8
40
+ Rectangle {
41
+ Layout.fillWidth: true; implicitHeight: 30; radius: Theme.r2
42
+ color: ms.swapFrom !== "" ? Qt.rgba(Theme.inferred.r, Theme.inferred.g, Theme.inferred.b, 0.16) : ms.canPaint ? Theme.accentSoft : Theme.panel2
43
+ Row {
44
+ x: 10; anchors.verticalCenter: parent.verticalCenter; spacing: 7
45
+ Icon { name: ms.swapFrom !== "" ? "redo" : ms.canPaint ? "material" : "cursor"; size: 14; color: ms.canPaint ? Theme.accentHi : Theme.faint
46
+ anchors.verticalCenter: parent.verticalCenter }
47
+ Text { anchors.verticalCenter: parent.verticalCenter
48
+ text: ms.swapFrom !== "" ? "Replacing " + ms.swapFrom.replace(/_/g, " ") + " in every part: pick the new material"
49
+ : ms.canPaint ? "Painting " + studio.selected + (studio.selectedMaterial ? " · now " + studio.selectedMaterial.replace(/_/g, " ") : "")
50
+ : "Select a part to paint it, or click a material in this build to swap it everywhere"
51
+ color: ms.canPaint ? Theme.text : Theme.dim; font.pixelSize: Theme.fsSmall; font.family: Theme.sans }
52
+ }
53
+ }
54
+ Repeater {
55
+ model: ms.groups
56
+ delegate: ColumnLayout {
57
+ id: grp
58
+ required property var modelData
59
+ Layout.fillWidth: true
60
+ spacing: 6
61
+ Text { text: grp.modelData.name.toUpperCase(); color: Theme.faint; Layout.topMargin: 6
62
+ font.pixelSize: Theme.fsTiny; font.family: Theme.sans; font.weight: Font.DemiBold; font.letterSpacing: Theme.caps }
63
+ Flow {
64
+ Layout.fillWidth: true
65
+ spacing: 4
66
+ Repeater {
67
+ model: grp.modelData.rows
68
+ delegate: Rectangle {
69
+ id: cell
70
+ required property var modelData
71
+ readonly property bool cur: studio.selectedMaterial === modelData.id && ms.canPaint
72
+ width: 66; height: 68; radius: Theme.r2
73
+ color: cell.cur ? Theme.accentSoft : cMa.containsMouse ? Theme.hover : "transparent"
74
+ border.width: cell.cur ? 1 : 0; border.color: Theme.accentLine
75
+ opacity: ms.canPaint || grp.modelData.name === "In this build" ? 1 : 0.55
76
+ Swatch {
77
+ anchors.horizontalCenter: parent.horizontalCenter; y: 6; size: 36
78
+ base: cell.modelData.color; metal: cell.modelData.metalness; rough: cell.modelData.roughness
79
+ glow: cell.modelData.emissive
80
+ }
81
+ Text {
82
+ anchors.horizontalCenter: parent.horizontalCenter; y: 47; width: parent.width - 6
83
+ text: cell.modelData.label; color: cell.cur ? Theme.text : Theme.dim; elide: Text.ElideRight
84
+ horizontalAlignment: Text.AlignHCenter; font.pixelSize: 9; font.family: Theme.sans
85
+ }
86
+ MouseArea { id: cMa; anchors.fill: parent; hoverEnabled: true; cursorShape: Qt.PointingHandCursor
87
+ onClicked: ms.choose(cell.modelData, grp.modelData.name) }
88
+ ToolTip.visible: cMa.containsMouse; ToolTip.delay: 500
89
+ ToolTip.text: cell.modelData.label + " metal " + cell.modelData.metalness.toFixed(2) + " rough " + cell.modelData.roughness.toFixed(2)
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,107 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+ import QtQuick.Layouts
4
+ import Replicator.UI
5
+
6
+ // Object Manager: components (colour, name, part count) with their parts beneath. Row buttons appear on hover:
7
+ // play how it is made, isolate, hide. Double-click isolates.
8
+ Rectangle {
9
+ id: om
10
+ color: Theme.panel
11
+ property var hidden: ({})
12
+ property string isolate: ""
13
+ signal toggleHidden(string cid)
14
+ signal isolateComponent(string cid)
15
+ signal playComponent(string cid)
16
+ signal contextRequested(string cid, real x, real y)
17
+ property var expanded: ({})
18
+
19
+ ListView {
20
+ id: list
21
+ anchors.fill: parent
22
+ anchors.topMargin: 4
23
+ clip: true
24
+ model: studio.components
25
+ boundsBehavior: Flickable.StopAtBounds
26
+ ScrollBar.vertical: ScrollBar {}
27
+ delegate: Column {
28
+ id: row
29
+ required property var modelData
30
+ required property int index
31
+ width: list.width
32
+ readonly property bool open: om.expanded[modelData.id] === true
33
+ readonly property bool sel: studio.selectedComponent === modelData.id || studio.selected === modelData.id
34
+ readonly property bool off: om.hidden[modelData.id] === true
35
+ readonly property bool solo: om.isolate === modelData.id
36
+ Item {
37
+ width: row.width; height: Theme.row
38
+ Rectangle {
39
+ anchors.fill: parent; anchors.leftMargin: 4; anchors.rightMargin: 4; radius: Theme.r1
40
+ color: row.sel ? Theme.accentSoft : hov.containsMouse ? Theme.hover : "transparent"
41
+ }
42
+ Rectangle { visible: row.sel; x: 4; width: 2; height: parent.height - 10; anchors.verticalCenter: parent.verticalCenter; radius: 1; color: Theme.accent }
43
+ MouseArea {
44
+ id: hov; anchors.fill: parent; hoverEnabled: true
45
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
46
+ onClicked: (m) => {
47
+ studio.select(row.modelData.id)
48
+ if (m.button === Qt.RightButton) { const p = mapToItem(null, m.x, m.y); om.contextRequested(row.modelData.id, p.x, p.y) }
49
+ }
50
+ onDoubleClicked: om.isolateComponent(row.solo ? "" : row.modelData.id)
51
+ }
52
+ RowLayout {
53
+ anchors.fill: parent; anchors.leftMargin: 10; anchors.rightMargin: 8; spacing: 6
54
+ Item {
55
+ implicitWidth: 14; implicitHeight: 14
56
+ Icon { anchors.centerIn: parent; name: row.open ? "chevronDown" : "chevronRight"; size: 11; color: Theme.faint }
57
+ MouseArea { anchors.fill: parent; anchors.margins: -5
58
+ onClicked: { const e = Object.assign({}, om.expanded); e[row.modelData.id] = !row.open; om.expanded = e } }
59
+ }
60
+ Rectangle { width: 10; height: 10; radius: 3; color: row.modelData.color; opacity: row.off ? 0.35 : 1 }
61
+ Text {
62
+ Layout.fillWidth: true; text: row.modelData.label; elide: Text.ElideRight
63
+ color: row.off ? Theme.faint : Theme.text; font.pixelSize: Theme.fs; font.family: Theme.sans
64
+ }
65
+ Text { text: row.modelData.count; color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.mono
66
+ visible: !hov.containsMouse && !row.solo && !row.off }
67
+ IconButton { size: 22; iconSize: 12; icon: "play"; tip: "Play how this component is made"
68
+ visible: hov.containsMouse || containsHover; property bool containsHover: false
69
+ onHit: om.playComponent(row.modelData.id) }
70
+ IconButton { size: 22; iconSize: 13; icon: "target"; tip: "Isolate"; on: row.solo
71
+ visible: hov.containsMouse || row.solo
72
+ onHit: om.isolateComponent(row.solo ? "" : row.modelData.id) }
73
+ IconButton { size: 22; iconSize: 13; icon: row.off ? "eyeOff" : "eye"; tip: row.off ? "Show" : "Hide"
74
+ visible: hov.containsMouse || row.off
75
+ onHit: om.toggleHidden(row.modelData.id) }
76
+ }
77
+ }
78
+ Repeater {
79
+ model: row.open ? row.modelData.shapes : []
80
+ delegate: Item {
81
+ id: leaf
82
+ required property var modelData
83
+ width: row.width; height: Theme.row - 4
84
+ Rectangle {
85
+ anchors.fill: parent; anchors.leftMargin: 4; anchors.rightMargin: 4; radius: Theme.r1
86
+ color: studio.selected === leaf.modelData ? Theme.accentSoft : pm.containsMouse ? Theme.hover : "transparent"
87
+ }
88
+ Rectangle { x: 23; width: 1; height: parent.height; color: Theme.lineSoft }
89
+ Text {
90
+ x: 40; anchors.verticalCenter: parent.verticalCenter
91
+ text: leaf.modelData; color: studio.selected === leaf.modelData ? Theme.text : Theme.dim
92
+ font.pixelSize: Theme.fsSmall; font.family: Theme.mono
93
+ }
94
+ MouseArea { id: pm; anchors.fill: parent; hoverEnabled: true; onClicked: studio.select(leaf.modelData) }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ Column {
100
+ anchors.centerIn: parent; visible: studio.components.length === 0; spacing: 8
101
+ Icon { name: "layers"; size: 26; color: Theme.faint; anchors.horizontalCenter: parent.horizontalCenter }
102
+ Text {
103
+ text: "No objects yet.\nSpecify one, add a primitive,\nor import a model."
104
+ horizontalAlignment: Text.AlignHCenter; color: Theme.faint; font.pixelSize: Theme.fs; font.family: Theme.sans; lineHeight: 1.3
105
+ }
106
+ }
107
+ }
@@ -0,0 +1,211 @@
1
+ import QtQuick
2
+ import QtQuick.Controls
3
+ import QtQuick.Layouts
4
+ import Replicator.UI
5
+
6
+ // Preferences (Ctrl+,): theme, accent, density and motion, plus the workspace toggles. Every change applies at
7
+ // once and is saved; there is no OK button.
8
+ Popup {
9
+ id: pf
10
+ property var workspace // the main window (layout toggles live there)
11
+
12
+ parent: Overlay.overlay
13
+ x: Math.round((parent.width - width) / 2)
14
+ y: Math.round((parent.height - height) / 2)
15
+ width: 640
16
+ height: Math.min(implicitHeight, parent.height - 32)
17
+ padding: 22
18
+ modal: true
19
+ focus: true
20
+ closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
21
+ Overlay.modal: Rectangle { color: Theme.scrim }
22
+ background: Rectangle { radius: 16; color: Theme.raised; border.color: Theme.glassLine }
23
+ enter: Transition {
24
+ NumberAnimation { property: "opacity"; from: 0; to: 1; duration: Theme.fast }
25
+ NumberAnimation { property: "scale"; from: 0.97; to: 1; duration: Theme.med; easing.type: Easing.OutCubic }
26
+ }
27
+
28
+ component Label: Text {
29
+ color: Theme.dim; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; font.weight: Font.DemiBold; font.letterSpacing: Theme.caps
30
+ }
31
+ component Toggle: Rectangle {
32
+ id: tg
33
+ property string text
34
+ property bool on: false
35
+ signal flip()
36
+ implicitWidth: tgRow.implicitWidth + 24; implicitHeight: Theme.ctl + 4; radius: height / 2
37
+ color: on ? Theme.accentSoft : tgMa.containsMouse ? Theme.hover : "transparent"
38
+ border.color: on ? Theme.accentLine : Theme.line
39
+ Row {
40
+ id: tgRow
41
+ anchors.centerIn: parent; spacing: 6
42
+ Icon { name: tg.on ? "check" : "close"; size: 12; color: tg.on ? Theme.accentHi : Theme.faint; anchors.verticalCenter: parent.verticalCenter }
43
+ Text { text: tg.text; color: tg.on ? Theme.text : Theme.dim; font.pixelSize: Theme.fs; font.family: Theme.sans; anchors.verticalCenter: parent.verticalCenter }
44
+ }
45
+ MouseArea { id: tgMa; anchors.fill: parent; hoverEnabled: true; cursorShape: Qt.PointingHandCursor; onClicked: tg.flip() }
46
+ }
47
+
48
+ // one service setting: a label and a field saved when editing ends (Enter or focus leaves)
49
+ component ServiceField: RowLayout {
50
+ id: sf
51
+ property string key
52
+ property string label
53
+ property string hint
54
+ spacing: 10
55
+ Text { text: sf.label; color: Theme.dim; font.pixelSize: Theme.fs; font.family: Theme.sans; Layout.preferredWidth: 150 }
56
+ TextField {
57
+ Layout.fillWidth: true
58
+ implicitHeight: Theme.ctl + 2
59
+ text: studio.services[sf.key] || ""
60
+ placeholderText: sf.hint
61
+ placeholderTextColor: Theme.faint
62
+ color: Theme.text; font.pixelSize: Theme.fsSmall; font.family: Theme.mono
63
+ selectByMouse: true
64
+ background: Rectangle { radius: Theme.r2; color: Theme.field; border.color: parent.activeFocus ? Theme.accentLine : Theme.line }
65
+ onEditingFinished: if (text.trim() !== (studio.services[sf.key] || "")) studio.setService(sf.key, JSON.stringify(text.trim()))
66
+ }
67
+ }
68
+
69
+ contentItem: ColumnLayout {
70
+ spacing: 12
71
+ RowLayout {
72
+ Layout.fillWidth: true
73
+ Icon { name: "sliders"; size: 18; color: Theme.accentHi }
74
+ Text { text: "Preferences"; color: Theme.text; font.pixelSize: 18; font.family: Theme.sans; font.weight: Font.DemiBold; Layout.leftMargin: 4 }
75
+ Item { Layout.fillWidth: true }
76
+ IconButton { icon: "close"; tip: "Close"; keys: "Esc"; onHit: pf.close() }
77
+ }
78
+ Flickable { // the settings scroll under a fixed title when the window is short
79
+ id: pfBody
80
+ Layout.fillWidth: true; Layout.fillHeight: true
81
+ Layout.preferredHeight: bodyCol.implicitHeight
82
+ contentHeight: bodyCol.implicitHeight
83
+ clip: true; boundsBehavior: Flickable.StopAtBounds
84
+ ScrollBar.vertical: ScrollBar { policy: pfBody.contentHeight > pfBody.height ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff }
85
+ ColumnLayout {
86
+ id: bodyCol
87
+ width: pfBody.width - (pfBody.contentHeight > pfBody.height ? 12 : 0)
88
+ spacing: 12
89
+
90
+ Label { text: "THEME"; Layout.topMargin: 4 }
91
+ RowLayout {
92
+ Layout.fillWidth: true
93
+ spacing: 10
94
+ Repeater {
95
+ model: Object.keys(Theme.themes)
96
+ delegate: Rectangle {
97
+ id: tc
98
+ required property string modelData
99
+ readonly property var th: Theme.themes[modelData]
100
+ readonly property bool sel: Theme.themeName === modelData
101
+ Layout.fillWidth: true
102
+ implicitHeight: 116; radius: Theme.r3
103
+ color: th.bg
104
+ border.width: sel ? 2 : 1
105
+ border.color: sel ? Theme.accent : tcMa.containsMouse ? Theme.accentLine : Theme.line
106
+ // a miniature of the workspace in this theme
107
+ Rectangle { x: 8; y: 8; width: parent.width - 16; height: 10; radius: 3; color: tc.th.header }
108
+ Rectangle { x: 8; y: 21; width: 9; height: 46; radius: 3; color: tc.th.header }
109
+ Rectangle {
110
+ x: 20; y: 21; width: parent.width - 28 - 40; height: 46; radius: 3
111
+ gradient: Gradient { GradientStop { position: 0; color: tc.th.viewTop } GradientStop { position: 1; color: tc.th.viewBottom } }
112
+ Rectangle { anchors.centerIn: parent; width: 22; height: 22; radius: 5; color: Theme.accent; opacity: 0.9 }
113
+ }
114
+ Rectangle { x: parent.width - 45; y: 21; width: 37; height: 46; radius: 3; color: tc.th.panel
115
+ Column { x: 4; y: 5; spacing: 4
116
+ Repeater { model: 4; Rectangle { width: 29 - index * 4; height: 3; radius: 1.5; color: index === 1 ? Theme.accent : tc.th.dim; opacity: 0.8 } } } }
117
+ Text { x: 10; y: 76; text: tc.th.label; color: tc.th.text; font.pixelSize: Theme.fs; font.family: Theme.sans; font.weight: Font.DemiBold }
118
+ Text { x: 10; y: 93; width: parent.width - 20; text: tc.th.note; color: tc.th.dim; font.pixelSize: 9; font.family: Theme.sans; elide: Text.ElideRight }
119
+ MouseArea { id: tcMa; anchors.fill: parent; hoverEnabled: true; cursorShape: Qt.PointingHandCursor; onClicked: Theme.themeName = tc.modelData }
120
+ }
121
+ }
122
+ }
123
+
124
+ Label { text: "ACCENT"; Layout.topMargin: 6 }
125
+ RowLayout {
126
+ spacing: 8
127
+ Repeater {
128
+ model: Object.keys(Theme.accents)
129
+ delegate: Rectangle {
130
+ id: ac
131
+ required property string modelData
132
+ readonly property bool sel: Theme.accentName === modelData
133
+ implicitWidth: acRow.implicitWidth + 22; implicitHeight: Theme.ctl + 4; radius: height / 2
134
+ color: sel ? Theme.accentSoft : acMa.containsMouse ? Theme.hover : "transparent"
135
+ border.color: sel ? Theme.accentLine : Theme.line
136
+ Row {
137
+ id: acRow
138
+ anchors.centerIn: parent; spacing: 7
139
+ Rectangle { width: 12; height: 12; radius: 6; color: Theme.accents[ac.modelData].base; anchors.verticalCenter: parent.verticalCenter }
140
+ Text { text: Theme.accents[ac.modelData].label; color: ac.sel ? Theme.text : Theme.dim
141
+ font.pixelSize: Theme.fs; font.family: Theme.sans; anchors.verticalCenter: parent.verticalCenter }
142
+ }
143
+ MouseArea { id: acMa; anchors.fill: parent; hoverEnabled: true; cursorShape: Qt.PointingHandCursor; onClicked: Theme.accentName = ac.modelData }
144
+ }
145
+ }
146
+ }
147
+
148
+ RowLayout {
149
+ Layout.topMargin: 6
150
+ spacing: 28
151
+ ColumnLayout {
152
+ spacing: 8
153
+ Label { text: "DENSITY" }
154
+ Segmented {
155
+ segWidth: 84
156
+ current: Theme.density
157
+ model: [ { key: "compact", label: "Compact" }, { key: "cozy", label: "Cozy" }, { key: "roomy", label: "Roomy" } ]
158
+ onPick: (k) => Theme.density = k
159
+ }
160
+ }
161
+ ColumnLayout {
162
+ spacing: 8
163
+ Label { text: "MOTION" }
164
+ Toggle { text: "Animate the interface"; on: Theme.motion; onFlip: Theme.motion = !Theme.motion }
165
+ }
166
+ }
167
+
168
+ Label { text: "WORKSPACE"; Layout.topMargin: 6 }
169
+ Flow {
170
+ Layout.fillWidth: true
171
+ spacing: 8
172
+ Toggle { text: "Tool rail"; on: pf.workspace.showLeft; onFlip: pf.workspace.showLeft = !pf.workspace.showLeft }
173
+ Toggle { text: "Manager dock"; on: pf.workspace.showRight; onFlip: pf.workspace.showRight = !pf.workspace.showRight }
174
+ Toggle { text: "Timeline"; on: pf.workspace.showTimeline; onFlip: pf.workspace.showTimeline = !pf.workspace.showTimeline }
175
+ Toggle { text: "Floor grid"; on: pf.workspace.showGrid; onFlip: pf.workspace.showGrid = !pf.workspace.showGrid }
176
+ Toggle { text: "Reference images"; on: pf.workspace.showReference; onFlip: pf.workspace.showReference = !pf.workspace.showReference }
177
+ }
178
+ Label { text: "RESEARCH AND VOICE"; Layout.topMargin: 6 }
179
+ Flow {
180
+ Layout.fillWidth: true
181
+ spacing: 8
182
+ Toggle { text: "Web research for Explain and specify"; on: studio.services.research === true; onFlip: studio.setService("research", JSON.stringify(!on)) }
183
+ Toggle { text: "Read explanations aloud"; on: studio.services.speak === true; onFlip: studio.setService("speak", JSON.stringify(!on)) }
184
+ }
185
+ ServiceField { Layout.fillWidth: true; key: "search_url"; label: "SearXNG"; hint: "empty = Wikipedia only · http://host:8888 or a {query} template" }
186
+ ServiceField { Layout.fillWidth: true; key: "tts_url"; label: "Speech server"; hint: "empty = espeak-ng · Kokoro: http://127.0.0.1:8880" }
187
+ ServiceField { Layout.fillWidth: true; key: "tts_cmd"; label: "or a speech command"; hint: "…/tts.py {text} -o {wav} --voice {voice} (CPU)" }
188
+ ServiceField { Layout.fillWidth: true; key: "tts_voice"; label: "Voice"; hint: "af_heart" }
189
+ ServiceField { Layout.fillWidth: true; key: "stt_url"; label: "Transcription server"; hint: "OpenAI-compatible, e.g. http://127.0.0.1:8890" }
190
+ ServiceField { Layout.fillWidth: true; key: "stt_cmd"; label: "or a command"; hint: "whisper-cli -m model.bin -f {wav} -nt" }
191
+ Text {
192
+ Layout.fillWidth: true
193
+ readonly property var st: studio.services.status || {}
194
+ text: "Speech: " + (st.tts || "none") + " · Dictation: " + (st.stt || "not set up")
195
+ + (st.record === false ? " · no microphone recorder" : "")
196
+ color: Theme.dim; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; wrapMode: Text.WordWrap
197
+ }
198
+ Text {
199
+ Layout.fillWidth: true
200
+ text: "Research sends only search words, never your build. Voice runs on the CPU. Saved in services.json (mode 600) in the Replicator config folder."
201
+ color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; wrapMode: Text.WordWrap
202
+ }
203
+ Text {
204
+ Layout.fillWidth: true; Layout.topMargin: 4
205
+ text: "Saved in Replicator.conf in the Replicator config folder. The viewport draws on: " + studio.drawsOn + " (REPLICATOR_GPU=auto, igpu or any)."
206
+ color: Theme.faint; font.pixelSize: Theme.fsTiny; font.family: Theme.sans; wrapMode: Text.WordWrap
207
+ }
208
+ }
209
+ }
210
+ }
211
+ }