jrl-umi3218 / sch-core

Implementation and computation algorithms for the convex hulls

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data conversion

jmirabel opened this issue · comments

Dear developers,

I would like to be able to support more file format than the one from qhull. Do you always use qhull to convert your input ?

At least, I couldn't find anything thus my second question. Do you have any guidelines on how to build a S_Polyhedron from a set of triangles that defines a convex volume ? I was about to reverse engineer the code but there may be some better hints to do that.
If I manage to do it, are you interested in a PR ?

Looking at the definition of Polyhedron_algorithms::openFromFile, it doesn't look very hard to do.

afaik we have only ever used qhull files or binary files with serialized object (produced from loading qhull files originally)

in fact if you look at Polyhedron_algorithms::openFromFile it's quite straight-forward:

  • add vertexes
  • add triangles with normals
  • updateVertexNeighbors()
  • deleteVertexesWithoutNeighbors()

You can access the Polyhedron_algorithms object of an empty S_Polyhedron to do all this but it could also be nice to have a constructor that simply takes vertexes and triangles. If you work on this it will be welcomed.

Thank you for your answer.

Yes, I realized that and implemented https://github.com/jmirabel/hpp-fcl/blob/devel/src/sch/assimp.cpp. It is based on assimp. I can make it independent in the way you suggest but I believe an optional dependency to assimp would be fine too.

I only have a doubt on whether qhull does some specific ordering, which is implicitly implied by SCH. I checked against simple primitives like boxes and it does not seem to be the case.

I'm personally not a big fan of optional dependency as it increases the complexity of the build process (slightly at the package level and a lot more at the global level) but I'll understand if you want to move on. We can simply link to hpp-fcl for an assimp based example if someone looks for it

I only have a doubt on whether qhull does some specific ordering, which is implicitly implied by SCH. I checked against simple primitives like boxes and it does not seem to be the case.

I am not aware of such things but we have also only ever used qhull files as far as I can remember...

Sorry for the late reply. When I implemented the algorithm I did not rely on any specific order. I like the idea of the constructor with generic vertexes and triangles, but the important information is just the list of vertices and the neighbor of each.

Keep in mind also that the polyhedrons have to be convex, otherwise, you'll end up with a local minimum or a point that does not belong to the object (depending on the initial condition).

Thank you for the reply @mehdi-benallegue