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

Method compute_end_loop_offsets

tools/Wires/Inflator/SimpleInflator.cpp:106–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void 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
126void SimpleInflator::generate_end_loops() {
127 const size_t num_edges = m_wire_network->get_num_edges();

Callers

nothing calls this directly

Calls 3

get_num_verticesMethod · 0.45
get_attributeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected