File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,9 @@ namespace deform {
119119 _dirty = false ;
120120 }
121121
122+ // Estimate positions
123+ estimatePositions ();
124+
122125 for (Index i = 0 ; i < numberOfIterations; ++i) {
123126
124127 // Estimate rotations
@@ -209,9 +212,13 @@ namespace deform {
209212
210213 const Scalar denom = Scalar (1.0 ) / (Scalar (4.0 ) * area);
211214
212- const Scalar cot0 = (-l0 * l0 + l1 * l1 + l2 * l2) * denom;
213- const Scalar cot1 = (l0 * l0 - l1 * l1 + l2 * l2) * denom;
214- const Scalar cot2 = (l0 * l0 + l1 * l1 - l2 * l2) * denom;
215+ Scalar cot0 = (-l0 * l0 + l1 * l1 + l2 * l2) * denom;
216+ Scalar cot1 = (l0 * l0 - l1 * l1 + l2 * l2) * denom;
217+ Scalar cot2 = (l0 * l0 + l1 * l1 - l2 * l2) * denom;
218+
219+ cot0 = std::max<Scalar>(Scalar (1e-8 ), cot0);
220+ cot1 = std::max<Scalar>(Scalar (1e-8 ), cot1);
221+ cot2 = std::max<Scalar>(Scalar (1e-8 ), cot2);
215222
216223 std::pair<Index, Index> e0 = undirectedEdge (vids (0 ), vids (1 ));
217224 std::pair<Index, Index> e1 = undirectedEdge (vids (1 ), vids (2 ));
You can’t perform that action at this time.
0 commit comments