| 150 | } |
| 151 | |
| 152 | void WireNetwork::drop_zero_dim() { |
| 153 | const size_t num_vertices = get_num_vertices(); |
| 154 | std::vector<bool> to_keep(m_dim, false); |
| 155 | size_t num_cols_to_keep = 0; |
| 156 | for (size_t i=0; i<m_dim; i++) { |
| 157 | if (m_bbox_min[i] < m_bbox_max[i]) { |
| 158 | to_keep[i] = true; |
| 159 | num_cols_to_keep += 1; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | MatrixFr vertices(num_vertices, num_cols_to_keep); |
| 164 | size_t count = 0; |
| 165 | for (size_t i=0; i<m_dim; i++) { |
| 166 | if (to_keep[i]) { |
| 167 | vertices.col(count) = m_vertices.col(i); |
| 168 | count++; |
| 169 | } |
| 170 | } |
| 171 | m_vertices.swap(vertices); |
| 172 | m_dim = num_cols_to_keep; |
| 173 | update_bbox(); |
| 174 | } |
| 175 | |
| 176 | void WireNetwork::filter_vertices(const std::vector<bool>& to_keep) { |
| 177 | const size_t num_vertices = m_vertices.rows(); |
no outgoing calls