MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / place

Method place

tools/Wires/Inflator/WireProfile.cpp:183–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183MatrixFr 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

Callers 3

generate_end_loopsMethod · 0.80
WireProfileTest.hFile · 0.80
TEST_FFunction · 0.80

Calls 5

rotate_loop_2DFunction · 0.85
rotate_loop_3DFunction · 0.85
NotImplementedErrorClass · 0.85
apply_correctionMethod · 0.80
strMethod · 0.45

Tested by 1

TEST_FFunction · 0.64