Skip to content

Commit

Permalink
add prim output
Browse files Browse the repository at this point in the history
  • Loading branch information
seeeagull committed Dec 18, 2023
1 parent 34f7625 commit 2df27a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion projects/Geometry/fTetWild
17 changes: 15 additions & 2 deletions projects/Geometry/tetmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct FTetWild : INode {
virtual void apply() override {
auto prim = get_input<PrimitiveObject>("prim");
auto input_dir = get_input2<std::string>("input_dir");
input_dir.erase(input_dir.find_last_not_of(" ")+1);
auto output_dir = get_input2<std::string>("output_dir");
auto tag = get_input2<std::string>("tag");
tag.erase(tag.find_last_not_of(" ")+1);
Expand Down Expand Up @@ -208,13 +209,25 @@ struct FTetWild : INode {
verts[i].push_back(prim->verts[i][j]);

runFTetWild(faces, verts, argc, argv);

prim->quads.clear();
prim->quads.resize(faces.size());
prim->verts.clear();
prim->verts.resize(verts.size());
for (int i = 0; i < faces.size(); ++i)
for (int j = 0; j < 4; ++j)
prim->quads[i][j] = faces[i][j];
for (int i = 0; i < verts.size(); ++i)
for (int j = 0; j < 3; ++j)
prim->verts[i][j] = verts[i][j];
set_output("prim", std::move(prim));
}
};

ZENO_DEFNODE(FTetWild)
({
{{"prim"},
{"readpath", "input_dir"},
{"readpath", "input_dir", " "},
{"string", "output_dir"},
{"readpath", "tag", " "},
{"enum none union intersection difference", "operation", "none"},
Expand All @@ -234,7 +247,7 @@ ZENO_DEFNODE(FTetWild)
{"bool", "use_general_wn", "0"},
{"bool", "use_input_for_wn", "0"},
{"readpath", "bg_mesh", " "}},
{},
{("prim")},
{},
{"primitive"},
});
Expand Down

0 comments on commit 2df27a2

Please sign in to comment.