# Confused about the behavior of the properties of Regions

Actually we can get some information in here.But I'm confuse this phenomenon still:

test = ConvexHullMesh[RandomReal[1, {7, 2}]]


test["EdgeLengths"]


{0.192337,0.4887,0.176702,0.185319,0.564806,0.428493,0.805059}

But the same result will not appear this case,

region = BoundaryMesh[DiscretizeRegion[SSSTriangle[3, 4, 5]]]


region /@ {"AdjacencyMatrix", "EdgeLengths"}


I think if the properties of "EdgeLengths" can work normally,it will help a lot to Labeling triangle edges in Mathematica 10.

Head /@ {test, region}


{BoundaryMeshRegion, BoundaryMeshRegion}

I think what you are using is an undocumented feature in these region objects, so I wouldn't expect it to work properly.

You can see some of the properties by using:

region["Properties"]


The list is quite long so I won't be including it here. Now, both of your regions will show "EdgeLengths" as one of the properties, so you clearly see that this undocumented feature is not completely fleshed-out. What's documented though, is the PropertyValue approach (well, partly at least), so let's use it:

PropertyValue[{test, 1}, MeshCellMeasure]
(* {0.261146, 0.694517, 0.406227, 0.339956, 0.576842} *)

PropertyValue[{region, 1}, MeshCellMeasure] (* This gives the length of the sides *)
(* {5., 3., 4.} *)


The 1 means we want the 1-D measure, which is the length of the edges. If you want the area, use 2, etc. One should be able to use PropertyList to obtain possible properties of a region, but this doesn't always work. Even in the "possible issues" section of the documentation for PropertyValue (which only shows example of its use with Graphs), it says:

PropertyValue may return \$Failed even when a property value exists:

Then shows an example where this happens. Clearly, even this approach is a work in progress.

Update

On the other hand if you still want to access the undocumented "Properties" of the regions, you can still use the also undocumented approach by calling GraphicsRegionToMeshObject on the mesh objects e,g.

treg = GraphicsRegionToMeshObject[region];


Then you can now call "EdgeLengths" and other properties:

treg /@ {"AdjacencyMatrix", "EdgeLengths"}

(* {{{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}, {5., 3., 4.}} *)

• Grateful for your patient explanation.:) – yode Apr 17 '16 at 15:55
• @yode. You're welcome. We're all confused about some of the region functions. – RunnyKine Apr 17 '16 at 15:59
• I just guess such as GraphicsRegionToMeshObject maybe give a help,but I don't sure. I remain it open for some time. – yode Apr 22 '16 at 7:19