16 lines
484 B
C++
16 lines
484 B
C++
|
|
#include <iostream>
|
||
|
|
#include "vde/core/point.h"
|
||
|
|
#include "vde/core/triangle.h"
|
||
|
|
#include "vde/core/aabb.h"
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
using namespace vde::core;
|
||
|
|
Triangle3D tri({0,0,0}, {1,0,0}, {0,1,0});
|
||
|
|
std::cout << "Triangle area: " << tri.area() << "\n";
|
||
|
|
std::cout << "Centroid: (" << tri.centroid().transpose() << ")\n";
|
||
|
|
Point3D p(0.25, 0.25, 0);
|
||
|
|
std::cout << "Point (0.25, 0.25) in triangle: "
|
||
|
|
<< (tri.contains(p) ? "yes" : "no") << "\n";
|
||
|
|
return 0;
|
||
|
|
}
|