RegionMember does not work with RandomPolyhedron or Polyhedron objectHow can I decide whether a closed surface is intersected by a triangle?Region Intersection for MeshRegion objects embedded in 3DThrough does not work with SubtractFitting does not workHandling Self-Intersecting RegionsDetermine whether points lie within a cowVolumes and moments of inertia of meshes in 3DParametricPlot3D coloring based on whether function located inside/outside of another parametric functionBooleanRegion with .stl files does not workInconsistent mesh generation from BoundaryDiscretizeRegion and ToBoundaryMesh at creases
Why is Google approaching my VPS machine?
How to not confuse readers with simultaneous events?
Detecting existence of a class member
Operation Unzalgo
What is this green alien supposed to be on the American covers of the "Hitchhiker's Guide to the Galaxy"?
Last-minute canceled work-trip mean I'll lose thousands of dollars on planned vacation
"This used to be my phone number"
Proof that every field is perfect???
How did Jayne know when to shoot?
How did J. J. Thomson establish the particle nature of the electron?
When designing an adventure, how can I ensure a continuous player experience in a setting that's likely to favor TPKs?
Why doesn't Venus have a magnetic field? How does the speed of rotation affect the magnetic field of a planet?
Should I have shared a document with a former employee?
How to belay quickly ascending top-rope climbers?
Should I have one hand on the throttle during engine ignition?
Wait or be waiting?
What is a Romeo Word™?
Random piece of plastic
Do Australia and New Zealand have a travel ban on Somalis (like Wikipedia says)?
Will the internet speed decrease on second router if there are multiple devices connected to primary router?
I have found a mistake on someone's code published online: what is the protocol?
Why do space operations use "nominal" to mean "working correctly"?
Apex Legends stuck at 60 FPS (G-Sync 144hz monitor)
How do you send money when you're not sure it's not a scam?
RegionMember does not work with RandomPolyhedron or Polyhedron object
How can I decide whether a closed surface is intersected by a triangle?Region Intersection for MeshRegion objects embedded in 3DThrough does not work with SubtractFitting does not workHandling Self-Intersecting RegionsDetermine whether points lie within a cowVolumes and moments of inertia of meshes in 3DParametricPlot3D coloring based on whether function located inside/outside of another parametric functionBooleanRegion with .stl files does not workInconsistent mesh generation from BoundaryDiscretizeRegion and ToBoundaryMesh at creases
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
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
functions computational-geometry mesh
$endgroup$
add a comment |
$begingroup$
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
functions computational-geometry mesh
$endgroup$
add a comment |
$begingroup$
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
functions computational-geometry mesh
$endgroup$
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
functions computational-geometry mesh
functions computational-geometry mesh
edited Jul 10 at 6:09
Ali Hashmi
asked Jul 10 at 3:24
Ali HashmiAli Hashmi
5,9604 gold badges15 silver badges34 bronze badges
5,9604 gold badges15 silver badges34 bronze badges
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
You could also try:
RegionMember[
BoundaryDiscretizeGraphics@CanonicalizePolyhedron[Polyhedron[data]]]
$endgroup$
add a comment |
$begingroup$
Polyhedrons are a very new data type and it is not unusual that not all possible functions have been overloaded for them.
You can extract the vertex coordinates of a Polyhedron R with R[[1]]; combined with ConvexHullMesh, this allows you to convert the Polyhedron to a MeshRegion and to apply `RandomPoint:
R = RandomPolyhedron[5];
S = ConvexHullMesh[R[[1]]];
RandomMember[S]
With the user-defined "polyhedron", you can do, e.g., this:
R = BoundaryDiscretizeGraphics@Graphics3D[
Polygon[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]
];
RandomMember[R]
PS.: I have no clue at all what this new datatype is supposed to ship what is not already provided MeshRegions.
$endgroup$
$begingroup$
thanks. what about the case if my polyhedron have faces wherein the vertices are not coplanar. What I have done is that I have triangulated those faces and can display a polyhedron successfully. Do you think the approach that you have mentioned above will work for such a polyhedron?
$endgroup$
– Ali Hashmi
Jul 10 at 4:32
$begingroup$
kindly check the example that I posted in the question
$endgroup$
– Ali Hashmi
Jul 10 at 4:43
$begingroup$
thanks. I was working on a solution myself as well. We both reached the same answer :) I will accept your answer however
$endgroup$
– Ali Hashmi
Jul 10 at 5:47
add a comment |
$begingroup$
here is a little fix that should work for both cases:
datamodified = data /. 0.4500000000, 9.803074361, -0.2935999100 -> 0.4500000000,
9.803074361, -0.3935999100 (* this will make vertices of one face non-coplanar *)
poly = Polyhedron[datamodified];
points = DeleteDuplicates@Flatten[poly[[1]], 1];
assoc = AssociationThread[points -> Range[Length@points]];
order = Map[Lookup[assoc, #] &, poly[[1]]];
reg = DiscretizeGraphics@Region@Polyhedron[points, order];

RegionMember@reg

$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f201832%2fregionmember-does-not-work-with-randompolyhedron-or-polyhedron-object%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You could also try:
RegionMember[
BoundaryDiscretizeGraphics@CanonicalizePolyhedron[Polyhedron[data]]]
$endgroup$
add a comment |
$begingroup$
You could also try:
RegionMember[
BoundaryDiscretizeGraphics@CanonicalizePolyhedron[Polyhedron[data]]]
$endgroup$
add a comment |
$begingroup$
You could also try:
RegionMember[
BoundaryDiscretizeGraphics@CanonicalizePolyhedron[Polyhedron[data]]]
$endgroup$
You could also try:
RegionMember[
BoundaryDiscretizeGraphics@CanonicalizePolyhedron[Polyhedron[data]]]
answered Jul 10 at 14:01
halmirhalmir
11.2k28 silver badges46 bronze badges
11.2k28 silver badges46 bronze badges
add a comment |
add a comment |
$begingroup$
Polyhedrons are a very new data type and it is not unusual that not all possible functions have been overloaded for them.
You can extract the vertex coordinates of a Polyhedron R with R[[1]]; combined with ConvexHullMesh, this allows you to convert the Polyhedron to a MeshRegion and to apply `RandomPoint:
R = RandomPolyhedron[5];
S = ConvexHullMesh[R[[1]]];
RandomMember[S]
With the user-defined "polyhedron", you can do, e.g., this:
R = BoundaryDiscretizeGraphics@Graphics3D[
Polygon[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]
];
RandomMember[R]
PS.: I have no clue at all what this new datatype is supposed to ship what is not already provided MeshRegions.
$endgroup$
$begingroup$
thanks. what about the case if my polyhedron have faces wherein the vertices are not coplanar. What I have done is that I have triangulated those faces and can display a polyhedron successfully. Do you think the approach that you have mentioned above will work for such a polyhedron?
$endgroup$
– Ali Hashmi
Jul 10 at 4:32
$begingroup$
kindly check the example that I posted in the question
$endgroup$
– Ali Hashmi
Jul 10 at 4:43
$begingroup$
thanks. I was working on a solution myself as well. We both reached the same answer :) I will accept your answer however
$endgroup$
– Ali Hashmi
Jul 10 at 5:47
add a comment |
$begingroup$
Polyhedrons are a very new data type and it is not unusual that not all possible functions have been overloaded for them.
You can extract the vertex coordinates of a Polyhedron R with R[[1]]; combined with ConvexHullMesh, this allows you to convert the Polyhedron to a MeshRegion and to apply `RandomPoint:
R = RandomPolyhedron[5];
S = ConvexHullMesh[R[[1]]];
RandomMember[S]
With the user-defined "polyhedron", you can do, e.g., this:
R = BoundaryDiscretizeGraphics@Graphics3D[
Polygon[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]
];
RandomMember[R]
PS.: I have no clue at all what this new datatype is supposed to ship what is not already provided MeshRegions.
$endgroup$
$begingroup$
thanks. what about the case if my polyhedron have faces wherein the vertices are not coplanar. What I have done is that I have triangulated those faces and can display a polyhedron successfully. Do you think the approach that you have mentioned above will work for such a polyhedron?
$endgroup$
– Ali Hashmi
Jul 10 at 4:32
$begingroup$
kindly check the example that I posted in the question
$endgroup$
– Ali Hashmi
Jul 10 at 4:43
$begingroup$
thanks. I was working on a solution myself as well. We both reached the same answer :) I will accept your answer however
$endgroup$
– Ali Hashmi
Jul 10 at 5:47
add a comment |
$begingroup$
Polyhedrons are a very new data type and it is not unusual that not all possible functions have been overloaded for them.
You can extract the vertex coordinates of a Polyhedron R with R[[1]]; combined with ConvexHullMesh, this allows you to convert the Polyhedron to a MeshRegion and to apply `RandomPoint:
R = RandomPolyhedron[5];
S = ConvexHullMesh[R[[1]]];
RandomMember[S]
With the user-defined "polyhedron", you can do, e.g., this:
R = BoundaryDiscretizeGraphics@Graphics3D[
Polygon[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]
];
RandomMember[R]
PS.: I have no clue at all what this new datatype is supposed to ship what is not already provided MeshRegions.
$endgroup$
Polyhedrons are a very new data type and it is not unusual that not all possible functions have been overloaded for them.
You can extract the vertex coordinates of a Polyhedron R with R[[1]]; combined with ConvexHullMesh, this allows you to convert the Polyhedron to a MeshRegion and to apply `RandomPoint:
R = RandomPolyhedron[5];
S = ConvexHullMesh[R[[1]]];
RandomMember[S]
With the user-defined "polyhedron", you can do, e.g., this:
R = BoundaryDiscretizeGraphics@Graphics3D[
Polygon[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]
];
RandomMember[R]
PS.: I have no clue at all what this new datatype is supposed to ship what is not already provided MeshRegions.
edited Jul 10 at 17:49
answered Jul 10 at 3:50
Henrik SchumacherHenrik Schumacher
65.4k5 gold badges94 silver badges180 bronze badges
65.4k5 gold badges94 silver badges180 bronze badges
$begingroup$
thanks. what about the case if my polyhedron have faces wherein the vertices are not coplanar. What I have done is that I have triangulated those faces and can display a polyhedron successfully. Do you think the approach that you have mentioned above will work for such a polyhedron?
$endgroup$
– Ali Hashmi
Jul 10 at 4:32
$begingroup$
kindly check the example that I posted in the question
$endgroup$
– Ali Hashmi
Jul 10 at 4:43
$begingroup$
thanks. I was working on a solution myself as well. We both reached the same answer :) I will accept your answer however
$endgroup$
– Ali Hashmi
Jul 10 at 5:47
add a comment |
$begingroup$
thanks. what about the case if my polyhedron have faces wherein the vertices are not coplanar. What I have done is that I have triangulated those faces and can display a polyhedron successfully. Do you think the approach that you have mentioned above will work for such a polyhedron?
$endgroup$
– Ali Hashmi
Jul 10 at 4:32
$begingroup$
kindly check the example that I posted in the question
$endgroup$
– Ali Hashmi
Jul 10 at 4:43
$begingroup$
thanks. I was working on a solution myself as well. We both reached the same answer :) I will accept your answer however
$endgroup$
– Ali Hashmi
Jul 10 at 5:47
$begingroup$
thanks. what about the case if my polyhedron have faces wherein the vertices are not coplanar. What I have done is that I have triangulated those faces and can display a polyhedron successfully. Do you think the approach that you have mentioned above will work for such a polyhedron?
$endgroup$
– Ali Hashmi
Jul 10 at 4:32
$begingroup$
thanks. what about the case if my polyhedron have faces wherein the vertices are not coplanar. What I have done is that I have triangulated those faces and can display a polyhedron successfully. Do you think the approach that you have mentioned above will work for such a polyhedron?
$endgroup$
– Ali Hashmi
Jul 10 at 4:32
$begingroup$
kindly check the example that I posted in the question
$endgroup$
– Ali Hashmi
Jul 10 at 4:43
$begingroup$
kindly check the example that I posted in the question
$endgroup$
– Ali Hashmi
Jul 10 at 4:43
$begingroup$
thanks. I was working on a solution myself as well. We both reached the same answer :) I will accept your answer however
$endgroup$
– Ali Hashmi
Jul 10 at 5:47
$begingroup$
thanks. I was working on a solution myself as well. We both reached the same answer :) I will accept your answer however
$endgroup$
– Ali Hashmi
Jul 10 at 5:47
add a comment |
$begingroup$
here is a little fix that should work for both cases:
datamodified = data /. 0.4500000000, 9.803074361, -0.2935999100 -> 0.4500000000,
9.803074361, -0.3935999100 (* this will make vertices of one face non-coplanar *)
poly = Polyhedron[datamodified];
points = DeleteDuplicates@Flatten[poly[[1]], 1];
assoc = AssociationThread[points -> Range[Length@points]];
order = Map[Lookup[assoc, #] &, poly[[1]]];
reg = DiscretizeGraphics@Region@Polyhedron[points, order];

RegionMember@reg

$endgroup$
add a comment |
$begingroup$
here is a little fix that should work for both cases:
datamodified = data /. 0.4500000000, 9.803074361, -0.2935999100 -> 0.4500000000,
9.803074361, -0.3935999100 (* this will make vertices of one face non-coplanar *)
poly = Polyhedron[datamodified];
points = DeleteDuplicates@Flatten[poly[[1]], 1];
assoc = AssociationThread[points -> Range[Length@points]];
order = Map[Lookup[assoc, #] &, poly[[1]]];
reg = DiscretizeGraphics@Region@Polyhedron[points, order];

RegionMember@reg

$endgroup$
add a comment |
$begingroup$
here is a little fix that should work for both cases:
datamodified = data /. 0.4500000000, 9.803074361, -0.2935999100 -> 0.4500000000,
9.803074361, -0.3935999100 (* this will make vertices of one face non-coplanar *)
poly = Polyhedron[datamodified];
points = DeleteDuplicates@Flatten[poly[[1]], 1];
assoc = AssociationThread[points -> Range[Length@points]];
order = Map[Lookup[assoc, #] &, poly[[1]]];
reg = DiscretizeGraphics@Region@Polyhedron[points, order];

RegionMember@reg

$endgroup$
here is a little fix that should work for both cases:
datamodified = data /. 0.4500000000, 9.803074361, -0.2935999100 -> 0.4500000000,
9.803074361, -0.3935999100 (* this will make vertices of one face non-coplanar *)
poly = Polyhedron[datamodified];
points = DeleteDuplicates@Flatten[poly[[1]], 1];
assoc = AssociationThread[points -> Range[Length@points]];
order = Map[Lookup[assoc, #] &, poly[[1]]];
reg = DiscretizeGraphics@Region@Polyhedron[points, order];

RegionMember@reg

answered Jul 10 at 5:42
Ali HashmiAli Hashmi
5,9604 gold badges15 silver badges34 bronze badges
5,9604 gold badges15 silver badges34 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f201832%2fregionmember-does-not-work-with-randompolyhedron-or-polyhedron-object%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown