@@ -118,63 +118,60 @@ class Classify_faces_locally {
118
118
}
119
119
}
120
120
121
- if (is_undefined_configuration) {
122
- return {};
123
- }
124
-
125
- // Check consistency and tag rest of the faces.
126
-
127
- // An example case of an inconsistent configuration:
128
- //
129
- // Right, Int.
130
- // //|
131
- // //|
132
- // //|
133
- // /////////|/////////
134
- // Left, ??? ---------+--------- Left, Ext.
135
- // :
136
- // Should be tagged as interior according to global classification.
137
-
138
- auto consistent = true ;
139
- for (auto dry_run : {true , false }) {
140
- auto tag = m.data (faces_.at (k).fi ).tag ;
141
- auto orientation = faces_.at (k).orientation ;
142
- // Go around and return to the starting point to check consistency.
143
- for (std::size_t i = k + 1 ; i <= k + faces_.size (); ++i) {
144
- const auto & f = faces_.at (i % faces_.size ());
145
- auto & f_data = m.data (f.fi );
146
-
147
- if (f.orientation == orientation) {
148
- tag = tag == Face_tag::EXTERIOR ? Face_tag::INTERIOR : Face_tag::EXTERIOR;
121
+ if (!is_undefined_configuration) {
122
+ // Check consistency and tag rest of the faces.
123
+
124
+ // An example case of an inconsistent configuration:
125
+ //
126
+ // Right, Int.
127
+ // //|
128
+ // //|
129
+ // //|
130
+ // /////////|/////////
131
+ // Left, ??? ---------+--------- Left, Ext.
132
+ // :
133
+ // Should be tagged as interior according to global classification.
134
+
135
+ auto consistent = true ;
136
+ for (auto dry_run : {true , false }) {
137
+ auto tag = m.data (faces_.at (k).fi ).tag ;
138
+ auto orientation = faces_.at (k).orientation ;
139
+ // Go around and return to the starting point to check consistency.
140
+ for (std::size_t i = k + 1 ; i <= k + faces_.size (); ++i) {
141
+ const auto & f = faces_.at (i % faces_.size ());
142
+ auto & f_data = m.data (f.fi );
143
+
144
+ if (f.orientation == orientation) {
145
+ tag = tag == Face_tag::EXTERIOR ? Face_tag::INTERIOR : Face_tag::EXTERIOR;
146
+ }
147
+ orientation = f.orientation ;
148
+
149
+ if (f_data.tag == Face_tag::UNKNOWN) {
150
+ if (!dry_run) {
151
+ f_data.tag = tag;
152
+ }
153
+ } else if ((f_data.tag == Face_tag::EXTERIOR || f_data.tag == Face_tag::INTERIOR) &&
154
+ f_data.tag != tag) {
155
+ consistent = false ;
156
+ break ;
157
+ }
149
158
}
150
- orientation = f.orientation ;
151
159
152
- if (f_data.tag == Face_tag::UNKNOWN) {
153
- if (!dry_run) {
154
- f_data.tag = tag;
155
- }
156
- } else if ((f_data.tag == Face_tag::EXTERIOR || f_data.tag == Face_tag::INTERIOR) &&
157
- f_data.tag != tag) {
158
- consistent = false ;
160
+ if (!consistent) {
161
+ // Leave unknown faces to the global classifier.
159
162
break ;
160
163
}
161
164
}
162
-
163
- if (!consistent) {
164
- // Leave unknown faces to the global classifier.
165
- break ;
166
- }
167
165
}
168
166
169
- // Propagate face tags.
167
+ // Propagate the tags.
170
168
171
169
Warnings warnings{};
172
170
173
171
for (const auto & f : faces_) {
174
- auto fi = f.fi ;
175
- auto f_tag = m.data (fi).tag ;
176
- if (f_tag == Face_tag::EXTERIOR || f_tag == Face_tag::INTERIOR) {
177
- warnings |= propagate_face_tags_ (m, border_edges, fi);
172
+ const auto & f_data = m.data (f.fi );
173
+ if (f_data.tag != Face_tag::UNKNOWN) {
174
+ warnings |= propagate_face_tags_ (m, border_edges, f.fi );
178
175
}
179
176
}
180
177
0 commit comments