1
$\begingroup$

For a regular Polygon in 3D I would expect some Line regions for the boundary

poly = Polygon[{{1, 0, 0}, {1, 1, 1}, {0, 0, 1}}];
SimplePolygonQ[poly] (* True*)


boundary=RegionBoundary[poly]  

but I get a Polygon-object

boundary = Polygon[{{1, 0, 0}, {1, 1, 1}, {0, 0, 1}}, {1, 2, 3}]

instead.

Expecting a one dimensional region RegionMeasure evaluates to my surprise

RegionMeasure[boundary,1] (* \[Infinity]*)
RegionMeasure[boundary,2] (*  Sqrt[3]/2 *)

My questions

Why RegionMeasure[boundary,1] doesn't give the correct length of the boundary?

Shouldn't RegionMeasure[boundary,2] be undefined?

Is there a simple way to get Line-objects as boundary

Thanks

$\endgroup$
3
  • $\begingroup$ Region /@ {#, RegionBoundary[#]} &@Disk[] works as one would expect. $\endgroup$
    – Syed
    Nov 10, 2023 at 17:24
  • $\begingroup$ Same with Polygon[{{0, 0}, {1, 0}, {0, 1}}] // RegionBoundary $\endgroup$ Nov 10, 2023 at 17:28
  • $\begingroup$ Perimeter@boundary works. Maybe it is looking for a 3D region with some volume to it. RegionDimension@poly being 2 might have something to do with it. $\endgroup$
    – Syed
    Nov 10, 2023 at 17:50

1 Answer 1

1
$\begingroup$

I found that only RegionPlot3D can recognize its boundary.

poly = Polygon[{{1, 0, 0}, {1, 1, 1}, {0, 0, 1}}];
plot = RegionPlot3D[poly, PlotStyle -> None, 
  BoundaryStyle -> {Thick, Red}]
plot // DiscretizeGraphics // RegionMeasure

enter image description here

4.24264

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.