| 166 | } |
| 167 | |
| 168 | void PhantomMeshGenerator::trim_irrelavent_edges() { |
| 169 | // Relavent edge is edge that have at least 1 end point from the original |
| 170 | // wire network. |
| 171 | const Float eps = 1e-3; |
| 172 | const size_t dim = m_wire_network->get_dim(); |
| 173 | const VectorF bbox_min = m_wire_network->get_bbox_min() - VectorF::Ones(dim)*eps; |
| 174 | const VectorF bbox_max = m_wire_network->get_bbox_max() + VectorF::Ones(dim)*eps; |
| 175 | |
| 176 | const size_t num_phantom_vertices = m_phantom_wires->get_num_vertices(); |
| 177 | const MatrixFr& phantom_vertices = m_phantom_wires->get_vertices(); |
| 178 | const MatrixIr& phantom_edges = m_phantom_wires->get_edges(); |
| 179 | |
| 180 | std::vector<bool> vertex_relavent_indicator(num_phantom_vertices, false); |
| 181 | for (size_t i=0; i<num_phantom_vertices; i++) { |
| 182 | const VectorF& v = phantom_vertices.row(i); |
| 183 | if ((v.array() > bbox_min.array()).all() && |
| 184 | (v.array() < bbox_max.array()).all()) { |
| 185 | vertex_relavent_indicator[i] = true; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | dilate(phantom_edges, vertex_relavent_indicator); |
| 190 | dilate(phantom_edges, vertex_relavent_indicator); |
| 191 | m_phantom_wires->filter_vertices(vertex_relavent_indicator); |
| 192 | } |
| 193 | |
| 194 | void PhantomMeshGenerator::convert_attributes_to_parameters() { |
| 195 | assert(m_parameter_manager); |
nothing calls this directly
no test coverage detected