Poly_CoherentTriangulation

Hello.
Does somebody knows about Poly_CoherentTriangulation Class added at OCC 6.3
I can add nodes by AddNode member but I can't add triangles by AddTriangle.
like this

Handle(Poly_CoherentTriangulation) myTri=new Poly_CoherentTriangulation();

for(int i=0;i gp_XYZ pt=gp_XYZ(x_arr[i],y_arr[i],z_arr[i]);
myTri->SetNode(pt,-1);
}

for(int i=0;i poly=myTri->AddTriangle(idx1[i],idx2[i],idx3[i]);
}

which x_arr,y_arr,z_arr means vertex array.and idx1,idx2,idx3 means index of vertex of each polygon.

all indexs are greater than 0 and smaller than npts .
First call of AddTriangle raise exception.
I confirm MaxNode() is same to npts. and NNodes() is 0.

Does anyone knows why I can't add triangles.

Thank you in advance.

totake's picture

I can fix this problem by myself like this.
Handle(NCollection_IncAllocator) alloc=new NCollection_IncAllocator();
Handle(Poly_CoherentTriangulation) myTri=new Poly_CoherentTriangulation(alloc);

but I don't understand what is NCollection_IncAllocator.

totake's picture

Does somebody knows about how to use Poly_CoherentTriangulation to mesh decimation,which introduced OCC 6.3 release notes.

Thank you in advance.