MeshIO.jl icon indicating copy to clipboard operation
MeshIO.jl copied to clipboard

This package needs to work with an interface, not with types

Open plut opened this issue 4 years ago • 3 comments

Right now this package can only work with the Mesh type as defined in GeometryBasics. Which, given how poorly this type is documented, makes it quite unuseable.

Instead of forcing the user to use these classes, the Julian way is to work with interfaces, not with types. As an example, one could look at this wonderful little package called AbstractTrees.jl: this manages to offer a number of useful algorithms for general tree types without forcing the user to use any explicit type (and not even forcing them to derive from a given abstract type).

This would be even more adapted to this package given that the interface used is really simple:

  • extract vertices and triangles from a mesh,
  • compute the normal for each face of the mesh (this can have a default method),
  • build a mesh from vertices and triangles.

plut avatar Nov 17 '21 19:11 plut

If you have a PR with the needed changes, I'm happy to review it ;)

SimonDanisch avatar Nov 17 '21 20:11 SimonDanisch

I am indeed trying to write a proof of concept, although 1) it will start by implementing only a small subset and 2) don't expect it too soon...

plut avatar Nov 17 '21 23:11 plut

This should be a bit easier going now with Pkg extensions in 1.9.

sjkelly avatar Jun 26 '24 17:06 sjkelly