rotate( mesh, rotate )Rotates a mesh ( or a selected part ) around an axis by number specified in the sliders. The unit used for rotation is radians.
cube.obj rotateX -0.8 |
cube.obj (selection) rotateX -0.8 |
twist( mesh, factor )Rotates all vertices v along the Y axis by v.position.y * factor. The units are again radians.
large_cube.obj twist 1 |
large_cube.obj twist 2 |
inflate( mesh, factor )Moves all vertices in the direction of their respective vertex normals, proportional to a factor. For the cube, this operation will give a scaling effect.
cube.obj inflate -1 |
cube.obj inflate 1 |
hand.obj inflate -0.1 |
hand.obj inflate 0.1 |
cube.obj inflate -1 |
cube.obj inflate 1 |
hand.obj inflate -1 |
hand.obj inflate 1 |
twist( mesh, factor )Moves all vertices in the direction of their respective vertex normals, proportional to mesh.averageEdgeLength(v) * factor * randomIn( -1, 1 ).
large_cube.obj noise 0.5 |
large_cube.obj noise 1 |
smooth( mesh, iter )This operation needs to be applied iter number of times. For each iteration, the vertices should be moved to the weighted average of itself and its neighbors. Be careful when updating the position. During a single iteration you want to use original positions throughout the entire computation. Update the actual positions of the vertices only after all new locations have been calculated.
large_cube.obj smooth 1 |
large_cube.obj smooth 10 |
cheetah.obj smooth 1 |
cheetah.obj smooth 10 |
sharpen( mesh, iter )This operation needs to be applied iter number of times, similarly to smooth. If you are having display issues consider checking triangulate. ( Assuming you have implemented the triangulate filter )
cheetah.obj sharpen 0 |
cheetah.obj sharpen 1 |
cheetah.obj sharpen 2 |
cheetah.obj sharpen 3 |
curvature( mesh )Depending on your choice of visualization, your results might vary greatly from this. However for the cheetah, what you should be seeing is high curvature values (bright yellow in our visualization) in places like the claws, nostrils or ears, and low curvature values (blue in our visualization) around the claws. This is due to the fact that Gaussian curvature is defined as product of principal curvatures. Your final colors will vary depending on what method you use to map the curvature to a suitable range for the colors. Notice that for the cube, all the vertices have the same value so they are all mapped to mid gray.
cube.obj curvature |
cheetah.obj curvature |
cow.obj curvature |
truncate( mesh, factor )Creates an effect where each vertex is "cut off". It is possible to accomplish this using the splitEdge() and splitFace() functions. Topologically we are only adding vertices, so there is no need to remove any vertices. Think about the necessary topological and geometrical changes.
cube.obj truncate 0.2 |
cube.obj truncate 0.4 |
cube.obj (selected) truncate 0.4 |
extrude( mesh, factor )The vertices of each face should be duplicated and moved along the normal of the face. The original face should be attached to the duplicated vertices. The set of original vertices and duplicated vertices should be connected together by new faces. This feature requires you to modify the half edge data structure by using the splitFaceMakeEdge(...), joinEdgeKillVertex( v1, v2, v3 ), and splitEdgeMakeVertex( v1, v2, f ) functions. Make sure you familiarize yourself with these functions before starting to code this one!
cube.obj extrude 1 |
cube.obj (selected) extrude 1 |
bevel( mesh, factor )Creates the effect where each edge is "cut off". Please refer to the precept 5 slides for some tips on implementing this feature.
cube.obj bevel 0.2 |
dodacahedron.obj bevel 0.2 |
tetrahedron.obj bevel 0.2 |
cube.obj bevel 0.2 |
dodacahedron.obj bevel 0.2 |
tetrahedron.obj bevel 0.2 |
splitLong( mesh, factor )Splits the longest edge in the mesh. Depending on the choice of which vertices you selected to connect to a newly created one, you can obtain different results. Notice that as you go through the iterations one of the newly added edges might be the longest one.
cube.obj splitLong 0.1 |
cube.obj splitLong 0.5 |
cube.obj splitLong 1.0 |
triSubdiv( mesh, levels )Splits each face into triangles. This effect is applied levels number of times. The mesh should be triangulated before using this function. In the example images, the input tetrahedron has been scaled (5) and rotated (1.57) for visualization purposes.
tetrahedron.obj triSubdiv 1 |
tetrahedron.obj triSubdiv 3 |
loop( mesh, levels )Splits each face into triangles. This effect is applied levels number of times. The mesh should be triangulated before using this function. In the example images, the input tetrahedron has been scaled (10) and rotated (1.57) for visualization purposes. In these examples, we have used Warren weights.
tetrahedron.obj triSubdiv 1 |
tetrahedron.obj triSubdiv 3 |
cheetah.obj triSubdiv 1 |
cheetah.obj triSubdiv 3 |
tetrahedron.obj triSubdiv 1 |
tetrahedron.obj triSubdiv 3 |
cheetah.obj triSubdiv 1 |
cheetah.obj triSubdiv 3 |
quadSubdiv( mesh, levels )Splits each face into quads. This effect is applied levels number of times.
cube.obj quadSubdiv 1 |
cube.obj quadSubdiv 2 |
cube.obj quadSubdiv 3 |
cube.obj (selected) quadSubdiv 1 |
cube.obj (selected) quadSubdiv 2 |
cube.obj (selected) quadSubdiv 3 |
catmullClark( mesh, levels )Splits each face into quads. This effect is applied levels number of times. Users update the rules as described in the slides. The order in which you should apply the geometrical changes is: modify the positions of the new edge midpoints, modify the positions of the newly created face centroids, modify the positions of the old vertices.
cube.obj catmullClark 1 |
cube.obj catmullClark 2 |
cube.obj catmullClark 3 |
dodacahedron.obj catmullClark 1 |
dodacahedron.objquadSubdiv 2 |
dodacahedron.obj catmullClark 3 |
cube.obj catmullClark 1 |
cube.obj catmullClark 2 |
cube.obj catmullClark 3 |
dodacahedron.obj catmullClark 1 |
dodacahedron.obj catmullClark 2 |
dodacahedron.obj catmullClark 3 |