Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

fix out of bounds on to_average array - 17435580.tif #70

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
703464a
Compute vertex normals in Mesh.
fester Jan 15, 2019
9bf2414
Added has_normals() to Mesh.
fester Jan 25, 2019
cc2b9b7
QuantizedMeshIO can write mesh normals.
fester Jan 25, 2019
8b85ced
Addded a command line switch to write QM normals.
fester Jan 25, 2019
002aeee
Fix formatting.
fester Jan 28, 2019
1d965aa
Correctly limit zoom levels for raster overviews.
fester Feb 4, 2019
c9a11ec
Formatting gone wrong, again.
fester Feb 5, 2019
a8cb8ef
Make windows build compatible with VS 2017
guischulz Apr 28, 2019
08c03e5
add max-iterations for Terra mesh
lekks Nov 15, 2019
97c33eb
throw error if max-iterations set for non terra method
lekks Nov 15, 2019
2cebb52
default to triangle mesh mode when generating a single .terrain file
jtfell Jan 16, 2020
3d18e29
fix out of bounds on to_average array - 17435580.tif
qGYdXbY2 Feb 25, 2020
42acac5
fix out of bounds on to_average array - 17435580.tif
qGYdXbY2 Feb 25, 2020
74f1e54
Merge branch 'master' of https://github.com/qGYdXbY2/tin-terrain
qGYdXbY2 Feb 25, 2020
91f1d7d
Merge branch 'master' into terrain-normals.fester
qGYdXbY2 Feb 25, 2020
c962616
Terrain normals.fester #55
qGYdXbY2 Feb 25, 2020
7a3f94b
Merge branch 'windows-msvc-compatibility' of https://github.com/guisc…
qGYdXbY2 Feb 25, 2020
4c21cc4
Make windows build compatible with VS 2017 #59
qGYdXbY2 Feb 25, 2020
20e4a9e
Merge branch 'max-iterations' of https://github.com/TraceAir/tin-terr…
qGYdXbY2 Feb 25, 2020
b64f657
issue4 --max-iterations #66
qGYdXbY2 Feb 25, 2020
866300f
Merge branch 'terrain-output-dem2tin.jtfell' of https://github.com/jt…
qGYdXbY2 Feb 25, 2020
654a939
Default to triangle mesh mode when generating a single .terrain file #67
qGYdXbY2 Feb 25, 2020
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
Prev Previous commit
Next Next commit
Added has_normals() to Mesh.
Signed-off-by: Tymofii Baga <3448+fester@users.noreply.github.com>
  • Loading branch information
fester committed Feb 12, 2019
commit 9bf2414b36d5027d870d32f38e697e530541331b
1 change: 1 addition & 0 deletions include/tntn/Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Mesh
bool check_for_holes_in_square_mesh() const;

void compute_vertex_normals();
bool has_normals() const;

private:
bool semantic_equal_tri_tri(const Mesh& other) const;
Expand Down
13 changes: 9 additions & 4 deletions src/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ void Mesh::clear()
m_triangles.clear();
m_vertices.clear();
m_faces.clear();
m_normals.clear();
}

void Mesh::clear_triangles()
Expand All @@ -36,6 +37,7 @@ Mesh Mesh::clone() const
out.m_faces = m_faces;
out.m_vertices = m_vertices;
out.m_triangles = m_triangles;
out.m_normals = m_normals;
return out;
}

Expand Down Expand Up @@ -719,6 +721,11 @@ bool Mesh::check_tin_properties() const
return true;
}

bool Mesh::has_normals() const
{
return !m_normals.empty();
}

void Mesh::compute_vertex_normals()
{
using namespace glm;
Expand Down Expand Up @@ -747,10 +754,8 @@ void Mesh::compute_vertex_normals()
}
}

for(auto& vertex_normal : m_normals)
{
vertex_normal = normalize(vertex_normal);
}
std::transform(m_normals.begin(), m_normals.end(), m_normals.begin(),
[](const auto &n) { return normalize(n); });
}

} //namespace tntn