9
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ 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. ... $\endgroup$ – Szabolcs Nov 21 '17 at 17:06
  • $\begingroup$ ... 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. $\endgroup$ – Szabolcs Nov 21 '17 at 17:08
  • $\begingroup$ @Szabolcs Among all Names["*"], the following mesh properties make sense: {MeshCellCentroid, MeshCellHighlight, MeshCellLabel, MeshCellMarker, MeshCellMeasure, MeshCellQuality, MeshCellShapeFunction, MeshCellStyle} $\endgroup$ – ybeltukov Nov 26 '17 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.