Using CurveMorph for build jigsaw puzzle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using CurveMorph for build jigsaw puzzle

Jerome Peace
Using CurveMorph for build jigsaw puzzle

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


>Lic. Edgar J. De Cleene edgardec2001 at yahoo.com.ar
>on Thu Jan 19 20:34:57 CET 2006 wrote:

>
>Jerome:
>
>Now what your work is on new images, I wish know if
possible build jigsaw
>puzzles, in particular pieces what combine straight
and smooth segments as
>the pieces what forms the border as you could see in
the attached .jpg.
>
>Any tip are welcome.
>
>And for others Squeakers loving puzzles what wish
point me to math of how to
>build jigsaw puzzles, I said thanks in advance.


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

Reply | Threaded
Open this post in threaded view
|

Re: Using CurveMorph for build jigsaw puzzle

Edgar J. De Cleene
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@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@32.
    canvas fillColor: (Color transparent).
    c _ Bezier3Segment new from: 16@32 via: 20@22 and: 22@22 to: 24@32.
    c _  c asBezierShape.
    canvas drawPolygon: c asPointArray fillStyle: Color red borderWidth: 1
borderColor: Color black.!


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




Picture 1.png (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using CurveMorph for build jigsaw puzzle

Jerome Peace
In reply to this post by Jerome Peace
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 

Reply | Threaded
Open this post in threaded view
|

Re: Using CurveMorph for build jigsaw puzzle

Edgar J. De Cleene
Peace Jerome puso en su mail :

> 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.

Maybe because in 3.2 times the Rompecabezas don't reach the .sar status, and
I know only what Squeak was my true love and no much more.

By the way I have a modification to last SarBuilder published by Ned just
for packaging this kind of app.
You could load the last (old , ugly) Rompecabezas.2.sar, with all picts, pr,
sounds.

Should be install fine in almost any Squeak what understand .sar.
In 3.8 only what you need is drag and drop and all folder creation , etc ,
should be automatic.

on my ftp
ftp://[hidden email]/
password: elpelotero

About 09:00 to 23:00 GMT roughly.

And a lot of things, take what you wish.

> 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.

Your beautiful Curves have a new home now, SqueakLight.
And just in case someone here find how combine straight - curve segments in
a closed figure, we email you

Very thanks.

Edgar



       

       
               
___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundo
http://correo.yahoo.com.ar