poly2tri_patch.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. diff -r 5de9623d6a50 poly2tri/common/shapes.h
  2. --- a/poly2tri/common/shapes.h Mon Aug 08 22:26:41 2011 -0400
  3. +++ b/poly2tri/common/shapes.h Tue Jan 17 02:36:52 2012 +0100
  4. @@ -35,6 +35,7 @@
  5. #include <vector>
  6. #include <cstddef>
  7. +#include <stdexcept>
  8. #include <assert.h>
  9. #include <cmath>
  10. @@ -136,7 +137,9 @@
  11. p = &p2;
  12. } else if (p1.x == p2.x) {
  13. // Repeat points
  14. - assert(false);
  15. + // ASSIMP_CHANGE (aramis_acg)
  16. + throw std::runtime_error("repeat points");
  17. + //assert(false);
  18. }
  19. }
  20. diff -r 5de9623d6a50 poly2tri/sweep/sweep.cc
  21. --- a/poly2tri/sweep/sweep.cc Mon Aug 08 22:26:41 2011 -0400
  22. +++ b/poly2tri/sweep/sweep.cc Tue Jan 17 02:36:52 2012 +0100
  23. @@ -113,6 +113,8 @@
  24. Point* p1 = triangle->PointCCW(point);
  25. Orientation o1 = Orient2d(eq, *p1, ep);
  26. if (o1 == COLLINEAR) {
  27. + // ASSIMP_CHANGE (aramis_acg)
  28. + throw std::runtime_error("EdgeEvent - collinear points not supported");
  29. if( triangle->Contains(&eq, p1)) {
  30. triangle->MarkConstrainedEdge(&eq, p1 );
  31. // We are modifying the constraint maybe it would be better to
  32. @@ -121,8 +123,8 @@
  33. triangle = &triangle->NeighborAcross(point);
  34. EdgeEvent( tcx, ep, *p1, triangle, *p1 );
  35. } else {
  36. + // ASSIMP_CHANGE (aramis_acg)
  37. std::runtime_error("EdgeEvent - collinear points not supported");
  38. - assert(0);
  39. }
  40. return;
  41. }
  42. @@ -130,6 +132,9 @@
  43. Point* p2 = triangle->PointCW(point);
  44. Orientation o2 = Orient2d(eq, *p2, ep);
  45. if (o2 == COLLINEAR) {
  46. + // ASSIMP_CHANGE (aramis_acg)
  47. + throw std::runtime_error("EdgeEvent - collinear points not supported");
  48. +
  49. if( triangle->Contains(&eq, p2)) {
  50. triangle->MarkConstrainedEdge(&eq, p2 );
  51. // We are modifying the constraint maybe it would be better to
  52. @@ -138,8 +143,8 @@
  53. triangle = &triangle->NeighborAcross(point);
  54. EdgeEvent( tcx, ep, *p2, triangle, *p2 );
  55. } else {
  56. - std::runtime_error("EdgeEvent - collinear points not supported");
  57. - assert(0);
  58. + // ASSIMP_CHANGE (aramis_acg)
  59. + throw std::runtime_error("EdgeEvent - collinear points not supported");
  60. }
  61. return;
  62. }
  63. @@ -712,7 +717,8 @@
  64. return *ot.PointCW(op);
  65. } else{
  66. //throw new RuntimeException("[Unsupported] Opposing point on constrained edge");
  67. - assert(0);
  68. + // ASSIMP_CHANGE (aramis_acg)
  69. + throw std::runtime_error("[Unsupported] Opposing point on constrained edge");
  70. }
  71. }