Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HELP creating 3D Delaunay #13

Open
pjetrusp opened this issue Feb 11, 2015 · 2 comments
Open

HELP creating 3D Delaunay #13

pjetrusp opened this issue Feb 11, 2015 · 2 comments

Comments

@pjetrusp
Copy link

I am having troubles understanding how to use 3d Delaunay class in IGEO for processing.
I Understand the part of creating tetrahedrons, but I can not figure it out after that. Also, I would like to ask why is processing running much slower once delaunay class is used?

@sghr
Copy link
Owner

sghr commented Feb 16, 2015

If you are talking about IDelaunay.getTetrahedron(IVec[]), it returns an array of 4 points which represents each tetrahedron-shaped cell as 4 vertices, and you'd build lines, surfaces or meshes out of them if you want. Below is an example. It'd be heavy to run delaunay with many points because of its 5D loop but I don't know why it'd make it slower after finishing it unless you make lots of geometries along it.

import igeo.*;
size(800,600,IG.GL);
IVec[] pts = new IVec[100];
for(int i=0; i<pts.length; i++){ pts[i] = IRand.pt(100); }
IVec[][] vtx = IDelaunay.getTetrahedron(pts);
for(int i=0; i<vtx.length; i++){
IColor c = IRand.clr();
new ISurface(vtx[i][0],vtx[i][1],vtx[i][2]).clr(c);
new ISurface(vtx[i][0],vtx[i][1],vtx[i][3]).clr(c);
new ISurface(vtx[i][0],vtx[i][2],vtx[i][3]).clr(c);
new ISurface(vtx[i][1],vtx[i][2],vtx[i][3]).clr(c);
}

@pjetrusp
Copy link
Author

Thank you for your kind reply.
Could you elaborate on other two components, and their use in creating delaunay triangulation. To be more specific, I am trying to triangulate a surface, which has a number on points on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants