I've been looking for SubDMesh documentation, but there's none. Kean's and Balaji's examples are excellent but i want to know how the parameters are sequenced:
sdm.SetSubDMesh(vertarray, facearray, 0);
Are the vertarray or facearray supposed to be arranged or sorted?
Or can they be random?
My problem is that, after closing the SubDMesh, i just can't make it WaterTight.
And so the conversion to solid, sdm.ConvertToSolid(false, false); always fails.
In short, what is the requirement of SubDMesh to be .WaterTight?
I don't understand what you mean by "Are the vertarray or facearray supposed to be arranged or sorted? Or can they be random?"
The way you have to provide arguments is logically described in the API Help Files for that method:
const AcGePoint3dArray& vertexArray
Input an array of vertex points.
const AcArray<Adesk::Int32>& faceArray
Input an array of 32-bit integers describing the face definition based on the input vertex array.
Initial smoothness level.
The faceArray defines an array of faces, and each face is defined by a set of numbers. The first number specifies the number of vertices in the face, the following numbers are the indices of the vertices making up the face.
See AcGiGeometry::shell() for more details on using an array of faces to define mesh faces. Note that Mesh does not support a hole definition like AcGiGeometry::shell().
This explanation seems rather explicit to me.
I hope it helps,
Thanks for the explanation.
I think i used the syntax this way, but the problem is that, the created shell is not "WaterTight" always.
I'm sure i might have been missing something here.
Here's the objective:
From a selection set of 3dfaces (triangles), use the vertices as vertexarray (at a projected elevation), and number of these 3dfaces as facearray, plus,
and to close the shell, i used the vertices of a 3dpolyline boundary to create a vertical wall composed of 3dfaces (rectangular), these are added to vertexarray and facearray(int n) as well, then lastly, the closing horizontal plane using the vertices of the boundary, but havin a flat elevation. The last closing plane's vertices are added to the vertexarray and also as n=1 in the facearray.
No errors, all is good, i can view it in 3d orbit.
The issue now is to convert this to a 3dsolid using the function SubDMesh.ConvertToSolid.
Somehow the subdmesh shell created is not "WaterTight".
Any suggestions ?