feat(UVMap): per-wedge UV/UVW coordinate store#16
Merged
csparker247 merged 7 commits intodevelopfrom Mar 25, 2026
Merged
Conversation
Introduces UVMap<T, Dims, Traits> — a header-only, templated, per-wedge UV coordinate store companion to Mesh. Key design points: - Two-level pool + per-wedge index mirrors OBJ/PLY vt index structure - Coordinate inner struct inherits Vec<T,Dims> and Traits with full arithmetic operator overloads to prevent trait field slicing - DefaultUVTraits (empty) and WithChart opt-in mixin - Auto-growing map(face, corner, uvIdx) via resize semantics - Const and non-const at() and get_coordinate() overloads - has() for safe pre-check; get() / get_coordinate() throw out_of_range - reserve_uvs / reserve_faces / clear / size / empty container API Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- make get() const; eliminates const_cast in get_coordinate() const overload - restrict T to floating-point types (is_floating_point_v); integer UV coordinates are semantically nonsensical - move DefaultUVTraits and WithChart into the traits namespace, consistent with Mesh's DefaultVertexTraits, WithNormal, WithColor - add [[nodiscard]] to all return-value methods - add noexcept to size(), empty(), clear() - add insert(Coordinate&&) move overload - use push_back(std::move(c)) in insert(Vec) to eliminate extra copy - add @pre precondition docs to map() for face, corner, and uvIdx - add TODO comment on face_uvs_ vector-of-vectors layout - tests: add move construction, move assignment, UVMap<> default-args smoke test - tests: add operator- and operator/ Coordinate arithmetic tests - tests: assert sum.chart and scaled.chart; fix misleading comment - tests: add RemapWedgeUpdatesIndex, clear()+reuse in ClearResetsPoolAndMapping, GetCoordinateConstPreservesWithChartTrait Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- OBJ: single-path and multi-chart (WithChart) texture overloads; MTL read/write with map_Kd extraction in material-declaration order - PLY: comment TextureFile <path> per chart (MeshLab convention); read and write; round-trips via texturePaths out-parameter - WithChart convention documented: chart index = texturePaths index - Out of scope updated: multi-texture is now in scope
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13
What changed
include/educelab/core/types/UVMap.hpp— new header-onlyUVMap<T, Dims, Traits>type: per-wedge UV/UVW coordinate store with a flat pool + per-face/per-corner index, full arithmetic operators onCoordinate, andtraits::DefaultUVTraits/traits::WithChartopt-in mixinstests/src/TestUVMap.cpp— 35 unit tests covering the full public APIinclude/educelab/core.hpp—UVMap.hppadded to umbrella includeCMakeLists.txt—UVMap.hppregistered inpublic_hdrs(installed with the library)examples/MeshExample.cpp— new example demonstratingMeshandUVMapusageREADME.md— added Mesh and UVMap usage sections; updated header-only dependency listconductor/—uv-map_20260323track marked complete;mesh-io_20260323spec and plan updated with texture path handling design decisions (unblocked by this PR)🤖 Generated with Claude Code