47 lines
929 B
C++
47 lines
929 B
C++
#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 {}
|
|
{
|
|
/*BRep_Builder builder;
|
|
TopoDS_Solid solid;
|
|
|
|
builder.MakeSolid(solid);
|
|
builder.Add(solid, shell.tcast());*/
|
|
BRepBuilderAPI_MakeSolid builder {shell.tcast()};
|
|
//p_shape = solid;
|
|
p_shape = builder.Shape();
|
|
}
|
|
|
|
[[nodiscard]]
|
|
TopoDS_Solid tcast() const
|
|
{
|
|
return TopoDS::Solid(p_shape);
|
|
}
|
|
};
|
|
|
|
}
|
|
|