Skip to content

Commit cefe2da

Browse files
authored
Merge pull request #2468 from SCIInstitute/groom_issues
Fix Groom issues #2467, #2466
2 parents b588b72 + 71ccc43 commit cefe2da

File tree

9 files changed

+81
-70
lines changed

9 files changed

+81
-70
lines changed

Libs/Analyze/MeshGenerator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ MeshHandle MeshGenerator::build_mesh_from_image(ImageType::Pointer image, float
135135

136136
//---------------------------------------------------------------------------
137137
MeshHandle MeshGenerator::build_mesh_from_file(std::string filename, float iso_value) {
138-
// std::cerr << "build_mesh from " << filename << "\n";
139138
MeshHandle mesh(new StudioMesh);
140139

141140
if (!QFileInfo(QString::fromStdString(filename)).exists()) {

Libs/Mesh/Mesh.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ Mesh& Mesh::smoothSinc(int iterations, double passband) {
298298
iterations = std::max<int>(iterations, 2);
299299
smoother->SetNumberOfIterations(iterations);
300300
smoother->SetPassBand(passband);
301+
302+
smoother->BoundarySmoothingOff();
303+
smoother->FeatureEdgeSmoothingOff();
304+
smoother->NonManifoldSmoothingOn();
305+
smoother->NormalizeCoordinatesOn();
306+
301307
smoother->Update();
302308
this->poly_data_ = smoother->GetOutput();
303309

@@ -722,6 +728,10 @@ Mesh& Mesh::clipClosedSurface(const Plane plane) {
722728
}
723729

724730
Mesh& Mesh::computeNormals() {
731+
// Remove existing normals first
732+
poly_data_->GetPointData()->SetNormals(nullptr);
733+
poly_data_->GetCellData()->SetNormals(nullptr);
734+
725735
auto normal = vtkSmartPointer<vtkPolyDataNormals>::New();
726736

727737
normal->SetInputData(this->poly_data_);

Studio/Interface/ShapeWorksStudioApp.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,15 +1335,17 @@ void ShapeWorksStudioApp::handle_groom_start() {
13351335
void ShapeWorksStudioApp::handle_groom_complete() {
13361336
update_view_combo();
13371337

1338+
// Clear cache BEFORE setting display mode, because set_display_mode triggers
1339+
// update_view_mode() which calls update_display() and would use stale cached meshes
1340+
session_->handle_clear_cache();
1341+
13381342
if (!session_->groomed_present()) {
13391343
// grooming may have failed, if so, we don't want to switch to groomed that don't exist
13401344
session_->set_display_mode(DisplayMode::Original);
13411345
} else {
13421346
session_->set_display_mode(DisplayMode::Groomed);
13431347
}
13441348

1345-
session_->handle_clear_cache();
1346-
13471349
update_display(true);
13481350
visualizer_->reset_camera();
13491351
enable_possible_actions();
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:c82102f0aaa408c3e2ba3503219575a218a952fe159dd692a9f712e8fa7d4f6d
3-
size 388356
2+
oid sha256:a007e47aa5c7b3c30cfae9055aa73d6cc009f8fd0e972c2806a062df54843744
3+
size 385579
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:5e7fb2d2dae972c9ba2070a8498af279269d9780af0cc238b5968993b778bcd4
3-
size 246231
2+
oid sha256:50faf83cc9d39e44a1932c3f1de5b8392e30b4715512fbd1492a6eecaa9f43cf
3+
size 432903

Testing/data/shapeworksTests/analyze/analysis_baseline.json

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,70 +1288,70 @@
12881288
"groups": [],
12891289
"good_bad_angles": [
12901290
[
1291-
9.84,
1291+
9.82,
12921292
4.17,
1293-
4.07,
1294-
10.96,
1295-
6.45,
1296-
7.3,
1297-
9.21,
1298-
8.39,
1299-
4.97,
1300-
10.62,
1301-
6.31,
1302-
4.74,
1303-
9.99,
1304-
7.71,
1305-
7.57,
1306-
8.0,
1293+
4.05,
1294+
10.88,
1295+
6.44,
1296+
7.45,
1297+
9.12,
1298+
8.36,
1299+
4.92,
1300+
10.55,
1301+
6.25,
1302+
4.64,
1303+
9.74,
1304+
7.68,
1305+
7.55,
1306+
7.95,
1307+
8.99,
1308+
3.93,
1309+
13.49,
13071310
9.03,
1308-
4.13,
1309-
13.58,
1310-
9.14,
13111311
3.43,
1312-
9.26,
1312+
8.82,
13131313
5.16,
1314-
9.76,
1315-
4.21,
1316-
8.78,
1314+
9.64,
1315+
4.23,
1316+
8.75,
13171317
4.56,
1318-
9.1,
1319-
7.51,
1320-
6.63,
1321-
9.97,
1322-
7.11,
1323-
11.15,
1324-
9.11,
1325-
7.6,
1326-
9.48,
1318+
9.06,
1319+
7.46,
1320+
6.54,
1321+
9.9,
1322+
7.1,
1323+
11.12,
1324+
8.98,
1325+
7.54,
1326+
9.38,
13271327
5.1,
1328-
17.11,
1329-
9.64,
1330-
5.94,
1331-
8.06,
1332-
7.9,
1333-
12.86,
1334-
7.06,
1335-
9.07,
1336-
3.91,
1337-
12.09,
1338-
5.81,
1339-
11.3,
13401328
12.96,
1341-
15.91,
1342-
12.14,
1343-
6.36,
1344-
12.83,
1345-
5.32,
1346-
11.5,
1347-
5.84,
1348-
6.2,
1349-
8.91,
1350-
6.27,
1351-
6.43,
1352-
4.98,
1353-
9.04,
1354-
8.81
1329+
9.62,
1330+
5.93,
1331+
8.02,
1332+
7.88,
1333+
12.76,
1334+
6.93,
1335+
9.02,
1336+
3.93,
1337+
11.97,
1338+
5.77,
1339+
11.3,
1340+
12.89,
1341+
15.77,
1342+
12.05,
1343+
6.33,
1344+
12.58,
1345+
5.36,
1346+
11.36,
1347+
5.86,
1348+
6.08,
1349+
8.86,
1350+
6.23,
1351+
6.26,
1352+
4.86,
1353+
8.64,
1354+
8.76
13551355
]
13561356
]
13571357
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:741cd03ff978820f49bee24a9505ee28430f2032a2c8f784d6a0a93eeac473db
3-
size 33002
2+
oid sha256:7b3a4c5cd0e617e9a86d5edfe8e6358b81eb7d584cfde178bef6ba9b4d93db5c
3+
size 49228
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:1a3e79ac29fe8720e7fa6f983ed14e55c417d92e501c02b9ac5ac9df96d58abb
3-
size 33002
2+
oid sha256:03791ed5d2528d3d54da0b0e6fba76b4eb0413558d3a6ca20bdf63b371909480
3+
size 49209

Testing/data/smoothsinc.vtp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:ca7aa53ca7ee84b523ff66bdd5b89827254279026070a95e36ec4edd473a0ad2
3-
size 7299939
2+
oid sha256:11dff539015f11fc545839df9eb89ba61d3e3ee531638a0de4e1307d0244abd4
3+
size 7873251

0 commit comments

Comments
 (0)