Mayaにメッシュを破断することは難しいです。このツールでMayaにメッシュを破断することは簡単です。Fracturing meshes in Maya is difficult. With this tool, fracturing meshes in Maya is easy.
Hadan is a fracturing tool for Autodesk Maya. Many major 3D packages, such as Luxology Modo, have either native or well-known plug-ins for fracturing geometry. Unfortunately, Maya does not (at the time of writing this project) have such tools by default. Hadan aims to solve this by introducing multiple fracture types with customizable options. For more details on the inner workings of Hadan, please refer to my accompanying report.
Hadan is not being developed. It is a was developed as a University project in a couple of months and should be treated as such.
Development on Hadan has now ceased, as it was created for a University module that has long since finished. The YouTube video below shows features of the tool.
Hadan is implemented as a Maya command with flags to configure its behavior. A GUI is provided for ease of use.
Flag | Type | Description |
---|---|---|
meshName/mn | string | Name of the mesh to fracture |
fractureType/ft | string | Fracture operation: uniform, cluster, or bezier |
slicerType/st | string | Slicer algorithm: gte or csgjs |
uniformCount/uc | integer | Number of random points to generate |
primaryCount/pc | integer | Number of random primary points to generate; used in cluster mode |
secondaryCount/sc | integer | Number of random secondary points to generate around primary points; used in cluster mode |
separationDistance/sd | double | Distance to shrink chunks' vertices along their normals |
sampleCount/sam | integer | Number of samples for bezier curves |
fluxPercent/flp | double | Fluctuation percentage based on the size of the object's bounding box |
randomSeed/rs | integer | Random seed for reproducible fractures |
point/pnt | double | Custom fracture location; three doubles (x, y, z) |
smoothingAngle/sa | double | Angle used for smoothing of chunks' normals |
minBezierDist/mbd | double | Minimum distance between randomly generated bezier endpoints as a percentage of the object's bounding box |
multithreaded/mt | boolean | Whether to enable multi-threading or not |
When fractureType/ft is set to uniform, uniformCount/uc randomly generated points are created within the object's bounding box.
When fractureType/ft is set to cluster, primaryCount/pc randomly generated points are spawned within the object's bounding box, and then secondaryCount/sc randomly generated points are added within a distance of fluxPercent/flp of each primary point. uniformCount/uc randomly generated points are also added for variation.
When fractureType/ft is set to bezier, one of three cases can occur. Each case is chosen based on the number of user-provided point/pnt. If none are provided, all four points of the bezier are randomly generated; the first and last are on the surface, and will attempt to space themselves at least minBezierDist/mbd apart (unless a maximum iteration count is hit, of which the last attempt is accepted regardless of the distance), and the two intermediate points are randomly generated within the bounding box. If two points are provided, they are assumed to be the beginning and end points respectively, and the two intermediate points are generated as before. If all four points are provided, the curve is assumed to be complete and in order, and no random generation will take place. The bezier curve is sampled sampleCount/sam times along the curve at uniform intervals. The sampled points are moved [-fluxPercent/flp, fluxPercent/flp] away from the curve for variation. uniformCount/uc uniform points are also added for variation.
The slicing algorithm used can be chosen using the slicerType/st flag. Choosing gte will use a cutting algorithm derived from Geometric Tools' ClipMesh. This algorithm is very efficient, but will not work for more complex geometry, especially concave. Electing to use csgjs will instead perform boolean intersections of each cell with the source geometry using a C++ port of the csg.js library. This option works better with complex geometry, but comes with its own drawbacks, especially in performance. Having a selection of slicing algorithms is important, as the source geometry may not always be suited for a specific algorithm.
Multi-threading is supported and can be toggled with the multithreaded/mt flag. It is enabled by default.
Each chunk has its normals generated and smoothed based on a smoothing angle. If an edge has only one face (which should seldom occur), then its edge will be hardened. If the angle between the shared faces of the edge in question is less than smoothingAngle/sa, it will be smoothed, or otherwise hardened.
Hadan's GUI is separated into three parts: Settings, Positions, and Advanced. The Settings tab allows for configuration of most of the flags above. The Positions tab is for managing custom user points. The Advanced tab is for extra configuration options. The GUI simply maps its elements to a flag in the command, and generates a command upon execution. The generated command can be seen in the Advanced tab after fracturing takes place.
Hadan is implemented as a Maya command. This can be run from both MEL and Python. Upon execution, Hadan goes through three major phases. The first stage, Generate Points, stage is responsible for generating source points used to feed stage 2. The second stage, Generate Cells, has to create slicing cells that will later be used to cut the geometry. The third stage, Cut Geometry, is where the source geometry is actually decimated based on the generated cells.
For more information, please see my accompanying report.
- Voro++ - computation of Voronoi diagrams
- GeometricTools - large library ranging from physics to graphics
- ccmath - mathematics library