Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
373 lines (350 loc) · 17.6 KB
/
Copy pathCargo.toml
File metadata and controls
373 lines (350 loc) · 17.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
[workspace]
resolver = "3"
members = ["crates/*", "crates/kernel/services", "apps/*", "xtask"]
# Third-party code kept with local fixes (vendor/), and the vendored SolidCore kernel (solidcore/);
# neither is linted as ours. See CONTRIBUTING.md, "How the code is laid out".
exclude = ["solidcore", "vendor"]
[workspace.package]
version = "0.54.0"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
authors = ["SolidCraft contributors"]
repository = "https://github.com/bherbruck/solidcraft"
[workspace.dependencies]
robust = "1.2"
# internal
craft-plugin = { path = "crates/craft-plugin" }
craft-plugin-wasm = { path = "crates/craft-plugin-wasm" }
# the one embedded script runtime: Rhai in a sandbox (docs/design/scripting.md)
craft-script = { path = "crates/script" }
solidcraft-geom = { path = "crates/geom" }
solidcraft-math = { path = "crates/math" }
solidcraft-smlib = { path = "crates/smlib" }
solidcraft-profile = { path = "crates/profile" }
solidcraft-feature-sheet-metal = { path = "crates/feature-sheet-metal" }
solidcraft-feature-drawing = { path = "crates/feature-drawing" }
solidcraft-feature-holes = { path = "crates/feature-holes" }
solidcraft-feature-frames = { path = "crates/feature-frames" }
solidcraft-feature-cell-grid = { path = "crates/feature-cell-grid" }
solidcraft-feature-mesh-fit = { path = "crates/feature-mesh-fit" }
solidcraft-feature-fabrication = { path = "crates/feature-fabrication" }
solidcraft-feature-shaft-spline = { path = "crates/feature-shaft-spline" }
solidcraft-feature-weld = { path = "crates/feature-weld" }
solidcraft-feature-plastic = { path = "crates/feature-plastic" }
solidcraft-feature-cam = { path = "crates/feature-cam" }
solidcraft-sketch = { path = "crates/sketch" }
solidcraft-kernel = { path = "crates/kernel" }
solidcraft-kernel-services = { path = "crates/kernel/services" }
# The kernel interface: the trait a kernel's adapter implements (docs/design/kernel-layer.md)
solidcraft-kernel-api = { path = "crates/kernel-api" }
# A kernel of its own built against the kernel interface alone (tests of the seam)
solidcraft-kernel-probe = { path = "crates/kernel-probe" }
solidcraft-render = { path = "crates/render" }
solidcraft-dynamics = { path = "crates/dynamics" }
solidcraft-gpu = { path = "crates/gpu" }
solidcraft-doc = { path = "crates/doc" }
# Versioned file formats: the format tag, the version registry and its upgrade, a newer file told
solidcraft-format = { path = "crates/format" }
solidcraft-io = { path = "crates/io" }
# FreeCAD, Rhino, OpenUSD and IGES read through cadmpeg (RFC 0021)
solidcraft-cadmpeg = { path = "crates/cadmpeg" }
solidcraft-exchange = { path = "crates/exchange" }
# A saved design's picture and summary for file browsers, without the kernel (apps/solidcraft-quicklook)
solidcraft-design-preview = { path = "crates/design-preview" }
solidcraft-icon-svg = { path = "crates/icon-svg" }
solidcraft-engine = { path = "crates/engine" }
# Without its default features, so an app built with `--no-default-features` leaves out what
# they bring (usage statistics); each app turns them on in its own defaults.
solidcraft-ui-egui = { path = "crates/ui-egui", default-features = false }
solidcraft-ui-kit = { path = "crates/ui-kit" }
# The app-neutral panel placement core: panels by id, dock, floating and window placement, saved layout values
solidcraft-panel-layout = { path = "crates/panel-layout" }
solidcraft-look = { path = "crates/look" }
solidcraft-ui-registry = { path = "crates/ui-registry" }
solidcraft-color = { path = "crates/color" }
solidcraft-display-units = { path = "crates/display-units" }
solidcraft-ui-text = { path = "crates/ui-text" }
solidcraft-ui-text-macros = { path = "crates/ui-text-macros" }
solidcraft-theme = { path = "crates/theme" }
solidcraft-viewport = { path = "crates/viewport" }
solidcraft-views = { path = "crates/views" }
solidcraft-viewport-egui = { path = "crates/viewport-egui" }
solidcraft-viewport-gpu = { path = "crates/viewport-gpu" }
solidcraft-window-gpu = { path = "crates/window-gpu" }
solidcraft-space-mouse = { path = "crates/space-mouse" }
solidcraft-mcp = { path = "crates/mcp" }
solidcraft-mcp-server = { path = "crates/mcp-server" }
solidcraft-control = { path = "crates/control" }
solidcraft-control-egui = { path = "crates/control-egui" }
solidcraft-derive = { path = "crates/derive" }
solidcraft-3dx-client = { path = "crates/threedx-client" }
solidcraft-bookmarks = { path = "crates/bookmarks" }
# The Rust port of NVIDIA's SMLib (Apache-2.0), the B-rep kernel behind crates/smlib. Vendored with
# `git subtree` at solidcore: that tree is the source of truth, and
# .github/workflows/solidcore-mirror.yml pushes changes in it back to its own repository (#13153).
solidcore = { path = "solidcore/crates/solidcore" }
# The kernel crates behind the facade (solidcore/layers.toml); only solidcore names them.
solidcore-kernel = { path = "solidcore/crates/solidcore-kernel" }
# Plain CAD values no kernel owns (points, planes, profiles): kernel-neutral, kept in the solidcore
# subtree so its mirror builds on its own (docs/design/kernel-layer.md §3, "The neutral crate").
cad-values = { path = "solidcore/crates/cad-values" }
# Geometry as data (solidcore's layers §1, "Record"): the B-rep record, its structural validation
# and the native body file. Vendored with solidcore, in the same subtree.
solidcore-record = { path = "solidcore/crates/solidcore-record" }
# The modelling layer (solidcore's layers §1, "Ops"): the record-level calls SolidCraft makes into the
# kernel, converting through solidcore-convert.
solidcore-ops = { path = "solidcore/crates/solidcore-ops" }
# Records to kernel bodies and back (solidcore's layers §1, "Convert"): stage A, the feature crates' converters name it.
solidcore-convert = { path = "solidcore/crates/solidcore-convert" }
# STEP import and export (vendored with solidcore): the Part 21 parser is solidcore-record's.
solidcore-step = { path = "solidcore/crates/solidcore-step" }
# CADIR (cadmpeg's neutral CAD model) read into B-rep records, as the STEP reader assembles them.
solidcore-cadir = { path = "solidcore/crates/solidcore-cadir" }
# Geometry made drawable (solidcore's layers §3): the one mesher, SolidCraft's, moved into the
# subtree (RFC 0003, item 1.1), with the display mesh and its levels of detail, the types
# SolidCraft's meshes are. Vendored with solidcore, in the same subtree.
solidcore-tess = { path = "solidcore/crates/solidcore-tess" }
# test tooling: a dev-dependency only (xtask/src/layers.rs)
solidcraft-testkit = { path = "crates/testkit" }
# foundation
thiserror = "2"
unicode-general-category = "1"
serde = { version = "1", features = ["derive", "rc"] }
# derive macros (crates/derive); already in the tree through serde_derive
proc-macro2 = "1"
quote = "1"
syn = { version = "2", features = ["full"] }
serde_json = { version = "1", features = ["float_roundtrip"] }
# command parameter and result schemas
schemars = "1.2"
serde_path_to_error = "0.1"
log = "0.4"
sha2 = "0.10"
# A container part's CRC-32, to check a part copied on save holds what it is saved for; already in
# the tree through zip.
crc32fast = "1.5"
# Provenance: the CBOR manifest encoding (RFC 8949), COSE_Sign1 records (RFC 9052) and Ed25519
# (RFC 8032). All pure Rust and permissive (Apache-2.0; BSD-3-Clause), so the browser build and
# `cargo xtask licences --check` keep working.
ciborium = { version = "0.2", default-features = false, features = ["std"] }
serde_bytes = "0.11"
coset = "0.4"
ed25519-dalek = { version = "2.1", default-features = false, features = ["std", "zeroize"] }
# OpenPGP detached-signature verification (MIT OR Apache-2.0; pure Rust, builds for wasm with
# its `wasm` feature). GnuPG signs for a key on a smartcard; no key material is copied out.
pgp = { version = "=0.21.1", default-features = false, features = ["wasm"] }
moxcms = { version = "0.8.1", default-features = false, features = ["extended_range"] }
semver = "1"
# Plugin help links are parsed, never hand-split (MIT OR Apache-2.0; already in the lock file).
url = "2.5"
# constrained Delaunay + Ruppert refinement for trimmed faces (MIT OR Apache-2.0).
spade = { version = "2.15", default-features = false, features = ["std"] }
rayon = "1.12"
# Native render-memory admission; RAM-only queries through a safe MIT-licensed API.
sysinfo = { version = "0.40.1", default-features = false, features = ["system"] }
# packages (3MF)
zip = { version = "9", default-features = false, features = ["deflate"] }
# Blender documents use gzip or Zstandard framing. Both pure-Rust decoders are
# already transitive dependencies; flate2 (listed with the sheet PDFs below) is
# MIT/Apache-2.0, ruzstd MIT.
ruzstd = "0.9"
quick-xml = "0.41"
# STEP text in a legacy encoding (GBK, Shift_JIS, …) instead of Part 21 escapes (#2344): detect
# and decode it. Both MIT OR Apache-2.0 (encoding_rs adds BSD-3-Clause data); encoding_rs is
# already in the tree through cadmpeg-codec-step.
chardetng = "0.1"
encoding_rs = "0.8"
# glTF 2.0 import (MIT OR Apache-2.0): the document model and GLB container only; buffers are
# read by crates/io itself, so no image decoding or file access comes with it.
gltf = { version = "1.4", default-features = false, features = ["names"] }
# The computer's name in a design's "open elsewhere" lock file (MIT OR Apache-2.0; already in the
# tree through x11rb).
gethostname = "1"
# fonts (sketch text outlines; MIT OR Apache-2.0, pure Rust)
ttf-parser = { version = "0.25", default-features = false, features = ["std", "variable-fonts"] }
# The installed fonts, for a character no bundled face has (#20005; MIT, pure Rust). Without
# fontconfig, its other dependencies are already in the tree.
fontdb = { version = "0.24", default-features = false, features = ["std", "fs", "memmap"] }
# Ends a process group with the system call (MIT; already in the tree through zip).
nix = { version = "0.31", default-features = false, features = ["signal", "user"] }
# images
image = { version = "0.25", default-features = false, features = ["png", "hdr"] }
png = "0.18.1"
# LZW for GIF animations (MIT OR Apache-2.0, pure Rust; already in the tree through image's tiff).
weezl = "0.1.12"
# sheet PDFs (MIT OR Apache-2.0, pure Rust; brings ryu, Apache-2.0 OR BSL-1.0)
pdf-writer = "0.15"
# deflate for PDF content streams (MIT OR Apache-2.0; already in the tree through zip)
flate2 = "1.1"
# rasterises the UI icon SVGs (BSD-3-Clause, pure Rust, builds for wasm)
tiny-skia = { version = "0.12", default-features = false, features = ["std", "simd"] }
# rasterises an SVG given as a canvas or decal image (MIT OR Apache-2.0, pure Rust, builds for
# wasm); no default features: no text, system fonts, raster images or SVGZ, so it reads no file but the SVG
resvg = { version = "0.50", default-features = false }
# build scripts: reads the icon palette (MIT OR Apache-2.0)
toml = "1"
# the one embedded script language, used only by crates/script (docs/design/scripting.md; MIT OR
# Apache-2.0, pure Rust, builds for wasm). No clock (it panics on wasm) and no custom syntax.
# Modules stay on for command namespaces (the engine installs no module resolver and disables
# `import`), closures for `list.filter(|x| ...)`. Never `unchecked`: the limits need it off.
rhai = { version = "1.27", default-features = false, features = ["std", "sync", "no_time", "no_custom_syntax"] }
# ui
# default_fonts: the built-in Hack is the UI's symbol fallback (#2955); 0.37 no longer turns it on.
egui = { version = "0.37", features = ["default_fonts"] }
eframe = { version = "0.37", default-features = false, features = ["persistence"] }
# Instant/SystemTime that also work in the browser (std panics on wasm32-unknown-unknown).
web-time = "1"
egui-wgpu = "0.37"
# the wgpu egui-wgpu uses, for compute (crates/gpu); backends come from the apps' features
wgpu = { version = "30", default-features = false, features = ["std", "wgsl"] }
naga = { version = "30", default-features = false }
pollster = "0.4"
rfd = "0.17"
[workspace.lints.rust]
unsafe_code = "forbid"
[workspace.lints.clippy]
dbg_macro = "warn"
todo = "warn"
too_many_arguments = "allow"
type_complexity = "allow"
# `!(x > tol)` is our idiom for "not a usable number" (NaN-safe).
neg_cmp_op_on_partial_ord = "allow"
# `eprintln!` and `eprint!` panic when stderr is a pipe whose reader has closed, which an agent
# running `solidcraft mcp` (and the app that one starts) can leave behind (#10111). Write through
# `solidcraft_geom::note!` (`solidcraft_engine::note!`), which ignores a failed write. Tests are
# exempt (clippy.toml `allow-print-in-tests`); examples and build scripts allow it at the top.
print_stderr = "deny"
# Dev builds keep line tables only, so backtraces still name file:line. Full debug info made the
# app binary 4.9 GB and every relink slow. For a debugger, override it:
# `CARGO_PROFILE_DEV_DEBUG=2`.
[profile.dev.package."*"]
opt-level = 2
debug = false
[profile.dev]
opt-level = 1
debug = "line-tables-only"
# Tests and lints (`cargo xtask ci`, GitHub CI): quick to build, quick enough to run. Light
# optimisation, line tables only (file:line in backtraces), no LTO, no debug assertions.
[profile.ci]
inherits = "dev"
opt-level = 1
debug = "line-tables-only"
debug-assertions = false
overflow-checks = true
incremental = false
[profile.ci.package."*"]
opt-level = 2
# No line tables for dependencies: they were over a third of the test archive every CI shard
# downloads. Our own crates keep theirs, so a backtrace still names file:line in them.
debug = false
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 16
# Line tables only: crash reports name file:line in their backtraces (no runtime cost; a larger
# binary). See docs/crash-reports.md.
debug = "line-tables-only"
# Local performance work: release without its thin LTO, incremental. A rebuild after an edit
# drops from 1.5-2 minutes to 3-10 seconds (the thin LTO link of the app was most of it), for
# about 4-7% more CPU time when running. Measure with it while iterating, and take the final numbers with
# --release. See docs/perf.md.
[profile.profiling]
inherits = "release"
lto = false
incremental = true
# The browser build's release profile (apps/solidcraft-web/index.html picks it): every visit
# downloads the wasm, so most crates are built for size. The crates below do the geometry, solve
# sketches and draw the view and the interface, so they stay built for speed. Native builds use
# `release`.
[profile.web-release]
inherits = "release"
opt-level = "s"
# No line tables: wasm-bindgen and wasm-opt drop them, so the shipped files never had them, and
# the web build installs no crash hook that would read them. Without them the wasm the linker
# writes is 304 MB instead of 1.08 GB, and the link needs about 5 GB less memory.
debug = false
[profile.web-release.package.solidcore]
opt-level = 3
[profile.web-release.package.solidcore-kernel]
opt-level = 3
[profile.web-release.package.solidcore-sweep]
opt-level = 3
[profile.web-release.package.solidcore-blend]
opt-level = 3
[profile.web-release.package.solidcore-offset]
opt-level = 3
[profile.web-release.package.solidcore-cadir]
opt-level = 3
[profile.web-release.package.solidcore-convert]
opt-level = 3
[profile.web-release.package.solidcore-ops]
opt-level = 3
[profile.web-release.package.solidcore-record]
opt-level = 3
[profile.web-release.package.solidcore-step]
opt-level = 3
[profile.web-release.package.solidcore-tess]
opt-level = 3
[profile.web-release.package.solidcraft-kernel]
opt-level = 3
# The feature crates that hold geometry maths.
[profile.web-release.package.solidcraft-feature-sheet-metal]
opt-level = 3
[profile.web-release.package.solidcraft-feature-cam]
opt-level = 3
[profile.web-release.package.solidcraft-feature-cell-grid]
opt-level = 3
[profile.web-release.package.solidcraft-feature-drawing]
opt-level = 3
[profile.web-release.package.solidcraft-feature-fabrication]
opt-level = 3
[profile.web-release.package.solidcraft-feature-frames]
opt-level = 3
[profile.web-release.package.solidcraft-feature-holes]
opt-level = 3
[profile.web-release.package.solidcraft-feature-plastic]
opt-level = 3
[profile.web-release.package.solidcraft-feature-shaft-spline]
opt-level = 3
[profile.web-release.package.solidcraft-feature-weld]
opt-level = 3
[profile.web-release.package.solidcraft-feature-mesh-fit]
opt-level = 3
[profile.web-release.package.solidcraft-geom]
opt-level = 3
[profile.web-release.package.solidcraft-math]
opt-level = 3
[profile.web-release.package.solidcraft-smlib]
opt-level = 3
[profile.web-release.package.solidcraft-render]
opt-level = 3
[profile.web-release.package.solidcraft-sketch]
opt-level = 3
[profile.web-release.package.egui]
opt-level = 3
[profile.web-release.package.epaint]
opt-level = 3
[profile.web-release.package.emath]
opt-level = 3
# Vendored crates with SolidCraft fixes (see vendor/README.md and ATTRIBUTION.md).
[patch.crates-io]
# egui 0.37.0, vendored with `git subtree` so SolidCraft can carry its own changes (vendor/README.md).
# egui-wgpu keeps OpenGL pipelines, resolve textures and CAD callbacks at the same safe sample count.
ecolor = { path = "vendor/egui/crates/ecolor" }
eframe = { path = "vendor/egui/crates/eframe" }
egui = { path = "vendor/egui/crates/egui" }
egui-wgpu = { path = "vendor/egui/crates/egui-wgpu" }
egui-winit = { path = "vendor/egui/crates/egui-winit" }
egui_glow = { path = "vendor/egui/crates/egui_glow" }
emath = { path = "vendor/egui/crates/emath" }
epaint = { path = "vendor/egui/crates/epaint" }
epaint_default_fonts = { path = "vendor/egui/crates/epaint_default_fonts" }
# Deliver trackpad pinch and rotation gestures on Wayland (zwp_pointer_gestures_v1), which
# winit 0.30 never binds and eframe 0.37 still requires winit 0.30.
winit = { path = "vendor/winit" }
# Mutation testing (cargo-mutants, docs/mutation-testing.md): the ci profile with incremental
# builds, since every mutant rebuilds the crates above the one it changes.
[profile.mutants]
inherits = "ci"
incremental = true