v0.1.0: 初始工程骨架 — 7模块 40头文件 32源文件 17文档 Apache-2.0
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
add_executable(hello_triangle main.cpp)
|
||||
target_link_libraries(hello_triangle PRIVATE vde)
|
||||
@@ -0,0 +1,15 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user