0
$\begingroup$

Assume you are given an integer $n$ and want to produce a sampling pattern with that many points on each side.

The square patterns is trivial, you just do n rows of n equidistant points at regular intervals.

The triangle pattern is also easy, it is the element basis used in FEM analysis, i.e. this picture:

enter image description here

Is there a way to generalise this sampling pattern to an arbitrary regular polygon?

$\endgroup$
7
  • 2
    $\begingroup$ What's your goal? What is it you want to do with these sample points? $\endgroup$ Commented Oct 28 at 3:48
  • $\begingroup$ @WolfgangBangerth there's a parametric method called the Charrot Gregory patch which maps a k-regular polygon to a patch in R^3 whose boundaries are defined by k parametric curves. I want a sampling of the regular polygon to have a good set of points to map $\endgroup$
    – Makogan
    Commented Oct 28 at 4:50
  • $\begingroup$ I'd echo Wolfgang's comment: sampling for what? There's a watershed here between (i) field visualization over the shape versus (ii) integrating/differentiating a function over the shape. The former wants nicely shaped pixels / visualization elements perhaps like what you've shown, the latter is going to be less structured because sample points must be placed carefully to satisfy accuracy/convergence requirements. $\endgroup$ Commented Oct 28 at 15:37
  • $\begingroup$ "to have a good set of points to map". That's your starting point. Define what "good" means in terms of an objective function, and now you can start to optimize. $\endgroup$ Commented Oct 28 at 17:57
  • $\begingroup$ Your title mentions regular polygon. But the example of a right triangle and the closing sentence concerning arbitrary polygon do not confine discussion to regular polygons. $\endgroup$
    – hardmath
    Commented Oct 29 at 5:24

1 Answer 1

3
$\begingroup$

In keeping with the philosophy of "keep it simple, stupid", there's a blunt way to do this which might work assuming your polygon is convex. If $\{v_1, \ldots, v_m\}$ are the polygon vertices, let $$\bar v = \frac{1}{m}\sum_iv_i$$ be the barycenter of the polygon. Divide the polygon into $m$ triangles by drawing edges from the barycenter to each polygon vertex. To generate the sampling pattern, use the usual pattern for simplices in each cell. The same trick could work for higher-dimensional polytopes provided you subdivide the faces first. It admittedly doesn't have the nice property of reproducing the usual tensor product sampling for a cube (it skips over some levels) but it might be good enough.

This could also work if the polygon is star-shaped with respect to some point.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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