alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 169 forks source link

re-triangulate mesh #36

Open ttsesm opened 7 years ago

ttsesm commented 7 years ago

Hi @alecjacobson

Thanks for the great work. Can you help me modify the triangulation of my mesh if possible. I am loading a CAD file as an .stl by getting the F, faces and V, vertices of it

[V,F] = load_mesh('lab.STL'); However, this mesh has a really strange pre-triangulation format as you can see in the image below:

image

My intention is if possible to remove this triangulation and apply another one. Do you know if that is possible?

Thanks.

Best regards, Theo

oqilipo commented 7 years ago

What's wrong with it? How should it look? What do you want to do with the mesh? Best regards.

ttsesm commented 7 years ago

Hi @oqilipo

Thank you for the reply. If you notice some faces in the corners of the mesh are quite bad triangulated (also I have noticed that the normals of the roof faces are pointing outwards, but that's another issue). You can check it in the attached files. I have the one with the mesh as is shown in the initial post and another one more complex populated with some furniture.

Regarding about what I want to do with the meshes, my first goal is to compute the form/view factors of the geometry and as a second goal to compute the radiosity values after I sub-divide the mesh to more patches.

meshes.zip

ttsesm commented 7 years ago

In general my idea was to merge back the coplanar faces so that I create only quads or a big multi-vertices planes for the ceiling and the floor and then apply a uniform triangulation so that to create the patches. However, I cannot make it work. I tried also to combine it with the geom3d library which has the "mergeCoplanarFaces(vertices, faces)" function but the best I could achieve was the following:

image

image

as you can see there are still some triangles left.