| 104 | } |
| 105 | |
| 106 | void SimpleInflator::compute_end_loop_offsets() { |
| 107 | const size_t num_vertices = m_wire_network->get_num_vertices(); |
| 108 | const VectorF& min_angles = |
| 109 | m_wire_network->get_attribute("vertex_min_angle"); |
| 110 | assert(min_angles.size() == num_vertices); |
| 111 | assert(min_angles.minCoeff() > 0.0); |
| 112 | VectorF vertex_thickness = compute_vertex_thickness(); |
| 113 | const Float max_rel_correction = m_rel_correction.maxCoeff(); |
| 114 | const Float max_abs_correction = m_abs_correction.maxCoeff(); |
| 115 | |
| 116 | m_end_loop_offsets.resize(num_vertices); |
| 117 | for (size_t i=0; i<num_vertices; i++) { |
| 118 | const Float max_correction = vertex_thickness[i] * max_rel_correction |
| 119 | + max_abs_correction + std::max(0.0, m_spread_const); |
| 120 | m_end_loop_offsets[i] = 0.5 * (vertex_thickness[i] + sqrt(2) * max_correction) / |
| 121 | tan(min_angles[i] * 0.5) + EPSILON; |
| 122 | } |
| 123 | validate_end_loop_offset(); |
| 124 | } |
| 125 | |
| 126 | void SimpleInflator::generate_end_loops() { |
| 127 | const size_t num_edges = m_wire_network->get_num_edges(); |
nothing calls this directly
no test coverage detected