WordCram icon indicating copy to clipboard operation
WordCram copied to clipboard

Combined Image and BBTree

Open Xeio opened this issue 12 years ago • 3 comments

Not sure if this is helpful to you, but I have code for combining the BBTree and ImageShaper in my fork. It's in C# though...

I'm not sure I like needing to pass the BBTree for the word into the Nudger/Placers, but this does allow nicer collisions (angled words fit into the shape better rather than using the rectangle bounding box for collision), and had a nice speed boost over the default .Net "shape" collision stuff. I don't know what the performance of the Java shapes are, so it may not be helpful there.

Also there are unit tests for the BBTree.Contains method which may be helpful.

Xeio avatar Sep 13 '13 03:09 Xeio

Hah! Why is it in C#? I don't mind, I can read & write both of them. Paste it here in a comment, maybe? or a gist link? I'll take a look.

danbernier avatar Oct 06 '13 19:10 danbernier

Why C#? Because. <_<

cough

https://gist.github.com/Xeio/6879334

Oh, and unit tests, though they may be less clean to port:

https://github.com/Xeio/WordCramSharp/blob/master/WordCram/WordCramTest/BBTreeContainsTest.cs

Xeio avatar Oct 08 '13 04:10 Xeio

Incredible, thank you! I'll take a closer look as soon as I have some time.

I'm feeling some lambda-envy over here! Proper generics are nice, too, though I don't lean on generics much in WordCram.

On Tue, Oct 8, 2013 at 12:10 AM, Joshua Shaffer [email protected]:

Why C#? Because. <_<

cough

https://gist.github.com/Xeio/6879334

— Reply to this email directly or view it on GitHubhttps://github.com/danbernier/WordCram/issues/44#issuecomment-25863745 .

twitter @danbernier http://wordcram.org | http://newhavenrb.org

danbernier avatar Oct 08 '13 11:10 danbernier