Skip to content

Commit 108d879

Browse files
committed
Fix root node.
Signed-off-by: Andre Pradhana <[email protected]>
1 parent 9d21a12 commit 108d879

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

openvdb/openvdb/tools/FastSweeping.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,17 @@ template <typename SdfGridT, typename ExtValueT>
961961
struct FastSweeping<SdfGridT, ExtValueT>::PruneMinMaxFltKernel {
962962
PruneMinMaxFltKernel(SdfValueT min, SdfValueT max) : mMin(min), mMax(max) {}
963963

964-
// Do nothing for the root node
965-
void operator()(typename SdfTreeT::RootNodeType&, size_t = 1) const { }
964+
// Root node
965+
void operator()(typename SdfTreeT::RootNodeType& node, size_t = 1) const {
966+
for (auto iter = node.beginValueAll(); iter; ++iter) {
967+
if (*iter == -std::numeric_limits<SdfValueT>::max()) {
968+
iter.setValue(mMin);
969+
}
970+
if (*iter == std::numeric_limits<SdfValueT>::max()) {
971+
iter.setValue(mMax);
972+
}
973+
}
974+
}
966975

967976
// Internal nodes
968977
template<typename NodeT>

0 commit comments

Comments
 (0)