Skip to content

Commit

Permalink
fixed property smoothing (elalish#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish committed Jun 14, 2024
1 parent 67c4647 commit 80a5f2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"program": "${workspaceFolder}/build/test/manifold_test",
"args": [
"--gtest_break_on_failure",
"--gtest_filter=Smooth.TruncatedCone"
"--gtest_filter=Smooth.RefineQuads"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build/test",
Expand Down
2 changes: 1 addition & 1 deletion src/manifold/src/manifold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ Manifold Manifold::SmoothOut(float minSharpAngle, float minSmoothness) const {
Vec<glm::ivec3> triProperties = pImpl->meshRelation_.triProperties;
pImpl->SetNormals(0, minSharpAngle);
pImpl->CreateTangents(0);
pImpl->meshRelation_.numProp = 0;
pImpl->meshRelation_.numProp = numProp;
pImpl->meshRelation_.properties.swap(properties);
pImpl->meshRelation_.triProperties.swap(triProperties);
} else {
Expand Down
3 changes: 2 additions & 1 deletion test/smooth_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ TEST(Smooth, Tetrahedron) {

TEST(Smooth, RefineQuads) {
Manifold cylinder =
Manifold(WithPositionColors(Manifold::Cylinder(2, 1, -1, 12).SmoothOut()))
Manifold(WithPositionColors(Manifold::Cylinder(2, 1, -1, 12)))
.SmoothOut()
.RefineToLength(0.05);
EXPECT_EQ(cylinder.NumTri(), 16892);
auto prop = cylinder.GetProperties();
Expand Down

0 comments on commit 80a5f2e

Please sign in to comment.