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.
- replicator/__init__.py +6 -0
- replicator/app.py +204 -0
- replicator/config.py +48 -0
- replicator/core/__init__.py +0 -0
- replicator/core/assembly.py +117 -0
- replicator/core/blender_link.py +161 -0
- replicator/core/critique.py +594 -0
- replicator/core/drawing.py +389 -0
- replicator/core/dxf.py +120 -0
- replicator/core/evaluate.py +439 -0
- replicator/core/explain.py +139 -0
- replicator/core/export.py +96 -0
- replicator/core/fit.py +170 -0
- replicator/core/importers.py +185 -0
- replicator/core/materials.py +104 -0
- replicator/core/ops_advanced.py +496 -0
- replicator/core/ops_engineering.py +223 -0
- replicator/core/physics.py +147 -0
- replicator/core/printers.py +100 -0
- replicator/core/program.py +298 -0
- replicator/core/render.py +145 -0
- replicator/core/reverse.py +350 -0
- replicator/core/robot.py +153 -0
- replicator/core/step.py +245 -0
- replicator/fixtures/gaming_pc_liquid.json +2259 -0
- replicator/fixtures/gas_generator_rocket.json +876 -0
- replicator/fixtures/gas_generator_rocket_aero.json +861 -0
- replicator/fixtures/house_two_bed.json +979 -0
- replicator/fixtures/quadcopter_drone.json +687 -0
- replicator/fixtures/raspberry_pi_5.json +884 -0
- replicator/fixtures/rocket_engine.json +652 -0
- replicator/fixtures/turbofan.json +931 -0
- replicator/fixtures/vector_engine.json +314 -0
- replicator/gpu.py +81 -0
- replicator/image3d/__init__.py +0 -0
- replicator/image3d/comfy.py +181 -0
- replicator/image3d/pipeline.py +208 -0
- replicator/image3d/sheet.py +154 -0
- replicator/knowledge/__init__.py +61 -0
- replicator/knowledge/car_wheel_corner.md +21 -0
- replicator/knowledge/desk_lamp.md +21 -0
- replicator/knowledge/desktop_pc.md +20 -0
- replicator/knowledge/electronics_board.md +21 -0
- replicator/knowledge/exoskeleton.md +21 -0
- replicator/knowledge/house.md +22 -0
- replicator/knowledge/light_aircraft.md +22 -0
- replicator/knowledge/multirotor_drone.md +25 -0
- replicator/knowledge/print_replica.md +13 -0
- replicator/knowledge/rocket_engine.md +27 -0
- replicator/knowledge/turbofan.md +23 -0
- replicator/llm/__init__.py +0 -0
- replicator/llm/client.py +424 -0
- replicator/llm/prompts/blueprint.md +28 -0
- replicator/llm/prompts/edit.md +15 -0
- replicator/llm/prompts/explain.md +37 -0
- replicator/llm/prompts/name_parts.md +13 -0
- replicator/llm/prompts/program.md +72 -0
- replicator/llm/prompts/research_queries.md +8 -0
- replicator/mcp_server.py +307 -0
- replicator/qml/Main.qml +874 -0
- replicator/qml/Replicator/UI/Chip.qml +17 -0
- replicator/qml/Replicator/UI/DockHeader.qml +27 -0
- replicator/qml/Replicator/UI/Icon.qml +118 -0
- replicator/qml/Replicator/UI/IconButton.qml +31 -0
- replicator/qml/Replicator/UI/Kbd.qml +18 -0
- replicator/qml/Replicator/UI/NumField.qml +69 -0
- replicator/qml/Replicator/UI/Pill.qml +28 -0
- replicator/qml/Replicator/UI/RCombo.qml +51 -0
- replicator/qml/Replicator/UI/RMenu.qml +42 -0
- replicator/qml/Replicator/UI/RSlider.qml +23 -0
- replicator/qml/Replicator/UI/Segmented.qml +63 -0
- replicator/qml/Replicator/UI/Swatch.qml +47 -0
- replicator/qml/Replicator/UI/Theme.qml +149 -0
- replicator/qml/Replicator/UI/qmldir +14 -0
- replicator/qml/panels/AgentPrompt.qml +53 -0
- replicator/qml/panels/AttributeManager.qml +171 -0
- replicator/qml/panels/Commander.qml +136 -0
- replicator/qml/panels/HolodeckPanel.qml +117 -0
- replicator/qml/panels/IssuesCard.qml +78 -0
- replicator/qml/panels/LedgerPanel.qml +110 -0
- replicator/qml/panels/MaterialShelf.qml +97 -0
- replicator/qml/panels/ObjectManager.qml +107 -0
- replicator/qml/panels/Preferences.qml +211 -0
- replicator/qml/panels/Presenter.qml +316 -0
- replicator/qml/panels/StatusBar.qml +77 -0
- replicator/qml/panels/Timeline.qml +149 -0
- replicator/qml/panels/Welcome.qml +126 -0
- replicator/qml/viewport/Callouts.qml +87 -0
- replicator/qml/viewport/EdgeMaterial.qml +16 -0
- replicator/qml/viewport/GridMaterial.qml +16 -0
- replicator/qml/viewport/HoloMaterial.qml +23 -0
- replicator/qml/viewport/NavGizmo.qml +72 -0
- replicator/qml/viewport/ReferenceMaterial.qml +17 -0
- replicator/qml/viewport/Viewport.qml +583 -0
- replicator/qt/__init__.py +0 -0
- replicator/qt/bridge.py +1427 -0
- replicator/qt/drawing_sheet.py +33 -0
- replicator/qt/envmap.py +40 -0
- replicator/qt/library.py +68 -0
- replicator/qt/mesh_geometry.py +167 -0
- replicator/qt/svg.py +41 -0
- replicator/research/__init__.py +0 -0
- replicator/research/lane.py +281 -0
- replicator/shaders/edge.frag +9 -0
- replicator/shaders/edge.vert +7 -0
- replicator/shaders/grid.frag +52 -0
- replicator/shaders/grid.vert +6 -0
- replicator/shaders/holo.frag +41 -0
- replicator/shaders/reference.frag +15 -0
- replicator/shaders/reference.vert +6 -0
- replicator/voice.py +120 -0
- replicator_workshop-0.1.0.dist-info/METADATA +410 -0
- replicator_workshop-0.1.0.dist-info/RECORD +118 -0
- replicator_workshop-0.1.0.dist-info/WHEEL +5 -0
- replicator_workshop-0.1.0.dist-info/entry_points.txt +3 -0
- replicator_workshop-0.1.0.dist-info/licenses/LICENSE +21 -0
- replicator_workshop-0.1.0.dist-info/licenses/vendor/mcp-for-blender/LICENSE +21 -0
- replicator_workshop-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import Replicator.UI
|
|
3
|
+
|
|
4
|
+
// Dissect callouts: one label per component, pinned to the exploded part by a leader line. Labels sit in two
|
|
5
|
+
// columns (left and right of the build), sorted by height and pushed apart so they never overlap; everything is
|
|
6
|
+
// re-projected every frame.
|
|
7
|
+
Item {
|
|
8
|
+
id: co
|
|
9
|
+
property var viewport
|
|
10
|
+
property real explode: 0
|
|
11
|
+
property string isolate: ""
|
|
12
|
+
property var hidden: ({})
|
|
13
|
+
property real keepOutLeft: 0 // bottom of the title block: left-column tags stay below it
|
|
14
|
+
signal chosen(string cid)
|
|
15
|
+
|
|
16
|
+
readonly property int tick: viewport ? viewport.tick : 0
|
|
17
|
+
readonly property var placed: {
|
|
18
|
+
tick
|
|
19
|
+
const comps = studio.components
|
|
20
|
+
if (!viewport || explode < 0.12) return []
|
|
21
|
+
const items = []
|
|
22
|
+
for (let i = 0; i < comps.length; i++) {
|
|
23
|
+
const c = comps[i]
|
|
24
|
+
if (hidden[c.id] === true || (isolate !== "" && isolate !== c.id)) continue
|
|
25
|
+
const w = Qt.vector3d(c.center[0] + c.offset[0] * explode, c.center[1] + c.offset[1] * explode,
|
|
26
|
+
c.center[2] + c.offset[2] * explode)
|
|
27
|
+
const p = viewport.project(w)
|
|
28
|
+
if (!(p.z > 0) || isNaN(p.x)) continue
|
|
29
|
+
items.push({ id: c.id, label: c.label, count: c.count, color: c.color, x: p.x, y: p.y })
|
|
30
|
+
}
|
|
31
|
+
const mid = width / 2
|
|
32
|
+
const gap = 26
|
|
33
|
+
for (const side of [-1, 1]) {
|
|
34
|
+
const col = items.filter(it => (it.x < mid ? -1 : 1) === side).sort((a, b) => a.y - b.y)
|
|
35
|
+
let lastY = -1e9
|
|
36
|
+
const top = side < 0 ? Math.max(70, co.keepOutLeft + 18) : 70
|
|
37
|
+
for (const it of col) {
|
|
38
|
+
it.side = side
|
|
39
|
+
it.ly = Math.max(it.y - 40, lastY + gap, top)
|
|
40
|
+
lastY = it.ly
|
|
41
|
+
const spread = Math.min(220, Math.max(90, Math.abs(it.x - mid) * 0.35 + 70))
|
|
42
|
+
const tagW = 40 + (it.label.length + (it.count > 1 ? 4 : 0)) * 6.8 // estimated: keeps the tag inside the view
|
|
43
|
+
it.lx = side < 0 ? Math.max(tagW + 12, Math.min(it.x - spread, mid - 260))
|
|
44
|
+
: Math.min(width - tagW - 12, Math.max(it.x + spread, mid + 260))
|
|
45
|
+
}
|
|
46
|
+
const over = col.length ? col[col.length - 1].ly - (height - 150) : 0 // stay above the bottom bar
|
|
47
|
+
if (over > 0) for (const it of col) it.ly = Math.max(top, it.ly - over)
|
|
48
|
+
}
|
|
49
|
+
return items
|
|
50
|
+
}
|
|
51
|
+
opacity: Math.min(1, Math.max(0, (explode - 0.12) * 4))
|
|
52
|
+
|
|
53
|
+
Canvas {
|
|
54
|
+
anchors.fill: parent
|
|
55
|
+
property var items: co.placed
|
|
56
|
+
onItemsChanged: requestPaint()
|
|
57
|
+
onPaint: {
|
|
58
|
+
const g = getContext("2d"); g.reset()
|
|
59
|
+
for (const it of items) {
|
|
60
|
+
g.strokeStyle = it.color; g.globalAlpha = 0.9; g.lineWidth = 1.2
|
|
61
|
+
g.beginPath(); g.moveTo(it.x, it.y)
|
|
62
|
+
g.lineTo(it.lx - it.side * 18, it.ly); g.lineTo(it.lx, it.ly); g.stroke()
|
|
63
|
+
g.fillStyle = it.color; g.beginPath(); g.arc(it.x, it.y, 3.2, 0, 2 * Math.PI); g.fill()
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
Repeater {
|
|
68
|
+
model: co.placed
|
|
69
|
+
delegate: Rectangle {
|
|
70
|
+
id: tag
|
|
71
|
+
required property var modelData
|
|
72
|
+
x: modelData.side < 0 ? modelData.lx - width : modelData.lx
|
|
73
|
+
y: modelData.ly - height / 2
|
|
74
|
+
width: lbl.implicitWidth + 32; height: 24; radius: 12
|
|
75
|
+
color: studio.selectedComponent === modelData.id ? Theme.raised : Theme.glass
|
|
76
|
+
border.color: studio.selectedComponent === modelData.id ? modelData.color : Qt.rgba(modelData.color.r, modelData.color.g, modelData.color.b, 0.55)
|
|
77
|
+
Rectangle { x: 10; anchors.verticalCenter: parent.verticalCenter; width: 7; height: 7; radius: 3.5; color: tag.modelData.color }
|
|
78
|
+
Text {
|
|
79
|
+
id: lbl
|
|
80
|
+
x: 23; anchors.verticalCenter: parent.verticalCenter
|
|
81
|
+
text: tag.modelData.label + (tag.modelData.count > 1 && !/x\d/.test(tag.modelData.label) ? " ×" + tag.modelData.count : "")
|
|
82
|
+
color: Theme.text; font.pixelSize: Theme.fsSmall; font.family: Theme.sans
|
|
83
|
+
}
|
|
84
|
+
MouseArea { anchors.fill: parent; cursorShape: Qt.PointingHandCursor; onClicked: co.chosen(tag.modelData.id) }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick3D
|
|
3
|
+
|
|
4
|
+
// Feature lines (creases and outlines), unshaded; reveal follows the part's scan plane.
|
|
5
|
+
CustomMaterial {
|
|
6
|
+
property color lineColor: "#101114"
|
|
7
|
+
property real reveal: 1.0
|
|
8
|
+
property real minY: 0
|
|
9
|
+
property real maxY: 100
|
|
10
|
+
property real strength: 1.0
|
|
11
|
+
shadingMode: CustomMaterial.Unshaded
|
|
12
|
+
sourceBlend: CustomMaterial.SrcAlpha
|
|
13
|
+
destinationBlend: CustomMaterial.OneMinusSrcAlpha
|
|
14
|
+
vertexShader: "../../shaders/edge.vert"
|
|
15
|
+
fragmentShader: "../../shaders/edge.frag"
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick3D
|
|
3
|
+
|
|
4
|
+
CustomMaterial {
|
|
5
|
+
property color lineColor: "#8d9198"
|
|
6
|
+
property color majorColor: "#5f646c"
|
|
7
|
+
property real blueprint: 0.0
|
|
8
|
+
property real fade: 6000
|
|
9
|
+
property real span: 900
|
|
10
|
+
shadingMode: CustomMaterial.Unshaded
|
|
11
|
+
sourceBlend: CustomMaterial.SrcAlpha
|
|
12
|
+
destinationBlend: CustomMaterial.OneMinusSrcAlpha
|
|
13
|
+
cullMode: Material.NoCulling
|
|
14
|
+
vertexShader: "../../shaders/grid.vert"
|
|
15
|
+
fragmentShader: "../../shaders/grid.frag"
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick3D
|
|
3
|
+
|
|
4
|
+
CustomMaterial {
|
|
5
|
+
property color baseColor: "#b8bbc2"
|
|
6
|
+
property color emissiveColor: "black"
|
|
7
|
+
property color tint: "#33c6ff"
|
|
8
|
+
property real tintAmount: 0.0
|
|
9
|
+
property real metal: 0.0
|
|
10
|
+
property real rough: 0.5
|
|
11
|
+
property real reveal: 1.0
|
|
12
|
+
property real minY: 0
|
|
13
|
+
property real maxY: 100
|
|
14
|
+
property real blueprint: 0.0
|
|
15
|
+
property real selected: 0.0
|
|
16
|
+
property real xray: 0.0
|
|
17
|
+
property real alpha: 1.0 // glass and clear plastics: blended with SrcAlpha so reflections fade with it too
|
|
18
|
+
sourceBlend: alpha < 0.999 ? CustomMaterial.SrcAlpha : CustomMaterial.NoBlend
|
|
19
|
+
destinationBlend: alpha < 0.999 ? CustomMaterial.OneMinusSrcAlpha : CustomMaterial.NoBlend
|
|
20
|
+
shadingMode: CustomMaterial.Shaded
|
|
21
|
+
cullMode: Material.NoCulling
|
|
22
|
+
fragmentShader: "../../shaders/holo.frag"
|
|
23
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import Replicator.UI
|
|
3
|
+
|
|
4
|
+
// Axis triad like C4D / Blender: X red, Y green, Z blue, positive ends labelled. Click an end to look down it.
|
|
5
|
+
Item {
|
|
6
|
+
id: g
|
|
7
|
+
property real yaw: 0
|
|
8
|
+
property real pitch: 0
|
|
9
|
+
signal snap(string name)
|
|
10
|
+
width: 92; height: 92
|
|
11
|
+
|
|
12
|
+
readonly property real cy: Math.cos(yaw * Math.PI / 180)
|
|
13
|
+
readonly property real sy: Math.sin(yaw * Math.PI / 180)
|
|
14
|
+
readonly property real cp: Math.cos(pitch * Math.PI / 180)
|
|
15
|
+
readonly property real sp: Math.sin(pitch * Math.PI / 180)
|
|
16
|
+
// camera basis (same as the viewport): dir to camera, right, up
|
|
17
|
+
function proj(v) {
|
|
18
|
+
const dir = [cp * sy, sp, cp * cy]
|
|
19
|
+
const right = [cy, 0, -sy]
|
|
20
|
+
const up = [dir[1] * right[2] - dir[2] * right[1], dir[2] * right[0] - dir[0] * right[2],
|
|
21
|
+
dir[0] * right[1] - dir[1] * right[0]]
|
|
22
|
+
return { x: v[0] * right[0] + v[1] * right[1] + v[2] * right[2],
|
|
23
|
+
y: -(v[0] * up[0] + v[1] * up[1] + v[2] * up[2]),
|
|
24
|
+
z: v[0] * dir[0] + v[1] * dir[1] + v[2] * dir[2] }
|
|
25
|
+
}
|
|
26
|
+
readonly property var axes: {
|
|
27
|
+
const a = [ { n: "X", v: [1, 0, 0], c: "#e5484d", view: "Right" }, { n: "Y", v: [0, 1, 0], c: "#7bd88f", view: "Top" },
|
|
28
|
+
{ n: "Z", v: [0, 0, 1], c: "#3d8ee6", view: "Front" }, { n: "-X", v: [-1, 0, 0], c: "#e5484d", view: "Left" },
|
|
29
|
+
{ n: "-Y", v: [0, -1, 0], c: "#7bd88f", view: "Bottom" }, { n: "-Z", v: [0, 0, -1], c: "#3d8ee6", view: "Back" } ]
|
|
30
|
+
const out = a.map(o => Object.assign({ p: proj(o.v) }, o))
|
|
31
|
+
out.sort((p, q) => p.p.z - q.p.z)
|
|
32
|
+
return out
|
|
33
|
+
}
|
|
34
|
+
Rectangle { anchors.fill: parent; radius: width / 2; color: hover.containsMouse ? Theme.press : Theme.hover
|
|
35
|
+
border.color: Theme.glassLine }
|
|
36
|
+
Canvas {
|
|
37
|
+
id: cv
|
|
38
|
+
anchors.fill: parent
|
|
39
|
+
property var ax: g.axes
|
|
40
|
+
onAxChanged: requestPaint()
|
|
41
|
+
onPaint: {
|
|
42
|
+
const c = getContext("2d"); c.reset()
|
|
43
|
+
const R = width / 2 - 13, cx = width / 2, cyy = height / 2
|
|
44
|
+
for (const a of ax) {
|
|
45
|
+
const x = cx + a.p.x * R, y = cyy + a.p.y * R
|
|
46
|
+
const pos = a.n.length === 1
|
|
47
|
+
if (pos) { c.strokeStyle = a.c; c.lineWidth = 2.2; c.beginPath(); c.moveTo(cx, cyy); c.lineTo(x, y); c.stroke() }
|
|
48
|
+
c.beginPath(); c.arc(x, y, pos ? 9 : 6, 0, 2 * Math.PI)
|
|
49
|
+
c.fillStyle = pos ? a.c : "#3a1d1f".replace("3a1d1f", a.c === "#e5484d" ? "5a2326" : a.c === "#7bd88f" ? "2c4a33" : "1f3654")
|
|
50
|
+
c.fill()
|
|
51
|
+
if (!pos) { c.strokeStyle = a.c; c.lineWidth = 1.4; c.stroke() }
|
|
52
|
+
if (pos) { c.fillStyle = "#101114"; c.font = "bold 10px sans-serif"; c.textAlign = "center"; c.textBaseline = "middle"; c.fillText(a.n, x, y + 0.5) }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
MouseArea {
|
|
57
|
+
id: hover
|
|
58
|
+
anchors.fill: parent
|
|
59
|
+
hoverEnabled: true
|
|
60
|
+
cursorShape: Qt.PointingHandCursor
|
|
61
|
+
onClicked: (m) => {
|
|
62
|
+
const R = width / 2 - 13
|
|
63
|
+
let best = null, bd = 1e9
|
|
64
|
+
for (const a of g.axes) {
|
|
65
|
+
const d = Math.hypot(width / 2 + a.p.x * R - m.x, height / 2 + a.p.y * R - m.y)
|
|
66
|
+
if (d < bd && a.p.z > -0.98) { bd = d; best = a }
|
|
67
|
+
}
|
|
68
|
+
if (best && bd < 14) g.snap(best.view)
|
|
69
|
+
else g.snap("Perspective")
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import QtQuick
|
|
2
|
+
import QtQuick3D
|
|
3
|
+
|
|
4
|
+
// A reference image standing in the scene. The views are drawn on white, so the white is almost keyed out: the
|
|
5
|
+
// figure shows on a sheet of frosted glass, and the plane never hides the build or the floor behind it.
|
|
6
|
+
CustomMaterial {
|
|
7
|
+
property TextureInput tex: TextureInput { texture: Texture {} }
|
|
8
|
+
property real strength: 0.92
|
|
9
|
+
property real paper: 0.09
|
|
10
|
+
shadingMode: CustomMaterial.Unshaded
|
|
11
|
+
sourceBlend: CustomMaterial.SrcAlpha
|
|
12
|
+
destinationBlend: CustomMaterial.OneMinusSrcAlpha
|
|
13
|
+
cullMode: Material.BackFaceCulling // a sheet shows only from the model's side, so it never covers the build
|
|
14
|
+
depthDrawMode: Material.NeverDepthDraw
|
|
15
|
+
vertexShader: "../../shaders/reference.vert"
|
|
16
|
+
fragmentShader: "../../shaders/reference.frag"
|
|
17
|
+
}
|