0
\$\begingroup\$

Given a canvas say, 1000 X 1000 unit. I would like to fill the canvas with triangles. The triangles can be of any type right angle, equilateral...etc. To avoid big chunks of triangles lets say all triangles should be of some area say, 40 unit^2. Any suggestions will be appreciated, thank you.

I'm trying to draw something like this:

enter image description here

\$\endgroup\$
2
  • 2
    \$\begingroup\$ What did you try? \$\endgroup\$
    – Vaillancourt
    May 23 '16 at 21:09
  • \$\begingroup\$ Limiting area isn't going to do much for you—a super long triangle like this has a really small area. Could you explain better what exactly you want here? The image's triangles are clearly not completely random. \$\endgroup\$
    – Anko
    Jul 26 '16 at 20:12
1
\$\begingroup\$
  1. Add some random points
  2. Repell points located too close to each other
  3. Add some points along the edges
  4. Do Delaunay Triangulation on all the points
  5. Done
\$\endgroup\$
2
  • \$\begingroup\$ Delaunay triangulation is extremely overkill here, and actually wrong. Notice his example has many long skinny triangles. A Delaunay triangulation specifically avoids that, and is expensive to compute. Maybe the concept "seems random" to you but it's seriously not the right tool for the job at all. \$\endgroup\$
    – MickLH
    Jun 4 '16 at 8:05
  • \$\begingroup\$ Delaunay triangulation avoids skinny triangles, but you'll still get some with random points. As for expense, you can perform a DT in (n log n) time. There's also a # of javascript implementations, so it would be an easy thing for OP to try. \$\endgroup\$
    – Pikalek
    Jul 26 '16 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.