As the title describes, specifically, simple code below
ConvexHullMesh[RandomReal[1, {10, 2}]]["Centroid"]
returns an error in V. 12.2, but it worked in V. 12.1.1 as far as I remember
BoundaryMeshRegion::unsupported
Is it a bug introduced by the new version? Or is there another way to get the centroid?
Update
I just find it that not only "Centroid"
, but also extractions of other "Properites"
fail; except for "BoundaryPolygons"
.
Update 2
To make this problem more understandable, let me make some modifications to the code.
mesh = ConvexHullMesh[RandomReal[1, {10, 2}]];
mesh["Properties"]
This would return a long List
of strings as the properties mesh
has. And then
mesh[str]
would return something, at least without any error message, where str
is arbitrary one of the elements of the aforementioned property List
; very much like OOP (objective-oriented programming). And that is what would happen in former versions like V. 12.1.1.
However now in V. 12.2, mesh["Centroid"]
fails, even though "Centroid"
can be found in that property List
of mesh
.
RegionCentroid[ConvexHullMesh[RandomReal[1, {10, 2}]]]
? $\endgroup$BoundaryMeshRegion
in the new version, isn't it? $\endgroup$MeshPrimitives@ConvexHullMesh[RandomReal[1, {10, 2}]]
? What is the"Properites"
? $\endgroup$