| 181 | } |
| 182 | |
| 183 | MatrixFr WireProfile::place(const VectorF& end_1, const VectorF& end_2, |
| 184 | Float offset, Float thickness, |
| 185 | const VectorF& rel_correction, |
| 186 | const VectorF& abs_correction, |
| 187 | Float correction_cap, |
| 188 | Float spread_const) { |
| 189 | VectorF dir = end_2 - end_1; |
| 190 | MatrixFr loop = m_loop; |
| 191 | |
| 192 | loop *= 0.5 * thickness / m_radius; |
| 193 | loop.rowwise() += m_offset_dir.transpose() * offset; |
| 194 | |
| 195 | if (m_dim == 2) { |
| 196 | loop = rotate_loop_2D(loop, dir); |
| 197 | } else if (m_dim == 3) { |
| 198 | loop = rotate_loop_3D(loop, dir); |
| 199 | if (m_correction_table) { |
| 200 | m_correction_table->apply_correction(dir, loop); |
| 201 | } |
| 202 | } else { |
| 203 | assert(false); |
| 204 | std::stringstream err_msg; |
| 205 | err_msg << "Unsupported dimention: " << m_dim; |
| 206 | throw NotImplementedError(err_msg.str()); |
| 207 | } |
| 208 | return loop.rowwise() + end_1.transpose(); |
| 209 | } |
| 210 | |