Skip to content

Commit ec67e8f

Browse files
committed
BUGFIX: Rendering of XYZIRT clouds without I
1 parent f72e705 commit ec67e8f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

doc/source/doxygen-docs/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Version 2.14.5: UNRELEASED
44
- Debian files:
55
- Fix appstreamcli warnings in metadata XML files.
6+
- BUG FIXES:
7+
- mrpt::maps::CPointsMapXYZIRT::getPointRGB() now handles the case of no intensity without throwing, fixing the visualization of such clouds through mrpt::opengl::CPointCloudColoured::loadFromPointsMap().
68

79
# Version 2.14.4: Released Oct 19th, 2024
810
- BUG FIXES:

libs/maps/src/maps/CPointsMapXYZIRT.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,20 @@ void CPointsMapXYZIRT::getPointRGB(
283283
size_t index, float& x, float& y, float& z, float& R, float& G, float& B) const
284284
{
285285
ASSERT_LT_(index, m_x.size());
286-
ASSERT_LT_(index, m_intensity.size());
287-
288286
x = m_x[index];
289287
y = m_y[index];
290288
z = m_z[index];
291-
R = G = B = m_intensity[index];
289+
290+
if (!m_intensity.empty())
291+
{
292+
ASSERT_LT_(index, m_intensity.size());
293+
R = G = B = m_intensity[index];
294+
}
295+
else
296+
{
297+
// Default color if no intensity:
298+
R = G = B = 1.0f;
299+
}
292300
}
293301

294302
bool CPointsMapXYZIRT::saveXYZIRT_to_text_file(const std::string& file) const

0 commit comments

Comments
 (0)