<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/127364/">https://git.reviewboard.kde.org/r/127364/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Before committing I would like to have feedback about one choice that has to be decided carefully:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">A) Substitute the present CircleBTPType and ArcBTPType with the new version.  This has the drawback of introducing a little
   backward compatibility risk:  The new version <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">could</em> open a previously saved kig file producing a different construction.
   In particular this could happen whenever a saved construction used one of the two intersection points of e.g. a CircleBTP
   and a line for further constructions, for example to build a locus.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">B) Add a <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">new</em> CircleBTPoType and ArcBTPoType to be used in place of the old constructions in newly created kig documents. An old
   saved file would contain references to CircleBTPType and continue to work as before.  This has the drawback of adding complexity
   in kig.  This is the path that I followed in the path file for this review.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Actually I would prefer choice "A" over "B" (I don't think there is <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">any</em> kig save file around the world that would be impacted!),
anyway, suggestions are appreciated.</p></pre>
 <br />









<p>- Maurizio Paolini</p>


<br />
<p>On March 16th, 2016, 8:08 a.m. UTC, Maurizio Paolini wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDE Edu, David Narváez and Rex Dieter.</div>
<div>By Maurizio Paolini.</div>


<p style="color: grey;"><i>Updated March 16, 2016, 8:08 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kig
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I am addressing two related issues: intersection points that jump, circles degenerating to lines.
When intersecting circles obtained as "circle by 3 points" it is possible that one or both degenerate into a straight line.  At present when dinamically moving one of the three defining points of a circle across the line through the other two, the two intersection points exchange position, possibly causing the subsequent constructions to change abruptly.
The other related issue is that at the moment the intersection point is not defined when one
of the two circles degenerate into a line.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Motivation: this situations naturally arise, for example, when trying to construct the Disk Poincare' model of the hyperbolic plane, in which case it is essential to allow for circles to become lines.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">A sample kig file that exposes these issues is available as http://dmf.unicatt.it/~paolini/kig/bugs/test_circle_intersection_old.kig</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The big black points can be moved across the other two defining one of the two circles, observe that the two intersection points exchange position.  Moreover, if a black point
is precisely aligned with the other two (press the shift key to force the point
onto the grid), then the two intersection points disappear.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Unfortunately, to address the "abrupt intersection points exchange" it seems necessary to add a (hidden) circle orientation for CircleImp(s).  In the proposed patch this is achieved by allowing the "mradius" member to be negative (it is "private", so that we to not risk to expose this possibility; radius() method will now return the absolute value of mradius, and the new "orientation()" method returns the circle orientation).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The additional 'orientation' information can then be used inside the CircleCircleIntersection::calc to avoid the abrupt jump of the intersection points.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The new CircleBTPoType class constructs an "oriented" circle (note that the user will not
be able to directly access the orientation information), whereas the old CircleBTPType is left unchanges.  CircleBTPoType substitutes CircleBTPType in builtin_stuff.cc.
In this way we ensure backward compatibility for old saved kig files, whereas new constructions will take advantage of the orientation.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Alternatively we can simply substitute the present CircleBTP with the new version.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>misc/builtin_stuff.cc <span style="color: grey">(e1de877)</span></li>

 <li>misc/common.cpp <span style="color: grey">(2e1fac9)</span></li>

 <li>objects/arc_type.h <span style="color: grey">(a9a7296)</span></li>

 <li>objects/arc_type.cc <span style="color: grey">(26c05cc)</span></li>

 <li>objects/circle_imp.h <span style="color: grey">(dc63e06)</span></li>

 <li>objects/circle_imp.cc <span style="color: grey">(7450ef6)</span></li>

 <li>objects/circle_type.h <span style="color: grey">(37cf400)</span></li>

 <li>objects/circle_type.cc <span style="color: grey">(25ec233)</span></li>

 <li>objects/intersection_types.cc <span style="color: grey">(2fd07be)</span></li>

 <li>objects/other_imp.h <span style="color: grey">(31feda6)</span></li>

 <li>objects/other_imp.cc <span style="color: grey">(d773196)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/127364/diff/" style="margin-left: 3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments </h1>


 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/03/13/31028aa6-140d-40c2-9a79-743ed2e10f40__test_circle_intersection_old.kig">old behaviour</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2016/03/13/526e0448-2b20-454b-ae2a-a5537bb94e99__test_circle_intersection_new.kig">new behaviour</a></li>

</ul>




  </td>
 </tr>
</table>







  </div>
 </body>
</html>