Mesh geometry 3
Last updated
Last updated
One of the most exciting techniques involving polygonal meshes is subdivision and the surfaces generated from this process. The basic concept involved first increasing the resolution of a base skeleton mesh and then applying a procedural transform not unlike the one above.
This example demonstrates a very basic scenario of producing molecule-like mesh geometries using one type of subdivision on a tetrahedral seed mesh. The process is highly compacted using clusters so we will need to break it down into steps.
Practice
To simplify mesh editing we use a custom component that accepts a mesh containing only triangular faces and outputs its points in three lists, one for each point. The logic is rather simple: we deconstruct the mesh into its vertices and faces; then we use the “list item” component to select the points from the vertex list by index.
Practice
Create a quadrilateral disassembly scheme that inputs a mesh and outputs its four corner points into lists of points.
The “deconstruct face” component outputs four corner indices no matter if the face is quad or triangle. Is it possible to tell whether a face is quad or triangle by looking at the indices?
The mesh assembly custom component collects three lists of points and outputs a list of single triangle meshes. We use “entwine” to package the three lists into a table of three columns; then we transpose such that each group contains three points which are then passed to the mesh construction component. The face is always the default value [0, 1, 2]. The result is a list of triangle meshes.
Practice
Develop the equivalent mesh assembly component for quadrilateral meshes.
Use the above setup to create your own unweld component that unconditionally decomposes a mesh into independent i.e. no shared vertices mesh.
This is the actual step of subdivision. For a triangle defined by three points, we first compute the mid-points of each edge. In this way we create three new points which we can use for constructing four smaller triangles.
We perform some bookkeeping such that the process can be recursively executed i.e. we can use the output as input of the same process. We thus need to first merge the triangles into a single mesh, using the “mesh join” component; then need to ensure the normals point towards the same direction, using the “unify mesh” component; and finally weld its points to remove duplication, using the “weld mesh” component.
Practice
Try creating a central-subdivision scheme by computing the centroid of a triangle and connecting it to the triangle’s points. This provides a one-to-three mapping which scales a bit slower than the one-to-four scheme developed here.
Develop a subdivision scheme for quadrilaterals. Use the centroid of the quad and connect it to the quad’s nodes. This is also a one-to-four face scheme.
Instead of arbitrarily copy / pasting the subdivision component to increase the mesh resolution, we can define a conditional logic subdivision component as follows: We will accept the original mesh and a number of iterations. Then we will use conditional control flow logic to apply a number of iterations up to four. This is a sufficient limit as the number of faces grow exponentially; from 1 triangle we obtain 1024 after only four iterations!
The graphs’ logic first checks if the number of iterations is larger than one. If this test fails we trickle down and output the original mesh, otherwise we perform one step of subdivision and chain to the next test for two, three and four iterations.
The molecule-like transform was developed completely by accident. It is a variation of the spherification transform seen earlier. Again we treat a mesh’s points as vectors from the world’s origin and perform a “double normalization” of sorts by dividing the vectors by their length twice, once to create unit vectors and then once more. The linear interpolation was replaced here with an expression for avoiding creating interim line geometries.
Practice
Experiment with transformation techniques, using more complex expressions, to scale normals; any function times the unit normal will do.
Try to apply transformations in between subdivision steps instead of waiting until the final depth is reached.
In this session we introduced basic concept regarding polygonized mesh geometries. We looked at construction from first principles, polygonizing smooth spline surfaces, using meshes as analysis visualization tools and performing transformations.
The powerful aspect of meshes is that unlike smooth spline surfaces whose points always follow a rectangular grid configuration, here we can define any arbitrary type of point connectivity ie. topology. On the other hand we need large number of points and faces to approximate “smooth-like” surfaces.
The description of meshes using vertex and index list is quite remarkable because it decouples the geometry expressed by the 3D positions of vertex list, from topology captured by the face index list. This allowed us to trivially alter the appearance of meshes while retaining the same connectivity content ie. face index list.
In conclusion, mesh geometries are the backbone of all computer graphics used today from real-time visualization, such as the CAD viewport and video games, to off-line rendering such as architectural, product design and movies.
Creating a tetrahedron is based on the manual assembly process we introduced for mesh construction. Tetrahedron is the most basic three-dimensional solid shape as it contains four points and four faces [].
Develop some additional Platonic polyhedra []. Notice that their points can be expressed as permutations which may simplify modelling.