Sync current main into render, preserving release and viewport changes (#5705)
* Regenerate THIRD-PARTY-LICENSES.txt and docs/features.md [skip ci] * Viewport: whole-body highlights reuse the model's own triangles (#4554) (#5109) Hovering or selecting whole bodies -- a browser row, a History group, a body under the pointer in body-pick mode -- built a CPU copy of every body's triangles into the highlight scene. On a 40-body 4.3 MB STEP assembly that was 147 bodies, 70 MB of triangle copies and a 519 ms frame. The model already has the same geometry on the GPU. The highlight now names it and the renderer draws it again in the highlight colour: - bodies drawn from a display plan: the model's evaluated plan chunks, with a hover/selection tint uniform (the chunks stay resident in the model scene); - bodies drawn as placements of shared triangles: the same placements of the model's shared triangles, coloured per instance; - bodies the model builds on the CPU: their vertex range in the model scene's block. See-through and faded bodies keep the CPU feedback, which colours them; faces and edges highlighted on their own are unchanged. The highlight looks the same (verified side by side). On the assembly the highlight build drops from 519 ms to 9 ms and no longer copies any triangles; selecting the whole assembly takes 9-20 ms. Co-authored-by: Claude Code <noreply@anthropic.com> * Offer to stand up SolidWorks files instead of turning them silently; add Turn Up Axis to the component menu (#5655) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> * Sketch on a picked origin plane uses the plane shown after standing an import up (#5659) * Sketch on a picked origin plane uses the plane shown, also in a moved component After a STEP file opens its component stays the active one, and standing it up turns that component a quarter about X. Starting a sketch on XY picked in the viewport then sent `{"plane": "XY"}`, which names the active component's own XY: upright after the stand-up. The sketch landed on the world XZ, Look At turned to face Y and the extrude went along Y. The viewport and browser only show the design's origin planes, so a picked origin plane now goes to sketch.create written out as that world plane while the active component is moved; sketch.create maps it into the component's frame once. The flip toward the viewer uses the same plane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Stand-up axes tests: stand the file up through the offer when one is waiting #5655 offers to stand up SolidWorks files instead of turning them silently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * gpu tests: give the two test frames the new hover and selection tints (#5698) #5109 added Frame::hover_tint and selection_tint; two test frames that landed alongside it didn't set them, so solidcraft-gpu's tests stopped compiling on main. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Release 0.21.0-rc.2 (#5691) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jackson Oursland <jacob.oursland@gmail.com> Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
This commit is contained in:
24 files changed
+1418
-158
No files matched your search
Generated
+17
-17
@@ -4199,7 +4199,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"block2 0.6.2",
|
||||
"eframe",
|
||||
@@ -4231,11 +4231,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-3dx-client"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-cli"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"image",
|
||||
"log",
|
||||
@@ -4247,7 +4247,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-derive"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -4256,7 +4256,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-doc"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"serde",
|
||||
@@ -4273,7 +4273,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-engine"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"schemars",
|
||||
@@ -4292,7 +4292,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-geom"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -4301,7 +4301,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-gpu"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"image",
|
||||
"log",
|
||||
@@ -4320,7 +4320,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-io"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"cadmpeg-core",
|
||||
"cadmpeg-ir",
|
||||
@@ -4343,7 +4343,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-kernel"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"proptest",
|
||||
@@ -4363,7 +4363,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-mcp"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"serde_json",
|
||||
"solidcraft-engine",
|
||||
@@ -4372,7 +4372,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-render"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"image",
|
||||
"moxcms",
|
||||
@@ -4386,7 +4386,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-sketch"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -4397,14 +4397,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-space-mouse"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-ui-egui"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"egui",
|
||||
@@ -4432,7 +4432,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "solidcraft-web"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"eframe",
|
||||
"egui",
|
||||
@@ -5962,7 +5962,7 @@ checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7"
|
||||
|
||||
[[package]]
|
||||
name = "xtask"
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"serde_json",
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ members = ["crates/*", "apps/*", "xtask"]
|
||||
exclude = ["vendor"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.21.0-rc.1"
|
||||
version = "0.21.0-rc.2"
|
||||
edition = "2024"
|
||||
license = "MIT OR Apache-2.0"
|
||||
rust-version = "1.95"
|
||||
|
||||
+698
-22
@@ -1,6 +1,6 @@
|
||||
Third-party software in SolidCraft
|
||||
|
||||
SolidCraft (the desktop app, solidcraft-cli and the web app) is built from the 560 crates below.
|
||||
SolidCraft (the desktop app, solidcraft-cli and the web app) is built from the 563 crates below.
|
||||
Generated by `cargo xtask licences` from Cargo.lock and the crates' own licence files.
|
||||
SolidCraft's own licence is in LICENSE-MIT and LICENSE-APACHE, and NOTICE.
|
||||
|
||||
@@ -95,6 +95,7 @@ core_detect 1.0.0 (MIT/Apache-2.0)
|
||||
cpufeatures 0.2.17 (MIT OR Apache-2.0)
|
||||
cpufeatures 0.3.1 (MIT OR Apache-2.0)
|
||||
crc32fast 1.5.2 (MIT OR Apache-2.0)
|
||||
crossbeam-channel 0.5.17 (MIT OR Apache-2.0)
|
||||
crossbeam-deque 0.8.8 (MIT OR Apache-2.0)
|
||||
crossbeam-epoch 0.9.21 (MIT OR Apache-2.0)
|
||||
crossbeam-utils 0.8.23 (MIT OR Apache-2.0)
|
||||
@@ -210,6 +211,7 @@ jni-sys 0.4.1 (MIT OR Apache-2.0)
|
||||
jni-sys-macros 0.4.1 (MIT OR Apache-2.0)
|
||||
js-sys 0.3.106 (MIT OR Apache-2.0)
|
||||
katexit 0.1.5 (MIT OR Apache-2.0)
|
||||
keyboard-types 0.8.3 (MIT OR Apache-2.0)
|
||||
keyring 3.6.3 (MIT OR Apache-2.0)
|
||||
khronos-egl 6.0.0 (MIT/Apache-2.0)
|
||||
kurbo 0.13.1 (Apache-2.0 OR MIT)
|
||||
@@ -234,6 +236,7 @@ minisign-verify 0.3.0 (MIT)
|
||||
miniz_oxide 0.8.9 (MIT OR Zlib OR Apache-2.0)
|
||||
miniz_oxide 0.9.1 (MIT OR Zlib OR Apache-2.0)
|
||||
moxcms 0.8.1 (BSD-3-Clause OR Apache-2.0)
|
||||
muda 0.21.2 (Apache-2.0 OR MIT)
|
||||
multiversion_no_op 1.0.0 (Apache-2.0 OR MIT)
|
||||
naga 30.0.1 (MIT OR Apache-2.0)
|
||||
naga-types 30.0.1 (MIT OR Apache-2.0)
|
||||
@@ -1108,26 +1111,27 @@ ahash 0.8.12, arrayvec 0.7.8, async-channel 2.5.0, async-executor 1.14.0, async-
|
||||
4.7.1, atomic-waker 1.1.2, base64 0.23.1, bitflags 1.3.2, bitflags 2.13.2, blocking 1.7.0, bumpalo
|
||||
3.20.3, cfg-if 1.0.5, cgl 0.3.2, concurrent-queue 2.5.0, core-foundation 0.10.1, core-foundation
|
||||
0.9.4, core-foundation-sys 0.8.7, core-graphics 0.23.2, core-graphics-types 0.1.3, core_detect
|
||||
1.0.0, crossbeam-deque 0.8.8, crossbeam-epoch 0.9.21, crossbeam-utils 0.8.23, dbus-secret-service
|
||||
4.1.0, displaydoc 0.2.7, either 1.19.0, equivalent 1.0.2, errno 0.3.14, euclid 0.22.14,
|
||||
event-listener 5.4.2, event-listener-strategy 0.5.4, fastrand 2.5.0, flate2 1.1.10, form_urlencoded
|
||||
1.2.2, futures-lite 2.6.1, gethostname 1.1.0, gif 0.14.2, glow 0.17.0, gltf 1.4.1, gltf-derive
|
||||
1.4.1, gltf-json 1.4.1, hashbrown 0.16.1, hashbrown 0.17.1, hermit-abi 0.5.3, httparse 1.10.1, idna
|
||||
1.1.0, idna_adapter 1.2.2, indexmap 2.14.2, itertools 0.13.0, itertools 0.15.0, js-sys 0.3.106,
|
||||
khronos-egl 6.0.0, lazy_static 1.5.1, linux-raw-sys 0.12.1, linux-raw-sys 0.4.15, lock_api 0.4.14,
|
||||
log 0.4.34, num 0.4.3, num-bigint 0.4.8, num-complex 0.4.6, num-integer 0.1.47, num-iter 0.1.46,
|
||||
num-rational 0.4.2, num-traits 0.2.19, once_cell 1.21.4, openssl-probe 0.2.1, ordered-stream 0.2.0,
|
||||
parking 2.2.1, parking_lot 0.12.5, parking_lot_core 0.9.12, percent-encoding 2.3.2, piper 0.2.5,
|
||||
plain 0.2.3, png 0.18.1, polling 3.11.0, pollster 0.4.0, pollster 1.0.1, rayon 1.12.0, rayon-core
|
||||
1.13.0, renderdoc-sys 1.1.0, robust 1.2.0, ron 0.12.2, roxmltree 0.21.1, rustc-hash 1.1.0, rustix
|
||||
0.38.44, rustix 1.1.5, rustls 0.23.46, rustls-native-certs 0.8.5, scoped-tls 1.0.1, scopeguard
|
||||
1.2.0, secret-service 4.0.0, security-framework 2.11.1, security-framework 3.7.0,
|
||||
security-framework-sys 2.17.0, signal-hook-registry 1.4.8, simd_cesu8 1.2.0, smallvec 1.16.2,
|
||||
smol_str 0.2.2, stable_deref_trait 1.2.1, syn 1.0.109, tempfile 3.27.0, ttf-parser 0.25.1,
|
||||
unicode-segmentation 1.13.3, unicode-width 0.2.2, url 2.5.8, uuid 1.27.0, wasi
|
||||
0.11.1+wasi-snapshot-preview1, wasip2 1.0.4+wasi-0.2.12, wasm-bindgen 0.2.129, wasm-bindgen-futures
|
||||
0.4.79, wasm-bindgen-macro 0.2.129, wasm-bindgen-macro-support 0.2.129, wasm-bindgen-shared 0.2.129,
|
||||
web-sys 0.3.106, weezl 0.1.12, wit-bindgen 0.57.1
|
||||
1.0.0, crossbeam-channel 0.5.17, crossbeam-deque 0.8.8, crossbeam-epoch 0.9.21, crossbeam-utils
|
||||
0.8.23, dbus-secret-service 4.1.0, displaydoc 0.2.7, either 1.19.0, equivalent 1.0.2, errno 0.3.14,
|
||||
euclid 0.22.14, event-listener 5.4.2, event-listener-strategy 0.5.4, fastrand 2.5.0, flate2 1.1.10,
|
||||
form_urlencoded 1.2.2, futures-lite 2.6.1, gethostname 1.1.0, gif 0.14.2, glow 0.17.0, gltf 1.4.1,
|
||||
gltf-derive 1.4.1, gltf-json 1.4.1, hashbrown 0.16.1, hashbrown 0.17.1, hermit-abi 0.5.3, httparse
|
||||
1.10.1, idna 1.1.0, idna_adapter 1.2.2, indexmap 2.14.2, itertools 0.13.0, itertools 0.15.0, js-sys
|
||||
0.3.106, keyboard-types 0.8.3, khronos-egl 6.0.0, lazy_static 1.5.1, linux-raw-sys 0.12.1,
|
||||
linux-raw-sys 0.4.15, lock_api 0.4.14, log 0.4.34, muda 0.21.2, num 0.4.3, num-bigint 0.4.8,
|
||||
num-complex 0.4.6, num-integer 0.1.47, num-iter 0.1.46, num-rational 0.4.2, num-traits 0.2.19,
|
||||
once_cell 1.21.4, openssl-probe 0.2.1, ordered-stream 0.2.0, parking 2.2.1, parking_lot 0.12.5,
|
||||
parking_lot_core 0.9.12, percent-encoding 2.3.2, piper 0.2.5, plain 0.2.3, png 0.18.1, polling
|
||||
3.11.0, pollster 0.4.0, pollster 1.0.1, rayon 1.12.0, rayon-core 1.13.0, renderdoc-sys 1.1.0, robust
|
||||
1.2.0, ron 0.12.2, roxmltree 0.21.1, rustc-hash 1.1.0, rustix 0.38.44, rustix 1.1.5, rustls 0.23.46,
|
||||
rustls-native-certs 0.8.5, scoped-tls 1.0.1, scopeguard 1.2.0, secret-service 4.0.0,
|
||||
security-framework 2.11.1, security-framework 3.7.0, security-framework-sys 2.17.0,
|
||||
signal-hook-registry 1.4.8, simd_cesu8 1.2.0, smallvec 1.16.2, smol_str 0.2.2, stable_deref_trait
|
||||
1.2.1, syn 1.0.109, tempfile 3.27.0, ttf-parser 0.25.1, unicode-segmentation 1.13.3, unicode-width
|
||||
0.2.2, url 2.5.8, uuid 1.27.0, wasi 0.11.1+wasi-snapshot-preview1, wasip2 1.0.4+wasi-0.2.12,
|
||||
wasm-bindgen 0.2.129, wasm-bindgen-futures 0.4.79, wasm-bindgen-macro 0.2.129,
|
||||
wasm-bindgen-macro-support 0.2.129, wasm-bindgen-shared 0.2.129, web-sys 0.3.106, weezl 0.1.12,
|
||||
wit-bindgen 0.57.1
|
||||
================================================================================
|
||||
|
||||
Apache License
|
||||
@@ -4030,7 +4034,605 @@ Apache License
|
||||
limitations under the License.
|
||||
|
||||
================================================================================
|
||||
crossbeam-deque 0.8.8, crossbeam-epoch 0.9.21, crossbeam-utils 0.8.23
|
||||
crossbeam-channel 0.5.17
|
||||
================================================================================
|
||||
|
||||
===============================================================================
|
||||
|
||||
matching.go
|
||||
https://creativecommons.org/licenses/by/3.0/legalcode
|
||||
|
||||
Creative Commons Legal Code
|
||||
|
||||
Attribution 3.0 Unported
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
|
||||
DAMAGES RESULTING FROM ITS USE.
|
||||
|
||||
License
|
||||
|
||||
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
|
||||
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
|
||||
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
|
||||
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
|
||||
|
||||
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
|
||||
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
|
||||
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
|
||||
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
|
||||
CONDITIONS.
|
||||
|
||||
1. Definitions
|
||||
|
||||
a. "Adaptation" means a work based upon the Work, or upon the Work and
|
||||
other pre-existing works, such as a translation, adaptation,
|
||||
derivative work, arrangement of music or other alterations of a
|
||||
literary or artistic work, or phonogram or performance and includes
|
||||
cinematographic adaptations or any other form in which the Work may be
|
||||
recast, transformed, or adapted including in any form recognizably
|
||||
derived from the original, except that a work that constitutes a
|
||||
Collection will not be considered an Adaptation for the purpose of
|
||||
this License. For the avoidance of doubt, where the Work is a musical
|
||||
work, performance or phonogram, the synchronization of the Work in
|
||||
timed-relation with a moving image ("synching") will be considered an
|
||||
Adaptation for the purpose of this License.
|
||||
b. "Collection" means a collection of literary or artistic works, such as
|
||||
encyclopedias and anthologies, or performances, phonograms or
|
||||
broadcasts, or other works or subject matter other than works listed
|
||||
in Section 1(f) below, which, by reason of the selection and
|
||||
arrangement of their contents, constitute intellectual creations, in
|
||||
which the Work is included in its entirety in unmodified form along
|
||||
with one or more other contributions, each constituting separate and
|
||||
independent works in themselves, which together are assembled into a
|
||||
collective whole. A work that constitutes a Collection will not be
|
||||
considered an Adaptation (as defined above) for the purposes of this
|
||||
License.
|
||||
c. "Distribute" means to make available to the public the original and
|
||||
copies of the Work or Adaptation, as appropriate, through sale or
|
||||
other transfer of ownership.
|
||||
d. "Licensor" means the individual, individuals, entity or entities that
|
||||
offer(s) the Work under the terms of this License.
|
||||
e. "Original Author" means, in the case of a literary or artistic work,
|
||||
the individual, individuals, entity or entities who created the Work
|
||||
or if no individual or entity can be identified, the publisher; and in
|
||||
addition (i) in the case of a performance the actors, singers,
|
||||
musicians, dancers, and other persons who act, sing, deliver, declaim,
|
||||
play in, interpret or otherwise perform literary or artistic works or
|
||||
expressions of folklore; (ii) in the case of a phonogram the producer
|
||||
being the person or legal entity who first fixes the sounds of a
|
||||
performance or other sounds; and, (iii) in the case of broadcasts, the
|
||||
organization that transmits the broadcast.
|
||||
f. "Work" means the literary and/or artistic work offered under the terms
|
||||
of this License including without limitation any production in the
|
||||
literary, scientific and artistic domain, whatever may be the mode or
|
||||
form of its expression including digital form, such as a book,
|
||||
pamphlet and other writing; a lecture, address, sermon or other work
|
||||
of the same nature; a dramatic or dramatico-musical work; a
|
||||
choreographic work or entertainment in dumb show; a musical
|
||||
composition with or without words; a cinematographic work to which are
|
||||
assimilated works expressed by a process analogous to cinematography;
|
||||
a work of drawing, painting, architecture, sculpture, engraving or
|
||||
lithography; a photographic work to which are assimilated works
|
||||
expressed by a process analogous to photography; a work of applied
|
||||
art; an illustration, map, plan, sketch or three-dimensional work
|
||||
relative to geography, topography, architecture or science; a
|
||||
performance; a broadcast; a phonogram; a compilation of data to the
|
||||
extent it is protected as a copyrightable work; or a work performed by
|
||||
a variety or circus performer to the extent it is not otherwise
|
||||
considered a literary or artistic work.
|
||||
g. "You" means an individual or entity exercising rights under this
|
||||
License who has not previously violated the terms of this License with
|
||||
respect to the Work, or who has received express permission from the
|
||||
Licensor to exercise rights under this License despite a previous
|
||||
violation.
|
||||
h. "Publicly Perform" means to perform public recitations of the Work and
|
||||
to communicate to the public those public recitations, by any means or
|
||||
process, including by wire or wireless means or public digital
|
||||
performances; to make available to the public Works in such a way that
|
||||
members of the public may access these Works from a place and at a
|
||||
place individually chosen by them; to perform the Work to the public
|
||||
by any means or process and the communication to the public of the
|
||||
performances of the Work, including by public digital performance; to
|
||||
broadcast and rebroadcast the Work by any means including signs,
|
||||
sounds or images.
|
||||
i. "Reproduce" means to make copies of the Work by any means including
|
||||
without limitation by sound or visual recordings and the right of
|
||||
fixation and reproducing fixations of the Work, including storage of a
|
||||
protected performance or phonogram in digital form or other electronic
|
||||
medium.
|
||||
|
||||
2. Fair Dealing Rights. Nothing in this License is intended to reduce,
|
||||
limit, or restrict any uses free from copyright or rights arising from
|
||||
limitations or exceptions that are provided for in connection with the
|
||||
copyright protection under copyright law or other applicable laws.
|
||||
|
||||
3. License Grant. Subject to the terms and conditions of this License,
|
||||
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
||||
perpetual (for the duration of the applicable copyright) license to
|
||||
exercise the rights in the Work as stated below:
|
||||
|
||||
a. to Reproduce the Work, to incorporate the Work into one or more
|
||||
Collections, and to Reproduce the Work as incorporated in the
|
||||
Collections;
|
||||
b. to create and Reproduce Adaptations provided that any such Adaptation,
|
||||
including any translation in any medium, takes reasonable steps to
|
||||
clearly label, demarcate or otherwise identify that changes were made
|
||||
to the original Work. For example, a translation could be marked "The
|
||||
original work was translated from English to Spanish," or a
|
||||
modification could indicate "The original work has been modified.";
|
||||
c. to Distribute and Publicly Perform the Work including as incorporated
|
||||
in Collections; and,
|
||||
d. to Distribute and Publicly Perform Adaptations.
|
||||
e. For the avoidance of doubt:
|
||||
|
||||
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme cannot be waived, the Licensor
|
||||
reserves the exclusive right to collect such royalties for any
|
||||
exercise by You of the rights granted under this License;
|
||||
ii. Waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme can be waived, the Licensor waives the
|
||||
exclusive right to collect such royalties for any exercise by You
|
||||
of the rights granted under this License; and,
|
||||
iii. Voluntary License Schemes. The Licensor waives the right to
|
||||
collect royalties, whether individually or, in the event that the
|
||||
Licensor is a member of a collecting society that administers
|
||||
voluntary licensing schemes, via that society, from any exercise
|
||||
by You of the rights granted under this License.
|
||||
|
||||
The above rights may be exercised in all media and formats whether now
|
||||
known or hereafter devised. The above rights include the right to make
|
||||
such modifications as are technically necessary to exercise the rights in
|
||||
other media and formats. Subject to Section 8(f), all rights not expressly
|
||||
granted by Licensor are hereby reserved.
|
||||
|
||||
4. Restrictions. The license granted in Section 3 above is expressly made
|
||||
subject to and limited by the following restrictions:
|
||||
|
||||
a. You may Distribute or Publicly Perform the Work only under the terms
|
||||
of this License. You must include a copy of, or the Uniform Resource
|
||||
Identifier (URI) for, this License with every copy of the Work You
|
||||
Distribute or Publicly Perform. You may not offer or impose any terms
|
||||
on the Work that restrict the terms of this License or the ability of
|
||||
the recipient of the Work to exercise the rights granted to that
|
||||
recipient under the terms of the License. You may not sublicense the
|
||||
Work. You must keep intact all notices that refer to this License and
|
||||
to the disclaimer of warranties with every copy of the Work You
|
||||
Distribute or Publicly Perform. When You Distribute or Publicly
|
||||
Perform the Work, You may not impose any effective technological
|
||||
measures on the Work that restrict the ability of a recipient of the
|
||||
Work from You to exercise the rights granted to that recipient under
|
||||
the terms of the License. This Section 4(a) applies to the Work as
|
||||
incorporated in a Collection, but this does not require the Collection
|
||||
apart from the Work itself to be made subject to the terms of this
|
||||
License. If You create a Collection, upon notice from any Licensor You
|
||||
must, to the extent practicable, remove from the Collection any credit
|
||||
as required by Section 4(b), as requested. If You create an
|
||||
Adaptation, upon notice from any Licensor You must, to the extent
|
||||
practicable, remove from the Adaptation any credit as required by
|
||||
Section 4(b), as requested.
|
||||
b. If You Distribute, or Publicly Perform the Work or any Adaptations or
|
||||
Collections, You must, unless a request has been made pursuant to
|
||||
Section 4(a), keep intact all copyright notices for the Work and
|
||||
provide, reasonable to the medium or means You are utilizing: (i) the
|
||||
name of the Original Author (or pseudonym, if applicable) if supplied,
|
||||
and/or if the Original Author and/or Licensor designate another party
|
||||
or parties (e.g., a sponsor institute, publishing entity, journal) for
|
||||
attribution ("Attribution Parties") in Licensor's copyright notice,
|
||||
terms of service or by other reasonable means, the name of such party
|
||||
or parties; (ii) the title of the Work if supplied; (iii) to the
|
||||
extent reasonably practicable, the URI, if any, that Licensor
|
||||
specifies to be associated with the Work, unless such URI does not
|
||||
refer to the copyright notice or licensing information for the Work;
|
||||
and (iv) , consistent with Section 3(b), in the case of an Adaptation,
|
||||
a credit identifying the use of the Work in the Adaptation (e.g.,
|
||||
"French translation of the Work by Original Author," or "Screenplay
|
||||
based on original Work by Original Author"). The credit required by
|
||||
this Section 4 (b) may be implemented in any reasonable manner;
|
||||
provided, however, that in the case of a Adaptation or Collection, at
|
||||
a minimum such credit will appear, if a credit for all contributing
|
||||
authors of the Adaptation or Collection appears, then as part of these
|
||||
credits and in a manner at least as prominent as the credits for the
|
||||
other contributing authors. For the avoidance of doubt, You may only
|
||||
use the credit required by this Section for the purpose of attribution
|
||||
in the manner set out above and, by exercising Your rights under this
|
||||
License, You may not implicitly or explicitly assert or imply any
|
||||
connection with, sponsorship or endorsement by the Original Author,
|
||||
Licensor and/or Attribution Parties, as appropriate, of You or Your
|
||||
use of the Work, without the separate, express prior written
|
||||
permission of the Original Author, Licensor and/or Attribution
|
||||
Parties.
|
||||
c. Except as otherwise agreed in writing by the Licensor or as may be
|
||||
otherwise permitted by applicable law, if You Reproduce, Distribute or
|
||||
Publicly Perform the Work either by itself or as part of any
|
||||
Adaptations or Collections, You must not distort, mutilate, modify or
|
||||
take other derogatory action in relation to the Work which would be
|
||||
prejudicial to the Original Author's honor or reputation. Licensor
|
||||
agrees that in those jurisdictions (e.g. Japan), in which any exercise
|
||||
of the right granted in Section 3(b) of this License (the right to
|
||||
make Adaptations) would be deemed to be a distortion, mutilation,
|
||||
modification or other derogatory action prejudicial to the Original
|
||||
Author's honor and reputation, the Licensor will waive or not assert,
|
||||
as appropriate, this Section, to the fullest extent permitted by the
|
||||
applicable national law, to enable You to reasonably exercise Your
|
||||
right under Section 3(b) of this License (right to make Adaptations)
|
||||
but not otherwise.
|
||||
|
||||
5. Representations, Warranties and Disclaimer
|
||||
|
||||
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
|
||||
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
|
||||
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
|
||||
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
|
||||
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
|
||||
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
|
||||
OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
|
||||
|
||||
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
|
||||
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
|
||||
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
|
||||
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
|
||||
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. Termination
|
||||
|
||||
a. This License and the rights granted hereunder will terminate
|
||||
automatically upon any breach by You of the terms of this License.
|
||||
Individuals or entities who have received Adaptations or Collections
|
||||
from You under this License, however, will not have their licenses
|
||||
terminated provided such individuals or entities remain in full
|
||||
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
|
||||
survive any termination of this License.
|
||||
b. Subject to the above terms and conditions, the license granted here is
|
||||
perpetual (for the duration of the applicable copyright in the Work).
|
||||
Notwithstanding the above, Licensor reserves the right to release the
|
||||
Work under different license terms or to stop distributing the Work at
|
||||
any time; provided, however that any such election will not serve to
|
||||
withdraw this License (or any other license that has been, or is
|
||||
required to be, granted under the terms of this License), and this
|
||||
License will continue in full force and effect unless terminated as
|
||||
stated above.
|
||||
|
||||
8. Miscellaneous
|
||||
|
||||
a. Each time You Distribute or Publicly Perform the Work or a Collection,
|
||||
the Licensor offers to the recipient a license to the Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
|
||||
offers to the recipient a license to the original Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
c. If any provision of this License is invalid or unenforceable under
|
||||
applicable law, it shall not affect the validity or enforceability of
|
||||
the remainder of the terms of this License, and without further action
|
||||
by the parties to this agreement, such provision shall be reformed to
|
||||
the minimum extent necessary to make such provision valid and
|
||||
enforceable.
|
||||
d. No term or provision of this License shall be deemed waived and no
|
||||
breach consented to unless such waiver or consent shall be in writing
|
||||
and signed by the party to be charged with such waiver or consent.
|
||||
e. This License constitutes the entire agreement between the parties with
|
||||
respect to the Work licensed here. There are no understandings,
|
||||
agreements or representations with respect to the Work not specified
|
||||
here. Licensor shall not be bound by any additional provisions that
|
||||
may appear in any communication from You. This License may not be
|
||||
modified without the mutual written agreement of the Licensor and You.
|
||||
f. The rights granted under, and the subject matter referenced, in this
|
||||
License were drafted utilizing the terminology of the Berne Convention
|
||||
for the Protection of Literary and Artistic Works (as amended on
|
||||
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
|
||||
Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
|
||||
and the Universal Copyright Convention (as revised on July 24, 1971).
|
||||
These rights and subject matter take effect in the relevant
|
||||
jurisdiction in which the License terms are sought to be enforced
|
||||
according to the corresponding provisions of the implementation of
|
||||
those treaty provisions in the applicable national law. If the
|
||||
standard suite of rights granted under applicable copyright law
|
||||
includes additional rights not granted under this License, such
|
||||
additional rights are deemed to be included in the License; this
|
||||
License is not intended to restrict the license of any rights under
|
||||
applicable law.
|
||||
|
||||
|
||||
Creative Commons Notice
|
||||
|
||||
Creative Commons is not a party to this License, and makes no warranty
|
||||
whatsoever in connection with the Work. Creative Commons will not be
|
||||
liable to You or any party on any legal theory for any damages
|
||||
whatsoever, including without limitation any general, special,
|
||||
incidental or consequential damages arising in connection to this
|
||||
license. Notwithstanding the foregoing two (2) sentences, if Creative
|
||||
Commons has expressly identified itself as the Licensor hereunder, it
|
||||
shall have all rights and obligations of Licensor.
|
||||
|
||||
Except for the limited purpose of indicating to the public that the
|
||||
Work is licensed under the CCPL, Creative Commons does not authorize
|
||||
the use by either party of the trademark "Creative Commons" or any
|
||||
related trademark or logo of Creative Commons without the prior
|
||||
written consent of Creative Commons. Any permitted use will be in
|
||||
compliance with Creative Commons' then-current trademark usage
|
||||
guidelines, as may be published on its website or otherwise made
|
||||
available upon request from time to time. For the avoidance of doubt,
|
||||
this trademark restriction does not form part of this License.
|
||||
|
||||
Creative Commons may be contacted at https://creativecommons.org/.
|
||||
|
||||
===============================================================================
|
||||
|
||||
The Go Programming Language
|
||||
https://golang.org/LICENSE
|
||||
|
||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
===============================================================================
|
||||
|
||||
The Rust Programming Language
|
||||
https://github.com/rust-lang/rust/blob/master/LICENSE-MIT
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
===============================================================================
|
||||
|
||||
The Rust Programming Language
|
||||
https://github.com/rust-lang/rust/blob/master/LICENSE-APACHE
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
================================================================================
|
||||
crossbeam-channel 0.5.17, crossbeam-deque 0.8.8, crossbeam-epoch 0.9.21, crossbeam-utils 0.8.23
|
||||
================================================================================
|
||||
|
||||
The MIT License (MIT)
|
||||
@@ -7716,6 +8318,30 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
================================================================================
|
||||
keyboard-types 0.8.3
|
||||
================================================================================
|
||||
|
||||
Copyright (c) 2017 Pyfisch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
================================================================================
|
||||
keyring 3.6.3
|
||||
================================================================================
|
||||
@@ -9452,6 +10078,56 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
================================================================================
|
||||
muda 0.21.2
|
||||
================================================================================
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022-2022 Tauri Programme within The Commons Conservancy
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
================================================================================
|
||||
muda 0.21.2
|
||||
================================================================================
|
||||
|
||||
SPDXVersion: SPDX-2.1
|
||||
DataLicense: CC0-1.0
|
||||
PackageName: muda
|
||||
DataFormat: SPDXRef-1
|
||||
PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
|
||||
PackageHomePage: https://tauri.app
|
||||
PackageLicenseDeclared: Apache-2.0
|
||||
PackageLicenseDeclared: MIT
|
||||
PackageCopyrightText: 2020-2022, The Tauri Programme in the Commons Conservancy
|
||||
PackageSummary: <text>Menu Utilities for Desktop Applications.
|
||||
</text>
|
||||
PackageComment: <text>The package includes the following libraries; see
|
||||
Relationship information.
|
||||
</text>
|
||||
Created: 2022-12-05T09:00:00Z
|
||||
PackageDownloadLocation: git://github.com/tauri-apps/muda
|
||||
PackageDownloadLocation: git+https://github.com/tauri-apps/muda.git
|
||||
PackageDownloadLocation: git+ssh://github.com/tauri-apps/muda.git
|
||||
Creator: Person: Daniel Thompson-Yvetot
|
||||
|
||||
================================================================================
|
||||
multiversion_no_op 1.0.0
|
||||
================================================================================
|
||||
|
||||
@@ -176,6 +176,7 @@
|
||||
"Export JSON…": "Export JSON…",
|
||||
"Export design library...": "Export design library...",
|
||||
"Export hidden edges as dashed lines": "Export hidden edges as dashed lines",
|
||||
"Exported by SolidWorks, which usually saves Y up": "Exported by SolidWorks, which usually saves Y up",
|
||||
"Expression": "Expression",
|
||||
"Extend to meet": "Extend to meet",
|
||||
"Extents": "Extents",
|
||||
|
||||
@@ -176,6 +176,7 @@
|
||||
"Export JSON…": "JSONを書き出し…",
|
||||
"Export design library...": "デザインライブラリを書き出す...",
|
||||
"Export hidden edges as dashed lines": "点線で出力",
|
||||
"Exported by SolidWorks, which usually saves Y up": "SolidWorks で書き出されたファイルです。通常は Y 軸が上になります",
|
||||
"Expression": "式",
|
||||
"Extend to meet": "交わるまで延長",
|
||||
"Extents": "範囲",
|
||||
|
||||
@@ -176,6 +176,7 @@
|
||||
"Export JSON…": "导出 JSON…",
|
||||
"Export design library...": "导出设计库...",
|
||||
"Export hidden edges as dashed lines": "以虚线导出隐藏线",
|
||||
"Exported by SolidWorks, which usually saves Y up": "由 SolidWorks 导出,通常以 Y 轴向上保存",
|
||||
"Expression": "表达式",
|
||||
"Extend to meet": "延伸至相交",
|
||||
"Extents": "范围",
|
||||
|
||||
@@ -16,6 +16,8 @@ struct U {
|
||||
ana_c: array<vec4<f32>, 8>,
|
||||
ana_f: vec4<f32>, // x = 1: stripe the negative draft and blocked faces
|
||||
depth: vec4<f32>, // x = 1: reversed depth (1 near, 0 far); y, z: the faces' push (`FACE_BIAS`)
|
||||
tint: vec4<f32>, // xyz added to a whole hovered body's colour before lighting
|
||||
sel: vec4<f32>, // xyz a whole selected body's colour before lighting
|
||||
};
|
||||
|
||||
fn reversed() -> bool {
|
||||
@@ -424,6 +426,20 @@ fn fs_tri(i: TOut) -> @location(0) vec4<f32> {
|
||||
return shade(i);
|
||||
}
|
||||
|
||||
/// A whole hovered body, lit over the model from its own plan triangles in a lifted colour.
|
||||
@fragment
|
||||
fn fs_hl_hover(i: TOut) -> @location(0) vec4<f32> {
|
||||
if (clipped(i.wp)) { discard; }
|
||||
return lit_color(i, 1.0, vec4<f32>(i.c.rgb + u.tint.rgb, i.c.a));
|
||||
}
|
||||
|
||||
/// A whole selected body, lit over the model from its own plan triangles in the selection colour.
|
||||
@fragment
|
||||
fn fs_hl_selected(i: TOut) -> @location(0) vec4<f32> {
|
||||
if (clipped(i.wp)) { discard; }
|
||||
return lit_color(i, 1.0, vec4<f32>(u.sel.rgb, i.c.a));
|
||||
}
|
||||
|
||||
/// Reference planes: shaded like `fs_tri`, but never cut by the section plane.
|
||||
@fragment
|
||||
fn fs_tri_all(i: TOut) -> @location(0) vec4<f32> {
|
||||
@@ -435,9 +451,15 @@ fn shade(i: TOut) -> vec4<f32> {
|
||||
}
|
||||
|
||||
fn lit(i: TOut, visibility: f32) -> vec4<f32> {
|
||||
return lit_color(i, visibility, i.c);
|
||||
}
|
||||
|
||||
/// [`lit`] in a colour of its own: a whole highlighted body is lit in its colour lifted by the
|
||||
/// hover amount, or in the selection colour, from the model's own plan triangles.
|
||||
fn lit_color(i: TOut, visibility: f32, base: vec4<f32>) -> vec4<f32> {
|
||||
// A zero normal marks flat colour (selection fills, translucent planes).
|
||||
if (length(i.n) < 0.5) {
|
||||
return out_color(i.c);
|
||||
return out_color(base);
|
||||
}
|
||||
let v = normalize(u.back.xyz);
|
||||
var n = normalize(i.n);
|
||||
@@ -448,7 +470,7 @@ fn lit(i: TOut, visibility: f32) -> vec4<f32> {
|
||||
let h = normalize(key + v);
|
||||
let spec = pow(max(dot(n, h), 0.0), 40.0) * 0.25;
|
||||
let k = 0.42 + 0.38 * diff + 0.25 * fill - (0.42 + 0.25 * fill) * (1.0 - visibility);
|
||||
return out_color(vec4<f32>(min(i.c.rgb * k + vec3<f32>(spec), vec3<f32>(1.0)), i.c.a));
|
||||
return out_color(vec4<f32>(min(base.rgb * k + vec3<f32>(spec), vec3<f32>(1.0)), base.a));
|
||||
}
|
||||
|
||||
// Lines, decals and ghosts are drawn at their own depth: opaque faces are pushed back by their
|
||||
|
||||
File renamed without changes.
@@ -383,6 +383,8 @@ fn frame(scene: &Scene, cam: &Camera, [width, height]: [u32; 2], key: u64, acces
|
||||
eye: [eye[0], eye[1], eye[2], if cam.fov > 0.0 { 1.0 } else { 0.0 }],
|
||||
ao_radius: 0.0,
|
||||
ssaa: 1.0,
|
||||
hover_tint: [0.0; 3],
|
||||
selection_tint: [0.0; 3],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+135
-4
@@ -28,9 +28,9 @@ pub const LINE_SIZE: usize = 32;
|
||||
/// are each row's dot product with (p, 1)), then its colour (4 × u8).
|
||||
pub const INSTANCE_SIZE: usize = 52;
|
||||
/// The shader's `U`: the view-projection matrix, 10 `vec4`s (the tenth carries the ambient
|
||||
/// occlusion radius), the 8 analysis colours, their flags and the depth direction
|
||||
/// (`uniform_bytes`).
|
||||
const UNIFORM_SIZE: u64 = 384;
|
||||
/// occlusion radius), the 8 analysis colours, their flags, the depth direction and the two
|
||||
/// whole-body highlight colours (`uniform_bytes`).
|
||||
const UNIFORM_SIZE: u64 = 416;
|
||||
|
||||
/// A body drawn from its display plan, evaluated on the GPU: the plan, and a colour per face
|
||||
/// (the plan's face numbering; faces past the end take the last colour).
|
||||
@@ -290,6 +290,22 @@ pub struct GpuScene {
|
||||
pub planned: Vec<PlannedBody>,
|
||||
/// Opaque bodies drawn as placements of shared triangles, like `tris`.
|
||||
pub instanced: Vec<InstancedMesh>,
|
||||
/// Whole hovered bodies the model draws from their plans on the GPU: lit again over the
|
||||
/// model in the hover colour from the model's own evaluated triangles, so a whole assembly
|
||||
/// under the pointer costs a draw per body, not a copy of every triangle on the CPU.
|
||||
pub hover_planned: Vec<Arc<solidcraft_geom::tess::TessPlan>>,
|
||||
/// Whole selected bodies, as `hover_planned`, in the selection colour.
|
||||
pub selected_planned: Vec<Arc<solidcraft_geom::tess::TessPlan>>,
|
||||
/// Whole hovered bodies the model builds on the CPU (no display plan): their triangles in
|
||||
/// the model scene's own blocks, drawn again tinted.
|
||||
pub hover_blocks: Vec<BlockTris>,
|
||||
/// Whole selected bodies, as `hover_blocks`, in the selection colour.
|
||||
pub selected_blocks: Vec<BlockTris>,
|
||||
/// Whole hovered bodies the model draws as placements of shared triangles: those meshes with
|
||||
/// the body's highlight colour on each placement.
|
||||
pub hover_instanced: Vec<InstancedMesh>,
|
||||
/// Whole selected bodies, as `hover_instanced`, in the selection colour.
|
||||
pub selected_instanced: Vec<InstancedMesh>,
|
||||
/// The model's bodies, a few at a time, drawn before the loose geometry above (`tris`,
|
||||
/// `trans`, `lines` and `hidden` of each block, in order, then the scene's own). A block
|
||||
/// that comes back unchanged keeps its buffers: a design changing one body at a time (an
|
||||
@@ -331,6 +347,16 @@ pub struct SceneBlock {
|
||||
pub bytes: Arc<BlockBytes>,
|
||||
}
|
||||
|
||||
/// A whole highlighted body the model builds on the CPU: its triangles in a model scene block,
|
||||
/// as vertices of the block's triangle buffer.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct BlockTris {
|
||||
/// The block's key ([`SceneBlock::key`]).
|
||||
pub block: u64,
|
||||
/// The body's vertices in it.
|
||||
pub tris: std::ops::Range<u32>,
|
||||
}
|
||||
|
||||
/// A block's geometry, laid out as in [`GpuScene`].
|
||||
#[derive(Default)]
|
||||
pub struct BlockBytes {
|
||||
@@ -492,6 +518,10 @@ pub struct Frame {
|
||||
/// direction and filter it down (1: off). Under 1 the frame is drawn smaller and filtered up
|
||||
/// (the product preview past its pixel budget, #1464).
|
||||
pub ssaa: f32,
|
||||
/// Whole-body hover highlight: added to the body's own colour before lighting (sRGB 0..1).
|
||||
pub hover_tint: [f32; 3],
|
||||
/// Whole-body selection highlight: a selected body's colour before lighting (sRGB 0..1).
|
||||
pub selection_tint: [f32; 3],
|
||||
}
|
||||
|
||||
/// Heights of the model seen from a direction (an orthographic depth map): a point is reachable
|
||||
@@ -614,6 +644,16 @@ struct Batch {
|
||||
struct PlannedDraw {
|
||||
mesh: Arc<crate::GpuMesh>,
|
||||
colors: wgpu::Buffer,
|
||||
/// The address of each plan in the chunk, in `mesh.parts` order: a whole-body highlight
|
||||
/// finds the evaluated triangles of the body it lights.
|
||||
plans: Vec<usize>,
|
||||
}
|
||||
|
||||
impl PlannedDraw {
|
||||
/// The part drawn from the plan at `address`, if this chunk holds it.
|
||||
fn part_of(&self, address: usize) -> Option<&crate::Part> {
|
||||
self.plans.iter().position(|p| *p == address).and_then(|i| self.mesh.parts.get(i))
|
||||
}
|
||||
}
|
||||
|
||||
/// An [`InstancedMesh`]'s triangles on the GPU (kept while its key comes back).
|
||||
@@ -830,6 +870,15 @@ struct Batches {
|
||||
guide_lines: Option<Batch>,
|
||||
planned: Vec<PlannedDraw>,
|
||||
instanced: Vec<InstancedDraw>,
|
||||
/// Whole highlighted bodies redrawn from `planned` (the scene's own plans are not used).
|
||||
hover_planned: Vec<Arc<solidcraft_geom::tess::TessPlan>>,
|
||||
selected_planned: Vec<Arc<solidcraft_geom::tess::TessPlan>>,
|
||||
/// Whole highlighted bodies redrawn from the scene's blocks, by block key and vertex range.
|
||||
hover_blocks: Vec<BlockTris>,
|
||||
selected_blocks: Vec<BlockTris>,
|
||||
/// Whole highlighted bodies drawn as placements of the scene's shared triangles.
|
||||
hover_instanced: Vec<InstancedDraw>,
|
||||
selected_instanced: Vec<InstancedDraw>,
|
||||
/// The instanced meshes' triangles (and their levels) on the GPU, by the address of the
|
||||
/// triangles they were uploaded from (held, so it stays theirs).
|
||||
instanced_tris: std::collections::HashMap<usize, (Arc<SharedTris>, Arc<SharedGpu>)>,
|
||||
@@ -851,6 +900,12 @@ impl Batches {
|
||||
None => Vec::new(),
|
||||
};
|
||||
self.instanced = self.instanced(device, &sc.instanced);
|
||||
self.hover_planned = sc.hover_planned;
|
||||
self.selected_planned = sc.selected_planned;
|
||||
self.hover_blocks = sc.hover_blocks;
|
||||
self.selected_blocks = sc.selected_blocks;
|
||||
self.hover_instanced = self.instanced(device, &sc.hover_instanced);
|
||||
self.selected_instanced = self.instanced(device, &sc.selected_instanced);
|
||||
let mut kept = std::mem::take(&mut self.blocks);
|
||||
let mut blocks: Vec<&BlockGpu> = Vec::with_capacity(sc.blocks.len());
|
||||
for block in &sc.blocks {
|
||||
@@ -1045,7 +1100,7 @@ impl Batches {
|
||||
bytes.extend(faces.iter().flat_map(|f| b.face_colors.get(*f as usize).copied().unwrap_or(last)));
|
||||
}
|
||||
if let Some((colors, _)) = upload(device, "sc_planned_colors", &bytes, 4).and_then(|c| c.parts.into_iter().next()) {
|
||||
out.push(PlannedDraw { mesh, colors });
|
||||
out.push(PlannedDraw { mesh, colors, plans: key(chunk) });
|
||||
}
|
||||
}
|
||||
out
|
||||
@@ -1079,6 +1134,17 @@ pub struct Renderer {
|
||||
tri_cut: Option<(wgpu::RenderPipeline, wgpu::RenderPipeline)>,
|
||||
/// Highlight triangles over the model (depth test ≤, no depth write).
|
||||
tri_hl: wgpu::RenderPipeline,
|
||||
/// Whole highlighted bodies, redrawn from the model's planned chunks in the hover and the
|
||||
/// selection colour (depth test ≤, no depth write).
|
||||
tri_hl_hover: wgpu::RenderPipeline,
|
||||
tri_hl_selected: wgpu::RenderPipeline,
|
||||
/// The same for bodies the model builds on the CPU, from its blocks' triangle buffers.
|
||||
tri_hl_hover_built: wgpu::RenderPipeline,
|
||||
tri_hl_selected_built: wgpu::RenderPipeline,
|
||||
/// The same for bodies drawn as placements of shared triangles (the placement's colour is
|
||||
/// the highlight's), smooth and flat.
|
||||
tri_hl_instanced: wgpu::RenderPipeline,
|
||||
tri_hl_instanced_flat: wgpu::RenderPipeline,
|
||||
pbr: wgpu::RenderPipeline,
|
||||
trans: wgpu::RenderPipeline,
|
||||
/// Glass: far sides (front faces culled), then near sides (back faces culled).
|
||||
@@ -1817,6 +1883,12 @@ impl Renderer {
|
||||
access_bind,
|
||||
access_version: 0,
|
||||
tri_hl: pipeline("sc_tris_hl", "vs_tri", "fs_tri", tri_layout(), highlight_depth(t.depth), alpha),
|
||||
tri_hl_hover: solid("sc_tris_hl_hover", "fs_hl_hover", None, highlight_depth(t.depth), TriSource::Planned),
|
||||
tri_hl_selected: solid("sc_tris_hl_selected", "fs_hl_selected", None, highlight_depth(t.depth), TriSource::Planned),
|
||||
tri_hl_hover_built: solid("sc_tris_hl_hover_built", "fs_hl_hover", None, highlight_depth(t.depth), TriSource::Built),
|
||||
tri_hl_selected_built: solid("sc_tris_hl_selected_built", "fs_hl_selected", None, highlight_depth(t.depth), TriSource::Built),
|
||||
tri_hl_instanced: solid("sc_tris_hl_instanced", "fs_tri", None, highlight_depth(t.depth), TriSource::Instanced),
|
||||
tri_hl_instanced_flat: solid("sc_tris_hl_instanced_flat", "fs_tri", None, highlight_depth(t.depth), TriSource::InstancedFlat),
|
||||
pbr: pipeline("sc_pbr", "vs_pbr", "fs_pbr", pbr_layout(), pushed(wgpu::CompareFunction::Less, true, FACE_BIAS), None),
|
||||
trans: pipeline("sc_trans", "vs_tri", "fs_tri", tri_layout(), depth(wgpu::CompareFunction::LessEqual, false), alpha),
|
||||
glass_far: glass("sc_glass_far", wgpu::Face::Front),
|
||||
@@ -2220,6 +2292,48 @@ impl Renderer {
|
||||
d.draw(pass, smooth, flat);
|
||||
}
|
||||
};
|
||||
// Whole highlighted bodies: the model's own evaluated plan triangles, drawn again in a
|
||||
// highlight colour (the pipeline adds or replaces the vertex colour).
|
||||
let tinted = |pass: &mut wgpu::RenderPass<'static>, p: &wgpu::RenderPipeline, plans: &[Arc<solidcraft_geom::tess::TessPlan>]| {
|
||||
for plan in plans {
|
||||
let address = Arc::as_ptr(plan) as usize;
|
||||
for d in &m.planned {
|
||||
let Some(part) = d.part_of(address) else { continue };
|
||||
pass.set_pipeline(p);
|
||||
pass.set_vertex_buffer(0, d.mesh.vertices.slice(..));
|
||||
pass.set_vertex_buffer(1, d.colors.slice(..));
|
||||
pass.set_index_buffer(d.mesh.indices.slice(..), wgpu::IndexFormat::Uint32);
|
||||
pass.draw_indexed(part.indices.clone(), 0, 0..1);
|
||||
}
|
||||
}
|
||||
};
|
||||
// Whole highlighted bodies the model builds on the CPU: their part of a block's triangle
|
||||
// buffer (the blocks may run over several buffers).
|
||||
let tinted_blocks = |pass: &mut wgpu::RenderPass<'static>, p: &wgpu::RenderPipeline, refs: &[BlockTris]| {
|
||||
for r in refs {
|
||||
let Some(block) = m.blocks.get(&r.block) else { continue };
|
||||
let Some(batch) = &block.tris else { continue };
|
||||
pass.set_pipeline(p);
|
||||
let mut base = 0u32;
|
||||
for (buffer, count) in &batch.parts {
|
||||
let end = base.saturating_add(*count);
|
||||
let (lo, hi) = (r.tris.start.max(base), r.tris.end.min(end));
|
||||
if lo < hi {
|
||||
pass.set_vertex_buffer(0, buffer.slice(..));
|
||||
pass.draw(lo - base..hi - base, 0..1);
|
||||
}
|
||||
base = end;
|
||||
}
|
||||
}
|
||||
};
|
||||
// Whole highlighted bodies the model draws as placements of shared triangles: the same
|
||||
// placements, with the highlight colour on each.
|
||||
let tinted_instanced =
|
||||
|pass: &mut wgpu::RenderPass<'static>, smooth: &wgpu::RenderPipeline, flat: &wgpu::RenderPipeline, list: &[InstancedDraw]| {
|
||||
for d in list.iter().filter(|d| d.look == InstanceLook::Opaque) {
|
||||
d.draw(pass, smooth, flat);
|
||||
}
|
||||
};
|
||||
let sectioned = cb.clip[..3].iter().map(|c| c * c).sum::<f32>() > 0.25;
|
||||
match (
|
||||
res.tri_cut.as_ref().filter(|_| sectioned),
|
||||
@@ -2246,6 +2360,15 @@ impl Renderer {
|
||||
}
|
||||
}
|
||||
tris(pass, &res.pbr, &m.pbr);
|
||||
// Whole-body tints first, so a face or an edge highlighted over the body (in `h.tris`
|
||||
// and `h.lines`) keeps its own colour, as it did when the body's triangles were built
|
||||
// into the same list before them.
|
||||
tinted(pass, &res.tri_hl_hover, &h.hover_planned);
|
||||
tinted(pass, &res.tri_hl_selected, &h.selected_planned);
|
||||
tinted_blocks(pass, &res.tri_hl_hover_built, &h.hover_blocks);
|
||||
tinted_blocks(pass, &res.tri_hl_selected_built, &h.selected_blocks);
|
||||
tinted_instanced(pass, &res.tri_hl_instanced, &res.tri_hl_instanced_flat, &h.hover_instanced);
|
||||
tinted_instanced(pass, &res.tri_hl_instanced, &res.tri_hl_instanced_flat, &h.selected_instanced);
|
||||
tris(pass, &res.tri_hl, &h.tris);
|
||||
lines(pass, &res.line, &m.lines);
|
||||
lines(pass, &res.line, &sk.lines);
|
||||
@@ -2523,6 +2646,8 @@ pub fn uniform_bytes(cb: &Frame, w: f32, h: f32, linear: bool, reversed: bool) -
|
||||
v.extend([cb.ao_radius, 0.0, 0.0, 0.0]);
|
||||
v.extend(cb.analysis_colors);
|
||||
v.extend([if reversed { 1.0 } else { 0.0 }, FACE_STEPS as f32, FACE_SLOPE, 0.0]);
|
||||
v.extend([cb.hover_tint[0], cb.hover_tint[1], cb.hover_tint[2], 0.0]);
|
||||
v.extend([cb.selection_tint[0], cb.selection_tint[1], cb.selection_tint[2], 0.0]);
|
||||
v.iter().flat_map(|x| x.to_le_bytes()).collect()
|
||||
}
|
||||
|
||||
@@ -2685,6 +2810,8 @@ mod tests {
|
||||
analysis: [0.0; 8],
|
||||
analysis_colors: [0.0; 36],
|
||||
access: None,
|
||||
hover_tint: [0.0; 3],
|
||||
selection_tint: [0.0; 3],
|
||||
outline: false,
|
||||
eye: [0.0; 4],
|
||||
ao_radius: 0.0,
|
||||
@@ -2926,6 +3053,8 @@ mod glass_tests {
|
||||
eye: [0.0, 0.0, 100.0, 0.0],
|
||||
ao_radius: 0.0,
|
||||
ssaa: 1.0,
|
||||
hover_tint: [0.0; 3],
|
||||
selection_tint: [0.0; 3],
|
||||
};
|
||||
let texture = |format, usage, sample_count| {
|
||||
device.create_texture(&wgpu::TextureDescriptor {
|
||||
@@ -3091,6 +3220,8 @@ mod glass_tests {
|
||||
analysis: [0.0; 8],
|
||||
analysis_colors: [0.0; 36],
|
||||
access: None,
|
||||
hover_tint: [0.0; 3],
|
||||
selection_tint: [0.0; 3],
|
||||
outline: false,
|
||||
eye: [0.0, 0.0, 100.0, 0.0],
|
||||
ao_radius: 0.0,
|
||||
|
||||
@@ -724,6 +724,13 @@ fn occurrence_items(app: &SolveApp, path: &[u64]) -> Vec<Item> {
|
||||
item.enabled = !placement.grounded && app.session.held_by_rigid_group(placement.occurrence).is_none();
|
||||
}
|
||||
"ui.properties" => item.params = Some(json!({"occurrence": placement.occurrence, "path": path})),
|
||||
"ui.turnUpAxis" => {
|
||||
for child in &mut item.children {
|
||||
if let Some(params) = child.params.as_mut() {
|
||||
params["occurrence"] = json!(placement.occurrence);
|
||||
}
|
||||
}
|
||||
}
|
||||
"occurrence.copy" => item.params = Some(json!({"occurrence": placement.occurrence, "translate": [10,10,0]})),
|
||||
"component.create" => item.params = Some(json!({"parent": placement.component, "parent_path": path})),
|
||||
"component.paste_new" => {
|
||||
@@ -750,6 +757,19 @@ fn occurrence_items(app: &SolveApp, path: &[u64]) -> Vec<Item> {
|
||||
entries
|
||||
}
|
||||
|
||||
/// "Turn Up Axis": a quarter turn about X of a component's occurrence for a file saved with the
|
||||
/// other axis up, one `occurrence.move` (one undo step).
|
||||
fn turn_up_axis(occurrence: u64, enabled: bool) -> Item {
|
||||
let mut item = act("ui.turnUpAxis", "Turn Up Axis", "move").on(enabled);
|
||||
item.children = [("Y up \u{2192} Z up", "90 deg"), ("Z up \u{2192} Y up", "-90 deg")]
|
||||
.into_iter()
|
||||
.map(|(label, angle)| {
|
||||
act("occurrence.move", label, "move").with(json!({"occurrence": occurrence, "axis": [1, 0, 0], "angle": angle})).on(enabled)
|
||||
})
|
||||
.collect();
|
||||
item
|
||||
}
|
||||
|
||||
fn component_items(app: &SolveApp, id: u64) -> Vec<Item> {
|
||||
let doc = &app.session.doc;
|
||||
let occ = doc.occurrence_of(id);
|
||||
@@ -772,6 +792,7 @@ fn component_items(app: &SolveApp, id: u64) -> Vec<Item> {
|
||||
.with(json!({ "occurrence": oid }))
|
||||
.on(!grounded && occ.is_some() && app.session.held_by_rigid_group(oid).is_none()),
|
||||
);
|
||||
v.push(turn_up_axis(oid, !grounded && occ.is_some() && app.session.held_by_rigid_group(oid).is_none()));
|
||||
v.push(cmd(app, "component.capture_position", "Capture Position").on(!app.session.pending_moves.is_empty()));
|
||||
v.push(cmd(app, "component.revert_position", "Revert Position").on(!app.session.pending_moves.is_empty()));
|
||||
// An imported assembly moves as one until its rigid group is released.
|
||||
|
||||
@@ -2824,7 +2824,7 @@ fn hole_defaults() -> Kind {
|
||||
/// Start a sketch on a picked plane or planar face and turn the view to face it.
|
||||
pub fn start_sketch(app: &mut SolveApp, sel: &Sel) -> Result<(), String> {
|
||||
let mut params = match sel {
|
||||
Sel::Plane { name } => json!({ "plane": name }),
|
||||
Sel::Plane { name } => json!({ "plane": shown_origin_plane(app, name).unwrap_or_else(|| json!(name)) }),
|
||||
Sel::Face { .. } => json!({ "plane": crate::sketch_attachment_ui::face_plane(app, sel).ok_or("Selected face placement no longer exists")? }),
|
||||
_ => return Err("Select an origin plane, construction plane or planar body face".into()),
|
||||
};
|
||||
@@ -2861,17 +2861,24 @@ fn flip_toward_viewer(app: &SolveApp, name: &str) -> Option<&'static str> {
|
||||
Some(if plane.y.dot(up) > 1e-9 { "y" } else { "x" })
|
||||
}
|
||||
|
||||
/// The world plane of an origin plane or a construction plane by name.
|
||||
/// The origin plane `name` as the viewport and the browser show it and the user picks it: the
|
||||
/// design's, in the world, written out for `sketch.create`, which puts it into the active
|
||||
/// component's frame once. By name it would be the active component's own plane, and once that
|
||||
/// component has moved (a stood-up import is turned a quarter about X) its XY is the world's XZ:
|
||||
/// the sketch, the view turning to it and the extrude all went the wrong way. `None` while the
|
||||
/// active component sits at the origin (the name says the same) or for a construction plane.
|
||||
fn shown_origin_plane(app: &SolveApp, name: &str) -> Option<Value> {
|
||||
let p = solidcraft_engine::geom::Plane::named(name)?;
|
||||
if app.session.doc.find_feature(name).is_some() || solidcraft_engine::doc::is_identity(&app.session.active_component_frame()) {
|
||||
return None;
|
||||
}
|
||||
Some(json!({"origin": [0.0, 0.0, 0.0], "x_dir": pt(p.x), "y_dir": pt(p.y)}))
|
||||
}
|
||||
|
||||
/// The world plane of an origin plane or a construction plane by name, where it is shown.
|
||||
fn plane_by_name(app: &SolveApp, name: &str) -> Option<solidcraft_engine::geom::Plane> {
|
||||
if let Some(p) = solidcraft_engine::geom::Plane::named(name) {
|
||||
// In an active component its origin planes are the component's.
|
||||
let m = app.session.active_component_frame();
|
||||
let (o, x, y) = (
|
||||
solidcraft_engine::doc::apply_point(&m, p.origin),
|
||||
solidcraft_engine::doc::apply_vector(&m, p.x),
|
||||
solidcraft_engine::doc::apply_vector(&m, p.y),
|
||||
);
|
||||
return solidcraft_engine::geom::Plane::new(o, x, y);
|
||||
return Some(p);
|
||||
}
|
||||
let st = app.session.world_state();
|
||||
st.construct.iter().find(|c| c.name == name).and_then(|c| match &c.geom {
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::sync::{Arc, Mutex};
|
||||
|
||||
use egui_wgpu::wgpu;
|
||||
pub use solidcraft_gpu::view::{
|
||||
AccessMap, BlockBytes, Frame, GpuImage, GpuScene, GpuTarget, INSTANCE_SIZE, InstanceLook, InstancedMesh, LINE_SIZE, LOD_PX, PBR_SIZE,
|
||||
AccessMap, BlockBytes, BlockTris, Frame, GpuImage, GpuScene, GpuTarget, INSTANCE_SIZE, InstanceLook, InstancedMesh, LINE_SIZE, LOD_PX, PBR_SIZE,
|
||||
PlannedBody, Renderer, SHARED_SIZE, SceneBlock, SceneSlot, SharedTris, TRI_SIZE, level_for, placement_scale, supersampled_size,
|
||||
};
|
||||
|
||||
@@ -311,6 +311,8 @@ fn offscreen(
|
||||
eye,
|
||||
ao_radius: 0.0,
|
||||
ssaa,
|
||||
hover_tint: [0.0; 3],
|
||||
selection_tint: [0.0; 3],
|
||||
});
|
||||
let texture = |format, usage| {
|
||||
device.create_texture(&wgpu::TextureDescriptor {
|
||||
|
||||
@@ -452,6 +452,8 @@ pub struct SolveApp {
|
||||
pub stand_up: Option<Vec<String>>,
|
||||
/// The placement of the component that file came in as: the offer turns it.
|
||||
pub stand_up_occurrence: Option<u64>,
|
||||
/// The file's header names an exporter that saves Y up (SolidWorks): the offer says so.
|
||||
pub stand_up_reason: bool,
|
||||
/// The anti-aliasing sample counts the graphics device supports (empty without a GPU).
|
||||
pub msaa_supported: Vec<u32>,
|
||||
/// Settings put back at start because they kept SolidCraft from starting, one line each,
|
||||
@@ -585,6 +587,7 @@ impl SolveApp {
|
||||
recoverable: Vec::new(),
|
||||
stand_up: None,
|
||||
stand_up_occurrence: None,
|
||||
stand_up_reason: false,
|
||||
msaa_supported: Vec::new(),
|
||||
settings_reset: Vec::new(),
|
||||
big_operation: false,
|
||||
|
||||
@@ -529,9 +529,6 @@ preference_settings! {
|
||||
look_at_speed: f32 = 1.0, PAGE_NAVIGATION, accept(0.25..=4.0) => enabled_slider(look_at_anim, "Animation speed", 0.5..=3.0, 0.25, |v| format!("{v:.2}×"));
|
||||
/// Default modelling orientation: `z` (Z up) or `y` (Y up) (#3).
|
||||
up_axis: String = "z".into(), PAGE_DESIGN;
|
||||
/// A STEP or IGES file whose header names a Y-up exporter (SolidWorks) is stood up as it
|
||||
/// opens, with an Undo in the toast (`stand_up`).
|
||||
auto_stand_up: bool = true, PAGE_DESIGN => check("Stand up Y-up files automatically", "A STEP or IGES file from a program that saves Y up opens standing, with Undo in the message");
|
||||
/// After a STEP or IGES file opens, offer to stand a Y-up part up (`stand_up`).
|
||||
offer_stand_up: bool = true, PAGE_DESIGN => check("Offer to stand up Y-up files", "After a STEP or IGES file opens with Z up, offer a quarter turn about X");
|
||||
/// What a middle-button double-click in the view does: `home`, `fit` or `off`.
|
||||
|
||||
@@ -49,7 +49,6 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
crate::i18n::tr_label("Which axis points up in the views (axis view, Home, Look At). Designs are unchanged."),
|
||||
ui_kit::Text::Hint("orientation"),
|
||||
);
|
||||
setting::auto_stand_up(app, ui);
|
||||
setting::offer_stand_up(app, ui);
|
||||
ui_kit::text(ui, app.tr("prefs.stand_up_note"), ui_kit::Text::Hint("stand_up"));
|
||||
});
|
||||
|
||||
@@ -783,6 +783,8 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
ao_radius: 0.0,
|
||||
eye: [eye.x as f32, eye.y as f32, eye.z as f32, if camera.fov > 0.0 { 1.0 } else { 0.0 }],
|
||||
ssaa: if width < full.0 { width as f32 / full.0 as f32 } else { 1.0 },
|
||||
hover_tint: [0.0; 3],
|
||||
selection_tint: [0.0; 3],
|
||||
});
|
||||
ui.painter().add(egui_wgpu::Callback::new_paint_callback(rect, callback));
|
||||
Ok(())
|
||||
|
||||
@@ -105,3 +105,30 @@ fn frame_cost_of_a_design_file() {
|
||||
h.frame();
|
||||
}
|
||||
}
|
||||
|
||||
/// A whole assembly's hover highlight: the model's own triangles (its display plans on the GPU)
|
||||
/// against the copy of every triangle it used to build here. Run with `--ignored --nocapture`.
|
||||
#[test]
|
||||
#[ignore = "manual scaling measurement"]
|
||||
fn whole_body_highlight_cost_from_the_models_own_triangles() {
|
||||
let mut h = Harness::new();
|
||||
let mut names = Vec::new();
|
||||
// Each torus holds some 8k triangles at Normal quality: twenty make a large assembly.
|
||||
for k in 0..20 {
|
||||
let name = format!("Torus{k}");
|
||||
h.app.run("solid.torus", json!({"major": 100, "minor": 10, "center": [k as f64 * 220.0, 0.0, 0.0], "body_name": name.clone()})).unwrap();
|
||||
names.push(name);
|
||||
}
|
||||
let st = h.app.session.world_state();
|
||||
let triangles: usize = st.bodies.iter().map(|b| b.mesh().triangles.len()).sum();
|
||||
st.warm_meshes(|| true);
|
||||
for b in &st.bodies {
|
||||
let _ = b.display_plan();
|
||||
}
|
||||
let bodies = names.len();
|
||||
h.app.viewport.hover_bodies = names;
|
||||
let copied = ms(|| drop(crate::viewport::build_highlight(&h.app)));
|
||||
h.app.viewport.gpu = Some(crate::gpu::GpuTarget { format: egui_wgpu::wgpu::TextureFormat::Rgba8Unorm, depth: None, samples: 1, tess: true });
|
||||
let planned = ms(|| drop(crate::viewport::build_highlight(&h.app)));
|
||||
println!("HIGHLIGHT bodies={bodies} triangles={triangles} cpu_copy_ms={copied:.2} model_triangles_ms={planned:.2}");
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
//! Standing up a Y-up file (#3). Many CAD programs save parts with Y up, so a STEP or IGES file
|
||||
//! from them opens lying on its back in a Z-up design. After such a file opens, SolidCraft
|
||||
//! offers to stand it up: a quarter turn about X (Y → Z) of the component the file came in as
|
||||
//! (#1386), so an assembly's parts and instances turn together, in one step that can be undone. Preferences › Design › "Offer to stand up Y-up
|
||||
//! files" turns the offer off; with Y up as the default orientation it isn't needed. When the
|
||||
//! file's header names an exporter known to save Y up (SolidWorks), Preferences › Design ›
|
||||
//! "Stand up Y-up files automatically" stands it up without asking, with Undo in the message.
|
||||
//! (#1386), so an assembly's parts and instances turn together, in one step that can be undone.
|
||||
//! Preferences › Design › "Offer to stand up Y-up files" turns the offer off; with Y up as the
|
||||
//! default orientation it isn't needed. The file is never turned without asking: a header that
|
||||
//! names an exporter known to save Y up (SolidWorks) only adds a reason line to the offer, since
|
||||
//! such a file may have been saved Z up. The context menu's "Turn Up Axis" fixes it any time.
|
||||
|
||||
use serde_json::json;
|
||||
|
||||
@@ -29,29 +30,18 @@ pub fn offer(app: &mut SolveApp, path: &str, before: &[String], result: Option<&
|
||||
return;
|
||||
}
|
||||
let occurrence = result.and_then(|r| r.get("occurrence")).and_then(serde_json::Value::as_u64);
|
||||
// A header that names a Y-up exporter: stand it up now, one undoable step, with Undo in the toast.
|
||||
if text("exporter_up") == Some("y") && app.preferences.auto_stand_up {
|
||||
let exporter = text("exporter").unwrap_or("a Y-up program").to_string();
|
||||
app.stand_up = Some(bodies);
|
||||
app.stand_up_occurrence = occurrence;
|
||||
match stand_up(app) {
|
||||
Ok(()) => {
|
||||
app.set_status(format!("Stood up (exported Y-up by {exporter}) \u{2014} Undo"), false);
|
||||
app.status_undo = true;
|
||||
}
|
||||
Err(e) => app.set_status(e, true),
|
||||
}
|
||||
return;
|
||||
}
|
||||
if !app.preferences.offer_stand_up {
|
||||
return;
|
||||
}
|
||||
// A header naming a Y-up exporter adds the reason; the file is never turned without asking.
|
||||
app.stand_up_reason = text("exporter_up") == Some("y");
|
||||
app.stand_up = Some(bodies);
|
||||
app.stand_up_occurrence = occurrence;
|
||||
}
|
||||
|
||||
/// Turn the offered bodies a quarter turn about X (Y up becomes Z up).
|
||||
pub fn stand_up(app: &mut SolveApp) -> Result<(), String> {
|
||||
app.stand_up_reason = false;
|
||||
let Some(bodies) = app.stand_up.take() else { return Err("no file is waiting to be stood up".into()) };
|
||||
match app.stand_up_occurrence.take() {
|
||||
// The import's component turns about its parent's origin, contents and all.
|
||||
@@ -66,6 +56,7 @@ pub fn stand_up(app: &mut SolveApp) -> Result<(), String> {
|
||||
/// Dismiss the offer and keep the file as it opened ("Leave it"); the preference stays on.
|
||||
pub fn leave(app: &mut SolveApp) {
|
||||
app.stand_up = None;
|
||||
app.stand_up_reason = false;
|
||||
app.stand_up_occurrence = None;
|
||||
}
|
||||
|
||||
@@ -83,6 +74,9 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
crate::i18n::tr_label("Files from many CAD programs have Y up, so they open lying on their back here (Z up)."),
|
||||
ui_kit::Text::Report("why", false),
|
||||
);
|
||||
if app.stand_up_reason {
|
||||
ui_kit::text(ui, crate::i18n::tr_label("Exported by SolidWorks, which usually saves Y up"), ui_kit::Text::Report("reason", false));
|
||||
}
|
||||
ui_kit::text(
|
||||
ui,
|
||||
crate::i18n::tr_label("Stand it up: a quarter turn about X, as one Move feature you can undo."),
|
||||
|
||||
+349
-53
@@ -100,6 +100,9 @@ pub struct ViewportState {
|
||||
hl_key: u64,
|
||||
/// Browser/timeline body feedback, independent of the camera and reference widget scale.
|
||||
hover_block: std::sync::Mutex<Option<HoverBlock>>,
|
||||
/// Each shown body the model builds on the CPU: the block of the model scene that holds its
|
||||
/// triangles, and the body's vertex range in it (for whole-body highlights).
|
||||
body_tris: std::sync::Mutex<std::collections::HashMap<String, (u64, std::ops::Range<u32>)>>,
|
||||
pub nav: Option<NavMode>,
|
||||
/// The preset's navigation for the left-button drag under way (Alias: Shift+Alt), taken
|
||||
/// when the button went down, so the drag neither selects nor moves sketch geometry.
|
||||
@@ -559,6 +562,9 @@ fn update_refinement(app: &mut SolveApp, ctx: &egui::Context, proj: &Proj) {
|
||||
pub(crate) struct CachedBlock {
|
||||
bytes: std::sync::Arc<crate::gpu::BlockBytes>,
|
||||
meshes: Vec<std::sync::Arc<solidcraft_engine::geom::Mesh>>,
|
||||
/// Each body's triangles in `bytes.tris`, by body name: whole-body highlights draw those
|
||||
/// vertices again instead of building a copy of them on the CPU.
|
||||
ranges: Vec<(String, std::ops::Range<u32>)>,
|
||||
}
|
||||
|
||||
/// [`ViewportState::mesh_bounds`]: each box by the shared mesh it was measured on (held, so its
|
||||
@@ -607,6 +613,8 @@ fn taken_shared_tris(mesh: &std::sync::Arc<solidcraft_engine::geom::Mesh>) -> Op
|
||||
|
||||
/// One body as the model scene draws it.
|
||||
struct BodyDraw {
|
||||
/// The body's name in the world state, for the highlight's lookup of its triangles.
|
||||
name: String,
|
||||
/// Its mesh where it stands, or (with `place`) the shared mesh `place` moves there.
|
||||
mesh: std::sync::Arc<solidcraft_engine::geom::Mesh>,
|
||||
/// The move from `mesh` to where the body stands, for a body drawn as an instance.
|
||||
@@ -693,16 +701,29 @@ fn push_block(
|
||||
build: impl Fn(&BodyDraw, &mut crate::gpu::BlockBytes),
|
||||
) {
|
||||
let same = |c: &CachedBlock| c.meshes.len() == draws.len() && c.meshes.iter().zip(&draws).all(|(m, d)| std::sync::Arc::ptr_eq(m, &d.mesh));
|
||||
let block = match kept.remove(&key).or_else(|| made.remove(&key)).filter(same) {
|
||||
let mut block = match kept.remove(&key).or_else(|| made.remove(&key)).filter(same) {
|
||||
Some(c) => c,
|
||||
None => {
|
||||
let mut bytes = crate::gpu::BlockBytes::default();
|
||||
let mut ranges = Vec::with_capacity(draws.len());
|
||||
for d in &draws {
|
||||
let start = u32::try_from(bytes.tris.len() / crate::gpu::TRI_SIZE).unwrap_or(u32::MAX);
|
||||
build(d, &mut bytes);
|
||||
let end = u32::try_from(bytes.tris.len() / crate::gpu::TRI_SIZE).unwrap_or(u32::MAX);
|
||||
ranges.push((d.name.clone(), start..end));
|
||||
}
|
||||
CachedBlock { bytes: std::sync::Arc::new(bytes), meshes: draws.iter().map(|d| d.mesh.clone()).collect() }
|
||||
CachedBlock { bytes: std::sync::Arc::new(bytes), meshes: draws.iter().map(|d| d.mesh.clone()).collect(), ranges }
|
||||
}
|
||||
};
|
||||
// The body names are not part of a block's key (its bytes are the same whatever a body is
|
||||
// called): keep the ranges' names those of the bodies drawn from them this time.
|
||||
if block.ranges.len() == draws.len() {
|
||||
for (range, d) in block.ranges.iter_mut().zip(&draws) {
|
||||
if range.0 != d.name {
|
||||
range.0.clone_from(&d.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
// See-through triangles are sorted with the rest of the glass, every view.
|
||||
sc.glass.extend_from_slice(&block.bytes.glass);
|
||||
sc.blocks.push(crate::gpu::SceneBlock { key, bytes: block.bytes.clone() });
|
||||
@@ -864,9 +885,10 @@ pub(crate) fn build_scene(app: &SolveApp) -> GpuScene {
|
||||
crate::gpu::InstanceLook::Opaque => 255,
|
||||
};
|
||||
let instanced = (!on_gpu && face_looks.is_empty()).then(|| instances.place(b, [col[0], col[1], col[2], alpha], look)).flatten();
|
||||
let name = b.name.clone();
|
||||
let body = match instanced {
|
||||
Some((mesh, place)) => BodyDraw { mesh, place: Some(place), col, faded, opacity, face_looks, on_gpu: true },
|
||||
None => BodyDraw { mesh: drawn_mesh(app, b), place: None, col, faded, opacity, face_looks, on_gpu },
|
||||
Some((mesh, place)) => BodyDraw { name, mesh, place: Some(place), col, faded, opacity, face_looks, on_gpu: true },
|
||||
None => BodyDraw { name, mesh: drawn_mesh(app, b), place: None, col, faded, opacity, face_looks, on_gpu },
|
||||
};
|
||||
let key = body.key(shaded, edges, hidden_edges, edge_col, hidden_col);
|
||||
key.hash(&mut run_key);
|
||||
@@ -882,6 +904,19 @@ pub(crate) fn build_scene(app: &SolveApp) -> GpuScene {
|
||||
if !run.is_empty() {
|
||||
push_block(&mut sc, &mut kept, &mut made, run_key.finish(), run, |d, out| d.build(out, shaded, edges, hidden_edges, edge_col, hidden_col));
|
||||
}
|
||||
// Where each CPU-built body's triangles are in the model's blocks, for whole-body
|
||||
// highlights (see `highlight_block_tris`).
|
||||
let mut body_tris = std::collections::HashMap::new();
|
||||
for (key, c) in &made {
|
||||
for (name, tris) in &c.ranges {
|
||||
if !tris.is_empty() {
|
||||
body_tris.insert(name.clone(), (*key, tris.clone()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Ok(mut m) = app.viewport.body_tris.lock() {
|
||||
*m = body_tris;
|
||||
}
|
||||
if let Ok(mut b) = app.viewport.blocks.lock() {
|
||||
*b = made;
|
||||
}
|
||||
@@ -2146,8 +2181,15 @@ fn highlight_geometry_key(app: &SolveApp) -> u64 {
|
||||
hover_drawn(&app.viewport.hover).hash(&mut h);
|
||||
app.viewport.hover_feature.hash(&mut h);
|
||||
app.viewport.hover_bodies.hash(&mut h);
|
||||
// Which mesh lights a face follows how the model draws its body (see `shown_mesh`).
|
||||
// Which mesh lights a face follows how the model draws its body (see `shown_mesh`), and at
|
||||
// which display quality its plan and edges are made.
|
||||
solidcraft_engine::doc::display_quality::current().hash(&mut h);
|
||||
lod_generation(app).hash(&mut h);
|
||||
// Whole-body highlights redraw the model scene's own blocks: they must be the scene's
|
||||
// current ones (their keys and the bodies' ranges in them).
|
||||
scene_key(app).hash(&mut h);
|
||||
// And the mode the model draws bodies in: from their plans on the GPU, or built here.
|
||||
app.viewport.gpu.is_some_and(|g| g.tess).hash(&mut h);
|
||||
app.session.active_component.hash(&mut h);
|
||||
app.session.active_occurrence_path.hash(&mut h);
|
||||
app.ui.visual_style.hash(&mut h);
|
||||
@@ -2182,15 +2224,125 @@ fn highlight_key(app: &SolveApp) -> u64 {
|
||||
h.finish()
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct HoverBlock {
|
||||
key: u64,
|
||||
state: std::sync::Arc<solidcraft_engine::doc::ModelState>,
|
||||
doc: std::sync::Arc<solidcraft_engine::doc::Document>,
|
||||
block: crate::gpu::SceneBlock,
|
||||
/// Whole bodies the model draws from their plans: reused like the block when the camera
|
||||
/// moves (they are the model's own evaluated triangles, not a copy of them).
|
||||
hover_planned: Vec<std::sync::Arc<solidcraft_engine::geom::tess::TessPlan>>,
|
||||
selected_planned: Vec<std::sync::Arc<solidcraft_engine::geom::tess::TessPlan>>,
|
||||
/// CPU-built bodies: their triangles in the model scene's blocks, reused the same way.
|
||||
hover_blocks: Vec<crate::gpu::BlockTris>,
|
||||
selected_blocks: Vec<crate::gpu::BlockTris>,
|
||||
/// Bodies the model draws as placements of shared triangles: the same placements with the
|
||||
/// highlight colour.
|
||||
hover_instanced: Vec<crate::gpu::InstancedMesh>,
|
||||
selected_instanced: Vec<crate::gpu::InstancedMesh>,
|
||||
}
|
||||
|
||||
/// The plan the model draws a whole highlighted body from, when it draws one on the GPU. The
|
||||
/// highlight then redraws those evaluated triangles in the highlight colour instead of building
|
||||
/// a copy of every triangle on the CPU: lighting a whole assembly's faces that way took seconds
|
||||
/// (every triangle of every body, again), while the model already had them all on the GPU.
|
||||
fn highlight_plan(
|
||||
app: &SolveApp,
|
||||
b: &solidcraft_engine::doc::ModelBody,
|
||||
active_bodies: &Option<Vec<String>>,
|
||||
) -> Option<std::sync::Arc<solidcraft_engine::geom::tess::TessPlan>> {
|
||||
drawn_plan(app, b, highlight_opaque(app, b, active_bodies))
|
||||
}
|
||||
|
||||
/// Whether the model draws a whole body opaque on the GPU, rather than building it on the CPU:
|
||||
/// a live preview stands in for none, faded and see-through bodies stay on the CPU, and face
|
||||
/// opacities matter only where faces are shaded.
|
||||
fn highlight_opaque(app: &SolveApp, b: &solidcraft_engine::doc::ModelBody, active_bodies: &Option<Vec<String>>) -> bool {
|
||||
if app.preview.effective_replaced().contains(&b.name) {
|
||||
return false;
|
||||
}
|
||||
let doc = &app.session.doc;
|
||||
let faces_opaque = app.ui.visual_style == 2 || doc.face_colors(b).iter().all(|(_, l)| l.opacity >= 0.999);
|
||||
!body_faded(app, b, active_bodies) && doc.model_body_opacity(b) >= 0.999 && faces_opaque
|
||||
}
|
||||
|
||||
/// Whole highlighted bodies the model draws as placements of shared triangles, collected as one
|
||||
/// [`InstancedMesh`] per mesh (a placement and its colour each): the model scene already holds
|
||||
/// the shared vertices, so a whole assembly under the pointer draws them again, not a copy.
|
||||
#[derive(Default)]
|
||||
struct HighlightInstances {
|
||||
meshes: Vec<crate::gpu::InstancedMesh>,
|
||||
/// The index in `meshes` of each mesh, by its address.
|
||||
by_mesh: std::collections::HashMap<usize, usize>,
|
||||
}
|
||||
|
||||
impl HighlightInstances {
|
||||
/// Add the body at `color`, when the model draws it as an instanced placement of an opaque
|
||||
/// shared mesh; `false` when it does not (the caller builds its feedback on the CPU).
|
||||
fn add(&mut self, app: &SolveApp, b: &solidcraft_engine::doc::ModelBody, active_bodies: &Option<Vec<String>>, color: [u8; 4]) -> bool {
|
||||
// A body with face appearances of its own is built on the CPU, never as an instance.
|
||||
if !highlight_opaque(app, b, active_bodies) || !app.session.doc.face_colors(b).is_empty() {
|
||||
return false;
|
||||
}
|
||||
let Some((mesh, m)) = shared_mesh(app, b) else { return false };
|
||||
let key = std::sync::Arc::as_ptr(&mesh) as usize;
|
||||
let at = match self.by_mesh.get(&key) {
|
||||
Some(i) => *i,
|
||||
None => {
|
||||
// The model scene's shared triangles (made ahead, or with its own instances).
|
||||
let tris = app
|
||||
.viewport
|
||||
.instanced_tris
|
||||
.lock()
|
||||
.ok()
|
||||
.and_then(|c| c.get(&key).filter(|(held, _)| std::sync::Arc::ptr_eq(held, &mesh)).map(|(_, t)| t.clone()))
|
||||
.or_else(|| taken_shared_tris(&mesh));
|
||||
let Some(tris) = tris else { return false };
|
||||
self.meshes.push(crate::gpu::InstancedMesh {
|
||||
key: key as u64,
|
||||
tris,
|
||||
instances: Vec::new(),
|
||||
look: crate::gpu::InstanceLook::Opaque,
|
||||
levels: Vec::new(),
|
||||
});
|
||||
self.by_mesh.insert(key, self.meshes.len() - 1);
|
||||
self.meshes.len() - 1
|
||||
}
|
||||
};
|
||||
let rows = [0, 1, 2].map(|r| [m[0][r] as f32, m[1][r] as f32, m[2][r] as f32, m[3][r] as f32]);
|
||||
match self.meshes.get_mut(at) {
|
||||
Some(inst) => {
|
||||
inst.place(rows, color);
|
||||
true
|
||||
}
|
||||
None => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// The meshes with their placements (none when nothing was added).
|
||||
fn finish(self) -> Vec<crate::gpu::InstancedMesh> {
|
||||
self.meshes
|
||||
}
|
||||
}
|
||||
|
||||
/// The model scene's triangles for a whole highlighted body it builds on the CPU (no display
|
||||
/// plan): the block holding them and the body's vertex range in it. Drawing those again tinted
|
||||
/// costs no CPU work, where copying every triangle did (a whole assembly hovered at once stalled
|
||||
/// the window). See-through and faded bodies have no range here: they are not in the block's
|
||||
/// opaque triangles, and the CPU feedback colours them.
|
||||
fn highlight_block_tris(app: &SolveApp, b: &solidcraft_engine::doc::ModelBody) -> Option<crate::gpu::BlockTris> {
|
||||
if app.preview.effective_replaced().contains(&b.name) {
|
||||
return None;
|
||||
}
|
||||
let map = app.viewport.body_tris.lock().ok()?;
|
||||
let (block, tris) = map.get(&b.name)?;
|
||||
Some(crate::gpu::BlockTris { block: *block, tris: tris.clone() })
|
||||
}
|
||||
|
||||
/// The highlight scene: origin widget, construction planes, selection and hover.
|
||||
pub(crate) fn build_highlight(app: &SolveApp) -> GpuScene {
|
||||
let began = crate::now_ms();
|
||||
let t = Tokens::get();
|
||||
let mut sc = GpuScene::default();
|
||||
let st = crate::open_meshing::shown_world(app);
|
||||
@@ -2271,17 +2423,22 @@ pub(crate) fn build_highlight(app: &SolveApp) -> GpuScene {
|
||||
|| matches!(hover, Some(Hit::Profile { .. }));
|
||||
let key = highlight_geometry_key(app);
|
||||
if !projected
|
||||
&& let Some(block) = app.viewport.hover_block.lock().ok().and_then(|cache| {
|
||||
cache
|
||||
.as_ref()
|
||||
.filter(|c| c.key == key && std::sync::Arc::ptr_eq(&c.state, &st) && std::sync::Arc::ptr_eq(&c.doc, &s.doc))
|
||||
.map(|c| c.block.clone())
|
||||
&& let Some(cached) = app.viewport.hover_block.lock().ok().and_then(|cache| {
|
||||
cache.as_ref().filter(|c| c.key == key && std::sync::Arc::ptr_eq(&c.state, &st) && std::sync::Arc::ptr_eq(&c.doc, &s.doc)).cloned()
|
||||
})
|
||||
{
|
||||
sc.blocks.push(block);
|
||||
sc.blocks.push(cached.block);
|
||||
sc.hover_planned = cached.hover_planned;
|
||||
sc.selected_planned = cached.selected_planned;
|
||||
sc.hover_blocks = cached.hover_blocks;
|
||||
sc.selected_blocks = cached.selected_blocks;
|
||||
sc.hover_instanced = cached.hover_instanced;
|
||||
sc.selected_instanced = cached.selected_instanced;
|
||||
return sc;
|
||||
}
|
||||
let mut feedback = GpuScene::default();
|
||||
let mut hover_instances = HighlightInstances::default();
|
||||
let mut selected_instances = HighlightInstances::default();
|
||||
// Selected things.
|
||||
for x in &sel {
|
||||
match x {
|
||||
@@ -2296,9 +2453,15 @@ pub(crate) fn build_highlight(app: &SolveApp) -> GpuScene {
|
||||
if let Some(b) = st.body(name)
|
||||
&& app.session.body_visible(name)
|
||||
{
|
||||
let m = shown(b);
|
||||
let count = b.body.face_count();
|
||||
mesh_tris(&mut feedback, &m, c4(t.body_selected), true, |f| (f as usize) < count);
|
||||
if let Some(plan) = highlight_plan(app, b, &active_bodies) {
|
||||
feedback.selected_planned.push(plan);
|
||||
} else if let Some(tris) = highlight_block_tris(app, b) {
|
||||
feedback.selected_blocks.push(tris);
|
||||
} else if !selected_instances.add(app, b, &active_bodies, c4(t.body_selected)) {
|
||||
let m = shown(b);
|
||||
let count = b.body.face_count();
|
||||
mesh_tris(&mut feedback, &m, c4(t.body_selected), true, |f| (f as usize) < count);
|
||||
}
|
||||
}
|
||||
}
|
||||
Sel::Edge { body, index, point } => {
|
||||
@@ -2350,44 +2513,55 @@ pub(crate) fn build_highlight(app: &SolveApp) -> GpuScene {
|
||||
// Timeline modifiers light only their resulting faces; browser rows light whole bodies.
|
||||
let mut hovered = app.viewport.hover_feature.map(|id| feature_geometry(app, id)).unwrap_or_default();
|
||||
hovered.extend(app.viewport.hover_bodies.iter().map(|name| Sel::Body { name: name.clone() }));
|
||||
// By name, once: a whole assembly holds thousands of bodies, and scanning the list for
|
||||
// each of them is quadratic (as is a body lookup by name in the world).
|
||||
let hovered_whole: std::collections::HashSet<&str> =
|
||||
hovered.iter().filter_map(|x| if let Sel::Body { name } = x { Some(name.as_str()) } else { None }).collect();
|
||||
let selected_whole: std::collections::HashSet<&str> =
|
||||
sel.iter().filter_map(|x| if let Sel::Body { name } = x { Some(name.as_str()) } else { None }).collect();
|
||||
let mut hovered_faces: std::collections::HashMap<&str, Vec<usize>> = std::collections::HashMap::new();
|
||||
let mut selected_faces: std::collections::HashMap<&str, std::collections::HashSet<usize>> = std::collections::HashMap::new();
|
||||
for x in &hovered {
|
||||
if let Sel::Face { body, index, .. } = x {
|
||||
hovered_faces.entry(body.as_str()).or_default().push(*index);
|
||||
}
|
||||
}
|
||||
for x in &sel {
|
||||
if let Sel::Face { body, index, .. } = x {
|
||||
selected_faces.entry(body.as_str()).or_default().insert(*index);
|
||||
}
|
||||
}
|
||||
for b in st.bodies.iter().filter(|b| app.session.body_visible(&b.name) && !app.preview.effective_replaced().contains(&b.name)) {
|
||||
let whole = hovered.iter().any(|x| matches!(x, Sel::Body { name } if name == &b.name));
|
||||
let faces: Vec<_> = if whole {
|
||||
(0..b.body.face_count()).collect()
|
||||
} else {
|
||||
hovered
|
||||
.iter()
|
||||
.filter_map(|x| match x {
|
||||
Sel::Face { body, index, .. } if body == &b.name => Some(*index),
|
||||
_ => None,
|
||||
})
|
||||
.collect()
|
||||
};
|
||||
let whole = hovered_whole.contains(b.name.as_str());
|
||||
let faces: Vec<usize> =
|
||||
if whole { (0..b.body.face_count()).collect() } else { hovered_faces.get(b.name.as_str()).cloned().unwrap_or_default() };
|
||||
if faces.is_empty() {
|
||||
continue;
|
||||
}
|
||||
let k = t.hover_face_lift;
|
||||
let c = body_rgb(app, &b.name);
|
||||
let m = drawn_mesh(app, b);
|
||||
let lit = shown(b);
|
||||
let selected_body = sel.iter().any(|x| matches!(x, Sel::Body { name } if name == &b.name));
|
||||
let base = body_color(&s.doc, b).unwrap_or(t.body);
|
||||
let k = t.hover_face_lift;
|
||||
let hover_col = [base.r().saturating_add(k), base.g().saturating_add(k), base.b().saturating_add(k), 255];
|
||||
let selected_body = selected_whole.contains(b.name.as_str());
|
||||
if !selected_body {
|
||||
let selected_faces: std::collections::HashSet<usize> = sel
|
||||
.iter()
|
||||
.filter_map(|x| {
|
||||
if let Sel::Face { body, index, .. } = x
|
||||
&& body == &b.name
|
||||
{
|
||||
Some(*index)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
let hovered_faces: std::collections::HashSet<usize> = faces.iter().copied().collect();
|
||||
mesh_tris(&mut feedback, &lit, [c.0.saturating_add(k), c.1.saturating_add(k), c.2.saturating_add(k), 255], true, |f| {
|
||||
hovered_faces.contains(&(f as usize)) && !selected_faces.contains(&(f as usize))
|
||||
});
|
||||
// A whole body the model draws from a plan is lit by redrawing the plan's own
|
||||
// evaluated triangles, not by building every triangle again (see `highlight_plan`).
|
||||
if whole && let Some(plan) = highlight_plan(app, b, &active_bodies) {
|
||||
feedback.hover_planned.push(plan);
|
||||
} else if whole && let Some(tris) = highlight_block_tris(app, b) {
|
||||
feedback.hover_blocks.push(tris);
|
||||
} else if whole && hover_instances.add(app, b, &active_bodies, hover_col) {
|
||||
// Its placements carry the highlight colour.
|
||||
} else {
|
||||
let lit = shown(b);
|
||||
let selected_faces = selected_faces.get(b.name.as_str());
|
||||
let hovered_faces: std::collections::HashSet<usize> = faces.iter().copied().collect();
|
||||
let keeps = |f: u32| {
|
||||
let f = f as usize;
|
||||
hovered_faces.contains(&f) && selected_faces.is_none_or(|s| !s.contains(&f))
|
||||
};
|
||||
mesh_tris(&mut feedback, &lit, hover_col, true, keeps);
|
||||
}
|
||||
}
|
||||
for (ei, e) in m.edges.iter().enumerate() {
|
||||
if m.edge_pickable(ei) && (whole || m.edge_faces.get(ei).is_some_and(|fs| fs.iter().any(|f| faces.contains(&(*f as usize))))) {
|
||||
@@ -2401,12 +2575,17 @@ pub(crate) fn build_highlight(app: &SolveApp) -> GpuScene {
|
||||
Some(Hit::Face { body, .. }) if app.ui.pick_bodies && app.dialog.is_none() && app.tool.is_none() => {
|
||||
if let Some(b) = st.body(body) {
|
||||
let k = t.hover_face_lift;
|
||||
let c = body_rgb(app, body);
|
||||
let m = shown(b);
|
||||
let count = b.body.face_count();
|
||||
mesh_tris(&mut feedback, &m, [c.0.saturating_add(k), c.1.saturating_add(k), c.2.saturating_add(k), 255], true, |f| {
|
||||
(f as usize) < count
|
||||
});
|
||||
let c = body_color(&s.doc, b).unwrap_or(t.body);
|
||||
let hover_col = [c.r().saturating_add(k), c.g().saturating_add(k), c.b().saturating_add(k), 255];
|
||||
if let Some(plan) = highlight_plan(app, b, &active_bodies) {
|
||||
feedback.hover_planned.push(plan);
|
||||
} else if let Some(tris) = highlight_block_tris(app, b) {
|
||||
feedback.hover_blocks.push(tris);
|
||||
} else if !hover_instances.add(app, b, &active_bodies, hover_col) {
|
||||
let m = shown(b);
|
||||
let count = b.body.face_count();
|
||||
mesh_tris(&mut feedback, &m, hover_col, true, |f| (f as usize) < count);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(Hit::Face { body, index, .. })
|
||||
@@ -2450,12 +2629,20 @@ pub(crate) fn build_highlight(app: &SolveApp) -> GpuScene {
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
feedback.hover_instanced = hover_instances.finish();
|
||||
feedback.selected_instanced = selected_instances.finish();
|
||||
if projected {
|
||||
sc.tris.append(&mut feedback.tris);
|
||||
sc.trans.append(&mut feedback.trans);
|
||||
sc.lines.append(&mut feedback.lines);
|
||||
sc.hidden.append(&mut feedback.hidden);
|
||||
sc.overlay.append(&mut feedback.overlay);
|
||||
sc.hover_planned.append(&mut feedback.hover_planned);
|
||||
sc.selected_planned.append(&mut feedback.selected_planned);
|
||||
sc.hover_blocks.append(&mut feedback.hover_blocks);
|
||||
sc.selected_blocks.append(&mut feedback.selected_blocks);
|
||||
sc.hover_instanced.append(&mut feedback.hover_instanced);
|
||||
sc.selected_instanced.append(&mut feedback.selected_instanced);
|
||||
} else {
|
||||
let block = crate::gpu::SceneBlock {
|
||||
key,
|
||||
@@ -2466,12 +2653,49 @@ pub(crate) fn build_highlight(app: &SolveApp) -> GpuScene {
|
||||
..Default::default()
|
||||
}),
|
||||
};
|
||||
let (hover_planned, selected_planned) = (feedback.hover_planned, feedback.selected_planned);
|
||||
let (hover_blocks, selected_blocks) = (feedback.hover_blocks, feedback.selected_blocks);
|
||||
let (hover_instanced, selected_instanced) = (feedback.hover_instanced, feedback.selected_instanced);
|
||||
if let Ok(mut cache) = app.viewport.hover_block.lock() {
|
||||
*cache = Some(HoverBlock { key, state: st.clone(), doc: s.doc.clone(), block: block.clone() });
|
||||
*cache = Some(HoverBlock {
|
||||
key,
|
||||
state: st.clone(),
|
||||
doc: s.doc.clone(),
|
||||
block: block.clone(),
|
||||
hover_planned: hover_planned.clone(),
|
||||
selected_planned: selected_planned.clone(),
|
||||
hover_blocks: hover_blocks.clone(),
|
||||
selected_blocks: selected_blocks.clone(),
|
||||
hover_instanced: hover_instanced.clone(),
|
||||
selected_instanced: selected_instanced.clone(),
|
||||
});
|
||||
}
|
||||
sc.blocks.push(block);
|
||||
sc.hover_planned = hover_planned;
|
||||
sc.selected_planned = selected_planned;
|
||||
sc.hover_blocks = hover_blocks;
|
||||
sc.selected_blocks = selected_blocks;
|
||||
sc.hover_instanced = hover_instanced;
|
||||
sc.selected_instanced = selected_instanced;
|
||||
}
|
||||
|
||||
if solidcraft_engine::geom::env::var_os("PROFILE_FRAMES").is_some() {
|
||||
let in_blocks = |f: fn(&crate::gpu::SceneBlock) -> usize| sc.blocks.iter().map(f).sum::<usize>();
|
||||
let tris = sc.tris.len() + in_blocks(|b| b.bytes.tris.len());
|
||||
let lines = sc.lines.len() + in_blocks(|b| b.bytes.lines.len());
|
||||
let hidden = sc.hidden.len() + in_blocks(|b| b.bytes.hidden.len());
|
||||
eprintln!(
|
||||
"SolidCraft highlight: {:.0} ms, hovered {} bodies, planned {} hover + {} selected, blocks {} hover + {} selected, instanced {} hover + {} selected, CPU triangles {tris} B, lines {lines} B, hidden {hidden} B",
|
||||
crate::now_ms() - began,
|
||||
hovered.len(),
|
||||
sc.hover_planned.len(),
|
||||
sc.selected_planned.len(),
|
||||
sc.hover_blocks.len(),
|
||||
sc.selected_blocks.len(),
|
||||
sc.hover_instanced.len(),
|
||||
sc.selected_instanced.len(),
|
||||
);
|
||||
}
|
||||
sc
|
||||
}
|
||||
|
||||
@@ -2698,6 +2922,7 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
}
|
||||
app.viewport.hl_key = hk;
|
||||
}
|
||||
crate::frame_watch::step(app, "highlight scene");
|
||||
let ppp = ui.ctx().pixels_per_point();
|
||||
let size_px = [rect.width() * ppp, rect.height() * ppp];
|
||||
let ssaa = supersampling(app, ui.ctx(), proj.vp.to_f32(), size_px);
|
||||
@@ -2735,6 +2960,13 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {
|
||||
let e = proj.cam.eye().to_f32();
|
||||
[e[0], e[1], e[2], if proj.cam.fov > 0.0 { 1.0 } else { 0.0 }]
|
||||
},
|
||||
// Whole-body highlights redraw the model's own plan triangles: the hover lifts each
|
||||
// body's colour the same amount `mesh_tris` used to, and a selection replaces it.
|
||||
hover_tint: [f32::from(t.hover_face_lift) / 255.0; 3],
|
||||
selection_tint: {
|
||||
let c = t.body_selected;
|
||||
[f32::from(c.r()) / 255.0, f32::from(c.g()) / 255.0, f32::from(c.b()) / 255.0]
|
||||
},
|
||||
});
|
||||
painter.add(egui_wgpu::Callback::new_paint_callback(rect, cb));
|
||||
}
|
||||
@@ -5075,6 +5307,8 @@ mod tests {
|
||||
eye: [e[0], e[1], e[2], if proj.cam.fov > 0.0 { 1.0 } else { 0.0 }],
|
||||
ao_radius: 0.0,
|
||||
ssaa: 1.0,
|
||||
hover_tint: [0.0; 3],
|
||||
selection_tint: [0.0; 3],
|
||||
};
|
||||
let t0 = std::time::Instant::now();
|
||||
let mut encoder = device.create_command_encoder(&Default::default());
|
||||
@@ -6247,6 +6481,68 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
/// A whole highlighted body is lit from the model's own triangles, not by copying every one
|
||||
/// of them onto the CPU (a whole assembly lit that way took most of a second a frame): from
|
||||
/// its display plan where the model draws one, else from its vertices in the model scene's
|
||||
/// blocks. See-through bodies keep the CPU feedback, which colours them.
|
||||
#[test]
|
||||
fn whole_body_highlights_reuse_the_models_own_triangles() {
|
||||
let mut app = cylinder_app();
|
||||
app.viewport.gpu = Some(GpuTarget { format: egui_wgpu::wgpu::TextureFormat::Rgba8Unorm, depth: None, samples: 1, tess: true });
|
||||
let body = app.session.world_state().bodies[0].clone();
|
||||
let plan = body.display_plan().expect("the test body is drawn from a plan");
|
||||
app.viewport.hover_bodies = vec![body.name.clone()];
|
||||
let hovered = build_highlight(&app);
|
||||
assert_eq!(hovered.hover_planned.len(), 1, "the whole hovered body is lit from its plan");
|
||||
assert!(std::sync::Arc::ptr_eq(&hovered.hover_planned[0], &plan));
|
||||
assert_eq!(hovered.tris.len(), 0);
|
||||
assert!(hovered.blocks.iter().all(|b| b.bytes.tris.is_empty()), "no copy of the body's triangles");
|
||||
app.viewport.hover_bodies.clear();
|
||||
app.session.selection = vec![Sel::Body { name: body.name.clone() }];
|
||||
let selected = build_highlight(&app);
|
||||
assert_eq!(selected.selected_planned.len(), 1, "a selected whole body is lit from its plan too");
|
||||
assert_eq!(selected.tris.len(), 0);
|
||||
assert!(selected.blocks.iter().all(|b| b.bytes.tris.is_empty()));
|
||||
// A body the model builds on the CPU (here: no GPU plans) is lit from its own vertices
|
||||
// in the model scene's blocks.
|
||||
app.session.selection.clear();
|
||||
app.viewport.hover_bodies.clear();
|
||||
app.viewport.gpu = None;
|
||||
build_scene(&app);
|
||||
app.viewport.hover_bodies = vec![body.name.clone()];
|
||||
let built = build_highlight(&app);
|
||||
assert!(built.hover_planned.is_empty());
|
||||
assert_eq!(built.hover_blocks.len(), 1, "a CPU-built body is lit from the model's block");
|
||||
assert_eq!(built.tris.len(), 0);
|
||||
assert!(built.blocks.iter().all(|b| b.bytes.tris.is_empty()), "no copy of the body's triangles");
|
||||
// Two occurrences of one component are drawn as placements of its shared triangles: the
|
||||
// highlight draws those placements again, in its colour.
|
||||
let mut s = solidcraft_engine::Session::default();
|
||||
s.execute("solid.cylinder", &json!({"radius": 10, "height": 20, "body_name": "Sleeve"})).unwrap();
|
||||
let made = s.execute("component.from_bodies", &json!({"bodies": ["Sleeve"]})).unwrap();
|
||||
let part = made["components"][0]["component"].as_u64().unwrap();
|
||||
s.execute("occurrence.copy", &json!({"component": part, "translate": [40, 0, 0]})).unwrap();
|
||||
let mut assembly = SolveApp::new(s, crate::Services::default());
|
||||
assembly.ui.show_origin = false;
|
||||
let names: Vec<String> = assembly.session.world_state().bodies.iter().map(|b| b.name.clone()).collect();
|
||||
assert_eq!(names.len(), 2, "two placements of the part");
|
||||
build_scene(&assembly);
|
||||
assembly.viewport.hover_bodies = names;
|
||||
let instanced = build_highlight(&assembly);
|
||||
assert_eq!(instanced.hover_instanced.len(), 1, "the part's one shared mesh");
|
||||
assert_eq!(instanced.hover_instanced[0].count(), 2, "both of its placements");
|
||||
assert_eq!(instanced.tris.len(), 0);
|
||||
assert!(instanced.blocks.iter().all(|b| b.bytes.tris.is_empty()), "no copy of the placements");
|
||||
// A see-through body is not in the block's opaque triangles: its feedback is built here.
|
||||
app.viewport.hover_bodies.clear();
|
||||
app.run("appearance.assign", json!({"bodies": [body.name.clone()], "color": [200, 200, 200], "opacity": 0.5})).unwrap();
|
||||
build_scene(&app);
|
||||
app.viewport.hover_bodies = vec![body.name.clone()];
|
||||
let see_through = build_highlight(&app);
|
||||
assert!(see_through.hover_planned.is_empty(), "a see-through body is not drawn from a plan");
|
||||
assert!(!see_through.merged().tris.is_empty(), "its highlight is still lit");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn smooth_wall_display_preserves_wireframe_and_edge_selection() {
|
||||
let mut s = solidcraft_engine::Session::default();
|
||||
|
||||
@@ -81,18 +81,25 @@ fn prefs_stand_up_false_leaves_the_offer() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_solidworks_header_stands_the_file_up_with_undo() {
|
||||
fn a_solidworks_header_shows_the_offer_and_does_not_turn_the_file() {
|
||||
let h = opened_from("'SolidWorks 2021','SolidWorks 2021'", |_| {});
|
||||
assert_eq!(h.app.stand_up.as_ref().map(Vec::len), Some(1), "offered");
|
||||
assert!(h.app.stand_up_reason, "with the reason line");
|
||||
assert!(!h.app.status_undo, "nothing was turned");
|
||||
assert!((height(&h) - 5.0).abs() < 1e-6, "not turned: {}", height(&h));
|
||||
// An unknown exporter gets the offer without the reason.
|
||||
assert!(!opened().app.stand_up_reason);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn stand_it_up_from_a_solidworks_offer_turns_once_and_undo_restores() {
|
||||
let mut h = opened_from("'SolidWorks 2021','SolidWorks 2021'", |_| {});
|
||||
assert!(h.app.stand_up.is_none(), "no offer: it stood up on its own");
|
||||
assert!((height(&h) - 40.0).abs() < 1e-6, "stood up: {}", height(&h));
|
||||
let status = h.app.status.clone().map(|s| s.0);
|
||||
assert_eq!(status.as_deref(), Some("Stood up (exported Y-up by SolidWorks) \u{2014} Undo"));
|
||||
assert!(h.app.status_undo);
|
||||
// Clicking the message is the Undo: one step puts the file back as it was written.
|
||||
h.run(&json!([{"click": {"handle": "status:chip"}}])).unwrap();
|
||||
h.run(&json!([{"click": {"handle": "stand_up:stand"}}])).unwrap();
|
||||
h.frames(3);
|
||||
assert!((height(&h) - 40.0).abs() < 1e-6, "stood up: {}", height(&h));
|
||||
assert!(!h.app.stand_up_reason);
|
||||
h.app.run("edit.undo", json!({})).unwrap();
|
||||
assert!((height(&h) - 5.0).abs() < 1e-6, "undone: {}", height(&h));
|
||||
assert!(h.app.stand_up.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -104,26 +111,97 @@ fn a_solidcraft_header_is_left_alone() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn automatic_stand_up_off_offers_a_solidworks_file_instead() {
|
||||
let h = opened_from("'SolidWorks 2021','SolidWorks 2021'", |h| h.app.preferences.auto_stand_up = false);
|
||||
assert_eq!(h.app.stand_up.as_ref().map(Vec::len), Some(1), "offered, not turned");
|
||||
assert!((height(&h) - 5.0).abs() < 1e-6);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_offer_preference_off_does_not_stop_a_known_y_up_file() {
|
||||
// An unknown exporter is not offered, but a SolidWorks file still stands up.
|
||||
fn the_offer_preference_off_stops_every_offer() {
|
||||
let off = |h: &mut Harness| h.app.preferences.offer_stand_up = false;
|
||||
assert!(opened_from("'Example CAD','Example CAD'", off).app.stand_up.is_none());
|
||||
let h = opened_from("'SolidWorks 2021','SolidWorks 2021'", off);
|
||||
assert!((height(&h) - 40.0).abs() < 1e-6, "stood up: {}", height(&h));
|
||||
assert!(h.app.stand_up.is_none());
|
||||
assert!((height(&h) - 5.0).abs() < 1e-6, "not turned: {}", height(&h));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn old_preferences_files_load_with_automatic_stand_up_on() {
|
||||
let old: solidcraft_ui_egui::prefs::Prefs = serde_json::from_str(r#"{"offer_stand_up": false, "up_axis": "z"}"#).unwrap();
|
||||
fn turn_up_axis_in_the_component_menu_turns_and_undo_restores() {
|
||||
// Leave the offer, then fix the orientation from the right-click menu.
|
||||
let mut h = opened();
|
||||
h.run(&json!([{"click": {"handle": "stand_up:leave"}}])).unwrap();
|
||||
h.frames(3);
|
||||
let occurrence = h.app.session.doc.occurrences.iter().map(|o| o.id).max().expect("the import's occurrence");
|
||||
let items = solidcraft_ui_egui::context_menu::items(&h.app, &solidcraft_ui_egui::context_menu::Target::Occurrence { path: vec![occurrence] });
|
||||
let turn = items.iter().find(|i| i.id == "ui.turnUpAxis").expect("Turn Up Axis is in the menu");
|
||||
let labels: Vec<_> = turn.children.iter().map(|c| c.label.as_str()).collect();
|
||||
assert_eq!(labels, ["Y up \u{2192} Z up", "Z up \u{2192} Y up"]);
|
||||
let at = egui::pos2(10.0, 10.0);
|
||||
solidcraft_ui_egui::context_menu::run_item(&mut h.app, &turn.children[0], at);
|
||||
assert!((height(&h) - 40.0).abs() < 1e-6, "Y up to Z up: {}", height(&h));
|
||||
h.app.run("edit.undo", json!({})).unwrap();
|
||||
assert!((height(&h) - 5.0).abs() < 1e-6, "undone: {}", height(&h));
|
||||
solidcraft_ui_egui::context_menu::run_item(&mut h.app, &turn.children[1], at);
|
||||
assert!((height(&h) - 40.0).abs() < 1e-6, "Z up to Y up: {}", height(&h));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn old_preferences_files_still_load() {
|
||||
// A file saved while "Stand up automatically" existed: the retired key is ignored.
|
||||
let old: solidcraft_ui_egui::prefs::Prefs = serde_json::from_str(r#"{"offer_stand_up": false, "auto_stand_up": true, "up_axis": "z"}"#).unwrap();
|
||||
assert!(!old.offer_stand_up, "the saved choice is kept");
|
||||
assert!(old.auto_stand_up, "the new setting starts on");
|
||||
let empty: solidcraft_ui_egui::prefs::Prefs = serde_json::from_str("{}").unwrap();
|
||||
assert!(empty.auto_stand_up && empty.offer_stand_up);
|
||||
assert!(empty.offer_stand_up);
|
||||
}
|
||||
|
||||
type V3 = solidcraft_engine::geom::Vec3;
|
||||
|
||||
/// A stood-up SolidWorks file (its component still the active one), a sketch started by
|
||||
/// `start`, a rectangle far from the part at x 200..220, y 0..10 on it, extruded 15 mm: the
|
||||
/// sketch's world normal, the direction the view turned to look from, and the new body's bounds.
|
||||
fn sketched_and_extruded(start: impl FnOnce(&mut Harness)) -> (V3, V3, solidcraft_engine::geom::Aabb3) {
|
||||
let mut h = opened_from("'SolidWorks 2021','SolidWorks 2021'", |h| h.app.preferences.look_at_anim = false);
|
||||
// Stand it up through the offer when one is waiting (a SolidWorks file is offered, not turned silently).
|
||||
if h.app.stand_up.is_some() {
|
||||
solidcraft_ui_egui::stand_up::stand_up(&mut h.app).unwrap();
|
||||
h.frames(2);
|
||||
}
|
||||
assert!((height(&h) - 40.0).abs() < 1e-6, "stood up: {}", height(&h));
|
||||
assert_ne!(h.app.session.active_component, 0, "the import's component is the one worked in");
|
||||
let before: Vec<String> = h.app.session.world_state().bodies.iter().map(|b| b.name.clone()).collect();
|
||||
start(&mut h);
|
||||
h.frames(2);
|
||||
let sketch = h.app.session.active_sketch.expect("a sketch is open");
|
||||
let normal = h.app.session.world_state().sketch(sketch).unwrap().plane.normal();
|
||||
let back = h.app.cam.back();
|
||||
h.app.run("sketch.rectangle.two_point", json!({"p0": [200, 0], "p1": [220, 10]})).unwrap();
|
||||
h.app.run("solid.extrude", json!({"distance": 15})).unwrap();
|
||||
let world = h.app.session.world_state();
|
||||
let made: Vec<_> = world.bodies.iter().filter(|b| !before.contains(&b.name)).collect();
|
||||
assert_eq!(made.len(), 1);
|
||||
(normal, back, made[0].mesh().bounds())
|
||||
}
|
||||
|
||||
fn near(a: V3, b: [f64; 3]) -> bool {
|
||||
a.dist(V3::new(b[0], b[1], b[2])) < 1e-6
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_sketch_on_the_xy_plane_shown_after_standing_up_extrudes_up() {
|
||||
// The origin planes the viewport and browser show are the design's: the XY picked there
|
||||
// stays flat, the view looks down on it and the extrude goes up, though the stood-up
|
||||
// component's own XY is now upright.
|
||||
let (normal, back, b) = sketched_and_extruded(|h| {
|
||||
solidcraft_ui_egui::dialogs::start_sketch(&mut h.app, &solidcraft_engine::Sel::Plane { name: "XY".into() }).unwrap();
|
||||
});
|
||||
assert!(near(normal, [0.0, 0.0, 1.0]), "faces up: {normal:?}");
|
||||
assert!((back.z - 1.0).abs() < 1e-3, "looks down on it: {back:?}");
|
||||
assert!(near(b.min, [200.0, 0.0, 0.0]) && near(b.max, [220.0, 10.0, 15.0]), "{b:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_sketch_on_the_stood_up_components_own_xy_is_turned_once() {
|
||||
// By name, a command's XY is the active component's own: upright now, facing -Y. The
|
||||
// sketch, the view and the extrude all follow it, the stand-up applied once.
|
||||
let (normal, back, b) = sketched_and_extruded(|h| {
|
||||
h.app.run("sketch.create", json!({"plane": "XY"})).unwrap();
|
||||
solidcraft_ui_egui::dialogs::look_at_sketch(&mut h.app);
|
||||
});
|
||||
assert!(near(normal, [0.0, -1.0, 0.0]), "faces -Y: {normal:?}");
|
||||
assert!((back.y + 1.0).abs() < 1e-3, "looks at it from -Y: {back:?}");
|
||||
assert!(near(b.min, [200.0, -15.0, 0.0]) && near(b.max, [220.0, 0.0, 10.0]), "{b:?}");
|
||||
}
|
||||
@@ -205,7 +205,7 @@ labels; `prefs:measure_axis_distances` identifies the checkbox.
|
||||
| `ui.home` | `open?`: bool; `sample?`: index | the start page: show or hide it, open a built-in sample (once built); returns `open` and the recent designs |
|
||||
| `ui.shortcut` | `command`, `key?`, `replace?` | a command's key, or rebinds it (`""` clears; a key another command uses is refused unless `replace`) |
|
||||
| `ui.help` | `item?`: `about`, `shortcuts` (read only), `report` (opens a report draft for review), `crashes` (the Crash Reports window) | the version, commit, build date and diagnostic text |
|
||||
| `ui.prefs` | any of `default_units`, `nav` (`fusion`, `solidworks`, `inventor`, `alias`, `blender`, `tinkercad`, `openscad`, `touchpad`), `zoom_reverse`, `pan_reverse_x` (default false: horizontal scrolling pans the other way), `zoom_to_cursor`, `smooth_wheel_zoom` (default true), `trackpad_pan` (default true: two-finger scroll pans, except Touchpad always zooms; pinch zooms), `orbit_around` (`view_centre` (default: what Pan moves and Fit frames), `origin` (the world origin stays still on screen), `cursor` (the model point under the pointer when the drag began); the older `orbit_cursor` boolean still sets `cursor` when true), `look_at_anim`, `look_at_speed`, `middle_double_click` (`home` (default), `fit`, `off`), `msaa`, `show_frame_rate` (default false: frames per second in the view's bottom-right corner, counting the frames the view draws anyway; it reads 0 FPS once the view is idle), `length_decimals`, `angle_decimals`, `theme` (`dark`, `light`, `system` or a theme file's id: a built-in one such as `gruvbox-dark`, or an imported one; the reply's `theme_ids` lists them), `theme_import` (a `solidcraft-theme/1` file's JSON or text: adds the theme and turns it on; the reply's `theme_imported` is its id), `theme_remove` (an imported theme's id), `theme_export: true` (the reply's `theme_file` is the theme on now as a complete file; see [colour themes](book/src/guide/ui-tour.md#colour-themes)), `language` (`en`, `ja`, `de`, `fr`, `ko`, `ms`, `ru`, `uk`, `zh`; see [localization](localization.md)), `ui_scale`, `ui_font` (an installed font family or a font file for the interface; empty for the built-in font), `up_axis` (`z`, `y`), `auto_stand_up` (default true: a STEP or IGES file whose header names a Y-up exporter, SolidWorks, is stood up as it opens), `offer_stand_up`, `color_vision` (`off` (default), `protan`, `deutan`, `tritan`: colour vision modes, #778), `check_updates` (default true; [updates](book/src/guide/updates.md)); `open` (a page: General, Interface, Design, Navigation, Keyboard Shortcuts, Sketch, Graphics, AI, Plugins; Shortcuts, Assistant and Sketch & selection are aliases, and the former Selection page opens Sketch) opens the Preferences dialog there; `button`: `ok`, `cancel`, `apply`, `defaults`; `stand_up: true` stands up a just-opened Y-up file, `stand_up: false` leaves it as it is ("Leave it": the offer closes and `offer_stand_up` stays on); the offer's buttons are the handles `stand_up:stand`, `stand_up:leave` and `stand_up:never` | sets preferences (kept between runs), returns them all plus `dialog` (the open page or null), `dark` and `stand_up_offer` |
|
||||
| `ui.prefs` | any of `default_units`, `nav` (`fusion`, `solidworks`, `inventor`, `alias`, `blender`, `tinkercad`, `openscad`, `touchpad`), `zoom_reverse`, `pan_reverse_x` (default false: horizontal scrolling pans the other way), `zoom_to_cursor`, `smooth_wheel_zoom` (default true), `trackpad_pan` (default true: two-finger scroll pans, except Touchpad always zooms; pinch zooms), `orbit_around` (`view_centre` (default: what Pan moves and Fit frames), `origin` (the world origin stays still on screen), `cursor` (the model point under the pointer when the drag began); the older `orbit_cursor` boolean still sets `cursor` when true), `look_at_anim`, `look_at_speed`, `middle_double_click` (`home` (default), `fit`, `off`), `msaa`, `show_frame_rate` (default false: frames per second in the view's bottom-right corner, counting the frames the view draws anyway; it reads 0 FPS once the view is idle), `length_decimals`, `angle_decimals`, `theme` (`dark`, `light`, `system` or a theme file's id: a built-in one such as `gruvbox-dark`, or an imported one; the reply's `theme_ids` lists them), `theme_import` (a `solidcraft-theme/1` file's JSON or text: adds the theme and turns it on; the reply's `theme_imported` is its id), `theme_remove` (an imported theme's id), `theme_export: true` (the reply's `theme_file` is the theme on now as a complete file; see [colour themes](book/src/guide/ui-tour.md#colour-themes)), `language` (`en`, `ja`, `de`, `fr`, `ko`, `ms`, `ru`, `uk`, `zh`; see [localization](localization.md)), `ui_scale`, `ui_font` (an installed font family or a font file for the interface; empty for the built-in font), `up_axis` (`z`, `y`), `offer_stand_up`, `color_vision` (`off` (default), `protan`, `deutan`, `tritan`: colour vision modes, #778), `check_updates` (default true; [updates](book/src/guide/updates.md)); `open` (a page: General, Interface, Design, Navigation, Keyboard Shortcuts, Sketch, Graphics, AI, Plugins; Shortcuts, Assistant and Sketch & selection are aliases, and the former Selection page opens Sketch) opens the Preferences dialog there; `button`: `ok`, `cancel`, `apply`, `defaults`; `stand_up: true` stands up a just-opened Y-up file, `stand_up: false` leaves it as it is ("Leave it": the offer closes and `offer_stand_up` stays on); the offer's buttons are the handles `stand_up:stand`, `stand_up:leave` and `stand_up:never` | sets preferences (kept between runs), returns them all plus `dialog` (the open page or null), `dark` and `stand_up_offer` |
|
||||
| `ui.capture` | `action?`: `capture`, `revert`, `cancel` | answers the Capture Position question (asked when a command starts or the design is saved while components were moved without capturing); without `action`, what waits |
|
||||
| `ui.window` | `action`: minimize, maximize, restore, toggle, close | what the title bar's caption buttons do (on Windows and Linux the application bar is the title bar); close asks about unsaved designs first |
|
||||
| `ui.agent_cursor` | `show` (bool), `speed`: a number from 1 to 5 (times the normal speed) or `"instant"` (no animation: the command runs at once and the pointer jumps to where it acted), `follow_camera` (bool); all optional | the settings. While the cursor is shown, `engine.execute` first glides to the command's toolbar button and to each pick, then runs and replies; later requests wait their turn. It also follows the pointer input sent with `ui.move`, `ui.click`, `ui.drag` and `ui.scroll`, as each event reaches the app, and a press leaves a ripple. `"animate": false` on a call skips it |
|
||||
|
||||
+1
-1
@@ -352,7 +352,7 @@ SolidCraft's commands by area, generated by `cargo xtask features` from the comm
|
||||
| New Design (Ctrl+N) | `file.new` | – |
|
||||
| Save (Ctrl+S) | `file.save` | – |
|
||||
| Save As | `file.save_as` | – |
|
||||
| Save As Mesh | `file.save_mesh` | MESH › MODIFY |
|
||||
| Save As Mesh | `file.save_mesh` | INSERT › FILES |
|
||||
| Installed Slicers | `file.slicers` | – |
|
||||
|
||||
## Documents
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ the supporting ellipse in the middle.
|
||||
|
||||
Files from different systems differ in which way is up and in what they call their solids. `doc.open`, `file.insert_step` and the MCP `open` tool take two options for STEP and IGES files; without them a file comes in as written.
|
||||
|
||||
- **`up`**: `"z"` (the default) keeps the file's axes. Many systems write Y up, so such a part lies on its back in SolidCraft's Z-up space. `"up": "y"` turns the import's component a quarter turn about X (+90°: Y becomes Z), as the window's "Stand it up" offer does, so an assembly's parts and instances turn together. The import and the turn are one undo step, the reply names the turned occurrence as `stand_up`, and only the file's component turns, not what is already in the design. The window offers to stand a part up after a STEP file opens unless the call said which way is up (`up: "z"` as well as `"y"`) or the file came from SolidCraft, which already writes Z up. A STEP reply's `system` is the originating system the file's header names (`SolidCraft` for SolidCraft's own exports). A header that names SolidWorks (in FILE_NAME's originating system or preprocessor version, or in FILE_DESCRIPTION; for IGES, the start of the global section's native system ID, which becomes the originating system) says the file has Y up: the reply carries `exporter` (`SolidWorks`) and `exporter_up` (`y`), and with Preferences › Design › "Stand up Y-up files automatically" on (the default) the window stands the part up as it opens, as one undo step, with Undo in the message. SolidCraft's own files say `z` and are left alone; any other exporter is unknown, so the offer stays.
|
||||
- **`up`**: `"z"` (the default) keeps the file's axes. Many systems write Y up, so such a part lies on its back in SolidCraft's Z-up space. `"up": "y"` turns the import's component a quarter turn about X (+90°: Y becomes Z), as the window's "Stand it up" offer does, so an assembly's parts and instances turn together. The import and the turn are one undo step, the reply names the turned occurrence as `stand_up`, and only the file's component turns, not what is already in the design. The window offers to stand a part up after a STEP file opens unless the call said which way is up (`up: "z"` as well as `"y"`) or the file came from SolidCraft, which already writes Z up. A STEP reply's `system` is the originating system the file's header names (`SolidCraft` for SolidCraft's own exports). A header that names SolidWorks (in FILE_NAME's originating system or preprocessor version, or in FILE_DESCRIPTION; for IGES, the start of the global section's native system ID, which becomes the originating system) says the file has Y up: the reply carries `exporter` (`SolidWorks`) and `exporter_up` (`y`), and the window's offer then says so ("Exported by SolidWorks, which usually saves Y up"). A file is never turned without asking, because the exporter may have saved it Z up; a component's right-click menu has Turn Up Axis (Y up → Z up, Z up → Y up: a quarter turn about X, one undo step) for fixing it any time. SolidCraft's own files say `z` and are left alone; any other exporter is unknown, so the offer stays.
|
||||
- **`names`**: `"auto"` (the default) keeps meaningful solid names and replaces placeholders such as `Body1` or `Body 2 (3)` with the nearest named product, then the occurrence name if no product is named. `"solid"` keeps the solid's name; `"product"` chooses the part's name; `"instance"` chooses the assembly occurrence (`Post-2`), falling back to the product. If the chosen name is missing, the solid's name remains. Repeated names are numbered (`Post`, `Post (2)`). Names are stored with the Import feature and survive reopening the design. Files without names or assembly metadata retain generated body names and a flat structure.
|
||||
- **Vertices off their curves**: some systems write an edge's vertex a little beside the end of its curve, often further off than the accuracy the file declares (`UNCERTAINTY_MEASURE_WITH_UNIT`). A vertex up to the file's own tolerance off, or up to 1/1000 of the model's size (never more than 1 mm), is read as that end of the edge: the curve's end is moved onto the vertex. A vertex further off leaves its face out, with a warning that says how far off it is.
|
||||
|
||||
|
||||
Reference in new issue
Block a user