You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

23 lines
622 B

#include <iostream>
#include "line.hpp"
#include "solid.hpp"
void testPrint(const ISolid &solid, const Vec3 &queryPt) {
Vec3 closestPt;
std::cout << "sdf on " << queryPt << " = " << solid.sdf(queryPt, closestPt) << std::endl;
}
void caseCyliner() {
Polyline profile{{{-1, 0., 0}, {1., 0., 0.}}, {1., 1.}, {0, 0, -1}, true};
Polyline axis{{{0, 0, 0}, {0, 0, 2}}, {0}, {0, 1, 0}};
ExtrudedSolidPolyline extrusion({profile}, axis);
testPrint(extrusion, {1, 2, 1});
testPrint(extrusion, {1, 2, -1});
profile.getAABB();
}
int main() {
caseCyliner();
return 0;
}