Skip to content

Commit

Permalink
Merge pull request #28 from loicgasser/bugfix/float-sides
Browse files Browse the repository at this point in the history
Use indices values to determine if an indice sits on a tile edge
  • Loading branch information
loicgasser authored Aug 25, 2018
2 parents 31a0560 + 5a23ba9 commit d4251b2
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 106 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ build/
doc/build/
.idea/
.coverage
.vscode
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: python
python:
- "2.7"
- "3.4"
- "3.6"
before_install:
- sudo apt-get remove -y libgdal1
- sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
Expand All @@ -13,6 +14,6 @@ install:
- pip install flake8
- pip install coveralls
script:
- flake8 --max-line-length=90 --ignore=E128,E221,E241,E251,E272,E731,W503,E402 quantized_mesh_tile tests
- flake8 --max-line-length=90 --ignore=E128,E221,E241,E251,E402 quantized_mesh_tile tests
- coverage run --source=quantized_mesh_tile setup.py test
after_success: coveralls
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
# built documents.
#
# The short X.Y version.
version = u'0.5'
version = u'0.6'
# The full version, including alpha/beta/rc tags.
release = u'0.5'
release = u'0.6'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 1 addition & 3 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ We use flake8 to lint the project. Here are the rules we ignore.
* E221: multiple spaces before operator
* E241: multiple spaces after ':'
* E251: multiple spaces around keyword/parameter equals
* E272: multiple spaces before keyword
* E731: do not assign a lambda expression, use a def
* W503: line break before binary operator
* E402: module level import not at top of file

Vizualize a terrain tile
------------------------
Expand Down
6 changes: 4 additions & 2 deletions quantized_mesh_tile/horizon_occlusion_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ def fromPoints(points, boundingSphere):
raise Exception('Your list of points must contain at least 2 points')

# Bring coordinates to ellipsoid scaled coordinates
scaleDown = lambda coord: [coord[0] * rX, coord[1] * rY, coord[2] * rZ]
def scaleDown(coord):
return [coord[0] * rX, coord[1] * rY, coord[2] * rZ]
scaledPoints = list(map(scaleDown, points))
scaledSphereCenter = scaleDown(boundingSphere.center)

magnitude = lambda coord: computeMagnitude(coord, scaledSphereCenter)
def magnitude(coord):
return computeMagnitude(coord, scaledSphereCenter)
magnitudes = list(map(magnitude, scaledPoints))

return c3d.multiplyByScalar(scaledSphereCenter, max(magnitudes))
4 changes: 3 additions & 1 deletion quantized_mesh_tile/llh_ecef.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def LLH2ECEF(lon, lat, alt):
lat *= (old_div(math.pi, 180.0))
lon *= (old_div(math.pi, 180.0))

n = lambda x: old_div(wgs84_a, math.sqrt(1 - wgs84_e2 * (math.sin(x) ** 2)))
def n(x):
return old_div(wgs84_a, math.sqrt(
1 - wgs84_e2 * (math.sin(x) ** 2)))

x = (n(lat) + alt) * math.cos(lat) * math.cos(lon)
y = (n(lat) + alt) * math.cos(lat) * math.sin(lon)
Expand Down
Loading

0 comments on commit d4251b2

Please sign in to comment.