closest point screencast => tutorial

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

closest point screencast => tutorial

ckhung
Hi Hilaire,

I followed the steps in your screencast:
http://people.ofset.org/hilaire/drgeo2/tutorials/AdvancedTools/805-drgeo-point-block-closure.ogv
with some variations. With a concavity in the polygon it's even easier
to see what the code tries to compute. I have a few questions,
most of which are about squeak. Can you please give me a link (URL) or
a few search keywords to answer each question (except the last one)?

1. When I partially type "OrderedCollection", the environment offers completion.
   However, DrGeoCanvas does not appear in the completion of its prefix.
   Is it because DrGeoCanvas is a private method or something like that?
2. How do I delete the bare bone canvas that has no window decorations?
3. When I see a function, how do I go about searching for its docs or code?
   I suppose OrderedCollection comes with squeak whereas closestPointTo comes
   with DrGeoII and I should look for their docs in different ways?
4. Are there a few important lists of functions that you would suggest to a math
   teacher who is more interested in fun geometry scriting than in squeak/smalltalk?
5. I would guess that one of the lists in (4) is specific to DrGeoII (not squeak-general)
   and the list has not been created. If you start writing a list of such functions
   on the wiki, we can then explore the list to create more interesting examples.
6. Can you explain these statements a bit?
    p:=figure
        point: [:prts | prts first closestPointTo: prts second point]
        parents: {C. O}.
   Specifically, does the "parents" binding cause drgeo to refresh the
   calculation of closest point each time the user moves either the polygon
   or the point? If so, then "parents" and its likes should definitely
   appear in the list of (5).

It should help, especially for people who are not familiar with squeak,
if I can turn your screencast into a tutorial in words,

Looks like it will be a lot of fun with DrGeoII scripting. Thanks, Hilaire!

--
              認識商業炒作之前的雲端, 請搜尋 「雲端 簡史」
                    http://people.ofset.org/~ckhung/
                         Chao-Kuei Hung 洪朝貴



closest-point.png (58K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: closest point screencast => tutorial

Hilaire Fernandes
Administrator
Hi Chao-Kuei,

I will respond to your questions in different emails. Here it goes for
your first question

Le 02/04/2011 09:02, [hidden email] a écrit :

> Hi Hilaire,
>
> I followed the steps in your screencast:
> http://people.ofset.org/hilaire/drgeo2/tutorials/AdvancedTools/805-drgeo-point-block-closure.ogv
> with some variations. With a concavity in the polygon it's even easier
> to see what the code tries to compute. I have a few questions,
> most of which are about squeak. Can you please give me a link (URL) or
> a few search keywords to answer each question (except the last one)?
>
> 1. When I partially type "OrderedCollection", the environment offers completion.
>    However, DrGeoCanvas does not appear in the completion of its prefix.
>    Is it because DrGeoCanvas is a private method or something like that?

Yes it can appear! In the popup list you have to use the keyboard down
arrow to see the entire list, then you will see the DrGeoCanvas.
I guess there are some sort of prediction algorithm, after a few use of
DrGeoCanvas it may become more common, so in the top of the list I guess.
One more tips, when you are in the list, you can use the keyboard right
arrow key to see the code of a message (does not work for class of course).

Then last, but not least, the Pharo Smalltalk environment does not make
distinction between DrGeo classes and methods and the system ones. All
flat wide open. It means, when scripting, you can use the entire Pharo
Smalltalk machinery, not limit. You can even do meta programming from
scripting (ie modifying Dr. Geo itself), but you don't need to do that.

Hilaire
--
Education 0.2 -- http://blog.ofset.org/hilaire
Was this message helpful?
Tell us!
Reply | Threaded
Open this post in threaded view
|

How to delete a bare bone canvas?

Hilaire Fernandes
Administrator
In reply to this post by ckhung
Show up the halo with a [Shift]+[Middle mouse bouton clic] over the canvas.

Then in the halo surrounding the canvas, clic the pink icon in the top left.

Hilaire



Le 02/04/2011 09:02, [hidden email] a écrit :
> 2. How do I How do I delete the bare bone canvas that has no window decorations?


--
Education 0.2 -- http://blog.ofset.org/hilaire
Was this message helpful?
Tell us!
Reply | Threaded
Open this post in threaded view
|

Documentation about function

Hilaire Fernandes
Administrator
In reply to this post by ckhung
You have several options:

1. When you are writing a script, in the workspace, select the message
you want to see the method, then do [Alt]+[m].

2. For specific DrGeo API, see the DrGeo user manual. It is only in
French right now, but contributors to translate it are welcome.
http://documentation.ofset.org/drgeo2/fr

3. For online tips regarding Pharo Smalltalk classes:
http://magaloma.seasidehosting.st

4. Pharo By Example free book http://pharobyexample.org


With #1 you can search for both DrGeo or Pharo Smalltalk methods.
#3 is specific to Pharo Smalltalk as this environment was not build with
DrGeo.

Hilaire



Le 02/04/2011 09:02, [hidden email] a écrit :
> 3. When I see a function, how do I go about searching for its docs or code?
>    I suppose OrderedCollection comes with squeak whereas closestPointTo comes
>    with DrGeoII and I should look for their docs in different ways?


--
Education 0.2 -- http://blog.ofset.org/hilaire
Was this message helpful?
Tell us!
Reply | Threaded
Open this post in threaded view
|

Smalltalk methods for math and geometry scripting

Hilaire Fernandes
Administrator
In reply to this post by ckhung
Explore the Number classes within the Kernel class catagory.

You can read online:

http://magaloma.seasidehosting.st/Kernel#Number

You can browse it from DrGeo itself with the source code browser

Also Float, Integer and Fraction classes.

For DrGeo specific method, read the user guide:
http://documentation.ofset.org/drgeo2/fr/drgeo005.html#toc12
http://documentation.ofset.org/drgeo2/fr/drgeo005.html#toc13

Google can translate it.

Hilaire


Le 02/04/2011 09:02, [hidden email] a écrit :
> 4. Are there a few important lists of functions that you would suggest to a math
>    teacher who is more interested in fun geometry scriting than in squeak/smalltalk?


--
Education 0.2 -- http://blog.ofset.org/hilaire
Was this message helpful?
Tell us!
Reply | Threaded
Open this post in threaded view
|

Documenting DrGeo API

Hilaire Fernandes
Administrator
In reply to this post by ckhung
For existing documentation effort, specific to DrGeo, it is there:
http://documentation.ofset.org/drgeo2/fr/drgeo005.html#toc12
http://documentation.ofset.org/drgeo2/fr/drgeo005.html#toc13

From Community section in DrGeo web site, we have a link to a discussion
page about useage of DrGeo API:

http://community.ofset.org/index.php/DrGeoII_discussion

It is written in Frenglish, just add here what you want and I can
contribute to it. But first look at the existing documentation through
GoogleTranslate

I would like to have documentation in Wiki, then produce a clean user
guide from it, but frankly I do not have the time to manage that myself.
I left this to someone else.


Hilaire


Le 02/04/2011 09:02, [hidden email] a écrit :
> 5. I would guess that one of the lists in (4) is specific to DrGeoII (not squeak-general)
>    and the list has not been created. If you start writing a list of such functions
>    on the wiki, we can then explore the list to create more interesting examples.


--
Education 0.2 -- http://blog.ofset.org/hilaire
Was this message helpful?
Tell us!
Reply | Threaded
Open this post in threaded view
|

Point defined by bloc

Hilaire Fernandes
Administrator
In reply to this post by ckhung
You described it right, the message #point:parents works with two arguments.

The first one is a bloc of code executed at each update of the canvas.
This bloc of code receive as an unique argument the collection provided
in the second part of the message (parents: argument).


It is documented in the section:
 http://documentation.ofset.org/drgeo2/fr/drgeo005.html#@default107


Hilaire

Le 02/04/2011 09:02, [hidden email] a écrit :
> 6. Can you explain these statements a bit?
>     p:=figure
> point: [:prts | prts first closestPointTo: prts second point]
> parents: {C. O}.
>    Specifically, does the "parents" binding cause drgeo to refresh the
>    calculation of closest point each time the user moves either the polygon
>    or the point? If so, then "parents" and its likes should definitely
>    appear in the list of (5).


--
Education 0.2 -- http://blog.ofset.org/hilaire
Was this message helpful?
Tell us!