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

Method check_thickness

tools/Wires/Inflator/InflatorEngine.cpp:232–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void InflatorEngine::check_thickness() const {
233 size_t size;
234 if (m_thickness_type == PER_VERTEX) {
235 size = m_wire_network->get_num_vertices();
236 } else if (m_thickness_type == PER_EDGE) {
237 size = m_wire_network->get_num_edges();
238 } else {
239 throw RuntimeError("Invalid thickness type!");
240 }
241
242 if (m_thickness.size() != size) {
243 std::stringstream err_msg;
244 err_msg << "Invalid thickness size: " << m_thickness.size() << std::endl;
245 err_msg << "Expect " << size << " thickness entries.";
246 throw RuntimeError(err_msg.str());
247 }
248
249 Float min_thickness = m_thickness.minCoeff();
250 if (min_thickness < 1e-2) {
251 std::stringstream err_msg;
252 err_msg << "Very thin thickness detected: " << min_thickness <<
253 std::endl;
254 err_msg << "PyWires assumes thickness have unit mm" << std::endl;
255 err_msg << "Thickness of such small value is typically not printable."
256 << std::endl;
257 std::cerr << err_msg.str();
258 }
259}
260

Callers

nothing calls this directly

Calls 5

RuntimeErrorClass · 0.85
get_num_verticesMethod · 0.45
get_num_edgesMethod · 0.45
sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected