mirror of https://github.com/CGAL/cgal
Favor earlier exit by reordering planes
This commit is contained in:
parent
e668500c05
commit
6080b92f12
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
#include <CGAL/Envelope.h>
|
#include <CGAL/Polyhedral_envelope.h>
|
||||||
#include <CGAL/Timer.h>
|
#include <CGAL/Timer.h>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
@ -28,7 +28,7 @@ int main(int argc, char* argv[])
|
||||||
typedef std::array<int, 3> Vector3i;
|
typedef std::array<int, 3> Vector3i;
|
||||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||||
typedef Kernel::Point_3 Point_3;
|
typedef Kernel::Point_3 Point_3;
|
||||||
typedef CGAL::Envelope<Kernel> Envelope;
|
typedef CGAL::Polyhedral_envelope<Kernel> Envelope;
|
||||||
|
|
||||||
std::vector<Point_3> env_vertices;
|
std::vector<Point_3> env_vertices;
|
||||||
std::vector<Vector3i> env_faces;
|
std::vector<Vector3i> env_faces;
|
||||||
|
|
|
||||||
|
|
@ -1745,13 +1745,6 @@ private:
|
||||||
halfspace[i].emplace_back(plane);// number 2
|
halfspace[i].emplace_back(plane);// number 2
|
||||||
|
|
||||||
|
|
||||||
if (obtuse != 1) {
|
|
||||||
plane = get_corner_plane(ver[faces[i][1]], midpoint(ver[faces[i][0]], ver[faces[i][2]]) , normal,
|
|
||||||
tolerance, use_accurate_cross);
|
|
||||||
halfspace[i].emplace_back(plane);// number 3;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
edgedire = normalize(BC);
|
edgedire = normalize(BC);
|
||||||
// if (use_accurate_cross)edgenormaldist = accurate_cross_product_direction(ORIGIN, edgedire, ORIGIN, normal)*tolerance;
|
// if (use_accurate_cross)edgenormaldist = accurate_cross_product_direction(ORIGIN, edgedire, ORIGIN, normal)*tolerance;
|
||||||
// else
|
// else
|
||||||
|
|
@ -1762,12 +1755,6 @@ private:
|
||||||
ver[faces[i][1]] + edgenormaldist + normal);
|
ver[faces[i][1]] + edgenormaldist + normal);
|
||||||
halfspace[i].emplace_back(plane);// number 4
|
halfspace[i].emplace_back(plane);// number 4
|
||||||
|
|
||||||
if (obtuse != 2) {
|
|
||||||
plane = get_corner_plane(ver[faces[i][2]], midpoint(ver[faces[i][0]], ver[faces[i][1]]), normal,
|
|
||||||
tolerance,use_accurate_cross);
|
|
||||||
halfspace[i].emplace_back(plane);// number 5;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
edgedire = -normalize(AC);
|
edgedire = -normalize(AC);
|
||||||
// if (use_accurate_cross)edgenormaldist = accurate_cross_product_direction(ORIGIN, edgedire, ORIGIN , normal)*tolerance;
|
// if (use_accurate_cross)edgenormaldist = accurate_cross_product_direction(ORIGIN, edgedire, ORIGIN , normal)*tolerance;
|
||||||
|
|
@ -1779,11 +1766,21 @@ private:
|
||||||
ver[faces[i][0]] + edgenormaldist + normal);
|
ver[faces[i][0]] + edgenormaldist + normal);
|
||||||
halfspace[i].emplace_back(plane);// number 6
|
halfspace[i].emplace_back(plane);// number 6
|
||||||
|
|
||||||
|
|
||||||
|
if (obtuse != 1) {
|
||||||
|
plane = get_corner_plane(ver[faces[i][1]], midpoint(ver[faces[i][0]], ver[faces[i][2]]) , normal,
|
||||||
|
tolerance, use_accurate_cross);
|
||||||
|
halfspace[i].emplace_back(plane);// number 3;
|
||||||
|
}
|
||||||
if (obtuse != 0) {
|
if (obtuse != 0) {
|
||||||
plane = get_corner_plane(ver[faces[i][0]], midpoint(ver[faces[i][1]], ver[faces[i][2]]) , normal,
|
plane = get_corner_plane(ver[faces[i][0]], midpoint(ver[faces[i][1]], ver[faces[i][2]]) , normal,
|
||||||
tolerance,use_accurate_cross);
|
tolerance,use_accurate_cross);
|
||||||
halfspace[i].emplace_back(plane);// number 7;
|
halfspace[i].emplace_back(plane);// number 7;
|
||||||
|
}
|
||||||
|
if (obtuse != 2) {
|
||||||
|
plane = get_corner_plane(ver[faces[i][2]], midpoint(ver[faces[i][0]], ver[faces[i][1]]), normal,
|
||||||
|
tolerance,use_accurate_cross);
|
||||||
|
halfspace[i].emplace_back(plane);// number 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CGAL_ENVELOPE_DEBUG
|
#ifdef CGAL_ENVELOPE_DEBUG
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue