Skip to main content
added 192 characters in body
Source Link
Michael Seifert
  • 15.3k
  • 35
  • 72

You want Hexahedron, which specifies a geometric region with six quadrilateral sides via a list of vertices. Note that the vertices need to be ordered in a specific way, described in the documentation; in your case, though, it's just the "obvious" ordering. Note also that you can run into weird behavior if your vertices are not coplanar; Hexahedron does not check for this, apparently.

reg = Hexahedron[{a, b, c, d, a1, b1, c1, d1}]
Volume[reg]
Graphics3D[reg]

(* 7/Sqrt[6] *)

enter image description here

You can further use built-in Mathematica functions to calculate things like centroids, nearest points, etc. Examples of this can be found in the above-linked documentation page.

You want Hexahedron, which specifies a geometric region with six quadrilateral sides via a list of vertices. Note that the vertices need to be ordered in a specific way, described in the documentation; in your case, though, it's just the "obvious" ordering.

reg = Hexahedron[{a, b, c, d, a1, b1, c1, d1}]
Volume[reg]
Graphics3D[reg]

(* 7/Sqrt[6] *)

enter image description here

You can further use built-in Mathematica functions to calculate things like centroids, nearest points, etc. Examples of this can be found in the above-linked documentation page.

You want Hexahedron, which specifies a geometric region with six quadrilateral sides via a list of vertices. Note that the vertices need to be ordered in a specific way, described in the documentation; in your case, though, it's just the "obvious" ordering. Note also that you can run into weird behavior if your vertices are not coplanar; Hexahedron does not check for this, apparently.

reg = Hexahedron[{a, b, c, d, a1, b1, c1, d1}]
Volume[reg]
Graphics3D[reg]

(* 7/Sqrt[6] *)

enter image description here

You can further use built-in Mathematica functions to calculate things like centroids, nearest points, etc. Examples of this can be found in the above-linked documentation page.

Source Link
Michael Seifert
  • 15.3k
  • 35
  • 72

You want Hexahedron, which specifies a geometric region with six quadrilateral sides via a list of vertices. Note that the vertices need to be ordered in a specific way, described in the documentation; in your case, though, it's just the "obvious" ordering.

reg = Hexahedron[{a, b, c, d, a1, b1, c1, d1}]
Volume[reg]
Graphics3D[reg]

(* 7/Sqrt[6] *)

enter image description here

You can further use built-in Mathematica functions to calculate things like centroids, nearest points, etc. Examples of this can be found in the above-linked documentation page.