DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: DONE: Automatically compute sizes of tangram pieces  (Read 31,003 times)

rmo

  • Participant
  • Joined in 2007
  • *
  • Posts: 3
DONE: Automatically compute sizes of tangram pieces
« on: March 01, 2012, 02:23 AM »
A really cool software for my workshop, should not be complex, I would not think.

Basically, I make tangram puzzle pieces. Wooden ones for kids and grownups alike to play with. But there has to be an easier way to figure out the piece sizes.

[attachimg=#]

What I would like to do is be able to input ONE number and all the pieces' side lengths are automatically calculated. So, I can make a tangram any size I want without having to take time to figure out the size of every single piece. If, say, I wanted to make the large square with a base of 10 inches, the program could figure all the lengths.

Here's the breakdown on size relationships, but the image shows it pretty well:

There are seven pieces to the puzzle, arranged in the image as shown to make a square: 5 triangles, 1 square and 1 parallelogram. The triangles are all isosceles, with 2 small ones, 1 middle size, and 2 large ones.

As you can see, the large triangles' hypotenuse is equal to one side of the whole square. The middle triangle's legs are 1/2 the length of the square. The small triangles' hypotenuse is 1/2 the length of the square. The small square's side is equal to 1/2 the middle triangle's hypotenuse, or the whole length of the small triangles' leg. The parallelogram's long side is equal to 1/2 the whole square's side, while the short side is equal to 1/2 of the hypotenuse of the middle triangle.

Is this doable?

Thanks!

Ron

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: DONE: Automatically compute sizes of tangram pieces
« Reply #1 on: March 01, 2012, 05:07 AM »
Here's a preliminary screenshot:

2012-02-29_230345.png

Was this something like you had in mind?

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,840
    • Coding Snacks
Re: DONE: Automatically compute sizes of tangram pieces
« Reply #2 on: March 01, 2012, 06:56 AM »
FWIW there are apps around that do similar things, ie calculating 'best fits' for cutting the maximum number of pieces out of a flat plane.

are there likely to be any more variables, eg varying the number of pieces?

and a suggestion - I have no idea if this possible or not, but it may get someone thinking.  Instead of measuring the sides, how about a drawing type application that lets you pick and place the various shapes into a defined outline.  The resulting image could be printed out and used as a 'template' (stick it onto your chosen material and cut along the lines)
Alcohol is photoshop, bottled
Askhole - someone who ask for advice, then ignores it
"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: DONE: Automatically compute sizes of tangram pieces
« Reply #3 on: March 01, 2012, 01:43 PM »
Was this something like you had in mind?
Nice work, and back in under three hours  :Thmbsup:
Chris
« Last Edit: March 01, 2012, 02:43 PM by cranioscopical »

rmo

  • Participant
  • Joined in 2007
  • *
  • Posts: 3
Re: DONE: Automatically compute sizes of tangram pieces
« Reply #4 on: March 01, 2012, 07:43 PM »
Here's a preliminary screenshot:
(see attachment in previous post)
Was this something like you had in mind?

YES! Perfect!

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: DONE: Automatically compute sizes of tangram pieces
« Reply #5 on: March 01, 2012, 09:05 PM »

rmo

  • Participant
  • Joined in 2007
  • *
  • Posts: 3
Re: DONE: Automatically compute sizes of tangram pieces
« Reply #6 on: March 02, 2012, 02:56 AM »
Thank you so much!

Now I can input some numbers for different size tangram puzzles to see which sizes are easiest to make. Works like a dream and I love that it can be more or less exact, depending on what decimal points I want.

Now if only it could sharpen my saw blades!  ;D

Thanks again!!

Ron

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: DONE: Automatically compute sizes of tangram pieces
« Reply #7 on: March 02, 2012, 05:27 AM »
You're very welcome.  I'm glad you've found it useful.  =]

Original address: https://www.donationcoder.com/forum/index.php?topic=30147.0