Cuboid
詳細とオプション
- Cuboidは,区間,長方形,正方形,立方体,四次元直方体,超直方体,超長方形,ボックスとしても知られている.
- Cuboidは領域
を表す.ただし,
かつ
である. - Cuboid[]はCuboid[{0,0,0}]に等しい.
- CanonicalizePolyhedronを使って直方体を明示的なPolyhedronオブジェクトに変換できる.
- CuboidはGraphicsおよびGraphics3Dで使うことができる.
- グラフィックスでは,点 pminおよび pmaxは,Scaled,ImageScaled,Offset,Dynamicの各式でよい.
- グラフィックスの描画は,FaceForm,EdgeForm,Opacity,色等の指示子の影響を受ける.
例題
すべて開く すべて閉じる例 (5)
Graphics3D[Cuboid[]]Graphics3D[{Yellow, Cuboid[{0, 0, 0}], Blue, Cuboid[{0.5, 0.5, 0.5}]}]Graphics3D[{Yellow, Cuboid[{0, 0, 0}, {1, 3, 1}], Blue, Cuboid[{2, 1, 1}, {4, 2, 3}]}]{Graphics3D[{Pink, Cuboid[]}], Graphics3D[{EdgeForm[Thick], Cuboid[]}], Graphics3D[{EdgeForm[Dashed], Cuboid[]}], Graphics3D[{EdgeForm[Directive[Thick, Dashed, Blue]], Pink, Cuboid[]}]}Volume[Cuboid[{Subscript[x, 1], Subscript[y, 1], Subscript[z, 1]}, {Subscript[x, 2], Subscript[y, 2], Subscript[z, 2]}]]RegionCentroid[Cuboid[{Subscript[x, 1], Subscript[y, 1], Subscript[z, 1]}, {Subscript[x, 2], Subscript[y, 2], Subscript[z, 2]}]]スコープ (21)
グラフィックス (11)
指定 (3)
スタイリング (5)
Table[Graphics3D[{c, Cuboid[]}], {c, {Red, Green, Blue, Yellow}}]FaceFormとEdgeFormで面と辺のスタイルが指定できる:
Graphics3D[{FaceForm[Pink], EdgeForm[Directive[Dashed, Thick, Blue]], Cuboid[]}]FaceFormを使って表面と裏面に異なる特性が指定できる:
Graphics3D[{FaceForm[Yellow, Blue], Cuboid[Scaled[{.1, -.5, .1}], Scaled[{.9, .8, .9}]]}, PlotRange -> {{-1 / 4, 5 / 4}, {1 / 4, 5 / 4}, {-1 / 4, 5 / 4}}]Table[Graphics3D[{Orange, Specularity[White, n], Cuboid[]}, Lighting -> {{"Point", White, Scaled[{2, -1, 1.2}]}}], {n, {5, 20, 100}}]Graphics3D[{Glow[Red], Black, Cuboid[]}]Opacityは面の透明度を指定する:
Table[Graphics3D[{Opacity[o], Cuboid[]}, Boxed -> False], {o, {0.1, 0.5, 0.9}}]座標 (3)
Scaled座標を使う:
Graphics3D[Cuboid[Scaled[{0, .2, .4}], Scaled[{1, .8, .6}]], PlotRange -> {{0, 10}, {0, 10}, {0, 10}}, Axes -> True]Graphics3D[Cuboid[Scaled[{0, 0, 0.5}, {0, 0, 1}]], PlotRange -> {{0, 5}, {0, 5}, {0, 5}}, Axes -> True]点はDynamicでもよい:
DynamicModule[{x}, {Slider[Dynamic[x], {0, 0.5}], Graphics3D[{Cuboid[Dynamic[{x, 0, 0}], {1, 1, 1}]}]}]領域 (10)
RegionEmbeddingDimension[Cuboid[{Subscript[l, 1], Subscript[l, 2], Subscript[l, 3]}, {Subscript[u, 1], Subscript[u, 2], Subscript[u, 3]}]]RegionDimension[Cuboid[{Subscript[l, 1], Subscript[l, 2], Subscript[l, 3]}, {Subscript[u, 1], Subscript[u, 2], Subscript[u, 3]}]]ℛ = Cuboid[{0, 0, 0}, {2, 2, 2}];{RegionMember[ℛ, {1, 1, 1}], RegionMember[ℛ, {3, 3, 3}]}RegionMember[Cuboid[{Subscript[l, 1], Subscript[l, 2], Subscript[l, 3]}, {Subscript[u, 1], Subscript[u, 2], Subscript[u, 3]}], {x, y, z}]ℛ = Cuboid[{0, 0, 0}, {2, 2, 2}];{Volume[ℛ], RegionMeasure[ℛ]}c = RegionCentroid[ℛ]Graphics3D[{{Opacity[0.5], LightBlue, ℛ}, {PointSize[Large], Red, Point[c]}}]ℛ = Cuboid[{0, 0, 0}, {2, 2, 2}];{RegionDistance[ℛ, {1, 1, 1}], RegionDistance[ℛ, {3, 3, 3}]}ContourPlot3D[Evaluate@RegionDistance[Cuboid[{-1, -1, -1}, {1, 1, 1}], {x, y, z}], {x, -2.1, 2.1}, {y, -2.1, 2.1}, {z, -2.1, 2.1}, Mesh -> None, Contours -> {0.25, 0.5, 1}, ContourStyle -> ColorData[94, "ColorList"], Lighting -> "Neutral", BaseStyle -> Opacity[0.5], BoxRatios -> Automatic]ℛ = Cuboid[{0, 0, 0}, {2, 2, 2}];{SignedRegionDistance[ℛ, {1, 1, 1}], SignedRegionDistance[ℛ, {3, 3, 3}]}ℛ = Cuboid[{-1, -1, -1}, {1, 1, 1}];{RegionNearest[ℛ, {0, 0, 0}], RegionNearest[ℛ, {2, 2, 2}]}spherePoints[{n_, m_}, c_, r_] :=
Flatten[Table[c + r{Cos[k 2π / n]Sin[l π / m], Sin[k 2π / n]Sin[l π / m], Cos[l π / m]}, {k, 0., n - 1}, {l, 0., m - 1}], 1];pl = spherePoints[{16, 8}, RegionCentroid[ℛ], 3];
npl = Table[RegionNearest[ℛ, p], {p, pl}];Legended[Graphics3D[{ℛ, {Thin, Gray, Line[Transpose[{pl, npl}]]}, {Red, Point[pl]}, {PointSize[Medium], Blue, Point[npl]}}, Lighting -> "Neutral", Boxed -> False], PointLegend[{Red, Blue}, {"start", "nearest"}]]BoundedRegionQ[Cuboid[{Subscript[l, 1], Subscript[l, 2], Subscript[l, 3]}, {Subscript[u, 1], Subscript[u, 2], Subscript[u, 3]}]]ℛ = Cuboid[{-1, -1, -1}, {1, 1, 1}];BoundedRegionQ[ℛ]r = RegionBounds[ℛ]ℛ = Cuboid[{Subscript[l, 1], Subscript[l, 2], Subscript[l, 3]}, {Subscript[u, 1], Subscript[u, 2], Subscript[u, 3]}];Integrate[x y z, {x, y, z}∈ℛ]ℛ = Cuboid[{0, 0, 0}, {1, 1, 1}];MinValue[{x y z - x y, {x, y, z}∈ℛ}, {x, y, z}]ℛ = Cuboid[{0, 0, 0}, {1, 1, 1}];Reduce[x^2 + y^2 + z^2 == 1 && x - y - z == -(1/2) && z^2 == x y + (1/4) && {x, y, z}∈ℛ, {x, y, z}]アプリケーション (8)
cuboid[l_, w_, h_] := Cuboid[{0, 0, 0}, {l, w, h}]Volume[cuboid[l, w, h]]Region /@ {cuboid[5, 1, 1], cuboid[2, 2, 4], cuboid[3, 3, 3]}ℛ = Cuboid[{0, 0, 0}, {l, w, h}];Integrate[x y z, {x, y, z}∈ℛ, Assumptions -> l > 0 && w > 0 && h > 0]ℛ = Cuboid[{0, 0, 0}, Quantity[{4, 3, 2}, "Centimeters"]];d = ChemicalData["Ethanol", "Density"]v = Volume[ℛ]FormulaData["MassDensity", {"ρ" -> d, "V" -> v}]RegionBoundsで境界ボックスを作る:
ℛ = Cone[{{0, 0, 0}, {0, 0, 3}}, 1];bounds = RegionBounds[ℛ];boundingBox = Cuboid@@Transpose[bounds];Volumeの相違を計算する:
Volume[boundingBox] - Volume[ℛ]Show[Graphics3D[{ℛ, EdgeForm[White], Opacity[0.2, Yellow], boundingBox}], Boxed -> False]data = RandomReal[{1, 10}, {12, 4}];Graphics3D[MapIndexed[{Hue[(Last[#2] - 1) / 4], Cuboid[Append[{1, 2}#2 - {.5, .5}, 0], Append[{1, 2}#2 + {.5, .5}, #1]]}&, data, {2}], Axes -> {False, False, True}, Lighting -> "Neutral"]Graphics3D[Cuboid /@ Position[#, 1], ImageSize -> Tiny, Boxed -> False]& /@ Take[CellularAutomaton[{14, {2, 1}, {1, 1, 1}}, {{{{1}}}, 0}, 10], {1, -1, 2}]cuboidRegionPlot3D[p_, {x_, xmin_, xmax_, dx_}, {y_, ymin_, ymax_, dy_}, {z_, zmin_, zmax_, dz_}] := Module[{f = Function@@{{x, y, z}, p}}, Graphics3D[Table[If[f[x, y, z], Cuboid[{x, y, z}, {x, y, z} + {dx, dy, dz}], {}], {x, xmin, xmax, dx}, {y, ymin, ymax, dy}, {z, zmin, zmax, dz}]]]cuboidRegionPlot3D[1 ≤ x ^ 2 + y ^ 2 + z ^ 2 ≤ 2 && x y z ≥ 0, {x, -2, 2, .1}, {y, -2, 2, 0.1}, {z, -2, 2, 0.1}]Table[Graphics3D[With[{p = First@v, q = Last@v}, {Red, Thick, Line[{1.5p - .5q, 1.5q - .5p}], Yellow, EdgeForm[], Table[Rotate[Cuboid[], 2Pi k / 20, p - q, q], {k, 20}]}]],
{v, {{{1, 1, 1}, {0, 0, 0}}, {{1, .5, 1}, {0, .5, 0}}, {{.7, .7, 1}, {.3, .3, 0}}}}]特性と関係 (8)
Transposeを使ってCuboidを範囲指定に変換する:
Transpose[List@@Cuboid[{0, 0, 0}, {1, 2, 3}]]逆に,範囲指定をCuboid指定に変換する:
RegionBounds[Ball[]]Cuboid@@Transpose[%]Rotateを使ってGraphics3D中の可能なすべての直方体を得る:
Graphics3D[Rotate[Cuboid[{0, 0, 0}, {1, 2, 1}], -30 Degree, {0, 0, 1}], Axes -> True]Subscript[ℛ, 1] = Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}];
Subscript[ℛ, 2] = Cuboid[{0, 0}, {1, 1}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]Subscript[ℛ, 1] = Rectangle[{0, 0}, {1, 1}];
Subscript[ℛ, 2] = Cuboid[{0, 0}, {1, 1}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]HexahedronはCuboidを一般化したものである:
Subscript[ℛ, 1] = Hexahedron[{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}, {0, 0, 1}, {0, 1, 1}, {1, 1, 1}, {1, 0, 1}}];
Subscript[ℛ, 2] = Cuboid[{0, 0, 0}, {1, 1, 1}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]ImplicitRegionは任意のCuboidを表すことができる:
Subscript[ℛ, 1] = ImplicitRegion[0 ≤ Subscript[t, 1] ≤ 1 && 0 ≤ Subscript[t, 2] ≤ 1 && 0 ≤ Subscript[t, 3] ≤ 1, {Subscript[t, 1], Subscript[t, 2], Subscript[t, 3]}];
Subscript[ℛ, 2] = Cuboid[{0, 0, 0}, {1, 1, 1}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]Parallelepipedは任意のCuboidを表すことができる:
Subscript[ℛ, 1] = Parallelepiped[{0, 0, 0}, {{1, 0, 0}, {0, 2, 0}, {0, 0, 3}}];
Subscript[ℛ, 2] = Cuboid[{0, 0, 0}, {1, 2, 3}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]Cuboidは,
ノルムについてのノルム球である:
ℛ = Cuboid[{-1, -1, -1}, {1, 1, 1}];Reduce[{Subscript[x, 1], Subscript[x, 2], Subscript[x, 3]}∈ℛ⧦Norm[{Subscript[x, 1], Subscript[x, 2], Subscript[x, 3]}, ∞] ≤ 1, {Subscript[x, 1], Subscript[x, 2], Subscript[x, 3]}, Reals]おもしろい例題 (3)
Graphics3D[Table[{EdgeForm[Opacity[.3]], Hue[RandomReal[]], Cuboid[RandomReal[4, 3]]}, {40}]]Graphics3D[{Opacity[0.3], EdgeForm[], Table[{ColorData["Rainbow"][Rescale[c, {0, 2Pi}]], GeometricTransformation[Cuboid[], RotationTransform[c, {-1, 2, -3}, {1.5, 0, 0}]]}, {c, 0, 2Pi, 2Pi / 12}]}]Graphics3D[{EdgeForm[Opacity[.3]], Table[{Hue[RandomReal[], .8], Cuboid[{#[[1]], #[[2]], -n}]}& /@ Tuples[Range[-n, n], 2], {n, 0, 10}]}, Lighting -> "Neutral", Boxed -> False]関連項目
Cube Hexahedron Parallelogram Rectangle Simplex Polyhedron CanonicalizePolyhedron BoundingRegion
形式: VTK
Function Repository: RoundedCuboid
テクニカルノート
関連するガイド
-
▪
- グラフィックスオブジェクト ▪
- 基本的な特殊領域 ▪
- 立体幾何学 ▪
- 記号的なグラフィックス言語 ▪
- 多面体
履歴
1991 で導入 (2.0) | 2014 で更新 (10.0) ▪ 2019 (12.0)
テキスト
Wolfram Research (1991), Cuboid, Wolfram言語関数, https://reference.wolfram.com/language/ref/Cuboid.html (2019年に更新).
CMS
Wolfram Language. 1991. "Cuboid." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/Cuboid.html.
APA
Wolfram Language. (1991). Cuboid. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Cuboid.html
BibTeX
@misc{reference.wolfram_2026_cuboid, author="Wolfram Research", title="{Cuboid}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/Cuboid.html}", note=[Accessed: 12-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_cuboid, organization={Wolfram Research}, title={Cuboid}, year={2019}, url={https://reference.wolfram.com/language/ref/Cuboid.html}, note=[Accessed: 12-September-2026]}