zarquon42b / Morpho

R-package providing a toolset for (3D-based) Geometric Morphometrics
51 stars 16 forks source link

The cutMeshPlane function only works on triangular meshes. #25

Closed dmurdoch closed 3 years ago

dmurdoch commented 3 years ago

This gives an informative error. See https://stackoverflow.com/q/68395692/2554330 for motivation.

zarquon42b commented 3 years ago

Hi, thanks for the PR. The alternative would be to convert the mesh to a triangular mesh using Morpho::quad2trimesh and issue a warning. Would you deem that useful? Edit: or extent the usecase of rmVertex to quad meshes.

dmurdoch commented 3 years ago

Yes, that would be a good change: in fact, I'm in the middle of exporting as.tmesh3d from rgl, as I didn't notice quad2trimesh. Differences between them:

I think I'll still go ahead with as.tmesh3d since it's a pretty simple function, but it also makes sense for you to make use of quad2trimesh in rmVertex. I'd encourage you to think about what to do with segments and points.

zarquon42b commented 3 years ago

Hi, I think I will make rmVertex compatible with tmesh3d. There is a lot of legacy code in Morpho which I keep to avoid inconsistencies in research code. I'll have a look and if as.tmesh3d does the same I might just make quad2trimesh a wrapper for this. I'll also look into the segments and points in rgl. I have neglected this as my personal research only deals with triangular meshes, so there is some coder bias ;)

zarquon42b commented 3 years ago

OK, rmVertex and therefore cutMeshPlane now work on tmesh3d. See 99e570892f51314cee523e50adc3b28e669036fb