Group Abstract Group Abstract

Message Boards Message Boards

2
|
5.3K Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Avoid warning while using RegionCentroid?

Posted 9 years ago

Encountered a warning when using RegionCentroid for shapes like the following:

enter image description here

The warning is

(*RegionCentroid::reg: Hexahedron[{{10.,10.,40.},{10.,20.,40.},{10.,15.33,50.},{10.,10.,50.},{30.,10.,40.},{30.,20.,40.},{30.,15.33,50.}, 
{30.,10.,50.}}] is not a correctly specified region.*)  

Note the 15.33 in the 4th and 7th vertex. When using a lower precision number, e.g. using 15.3, a warning is not returned. Is there an option to pass to RegionCentroid that would allow it return a result for the higher precision number (e.g. 15.33 ) ?

Below is the code

g2 = Hexahedron[{{10., 10., 40.}, {10., 20., 40.}, {10., 15.33, 50.}, {10., 10., 50.}, {30., 10., 40.}, {30., 20., 40.}, {30., 15.33, 50.}, {30., 10., 50.}}];
g1 = Hexahedron[{{10., 10., 40.}, {10., 20., 40.}, {10., 15.3, 50.}, {10., 10., 50.}, {30., 10., 40.}, {30., 20., 40.}, {30.,15.3, 50.}, {30., 10., 50.}}];
g0 = Hexahedron[{{10., 10., 40.}, {10., 20., 40.}, {10., 15., 50.}, {10., 10., 50.}, {30., 10., 40.}, {30., 20., 40.}, {30., 15., 50.}, {30., 10., 50.}}];
RegionCentroid[g2]
RegionCentroid[g1]
RegionCentroid[g0]
Graphics3D[{g2}]
Attachments:
POSTED BY: Robert McHugh
2 Replies
POSTED BY: Sander Huisman

Can be track under: [CASE:3828560]. If there is any follow-up I will post it here.

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard