GLVisualize - primitives


which primitives are there in GLVisualize?
I found spheres and lines, but is there also a cylinder primitive?
I would like to port some code from cgkit (Python) to Julia. They have
a lot of primitives:

Any comments welcome.


1 Like

Hi Uwe,
these are the currently supported primitives:

Them being support only means, that they have a type representing their structure, and that functions are defined on them to build up a triangle mesh.
In GeometryTypes, that means for them to be decomposable. I should have this in the developer docs.
Let me take the chance to add this:


1 Like

Thanks for the links!

I did not find any cylinder primitive. What would be the best way to implement a shaded cylinder?


Yes, it’s not implemented yet.
You’ll need to add a Cylinder type and implement decompose for points and faces as described. PRs for GeometryTypes would be much appreciated :slight_smile:

Then this should work:


You will see that it will look a bit strange, since the normals are generated in a silly way. So you should also implement decompose for the Normal type.

As a stop gap solution, you could just find a cylinder mesh in form of e.g. an .obj, load it with FileIO and just scale it to your desired size :wink:

I opened an issue and suggest to continue the discussion there: