メインコンテンツ

surfaceMeshShow

表面メッシュを表示する

R2022b 以降

    説明

    surfaceMeshShow(surfaceMeshObj) は、surfaceMeshObj オブジェクトで指定された表面メッシュを表示します。

    surfaceMeshShow(triangulationObj) は、triangulation オブジェクトで指定された表面メッシュを表示します。

    surfaceMeshShow(vertices,faces) は、入力の頂点と面で定義された表面メッシュを表示します。

    surfaceMeshShow(___,Name=Value) は、前述の構文の入力引数の任意の組み合わせに加え、1 つ以上の名前と値の引数を使用してオプションを指定します。たとえば、Title="Cuboid" は表面メッシュとタイトル "Cuboid" を表示します。

    すべて折りたたむ

    表面メッシュのメッシュ頂点とメッシュ面を定義します。

    vertices = [0 0 0; 0 0 1; 0 1 1; 0 0 2; 1 0.5 1];
    faces = [1 2 3; 2 3 4; 2 3 5];

    頂点と面を使用して、surfaceMesh オブジェクトを作成します。

    mesh = surfaceMesh(vertices,faces);

    表面メッシュを表示します。

    surfaceMeshShow(mesh,Title="Surface Mesh",ColorMap="hot",BackgroundColor="blue")

    Viewer3D オブジェクトを作成して、表面メッシュを表示します。

    viewer = viewer3d;

    viewer.CameraPosition = [-2 2 0];
    viewer.CameraZoom = 0.5;
    surfaceMeshShow(mesh,Parent=viewer,Title="Surface Mesh With Viewer")

    3 次元の三角形分割を表す triangulation オブジェクトを作成します。

    [x,y] = meshgrid(1:15,1:15);
    tri = delaunay(x,y);
    z = peaks(15);
    triangulationObject = triangulation(tri,x(:),y(:),z(:));

    三角形分割で定義された表面メッシュを表示します。

    surfaceMeshShow(triangulationObject,ColorMap="summer",Title="Triangulation Object Mesh");

    入力引数

    すべて折りたたむ

    表面メッシュ データ。surfaceMesh オブジェクトとして指定します。

    表面メッシュの三角形分割。triangulation オブジェクトとして指定します。

    メッシュ頂点。M 行 3 列の行列として指定します。行列の各行は、[x y z] の形式で、頂点の座標を指定します。各頂点には、行列の行番号と等しい頂点 ID があります。M は頂点の合計数です。

    メッシュの三角面。N 行 3 列の行列として指定します。行列の各行は、[V1 V2 V3] の形式で、三角面を定義する頂点の頂点 ID を指定します。N は面の数です。

    名前と値の引数

    すべて折りたたむ

    オプションの引数のペアを Name1=Value1,...,NameN=ValueN として指定します。ここで、Name は引数名で、Value は対応する値です。名前と値の引数は他の引数の後に指定しなければなりませんが、ペアの順序は重要ではありません。

    例: surfaceMeshShow(mesh,Title="Cuboid") は表面メッシュとタイトル "Cuboid" を表示します。

    表面メッシュのカラーマップ。次のオプションのいずれかとして指定します。

    カラーマップ名カラー スケール

    parula

    Colorbar showing the colors of the parula colormap. The colormap starts at dark blue and transitions to lighter blue, green, orange and yellow. The transitions between colors are more perceptually uniform than in most other colormaps.

    turbo

    Colorbar showing the colors of the turbo colormap. The colormap starts at dark blue and transitions to lighter blue, bright green, orange, yellow, and dark red. This colormap is similar to jet, but the transitions between colors are more perceptually uniform than in jet.

    hsv

    Colorbar showing the colors of the hsv colormap. The colormap starts at red and transitions to yellow, bright green, cyan, dark blue, magenta, and bright orange.

    hot

    Colorbar showing the colors of the hot colormap. The colormap starts at dark red and transitions to bright red, orange, yellow, and white.

    cool

    Colorbar showing the colors of the cool colormap. The colormap starts at cyan and transitions to light blue, light purple, and magenta.

    spring

    Colorbar showing the colors of the spring colormap. The colormap starts at magenta and transitions to pink, light orange, and yellow.

    summer

    Colorbar showing the colors of the summer colormap. The colormap starts at medium green and transitions to yellow.

    autumn

    Colorbar showing the colors of the autumn colormap. The colormap starts at bright orange and transitions to yellow.

    winter

    Colorbar showing the colors of the winter colormap. The colormap starts at dark blue and transitions to bright green.

    gray

    Colorbar showing the gray colormap. The colormap starts at black and transitions to white.

    bone

    Colorbar showing the bone colormap. This colormap has colors that are approximately gray with a slight blue color tint. The colormap starts at dark gray and transitions to white.

    copper

    Colorbar showing the copper colormap. This colormap starts at black and transitions to a medium orange, similar to the color of copper.

    pink

    Colorbar showing the pink colormap. This colormap starts at dark red and transitions to dark pink, tan, and white.

    sky (R2023a 以降)

    Colorbar showing the sky colormap. This colormap starts at a very light shade of blue and transitions to a darker shade of blue.

    abyss (R2023b 以降)

    Colorbar showing the abyss colormap. This colormap starts at a very dark shade of blue and transitions to a lighter shade of blue.

    nebula (R2025a 以降)

    Colorbar showing the nebula colormap. This colormap starts at a medium shade of blue and transitions to a bright shade of red.

    jet

    Colorbar showing the colors of the jet colormap. The colormap starts at dark blue and transitions to light blue, bright green, orange, yellow, and dark red.

    lines

    Colorbar showing the colors of the lines colormap. The colormap contains a repeating pattern of colors: dark blue, dark orange, dark yellow, dark purple, medium green, light blue, and dark red.

    colorcube

    Colorbar showing the colors of the colorcube colormap. The colormap is a course sampling of the RGB colorspace.

    prism

    Colorbar showing the colors of the prism colormap. The colormap contains a repeating pattern of colors: red, orange, yellow, green, blue, and purple.

    flag

    Colorbar showing the colors of the flag colormap. The colormap contains a repeating pattern of colors: red, white, blue, and black.

    white

    Colorbar showing the white colormap, which is entirely white.

    詳細については、colormap を参照してください。

    表面メッシュの背景色。次のオプションのいずれかとして指定します。

    • RGB 3 成分 — 色の赤、緑、青の各成分の強度値を指定する 3 要素の行ベクトルです。強度値は [0,1] の範囲でなければなりません。たとえば [0.4 0.6 0.7] のようになります。

    • 16 進数カラー コード — ハッシュ記号 (#) で始まり、3 桁または 6 桁の 16 進数 (数字は 0 から F まで) が続く文字ベクトルまたは string スカラーです。これらの値では大文字小文字は区別されません。したがって、カラー コード "#FF8800""#ff8800""#F80"、および "#f80" は等価です。

    • 色名または省略名"red""green" などの色名を指定します。省略名は、"r""g" など、色名の 1 文字を指定します。

    RGB 3 成分、および 16 進数カラー コードは、カスタム カラーの指定に便利です。

    次の表に、名前の付いた色オプション、等価の RGB 3 成分、および 16 進数カラー コードを示します。

    色名省略名RGB 3 成分16 進数カラー コード
    "red""r"[1 0 0]"#FF0000"
    "green""g"[0 1 0]"#00FF00"
    "blue""b"[0 0 1]"#0000FF"
    "cyan" "c"[0 1 1]"#00FFFF"
    "magenta""m"[1 0 1]"#FF00FF"
    "yellow""y"[1 1 0]"#FFFF00"
    "black""k"[0 0 0]"#000000"
    "white""w"[1 1 1]"#FFFFFF"

    表面メッシュの透明度。範囲 [0, 1] の正のスカラーとして指定します。値が 1 の場合、メッシュは完全に不透明になり、値が 0 の場合、完全に透明になります。それらの間の値の場合は半透明になります。

    データ型: single | double

    メッシュ表面をワイヤーフレームとして表示するかどうか。logical true または false として指定します。true に設定すると、関数はメッシュ表面をワイヤーフレームとして表示します。それ以外の場合、表面は塗りつぶされます。

    データ型: logical

    メッシュ頂点のみを表示するかどうか。logical true または false として指定します。true に設定すると、関数はメッシュ頂点のみを表示します。

    データ型: logical

    表面メッシュ表示のタイトル。文字ベクトルまたは string スカラーとして指定します。この値は既定で空です。

    データ型: char | string

    surfaceMesh オブジェクトの親。Viewer3D オブジェクトとして指定します。Viewer3D オブジェクトは、viewer3d 関数を使用して作成できます。親を指定せずに surfaceMeshShow を呼び出すと、関数は新しい Viewer3D オブジェクトを作成し、そのオブジェクトを親として設定します。surfaceMesh オブジェクトの親を再設定することはできません。

    バージョン履歴

    R2022b で導入

    すべて展開する

    参考

    関数

    オブジェクト