Using CurveMorph for build jigsaw puzzle

Peace Jerome peace_the_dreamer at yahoo.com
Thu Jan 26 00:53:50 UTC 2006


Using CurveMorph for build jigsaw puzzle
Hi Edgar, 

Thank you for your interest.

I have not been able to access the pictures in my
browser. The mail archive says it can’t find them.  Do
you have them in a public place and can you give me a
url to get there?

Now that you mention it I do remember coming across
Rompecabezas in the past. I don’t remember if I played
with it. At that time I might have been stumped in
loading it. I gave it another try and found I don't
know how to load a .sar file into a 3.2 image. Sigh.

I’m glad to hear you want to introduce my new curves
to your students. The thought of seeing what others
might make of them was one of the motivations of doing
the work. I look forward to your results.

I remember running into a similar difficulty with
morphs once picked up dropping to places where I
couldn’t reach them I made a puzzleboard, which was a
pasteup morph.

The pasteup morph would take the first dropped morph
as the “ground” for the puzzle. Then anything placed
on the board had to be within that ground morph and
not touching any other piece.
Misplaced pieces where simply rejected.  I dusted off
the change set and it still works in 3.9.
There is currently a minor difficulty about rejected
polygons getting deleted (see Mantis #2512
(http://bugs.impara.de/view.php?id=2512)  for the
fix.) So this might help with your puzzles, Si?

Check http://209.143.91.36/super/634 (on Bobs
superswiki) for the old project. I’ve now put the cs
up there too. My rooks nest on the swiki is at: 
http://209.143.91.36/super/637 

Yours in service, --Jerome Peace


>Lic. Edgar J. De Cleene edgardec2001 at yahoo.com.ar 
wrote:
>Wed Jan 25 10:35:13 CET 2006 
>
>

>
>Peace Jerome puso en su mail :
>
>> Hi Edgar,
>> 
>> I took some time to think about your request. I
would
>> not use curves or curviers to build jigsaw puzzles.
>> Your best bet is segmented polygons. You just need
to
>> add enough vertices to make a good curve
>> approximation.
>> 
>> Then arrange them in the solved puzzle. Give them a
>> bitmapfill.
>> Now for each piece do two things.
>> Set the form of the fill to the picture of the
entire
>> solved puzzle and the origin of each bit fill to
the
>> same point (topLeft of the entire solved puzzle).
Now
>> each piece shows its portion of the puzzle. You can
>> now scatter the pieces.
>> 
>> Then of course you (or someone else) has a puzzle
to
>> solve.
>> 
>> -----
>> Why not curves.
>> 
>> The way they are set up now each vertex adds
something
>> to determine how the curves are done. To get
matching
>> edges you would need something new that hasn't been
>> invented yet in morphic. It's and interesting
problem
>> but I've relegated it to a back burner. It will
>> require time and inspiration (which comes with time
>> and chance).
>> 
>> I thank you though for triggering some thought on
the
>> subject.
>> 
>> Cheers and joy -- Jerome Peace
>
>Very kind.
>
>Actually, I have a Rompecabezas (puzzle) app, from my
first incursions in
>Squeak.
>
>Is more Pascal what Smalltalk / Squeak and solves the
problem with a
>PuzzleMorph subclass of PolygonMorph what roughly do
some similar to your
>suggestion.
>
>And was in http://minnow.cc.gatech.edu/squeak/3938
for a long time now.
>
>The made on it end in discovering the first bug on
Squeak on 3.2 times, an
>obscure case of when you do the fill some "pieces"
don't could be grabbed .
>
>What now I wish, as part of my students doing his
first steps into Squeak
>world, is give this awful code to one, and say what
her should convert in a
>semi - decent Squeak app.
>
>And if is possible , use your beauty CurveMorph for
doing.
>
>I investigate about something like
>| canvas |
>    canvas _ FormCanvas extent: 40 at 32.
>    canvas fillColor: (Color transparent).
>    canvas drawPolygon: (Bezier3Segment example1)
fillStyle: Color red
>borderWidth: 2 borderColor: Color black.
>    canvas form asMorph openInWorld
>
>Or
>| canvas c|
>    canvas _ FormCanvas extent: 40 at 32.
>    canvas fillColor: (Color transparent).
>    c _ Bezier3Segment new from: 16 at 32 via: 20 at
22 and: 22 at 22 to: 24 at 32.
>    c _  c asBezierShape.
>    canvas drawPolygon: c asPointArray fillStyle:
Color red borderWidth: 1
>borderColor: Color black.!
>
I tried this I got two triangle looking image morphs. 
Is the problem you are trying to describe that you
could pick them up by any transparent pixel within
their bounds.  I can see that would interfere with
overlapping pieces. If so you are correct in using
polygons. That worked for my sliding block puzzles.
Blocks were easier to manage than jigsaw pieces.  You
could also subclass imageMorph to define containsPoint
only for pixels that cast a shadow. That would prevent
them from being picked up. Of course an invisible
morph would be hard to catch. ;-) .
>
>The problem could be solved merging a PolygonMorph
and a Curve Morph, as in
>attached picture (made by hand and quick for you have
the idea).
>
>I let for the wiz figure how to get a closed figure
with straight and curve
>segments  :=)
>
>Very thanks !!!
>
>Edgar


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
protection around 
http://mail.yahoo.com 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Squeak-dev mailing list