Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The template definition of Octree::traverse moves from the detail folder (advanced header, outside geode::detail) to octree.hpp. FACE_SIDE and BALANCE_TYPE document how face_neighbor_leaves() and balance() use them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GCC rejects a member of Octree::Impl (external linkage) whose type is declared in an anonymous namespace (-Werror=subobject-linkage). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
panquez
left a comment
There was a problem hiding this comment.
LGTM but there is too much uses of uint32_t and uint64_t which is not mainly used in OpenGeode
| * 2^(dimension-1) finer leaves of a one-level-finer neighbor. | ||
| */ | ||
| using FaceNeighbors = | ||
| absl::InlinedVector< index_t, 1u << ( dimension - 1 ) >; |
There was a problem hiding this comment.
put this in a variable like NB_CHILDREN
There was a problem hiding this comment.
Added NB_FACE_CHILDREN (2^(dimension-1), the children of a cell touching one of its faces), used for FaceNeighbors and in the docs (1d125c6).
| /*! | ||
| * Minimal corner of the cell in the finest lattice. | ||
| */ | ||
| [[nodiscard]] const std::array< uint32_t, dimension >& cell_anchor( |
There was a problem hiding this comment.
use index_t instead of uint32 ?
There was a problem hiding this comment.
Done in 1d125c6: anchors and lattice values are index_t (they fit in 31 bits), in the API, the implementation and the tests.
| /*! | ||
| * All the leaf cells, sorted by cell index. | ||
| */ | ||
| [[nodiscard]] std::vector< index_t > leaves() const; |
There was a problem hiding this comment.
could be intersecting to have of the leaves from a non leaves level cell?
There was a problem hiding this comment.
Added leaves( cell ) (df4ed85): the leaves of the subtree of a cell (the cell itself if it is a leaf), in depth-first order, children in index order. Also bound in Python.
| } | ||
| const auto smallest_side = | ||
| *std::min_element( sides.begin(), sides.end() ); | ||
| uint64_t nb_roots{ 1 }; |
There was a problem hiding this comment.
Not needed there: the guard now checks nb < NO_ID / nb_roots before the product, with index_t (1d125c6, test_elongated covers each guard). The conversion corner keys are index_t too. uint64_t remains only for the locational code used as hash key (sentinel bit + 21 bits x 3 axes = 64 bits), which needs it, and for the random generator of the test.
…n count Anchors and lattice values fit in 31 bits: index_t replaces uint32_t, and the corner keys of the conversions no longer need uint64_t. The root count guard checks before the product instead of using uint64_t. NB_FACE_CHILDREN names 2^(dimension-1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Octree2D/Octree3D (queries, refine, traverse with Python callables, face_neighbor_leaves, balance, cell attributes) with index checks, and convert_octree_into_polygonal_surface / convert_octree_into_hybrid_solid. The geometry module imports opengeode_py_basic for AttributeManager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adaptive octree used by the octree metric of Geode-Common (
feat/octree, PR #691) and the Simplex mesher (feat/octree, PR #494).Octree<dimension>(geometry)max_depth()follows from the root grid size.leaf_containing,cell_bounding_box,cell_center,cell_lengths,leaves,parent/children,traverse( filter, action )with pruning.face_neighbor_leavesandbalance( BALANCE_TYPE )(2:1 balance, deterministic FIFO order).cell_attribute_manager(): attributes on all cells, inherited by the children on refinement. Serializable.Conversion to meshes (mesh helpers)
convert_octree_into_hybrid_solid(3D) andconvert_octree_into_polygonal_surface(2D): one hexahedron/quadrangle per leaf, leaf attributes transferred. Non-conforming at level jumps; meant for visualization and export.Tests
test-octree(refinement, queries, traversal, neighbours, balance, serialization) andtest-convert-octree.🤖 Generated with Claude Code