Description of the limitation and why it is relevant to address
I use TriangleAssembly to represent shells in finite elements models in VIKTOR. I found this limitating for 3 reasons:
- TriangleAssembly requires a Triangle list. Each Triangle is shown in viewport only on one side, hence I have to double the triangles in code
- TriangleAssembly doesn’t have a visible border. This means that all shell elements (one TriangleAssembly for each), for instance, in a slab appears continuous, and user cannot distinguish one element from another.
- AFAIK, shell extrusion is hard to implement.It would be nice to have a dedicated Geometry object for shells in FE models (already extruded).
Submitter proposed design (optional)
It would be nice to have a dedicated Geometry object for shells in FE models.
OR
Optional parameter for TriangleAssembly border and (possibly) another optional parameter for reversed face visibility.
Current workarounds
None
Hi NextFEM,
Welcome to the VIKTOR Community!
If I understand your question correctly, you would like to show the edges (by means of a line of different color) on your shell for inspection of the mesh.Since you have a shell with a thickness, you need to double the triangles to make an inside and an outside.
When you use the TriangleAssembly you are essentially entrering a bunch of points that are organised in a list of triangles. believe that if you extract the lines from each triangle, and remove duplicate lines (triangles touching).
From there you can easily place the “mesh” over the geometry and have the triangles visible.
Another option would be to look into packages like trimesh and display the geoemtry in a WebView using PyVista. This ofcourse heavily depends on what you aim to do with the geometry afterwards.
Hope this helps!
Happy coding!
Hello,
thanks for your reply.
Add a Line for each edge helps a lot; however extrusion will be a little tricky, I’ll have a look in PyVista, thanks for the hint.
No problem!
Feel free to post the solution you found best here. It may help someone else struggling with the same issue in future.
Hello,
I still didn’t find a solution for shell extrusion, but wanted to share something I discovered, related to the first issue originally described in (1.).
In order to avoid doubling the triangles to make a shell visible from both sides, the Three.js material used in VIKTOR can implement the flag:
side: THREE.DoubleSide // Enable double-sided rendering
This will improve performance, by supplying half the triangles actually coded.