Boolean ops using Nef polyhedra (untested)

This commit is contained in:
Ken Arroyo Ohori
2017-03-02 18:11:11 -06:00
parent c9633273a6
commit 6297ff74f1
4 changed files with 246 additions and 2 deletions
@@ -25,14 +25,17 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcRepresentation* l, Convers
bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcCartesianPoint* l, cgal_point_t& point) {
std::vector<double> xyz = l->Coordinates();
if (xyz.size() == 3) {
if (xyz.size() < 4) {
point = Kernel::Point_3(xyz.size() ? (xyz[0]*getValue(GV_LENGTH_UNIT)) : 0.0f,
xyz.size() > 1 ? (xyz[1]*getValue(GV_LENGTH_UNIT)) : 0.0f,
xyz.size() > 2 ? (xyz[2]*getValue(GV_LENGTH_UNIT)) : 0.0f);
// std::cout << "Converted Point(" << point << ")" << std::endl;
return true;
} else {
throw std::runtime_error("Point without 3 coordinates");
std::cout << "Point(";
for (auto &coordinate: xyz) std::cout << coordinate << " ";
std::cout << ")";
throw std::runtime_error("Could not parse point");
}
}