yes when you add the point you can add an id to associate with a subpart. How are you initiliazing the mesh. I suppose you are creating it in this function
- Code: Select all
NewtonMesh * disjointPieces = triMeshToNewtonMesh(triMesh);
if you show me the implementation I can show you how to make it posible to do what you want,
then after that you can also do stuf like make the mesh a perfect tringular mesh, because then triangulation feature produce the best mesh by the delanay critiria,
that is minumizes slivers, reduces joint, etc
for example if you use these function to crate the mesh
- Code: Select all
void NewtonMeshBeginFace(const NewtonMesh* const mesh);
void NewtonMeshAddFace(const NewtonMesh* const mesh, int vertexCount, const dFloat* const vertex, int strideInBytes, int materialIndex);
void NewtonMeshEndFace(const NewtonMesh* const mesh);
void NewtonMeshBuildFromVertexListIndexList(const NewtonMesh* const mesh,
int faceCount, const int* const faceIndexCount, const int* const faceMaterialIndex,
const dFloat* const vertex, int vertexStrideInBytes, const int* const vertexIndex,
const dFloat* const normal, int normalStrideInBytes, const int* const normalIndex,
const dFloat* const uv0, int uv0StrideInBytes, const int* const uv0Index,
const dFloat* const uv1, int uv1StrideInBytes, const int* const uv1Index);
then you pass the id as the fourth paratmeter in the vertex, for example say you are adding a cube you start with and id counter
int id = 0
then for each polygon that form the first mash segment you asign id as the
verte[i] = (x0, y0, z0, id)
verte[i] = (x1, y1, z1, id)
...
the you increment ID and for each point of the next segmnet you asign this new id, and so on.
if you do not do that the the manifold will get confused with complanar faces that share more than two edges and will try to do the best it could by separating then automatically.
I am glad you are usin the mesh, that tool also has poweful feature like the voronoi decompolsition, you will see that is faste tha any othe version out there by several order of magnitud.
It also has bollean, liek diffrenct, or, and oteh stuff, I still ahe to do some wotk of that but for teh most part they work
I never continues working on then because thre was no one testing it, but if some one is using it I can continues.
some of the algorithm there are very very poerweful rubust, and fast all in one package.
as it you can actually make voronoi pieces from convex pieces of almost any density practically in real time.
it also provide a way to apply materals ans tow UV channels to the segment as they are generated.
This can be use to simulate simple fracturing, and I am working on fix the sumerical round of but on the bollean so that I can apply fracture to more concave pieces.
but for simple convex is can be use and is faste that any tool out there, it is also more acurate since it alway mmake pefect voronoi, not vertex preporssesing and no round errros instabilities.