Shapes and Grid
in
Programming Questions
•
2 years ago
Hi All,
I'd like to create grid of shapes - ie. tesselation on the plane of some basic geometric tiles such triangles, quads, and hexagons.
I thought it would be nice to have a unique Class Shape to handle different basic shapes and then replicate them by translations. But I am not sure how to organize data...Let's say I have 3 basic shapes should I have 3 constructor that build the actual shape or should I have additional function for that?
Then the same when I want to create the grid with the basic shape. Another issue is that If, lets say I use pvector to locate points for basic shape, then I dont want to have duplicate points on shape that are next to each other - any idea how to avoid this?
It would great if someone has a very basic sample I can look at to have some ideas how can I start building it. Suggestions?
1