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.
mesh2 = SetProperty[{mesh, {1, All}}, "foo" -> RandomReal[1, MeshCellCount[mesh, 1]]]
. Then I can doPropertyValue[{mesh2, {1, {3,4}}}, "foo"]
to retrieve that property for edges 3 and 4. But if I doPropertyValue[{mesh2, 1}, "foo"]
, I simply getAutomatic
.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$PropertyValue[{mesh2, 1}, MeshCellMeasure]
andPropertyValue[{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$Names["*"]
, the following mesh properties make sense:{MeshCellCentroid, MeshCellHighlight, MeshCellLabel, MeshCellMarker, MeshCellMeasure, MeshCellQuality, MeshCellShapeFunction, MeshCellStyle}
$\endgroup$