Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
453843d
craft-mesh-ops: mesh operations, a BVH and primitives for the 3D apps
dotCooCoo Nov 13, 2026
c9dcc39
craft-mesh-ops: G-buffer and unwrap work stays within Limits
dotCooCoo Nov 14, 2026
c8a410f
craft-mesh-ops: subdivision checks materials and welding reports OutO…
dotCooCoo Nov 14, 2026
1eca580
Merge main into feat/craft-mesh-ops
dotCooCoo Nov 14, 2026
e35ec1c
craft-mesh-ops: G-buffer budgets are checked before its buffers are r…
dotCooCoo Nov 14, 2026
9bbfd65
Merge main into feat/craft-mesh-ops
dotCooCoo Nov 14, 2026
1244414
craft-mesh-ops: split mirrored tangent frames and keep UV charts from…
dotCooCoo Nov 14, 2026
b0e877a
craft-mesh-ops: reserve primitive storage and copy only the attribute…
dotCooCoo Nov 14, 2026
c6acc05
craft-mesh-ops: subdivision reserves its copy of the input arrays
dotCooCoo Nov 14, 2026
a137750
craft-mesh-ops: keep the normal and chart plane of a small face far f…
dotCooCoo Nov 14, 2026
8481668
Merge the review fixes into feat/craft-mesh-ops
dotCooCoo Nov 14, 2026
dc391e9
craft-mesh-ops: keep far and tiny geometry finite and bound MikkTSpac…
dotCooCoo Nov 14, 2026
479c598
craft-mesh-ops: an empty mesh passes no attributes on when appended
dotCooCoo Nov 14, 2026
32f7a79
craft-mesh-ops: test that from_parts checks the triangle cap first
dotCooCoo Nov 14, 2026
673fe15
craft-mesh-ops: try_append reserves its memory before copying
dotCooCoo Nov 14, 2026
645fe92
Merge main into feat/craft-mesh-ops
dotCooCoo Nov 14, 2026
8fef407
craft-mesh-ops: wire edges, UV seams, UV tiles and material UV mappin…
dotCooCoo Nov 14, 2026
4355d6d
craft-mesh-ops: appending reserves every array before changing the me…
dotCooCoo Nov 14, 2026
9df251e
craft-mesh-ops: material UV mapping checks its vertex copies against …
dotCooCoo Nov 14, 2026
f895f0b
Merge main into feat/craft-mesh-ops
dotCooCoo Nov 14, 2026
d1a2a31
craft-mesh-ops: subdivision keeps midpoint normals and tangents of lo…
dotCooCoo Nov 14, 2026
abd6f46
craft-mesh-ops: primitives check tangent vertex copies against the ve…
dotCooCoo Nov 14, 2026
100e743
Merge origin/feat/craft-mesh-ops into feat/craft-mesh-ops
dotCooCoo Nov 14, 2026
d03016b
Merge main into feat/craft-mesh-ops
dotCooCoo Nov 14, 2026
a42612b
craft-mesh-ops: material UV mapping, append and subdivision copy name…
dotCooCoo Nov 14, 2026
ac472d8
craft-mesh-ops: tangent splits stop at the vertex limit before copying
dotCooCoo Nov 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ author, source and license. Library code and original assets are under the repos
| `crates/text/assets/hyphen/en-us.pat` | DesignCraft contributors, trained from the Moby Hyphenator II list | `crates/text/examples/hyphgen.rs` | CC0-1.0 |
| Patterns embedded through `hypher` (optional `craft-text` language features) | hyph-utf8 authors, per language | [tex-hyphen](https://github.com/hyphenation/tex-hyphen), as packaged in [hypher](https://github.com/typst/hypher/tree/main/patterns) | Per file header: LPPL, MIT, BSD-3-Clause, Unlicense or a permit-any-use notice (or a choice including one); Slovak (`hyph-sk.tex`, embedded whenever `hypher/slovak` is on: feature `slovak-gpl`, or another dependency through feature unification) is GPL-2.0-or-later; Spanish (`hyph-es.tex` 5.0, Javier Bezos, CervanTeX) is MIT |
| Word-break dictionaries and LSTM models embedded through `icu_segmenter_data` (optional `craft-text` features `thai`, `lao`, `khmer`, `burmese`) | Unicode, Inc. and ICU4X contributors | [ICU4X](https://github.com/unicode-org/icu4x) | Unicode-3.0 |
| MikkTSpace tangent generation compiled in through `mikktspace` (`craft-mesh-ops`) | Benjamin Wasty, David Harvey-Macaulay and Layl Bongers; translated from the C original by Morten S. Mikkelsen | [mikktspace 0.3.0](https://crates.io/crates/mikktspace/0.3.0), [gltf-rs/mikktspace](https://github.com/gltf-rs/mikktspace) | MIT OR Apache-2.0 (the package's `license` field); its `src/generated.rs` also carries the C original's 2011 notice, reproduced in [`crates/mesh-ops/ATTRIBUTION.md`](crates/mesh-ops/ATTRIBUTION.md) |
| `crates/ui/tests/fonts/NotoSansArabic-test.ttf` (subset to the test strings, default weight set to 100, width axis dropped) | The Noto Project Authors | [google/fonts@7085eb8 `ofl/notosansarabic`](https://github.com/google/fonts/tree/7085eb89a950e85db5b166b7a58d414544b4140c/ofl/notosansarabic), via craft-fonts | OFL-1.1 (`licenses/ui-test-fonts/OFL-NotoSansArabic.txt`) |
| `crates/ui/tests/fonts/NotoSansCJKsc-test.otf` (subset to the test strings) | The Noto Project Authors (Adobe, Google) | [notofonts/noto-cjk@f8d1575 `Sans/OTF/SimplifiedChinese`](https://github.com/notofonts/noto-cjk/tree/f8d157532fbfaeda587e826d4cd5b21a49186f7c/Sans/OTF/SimplifiedChinese), via craft-fonts | OFL-1.1 (`licenses/ui-test-fonts/OFL-NotoSansCJK.txt`) |
| `crates/ui/tests/fonts/NotoSansArabic-screens.ttf` (instance at weight 400 and width 100, subset to the screen test strings) | The Noto Project Authors | [google/fonts@7085eb8 `ofl/notosansarabic`](https://github.com/google/fonts/tree/7085eb89a950e85db5b166b7a58d414544b4140c/ofl/notosansarabic), via craft-fonts | OFL-1.1 (`licenses/ui-test-fonts/OFL-NotoSansArabic.txt`) |
Expand Down
35 changes: 35 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ craft-gcode = { path = "crates/gcode" }
craft-gif = { path = "crates/gif" }
craft-hdr = { path = "crates/hdr" }
craft-mesh = { path = "crates/mesh" }
craft-mesh-ops = { path = "crates/mesh-ops" }
craft-html = { path = "crates/html" }
craft-heif = { path = "crates/heif" }
craft-fig = { path = "crates/fig" }
Expand Down
18 changes: 18 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ craft-proof Language data, embedded at build time from craft-i18n's language-dat
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.
mikktspace 0.3.0 (https://crates.io/crates/mikktspace/0.3.0), a dependency of crates/mesh-ops,
is MIT OR Apache-2.0. Its src/generated.rs, a translation of Morten S. Mikkelsen's C
MikkTSpace, carries that original's 2011 zlib-style notice, which must not be removed or
altered; crates/mesh-ops/ATTRIBUTION.md reproduces it in full.
crates/text/assets/hyphen/en-us.pat: CC0-1.0, trained from en-us.dic by DesignCraft's trainer.
Hyphenation patterns for other languages, embedded through the hypher crate only when the
matching craft-text feature is enabled (none are by default). They come from hyph-utf8,
Expand Down Expand Up @@ -215,6 +219,20 @@ The colour management module in crates/cms is extracted from:
Licensed MIT OR Apache-2.0. Its generated ICC profile is dedicated to the public domain
(CC0-1.0); see ATTRIBUTION.md.

The mesh operations in crates/mesh-ops are moved from:
- TextureCraft, crates/geom (src/mesh.rs, bvh.rs, primitives.rs, gbuffer.rs, unwrap.rs,
camera.rs and their tests), revision 386630ee85cb22679295b24013575d1aecb39ad2.
https://github.com/storytold/texturecraft
Copyright (c) 2026 ArtCraft Team and the TextureCraft contributors.
- MaterialCraft, crates/geom/src/mesh.rs (subdivision and its test), revision
3133062968b8a1566eda12a357cb06062db16687.
https://github.com/storytold/materialcraft
Copyright (c) 2026 ArtCraft Team and the MaterialCraft contributors.
The index check before tangent generation and its two tests are from TextureCraft pull
request #386 by simonhull, revision faa4548a6f34bb61d43f56b3500edb73dd71981b
(https://github.com/storytold/texturecraft/pull/386).
All licensed MIT OR Apache-2.0.

Optional PDF writer

Krilla 0.8.2 (https://github.com/LaurenzV/krilla), MIT OR Apache-2.0.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ See the [release notes](CHANGELOG.md) for included functionality and known limit
glTF 2.0 / GLB and 3MF, one feature each. Readers are bounded by `Limits`, never open a file themselves
glTF 2.0 / GLB and FBX, one feature each. Readers are bounded by `Limits`, never open a file themselves
and never panic. Carved from EffectCraft, SolidCraft, TextureCraft and MaterialCraft.
- [`craft-mesh-ops`](crates/mesh-ops/README.md): operations on triangle meshes: smooth normals,
MikkTSpace tangents, welding, UV unwrapping, a UV-space G-buffer, primitives with UVs and a
BVH for ray casts (feature `bvh`), with slice functions checked against `Limits`. From
TextureCraft and MaterialCraft.
- [`craft-midi`](crates/midi/README.md): Standard MIDI Files: a bounded reader for formats 0, 1 and
2 and a format-1 writer, over a neutral model of notes and channel events in ticks at 960 per
quarter note. From SoundCraft.
Expand Down
32 changes: 32 additions & 0 deletions crates/mesh-ops/ATTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Attribution

`craft-mesh-ops` generates tangents with the `mikktspace` crate.

| Package | Authors | Source | License |
|---|---|---|---|
| `mikktspace` 0.3.0 | Benjamin Wasty, David Harvey-Macaulay, Layl Bongers | [crates.io](https://crates.io/crates/mikktspace/0.3.0), [gltf-rs/mikktspace](https://github.com/gltf-rs/mikktspace) | MIT OR Apache-2.0 (the package's `license` field) |

The package's `src/generated.rs` is a translation of Morten S. Mikkelsen's C implementation of
the MikkTSpace algorithm and carries that implementation's notice, reproduced here unchanged:

```text
Copyright (C) 2011 by Morten S. Mikkelsen

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.
```
26 changes: 26 additions & 0 deletions crates/mesh-ops/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "craft-mesh-ops"
description = "Triangle mesh operations: smooth normals, MikkTSpace tangents, welding, UV unwrapping, a UV-space G-buffer, primitives with UVs and a BVH, bounded on hostile input"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
repository.workspace = true

[lints]
workspace = true

[features]
default = []
bvh = []
parallel = ["dep:rayon"]
serde = ["dep:serde", "glam/serde"]

[dependencies]
glam = "0.30"
# MIT OR Apache-2.0; its src/generated.rs also carries the zlib-style notice of the C original,
# reproduced in ATTRIBUTION.md.
mikktspace = { version = "0.3", default-features = false, features = ["glam"] }
rayon = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
thiserror = { workspace = true }
Loading
Loading