12 Commits

Author SHA1 Message Date
Martin Dobias
6508543f5f [3d] Fix tessellator crash with nearly collinear points (fixes #17745) 2018-01-01 22:28:40 +01:00
Nyall Dawson
69c3debfc0 Nicer API for datum transforms
Instead of using QPairs of ints, use more descriptive structs, also
rename a lot of datum related methods for clarity and add docs
2017-12-15 14:16:59 +10:00
Martin Dobias
b773d617b1 [3d] Tessellator fixes + culling mode configuration for 3D polygons
- missing vertical walls since a recent tessellator crash fix (fixes #17604)
- choice of the culling mode - no culling / back face / front face (fixes #17619)
- more unit tests for tessellator
2017-12-04 22:28:14 +01:00
Martin Dobias
62543eb421 [3d] Cleaned up code for camera translation + tests 2017-11-29 11:45:30 +01:00
Martin Dobias
7bce7ea9ca [3d] Fix crash in tessellator with near coords (fixes #17286, fixes #17515)
As the readme of poly2tri library says: "Poly2Tri does not support repeat points within epsilon."

When the coordinates are very near to each other, we get crashes in triangulation code.
To prevent that, we try to simplify geometries to hopefully fix the problem automatically,
if that fails we just skip the polygon as the last resort.

Usually this happens if user tries to use 3D renderer on unprojected lat/lon coordinates.
2017-11-27 17:01:38 +01:00
Nyall Dawson
006da6e365 Move conversion of tesselation to multipolygon to QgsTessellator
Also
- add unit test
- fix bad tesselation due to missing origins
2017-11-27 06:54:29 +11:00
Martin Dobias
a2ff3631d5 Fix tessellation of polygons that are not horizontal
Discovered by Nyall while working on PR #5708

Tessellation would shift coordinates because when points got reprojected
to the new base, the Z coordinates were considered zero (which worked only
when all points were on the same plane).
2017-11-23 14:09:03 +01:00
Nyall Dawson
5206bf0f76 [3d] Fix creation of extruded walls in vertex binding mode
Previously the walls always had horizontal top/bottom, but
in vertex binding mode the walls need to have different z values
at the start and end coordinate

Note that the unit test exposes a different bug in the tesselator,
which should also be fixed...
2017-11-23 11:40:52 +01:00
Matthias Kuhn
b6f46eae11
Rename QgsPolygonV2 to QgsPolygon 2017-10-30 09:14:04 +01:00
Martin Dobias
006352f128 More tessellation fixes and more unit tests 2017-10-11 12:33:47 +02:00
Martin Dobias
8412a87c00 Improvements to tessellator unit test + death to qIsNaN() 2017-10-11 10:07:41 +02:00
Martin Dobias
2c246908d7 Fixes to make tessellation of polygons without Z work again
+ initial work on unit testing of tessellator
2017-10-11 01:17:08 +02:00