According to the documentation RegionMember
should work with regions that are true for ConstantRegionQ
. However, the function does not work with simple polyhedra.
Consider:
ConstantRegionQ@RandomPolyhedron[5]
(*True*)
RegionMember@RandomPolyhedron[5]
(* {} *)
I am using version 12.0. Is this a bug?
And since RegionMember
is not working, is there a way to test whether a point lies inside or outside a user defined polyhedra?
An example for a user defined polyhedron (here i have triangulated the individual faces because the vertices of a face does not have to be coplanar):
data = {{{0.9000000000, 9.803074361, -0.2788974201}, {0.6750000000,
10.19278579, -0.2270388454}, {0.4500000000,
9.803074361, -0.2935999100}}, {{0.6750000000,
10.19278579, -0.2270388454}, {0.2250000000,
10.19278579, -0.2379129589}, {0.4500000000,
9.803074361, -0.2935999100}}, {{0.2250000000,
10.19278579, -0.2379129589}, {0,
9.803074361, -0.3066046725}, {0.4500000000,
9.803074361, -0.2935999100}}, {{0,
9.803074361, -0.3066046725}, {0.2250000000,
9.413362929, -0.3638887807}, {0.4500000000,
9.803074361, -0.2935999100}}, {{0.2250000000,
9.413362929, -0.3638887807}, {0.6750000000,
9.413362929, -0.3472567826}, {0.4500000000,
9.803074361, -0.2935999100}}, {{0.6750000000,
9.413362929, -0.3472567826}, {0.9000000000,
9.803074361, -0.2788974201}, {0.4500000000,
9.803074361, -0.2935999100}}, {{0.9000000000,
9.803074361, -1.278897420}, {0.6750000000,
10.19278579, -1.227038845}, {0.4500000000,
9.803074361, -1.293599910}}, {{0.6750000000,
10.19278579, -1.227038845}, {0.2250000000,
10.19278579, -1.237912959}, {0.4500000000,
9.803074361, -1.293599910}}, {{0.2250000000,
10.19278579, -1.237912959}, {0,
9.803074361, -1.306604673}, {0.4500000000,
9.803074361, -1.293599910}}, {{0,
9.803074361, -1.306604673}, {0.2250000000,
9.413362929, -1.363888781}, {0.4500000000,
9.803074361, -1.293599910}}, {{0.2250000000,
9.413362929, -1.363888781}, {0.6750000000,
9.413362929, -1.347256783}, {0.4500000000,
9.803074361, -1.293599910}}, {{0.6750000000,
9.413362929, -1.347256783}, {0.9000000000,
9.803074361, -1.278897420}, {0.4500000000,
9.803074361, -1.293599910}}, {{0.9000000000,
9.803074361, -0.2788974201}, {0.9000000000,
9.803074361, -1.278897420}, {0.7875000000,
9.997930077, -0.7529681327}}, {{0.9000000000,
9.803074361, -1.278897420}, {0.6750000000,
10.19278579, -1.227038845}, {0.7875000000,
9.997930077, -0.7529681327}}, {{0.6750000000,
10.19278579, -1.227038845}, {0.6750000000,
10.19278579, -0.2270388454}, {0.7875000000,
9.997930077, -0.7529681327}}, {{0.6750000000,
10.19278579, -0.2270388454}, {0.9000000000,
9.803074361, -0.2788974201}, {0.7875000000,
9.997930077, -0.7529681327}}, {{0.6750000000,
10.19278579, -0.2270388454}, {0.6750000000,
10.19278579, -1.227038845}, {0.4500000000,
10.19278579, -0.7324759022}}, {{0.6750000000,
10.19278579, -1.227038845}, {0.2250000000,
10.19278579, -1.237912959}, {0.4500000000,
10.19278579, -0.7324759022}}, {{0.2250000000,
10.19278579, -1.237912959}, {0.2250000000,
10.19278579, -0.2379129589}, {0.4500000000,
10.19278579, -0.7324759022}}, {{0.2250000000,
10.19278579, -0.2379129589}, {0.6750000000,
10.19278579, -0.2270388454}, {0.4500000000,
10.19278579, -0.7324759022}}, {{0.2250000000,
10.19278579, -0.2379129589}, {0.2250000000,
10.19278579, -1.237912959}, {0.1125000000,
9.997930077, -0.7722588157}}, {{0.2250000000,
10.19278579, -1.237912959}, {0,
9.803074361, -1.306604673}, {0.1125000000,
9.997930077, -0.7722588157}}, {{0, 9.803074361, -1.306604673}, {0,
9.803074361, -0.3066046725}, {0.1125000000,
9.997930077, -0.7722588157}}, {{0,
9.803074361, -0.3066046725}, {0.2250000000,
10.19278579, -0.2379129589}, {0.1125000000,
9.997930077, -0.7722588157}}, {{0, 9.803074361, -0.3066046725}, {0,
9.803074361, -1.306604673}, {0.1125000000,
9.608218645, -0.8352467266}}, {{0,
9.803074361, -1.306604673}, {0.2250000000,
9.413362929, -1.363888781}, {0.1125000000,
9.608218645, -0.8352467266}}, {{0.2250000000,
9.413362929, -1.363888781}, {0.2250000000,
9.413362929, -0.3638887807}, {0.1125000000,
9.608218645, -0.8352467266}}, {{0.2250000000,
9.413362929, -0.3638887807}, {0,
9.803074361, -0.3066046725}, {0.1125000000,
9.608218645, -0.8352467266}}, {{0.2250000000,
9.413362929, -0.3638887807}, {0.2250000000,
9.413362929, -1.363888781}, {0.4500000000,
9.413362929, -0.8555727816}}, {{0.2250000000,
9.413362929, -1.363888781}, {0.6750000000,
9.413362929, -1.347256783}, {0.4500000000,
9.413362929, -0.8555727816}}, {{0.6750000000,
9.413362929, -1.347256783}, {0.6750000000,
9.413362929, -0.3472567826}, {0.4500000000,
9.413362929, -0.8555727816}}, {{0.6750000000,
9.413362929, -0.3472567826}, {0.2250000000,
9.413362929, -0.3638887807}, {0.4500000000,
9.413362929, -0.8555727816}}, {{0.6750000000,
9.413362929, -0.3472567826}, {0.6750000000,
9.413362929, -1.347256783}, {0.7875000000,
9.608218645, -0.8130771013}}, {{0.6750000000,
9.413362929, -1.347256783}, {0.9000000000,
9.803074361, -1.278897420}, {0.7875000000,
9.608218645, -0.8130771013}}, {{0.9000000000,
9.803074361, -1.278897420}, {0.9000000000,
9.803074361, -0.2788974201}, {0.7875000000,
9.608218645, -0.8130771013}}, {{0.9000000000,
9.803074361, -0.2788974201}, {0.6750000000,
9.413362929, -0.3472567826}, {0.7875000000,
9.608218645, -0.8130771013}}};
Polyhedron@data