0

I have an stl file which is composed of contiguous cubes, like this:

http://www.mathworks.com.au/matlabcentral/fileexchange/screenshots/6499/original.jpg

I need to remove all the shared faces of the cubes, so the structure become one continuous solid.

Note that I cannot just delete ALL the internal structure. The object is hollow and its internal structure must be maintained. I just want to delete the shared faces of the adjacent cubes.

Is there a way to do that in MeshLab? Thanks,

Marc Mutz - mmutz
  • 24,485
  • 12
  • 80
  • 90
Chris Parry
  • 2,937
  • 7
  • 30
  • 71

1 Answers1

0

I'm trying to do something similar, so here there is how I have done it:

get the boundary voxels and convert it to points:

surface= Volume- imerode(Volume, true(3));
indx=find(surface);
[x,y,z]=ind2sub(size(Volume),indx);
surface=horzcat(x,y,z);

Save it as a ply file

function save_ply(filename,xyz)
    fid=fopen(strcat(filename,'.ply'),'wt');
    fprintf(fid,'ply\n');
    fprintf(fid,'format ascii 1.0\n');
    fprintf(fid,'element vertex %u\n',size(xyz,2));
    fprintf(fid,'property float x\n');
    fprintf(fid,'property float y\n');
    fprintf(fid,'property float z\n');
    fprintf(fid,'end_header\n');

    for ii=1:size(xyz,2)
       fprintf(fid,'%4f %4f %4f\n',xyz(1,ii),xyz(2,ii),xyz(3,ii)); 
    end

end

And then you can load the point cloud to Meshlab. You can then create STL files with the tens of algorithms that it has inside, however im in that point now, triyng to choose the best. for non convex surfaces as yours.

Ander Biguri
  • 35,140
  • 11
  • 74
  • 120