3DCoat
3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
|
EdgeMesher allows to create the polygonal mesh from the set of edges in space. More...
#include <ReconstructMeshFromEdges.h>
Classes | |
struct | vertex |
Initially, mesh consists of edges that connects two un-indexed vertices. This is the un-indexed vertex. More... | |
Public Member Functions | |
void | addEdge (const vertex &n1, const vertex &n2) |
Add non-indexed edge to the mesh. More... | |
ReconstructMeshFromEdges () | |
constructor does not require anything. More... | |
void | MakeMesh (cList< vertex > &outPositions, cList< int > &outFaces, int maxring=12, float AbsoluteWeldRatio=0.00001, float LocalWeldRatio=0.05) |
Generate connective mesh using just edges as the input. More... | |
Protected Member Functions | |
void | AutoWeld (float AbsoluteWeldRatio, float LocalWeldRatio) |
Weld vertices without the pre-defined distance. Weld distance determined locally basing on the locally gathered edges lengths. More... | |
Protected Attributes | |
cList< vertex > | vertices |
the initial list of vertices, weld will decrease the amount More... | |
cList< DWORDS2 > | edges |
the edges list passed by the calls of the addEdge More... | |
EdgeMesher allows to create the polygonal mesh from the set of edges in space.
The usual pattern of usage:
ReconstructMeshFromEdges::ReconstructMeshFromEdges | ( | ) |
constructor does not require anything.
|
protected |
Weld vertices without the pre-defined distance. Weld distance determined locally basing on the locally gathered edges lengths.
AbsoluteWeldRatio | - the weld distance in relation to the average edge length. |
LocalWeldRatio | - the weld distance in relation to the average edges length in the local neighborhood. |
weld fist
collect nearby vertices as candidates for welding
now all nearby vertices welded, edges are referring welded vertices, ready to create the surface
References edges, and vertices.
Referenced by MakeMesh().
void ReconstructMeshFromEdges::MakeMesh | ( | cList< vertex > & | outPositions, |
cList< int > & | outFaces, | ||
int | maxring = 12 , |
||
float | AbsoluteWeldRatio = 0.00001 , |
||
float | LocalWeldRatio = 0.05 |
||
) |
Generate connective mesh using just edges as the input.
outPositions | - the output vertex list will be written there |
outFaces | - the output faces wil be written there, array of int in format: [face1_verts_count, face1_vert1_index, face1_vert2_index ..., face2_verts_count, face2_vert1_index, face2_vert2_index ...,...] |
maxring | - the maximal edges count for the resulting N-gons |
AbsoluteWeldRatio | - the weld distance in relation to the average edge length. |
LocalWeldRatio | - the weld distance in relation to the average edges length in the local neighborhood. |
walk through edges in attempt to complete faces. Faces direction defined by normals sign.
in the first pass we walk only through valence 4 vertices
References AutoWeld(), edges, and vertices.
the edges list passed by the calls of the addEdge
Referenced by addEdge(), AutoWeld(), and MakeMesh().
the initial list of vertices, weld will decrease the amount
Referenced by addEdge(), AutoWeld(), and MakeMesh().