9

I am trying to write a code to estimate geometric properties (i.e. Mean Curvature, Gaussian Curvature, Principle Curvatures) on a triangulated mesh.

I would like to save the calculated data as a set of "Properties" to a given vertex within a mesh, which would allow for easier data storage and visualisation afterwards.

Something like this would be great:

SetProperty[{mesh,vertex1},"MeanCurvature"-> H ]

SetProperty[{mesh,vertex1},"GaussianCurvature"-> G ]

It seems like in graphs this is possible (see here for example), however I am not too sure how to set properties for mesh objects. Any help would be greatly appreciated.

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
Dunlop
  • 4,023
  • 5
  • 26
  • 41
  • It is possible to do this, but it is not at all clear to me what the correct way to do it is. For example, mesh2 = SetProperty[{mesh, {1, All}}, "foo" -> RandomReal[1, MeshCellCount[mesh, 1]]]. Then I can do PropertyValue[{mesh2, {1, {3,4}}}, "foo"] to retrieve that property for edges 3 and 4. But if I do PropertyValue[{mesh2, 1}, "foo"], I simply get Automatic. PropertyValue[{mesh2, {1, All}}, "foo"] does work. One might think that this is related to whether the property is associated with "edges in general", or with individual edges. ... – Szabolcs Nov 21 '17 at 17:06
  • ... but that is inconsistent with how both PropertyValue[{mesh2, 1}, MeshCellMeasure] and PropertyValue[{mesh2, {1,All}}, MeshCellMeasure] return the same thing. I think a clear description of how mesh properties work is very much needed, in conjunction with a complete list of built-in properties and an explanation of how and when these behave differently from user-defined properties. – Szabolcs Nov 21 '17 at 17:08
  • @Szabolcs Among all Names["*"], the following mesh properties make sense: {MeshCellCentroid, MeshCellHighlight, MeshCellLabel, MeshCellMarker, MeshCellMeasure, MeshCellQuality, MeshCellShapeFunction, MeshCellStyle} – ybeltukov Nov 26 '17 at 09:54

0 Answers0