21 ExpressionPtr tag_selection;
22 std::set<std::string> fill_tags;
25 std::string output_path;
34 for (
const std::string& tag : json_params[
"fill_tags"]) {
35 if (tag ==
"ambient") {
37 "'ambient' tag cannot be given explicitly to fill_tags, ignoring. To "
38 "set offset to 'ambient', pass fill_tags=[].");
41 fill_tags.insert(tag);
43 radius_rel = json_params[
"radius_rel"];
44 radius = json_params[
"radius"];
45 output_path = json_params[
"output"];
46 debug_output = json_params[
"DEBUG_output"];
47 write_surface = json_params[
"write_surface"];
48 save_vtu = json_params[
"save_vtu"];
51 void init(
const VectorXd& mins,
const VectorXd& maxes)
53 const double diag = (maxes - mins).norm();
55 radius_rel = radius / diag;
57 radius = radius_rel * diag;
63 nlohmann::json offset_params;
64 offset_params[
"application"] =
"topological_offset";
65 offset_params[
"input"] =
"this doesn't matter";
66 offset_params[
"offset_selection"] =
"this should never be used.";
69 const auto spec = jse::embed::wmtk_topological_offset_spec::topological_offset_spec::spec();
71 bool r = spec_engine.verify_json(offset_params, spec);
73 log_and_throw_error(spec_engine.log2str());
75 offset_params = spec_engine.inject_defaults(offset_params, spec);
78 ret_params.target_distance = radius;
79 ret_params.target_distance_rel = radius_rel;
80 ret_params.offset_output_tag = fill_tags;
81 ret_params.debug_output = debug_output;
82 ret_params.save_vtu = save_vtu;