<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: nPoints evenly spaced inside circle in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422212#M6312</link>
    <description>&lt;P&gt;I'm not sure what the vogel method is, unless you meant voxel?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are three patterns you can use the create a set of points that are all equidistant from their closest neighbors.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jonahrnhrt_0-1586018145592.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/749868i27454AFCBB4835E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jonahrnhrt_0-1586018145592.png" alt="jonahrnhrt_0-1586018145592.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can see this when you are tiling a plane. If your points at are the center of the polygons, then they will be evenly distributed. You'd just need to choose a starting point in the shape, and then build out to each of the neighboring points and if those points are inside the shape continue the process until none of the points have neighbors that are inside the shape.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It might be easier/faster to get a bounding box for your shape and use that to quickly find all the points that would be inside that box and then check if they are in your shape.&lt;/P&gt;</description>
    <pubDate>Sat, 04 Apr 2020 16:40:29 GMT</pubDate>
    <dc:creator>jmreinhart</dc:creator>
    <dc:date>2020-04-04T16:40:29Z</dc:date>
    <item>
      <title>nPoints evenly spaced inside circle</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9416265#M6310</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if that's the right place to ask that question but:&lt;/P&gt;&lt;P&gt;I'd like to compute the positions of a determined amount of points inside a circle (ideally an arbitrary shape). This points have to be equidistant (evenly distributed).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 23:45:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9416265#M6310</guid>
      <dc:creator>stuzzz</dc:creator>
      <dc:date>2020-04-01T23:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: nPoints evenly spaced inside circle</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9417857#M6311</link>
      <description>&lt;P&gt;I've found the vogel method which works fine but only for circle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 15:15:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9417857#M6311</guid>
      <dc:creator>stuzzz</dc:creator>
      <dc:date>2020-04-02T15:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: nPoints evenly spaced inside circle</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422212#M6312</link>
      <description>&lt;P&gt;I'm not sure what the vogel method is, unless you meant voxel?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are three patterns you can use the create a set of points that are all equidistant from their closest neighbors.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jonahrnhrt_0-1586018145592.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/749868i27454AFCBB4835E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jonahrnhrt_0-1586018145592.png" alt="jonahrnhrt_0-1586018145592.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can see this when you are tiling a plane. If your points at are the center of the polygons, then they will be evenly distributed. You'd just need to choose a starting point in the shape, and then build out to each of the neighboring points and if those points are inside the shape continue the process until none of the points have neighbors that are inside the shape.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It might be easier/faster to get a bounding box for your shape and use that to quickly find all the points that would be inside that box and then check if they are in your shape.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2020 16:40:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422212#M6312</guid>
      <dc:creator>jmreinhart</dc:creator>
      <dc:date>2020-04-04T16:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: nPoints evenly spaced inside circle</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422220#M6313</link>
      <description>&lt;P&gt;I just realized you may have meant sphere not circle. In that case the only tiling shape is a cube so you would just create a code that loops through the points that would be in some A x B x C 3D grid, and check if they are inside the shape.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To check if the point is inside, find the closest point on the shapes surface. Get the normal vectors at that point. Find the vector from your point to the point on the surface. Take the dot product of the two. If the result is &amp;lt;0 then you are inside the shape. This method will not work for self intersecting shapes.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2020 16:46:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422220#M6313</guid>
      <dc:creator>jmreinhart</dc:creator>
      <dc:date>2020-04-04T16:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: nPoints evenly spaced inside circle</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422236#M6314</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really meant Vo&lt;STRONG&gt;g&lt;/STRONG&gt;el method, here is a &lt;A href="https://apps.dtic.mil/dtic/tr/fulltext/u2/a626479.pdf" target="_blank" rel="noopener"&gt;link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This works for 2d circles but not for arbitrary shapes(unfortunately). Ideally I need an approach for arbitrary shapes.&lt;/P&gt;&lt;P&gt;here's a python code made from the Vogel forumla:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;points = []
num_pts = 100
golden = pi *(3 - sqrt(5))
for index in range(num_pts):
	theta = index * golden
	r = sqrt(index) / sqrt(num_pts)
	pos = (r*cos(theta), 0, r*sin(theta))
        points.append(pos)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The yellow tessellation (with triangles) would help. But let say you X amount of points inside that shape, how would you define the distance between these points. Do you think about a loop reevaluation until the X value is found?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2020 17:03:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422236#M6314</guid>
      <dc:creator>stuzzz</dc:creator>
      <dc:date>2020-04-04T17:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: nPoints evenly spaced inside circle</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422245#M6315</link>
      <description>&lt;P&gt;Oh, that's a really interesting method. I've seen graphics showing flower seeds following that method to spread out evenly. Yeah unfortunately that method is only useful for circles. I think your best bet is creating a grid of points and checking if they are in or out. You'll need to iterate the distance to if you want an exact number of points inside the shape. Iterating until you get an exact number of points might be slow (if you have lots of points) so if you just want a result that looks right you could put in a distance have it generate the points inside the shape, and then you could decide if you want more or less and adjust the distance manually.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2020 17:09:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422245#M6315</guid>
      <dc:creator>jmreinhart</dc:creator>
      <dc:date>2020-04-04T17:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: nPoints evenly spaced inside circle</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422261#M6316</link>
      <description>&lt;P&gt;Yes, the spiral flower is really nice for circles but has poor result with very few points (less than 10).&lt;/P&gt;&lt;P&gt;I though about the grid also but you are right, it wouldn't be the best approach for efficiency.&lt;/P&gt;&lt;P&gt;We could have an approximation by calculating the area of the shape and dividing that wih the X amount of points as starting point...&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This will give an idea of the optimal distance for generating the grid and thus reducing the amount of iterations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still hope to find a better method.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2020 17:21:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422261#M6316</guid>
      <dc:creator>stuzzz</dc:creator>
      <dc:date>2020-04-04T17:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: nPoints evenly spaced inside circle</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422868#M6317</link>
      <description>&lt;P&gt;What do you need these points for? There might be a slightly different approach that would suit your needs better.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2020 09:14:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9422868#M6317</guid>
      <dc:creator>jmreinhart</dc:creator>
      <dc:date>2020-04-05T09:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: nPoints evenly spaced inside circle</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9423089#M6318</link>
      <description>&lt;P&gt;I'd need to generate a scatter of curves inside a closed nurbs surface.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2020 13:56:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/npoints-evenly-spaced-inside-circle/m-p/9423089#M6318</guid>
      <dc:creator>stuzzz</dc:creator>
      <dc:date>2020-04-05T13:56:37Z</dc:date>
    </item>
  </channel>
</rss>

