이 이미지와 같은 그림을 허용하는 알고리즘을 알고 있습니까?


9

Does anyone know how to create an algorithm capable of making the figure just like in the picture, when given a set of specific points (3D array)

enter image description here


4
It's a thing, is this what you are looking for: blog.andreaskahler.com/2009/06/…
Luke San Antonio Bialecki

3
@LukeSanAntonio Post that as an answer so I can upvote it please ;) (but not just the link, some minimal explanation of the algorithm would be necessary for an answer)
yannis

1
@YannisRizos I would, but I don't have any knowledge or experience in this kind of thing, so I could not give you an adequate explanation (well I could, but others could do much better) The only reason I knew the link is because I knew the name of the shape from Blender (wiki.blender.org/index.php/Doc:2.4/Manual/Modeling/Meshes/…)
Luke San Antonio Bialecki

creating the shadow from a 3D object is done daily, check out shadow mapping and shadow volume, but there are more shadow creation algorithms available
ratchet freak

It's not the Shadow I'm looking to create, it's the physical object. We're going to 3D print it.
user88794

답변:


5

Coming here after the battle, but since there are no accepted answer yet and seeing that @Luke refuses to get the rep he deserves, here is a quick summary of the link he provided.

So the full algorithm is available here:

http://blog.andreaskahler.com/2009/06/creating-icosphere-mesh-in-code.html

The idea is to bootstrap your mesh with a simple method which gives you a sphere with 20 faces, and then refine it until you are satisfied.

Bootstrapping the shape

You start with an icosahedron. As the wikipedia article says, you can obtain the vertices by drawing three identical and orthogonal rectangle. You have 3 rectangles with 4 corner each --> 12 vertices.

Wikipedia illustration:

정 이십 면체

For example, the Z plan points are (a, b are the rectangle lengths):

  • (+a, +b, 0)
  • (-a, +b, 0)
  • (+a, -b, 0)
  • (-a, -b, 0)

Now you still have to find the 20 faces. This is left as an exercise to the reader :p

Refining the shape

Now that you have a basic sphere, you may want to add polygons. You do so with this simple algorithm:

for each iteration:
    # each iteration multiplies by 4 the number of faces
    for each edge at the current iteration:
        split the edge in two
        replace the middle point on the sphere

To find the middle point, we suppose that we wish to create the unit sphere (center (0, 0, 0), radius 1).

middlePoint(p1, p2):
    middle = Point((p1.X + p2.X / 2), # same for y, z)
    radius = sqrt(middle.X^2, middle.Y^2, middle.Z^2)
    return Point(middle.X / radius,  # same for y, z)

At each iteration, we may have to reconstruct the faces, but it is fairly easy. Each face is divided into four:

얼굴 수정

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.