For each line (edge) of the polyhedron you can write it's equation as
(y - y1) = (y1 - y2)(x - x1)/(x1 - x2)
So in case of edge from vertex (0, 2) to (1, 0) you can generate it as -
x = (1 - 0) * rand(n,1) + 0 ;
y = (2 - 0)/(0 - 1) * (x - 0) + 2 ;
Here 'n' is the number points you need to generate on the edge. You can do it for each pair of adjacent vertices in a loop.
0 Comments
Sign in to comment.