<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><font size="4">On the paper, there are no notion of line nor
        intersection as in DrGeo. </font></p>
    <p><font size="4">The straight lines the user draws with the tools
        are just plain writing in the paper constrained by the tool
        (line6):</font></p>
    <p><!-- HTML generated using hilite.me --></p>
    <div
style="background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.1em .6em;">
      <table>
        <tbody>
          <tr>
            <td>
              <pre style="margin: 0; line-height: 125%;">1
2
3
4
5
6
7
8</pre>
            </td>
            <td>
              <pre style="margin: 0; line-height: 125%;"><span></span><span
              style="color: #00F; font-weight: bold">GeometryTool</span><span
              style="color: #00F">>>mouseButton1Down:</span> <span
              style="color: #19177C">event</span> <span
              style="color: #00F">localPosition:</span> <span
              style="color: #19177C">localPosition</span>
        (<span style="color: #008000">self</span> <span style="color: #00F">paper</span> <span
              style="color: #00F">writingTool</span> <span
              style="color: #00F">notNil</span> <span
              style="color: #00F">and:</span> [<span
              style="color: #008000">self</span> <span
              style="color: #00F">inStrokeZone:</span> <span
              style="color: #19177C">localPosition</span>])
                <span style="color: #008000">ifTrue:</span> [<span
              style="color: #3D7B7B; font-style: italic">" initiate stroke along the tool "</span>
                        <span style="color: #19177C">lastHandPosition</span> <span
              style="color: #666">:=</span> <span style="color: #008000">nil</span>.
                        <span style="color: #3D7B7B; font-style: italic">" Let the paper to handle the hand stroke, constraint the hand position to be aligned with a tool border ! "</span>
                        <span style="color: #008000">self</span> <span style="color: #00F">paper</span> <span
              style="color: #00F">mouseButton1Down:</span> <span
              style="color: #19177C">event</span> <span
              style="color: #00F">localPosition:</span> (<span
              style="color: #008000">self</span> <span
              style="color: #00F">externalize:</span> (<span
              style="color: #008000">self</span> <span
              style="color: #00F">constrainToDirection:</span> <span
              style="color: #19177C">localPosition</span>))]
                <span style="color: #008000">ifFalse:</span> [<span
              style="color: #3D7B7B; font-style: italic">"Initate a drag of the tool "</span> 
                        <span style="color: #19177C">lastHandPosition</span> <span
              style="color: #666">:=</span> <span style="color: #008000">self</span> <span
              style="color: #00F">externalize:</span> <span
              style="color: #19177C">localPosition</span> ]
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">There are notion of stroke zone (line 1
      above), specific to each tool (SetSquare below):</div>
    <div class="moz-cite-prefix"><!-- HTML generated using hilite.me -->
      <div
style="background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.1em .6em;">
        <table>
          <tbody>
            <tr>
              <td>
                <pre style="margin: 0; line-height: 125%;">1
2
3
4
5
6
7
8
9</pre>
              </td>
              <td>
                <pre style="margin: 0; line-height: 125%;"><span></span><span
                style="color: #00F; font-weight: bold">SetSquare</span><span
                style="color: #00F">>>inStrokeZone:</span> <span
                style="color: #19177C">localPosition</span>
        (<span style="color: #008000">self</span> <span style="color: #00F">strokeZoneX</span> <span
                style="color: #00F">containsPoint:</span> <span
                style="color: #19177C">localPosition</span>) <span
                style="color: #008000">ifTrue:</span> [
                <span style="color: #19177C">strokeSide</span> <span
                style="color: #666">:=</span> <span
                style="color: #19177C">#ox</span>.
                <span style="color: #666">^</span> <span style="color: #008000">true</span>].
        (<span style="color: #008000">self</span> <span style="color: #00F">strokeZoneY</span> <span
                style="color: #00F">containsPoint:</span> <span
                style="color: #19177C">localPosition</span>) <span
                style="color: #008000">ifTrue:</span> [
                <span style="color: #19177C">strokeSide</span> <span
                style="color: #666">:=</span> <span
                style="color: #19177C">#oy</span>.
                <span style="color: #666">^</span> <span style="color: #008000">true</span>].
        <span style="color: #19177C">strokeSide</span> <span
                style="color: #666">:=</span> <span
                style="color: #008000">nil</span>.
        <span style="color: #666">^</span> <span style="color: #008000">false</span>
</pre>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Then, the specific constraint for a
      given tool as the SetSquare:</div>
    <div class="moz-cite-prefix"><!-- HTML generated using hilite.me -->
      <div
style="background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.1em .6em;">
        <table>
          <tbody>
            <tr>
              <td>
                <pre style="margin: 0; line-height: 125%;">1
2
3
4</pre>
              </td>
              <td>
                <pre style="margin: 0; line-height: 125%;"><span></span><span
                style="color: #00F; font-weight: bold">SetSquare</span><span
                style="color: #00F">>>constrainToDirection:</span> <span
                style="color: #19177C">localHandPosition</span>
        <span style="color: #666">^</span> <span style="color: #19177C">strokeSide</span> <span
                style="color: #00F">==</span> <span
                style="color: #19177C">#ox</span>
                <span style="color: #008000">ifTrue:</span> [<span
                style="color: #19177C">localHandPosition</span> <span
                style="color: #00F">x</span> <span style="color: #00F">@</span> <span
                style="color: #666">0</span>]
                <span style="color: #008000">ifFalse:</span> [ <span
                style="color: #666">0</span> <span style="color: #00F">@</span> <span
                style="color: #19177C">localHandPosition</span> <span
                style="color: #00F">y</span>]
</pre>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Again, the Morphic3 framework proved to
      be of an invaluable assistance in such design. Even Juan did not
      realize its usefulness until recently, so far for him the Morphic
      protocol to navigate from one reference frame to another one was
      only useful for internal usage, not particularly intended to the
      GUI designer. It proved the opposite and it reminds me this Alan
      Kay quote: <i>Simple things should be simple and complex things
        should be possible.</i> This is exactly where we are with
      Morphic3.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Regarding snapping with line shapes, it
      should be doable. Indeed the handwritings in a paper are grouped
      in StrokeGroupMorph (it manages the writing occurring between a
      pen down and pen up gesture). Such groups could self analyze
      themselves to recognize usual shapes as straight line, circle.
      Then, you could have a cross analysis between such groups to
      identify the intersections between them. Perfectly doable. When
      you have these information available, snapping to a given tool is
      easy. The evil is in the details of course. </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">
      <div class="moz-cite-prefix">There are snapping between the ruler
        and the set square. In the demo, you can observe the set square
        aligns itself with he ruler when it is moved toward it and the
        two are more or less parallel.<br>
      </div>
      <div class="moz-cite-prefix"><br>
      </div>
    </div>
    <div class="moz-cite-prefix">Dybo targets all kind of teaching in
      school. In math, the geometry tools are the minimum to have, I
      will implement the compass tool next. Snapping is kind of very
      cool to have to attract the attention of math teachers, but I need
      first to develop other tooling for other taught subject. The
      geometry tools are special because they are used to sketch on the
      paper, the other tool to develop would be different, easier to
      implement. These are dynamic knowledge models represented by a box
      morph and scripted with smalltalk code edited by the user (teacher
      or student). The aim is high indeed.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    Hilaire<br>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Le 14/09/2025 à 09:06, Luciano
      Notarfrancesco a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CAL5GDyq2W5EF0zbxjXEPpMKUFJXQrKkaWP92Se4FDP6r9kjT0w@mail.gmail.com">
      <div dir="auto">Very cool! Do the tools snap to lines,
        intersections, etc?</div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://mamot.fr/@drgeo">http://mamot.fr/@drgeo</a></pre>
  </body>
</html>