5 #include <nlohmann/json.hpp>
16 std::variant<GridOptions, TriangleFanOptions, DiskOptions>
settings;
21 [&](
const auto& s) { nlohmann_json_j[
"settings"] = s; },
26 if (nlohmann_json_j.contains(
"triangle_fan")) {
27 const auto& settings_js = nlohmann_json_j[
"triangle_fan"];
29 }
else if (nlohmann_json_j.contains(
"grid")) {
30 const auto& settings_js = nlohmann_json_j[
"grid"];
32 }
else if (nlohmann_json_j.contains(
"disk")) {
33 const auto& settings_js = nlohmann_json_j[
"disk"];
37 throw std::runtime_error(fmt::format(
"Unknown procedural mesh mesh_type"));
friend void to_json(nlohmann::json &nlohmann_json_j, const ProceduralOptions &nlohmann_json_t)
std::variant< GridOptions, TriangleFanOptions, DiskOptions > settings
friend void from_json(const nlohmann::json &nlohmann_json_j, ProceduralOptions &nlohmann_json_t)