hyporo-cpp/source/hpr/csg/solid.hpp

47 lines
929 B
C++
Raw Permalink Normal View History

2023-03-13 22:27:09 +05:00
#pragma once
#include <hpr/csg/shape.hpp>
#include <hpr/csg/shell.hpp>
namespace hpr::csg
{
class Solid : public Shape
{
public:
Solid() = default;
~Solid() override = default;
explicit
Solid(const Shape& shape) :
Shape {shape.type() == Type::Solid ? shape : throw std::runtime_error("")}
{}
explicit
Solid(const Shell& shell) :
Shape {}
{
2023-04-10 22:01:56 +05:00
/*BRep_Builder builder;
2023-03-13 22:27:09 +05:00
TopoDS_Solid solid;
builder.MakeSolid(solid);
2023-04-10 22:01:56 +05:00
builder.Add(solid, shell.tcast());*/
BRepBuilderAPI_MakeSolid builder {shell.tcast()};
//p_shape = solid;
p_shape = builder.Shape();
2023-03-13 22:27:09 +05:00
}
[[nodiscard]]
TopoDS_Solid tcast() const
{
return TopoDS::Solid(p_shape);
}
};
}