0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MATLAB > freeBoundary() > 四角形をfreeBoundaryしてみる > 2つでなく4つの三角形のインデックスが得られる

Last updated at Posted at 2017-11-11
動作環境
GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 16.04 LTS desktop amd64
TensorFlow v1.2.1
cuDNN v5.1 for Linux
CUDA v8.0
Python 3.5.2
IPython 6.0.0 -- An enhanced Interactive Python.
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
scipy v0.19.1
geopandas v0.3.0
MATLAB R2017b (Home Edition)

関連

MATLAB > freeBoundary()を試してみた > tetmeshを処理してみた

調査内容 > 正面の四角形

単純な四角形に関して、freeBoundary()を適用してみた。
X3の座標は左上から時計回り。

>> X3 = [0 0 0; 1 0 0; 1 1 0; 0 1 0;]

X3 =

     0     0     0
     1     0     0
     1     1     0
     0     1     0

>> tet3 = [1 2 3 4]

tet3 =

     1     2     3     4
>> trep=TriRep(tet3,X3)

trep = 

  TriRep のプロパティ:

                X: [4×3 double]
    Triangulation: [1 2 3 4]

>> [tri3 xf3] = freeBoundary(trep)

tri3 =

     1     3     4
     2     4     3
     2     1     4
     2     3     1


xf3 =

     1     0     0
     0     0     0
     1     1     0
     0     1     0

2つの三角形ではなく、(LB,RB,LT,RT)という4つの三角形のインデックスがtri3に得られる。
(ここでL:Left, R:Right, B:Bottom, T:Top)。

領域は重なっている部分がある。

調査内容 > 正面の四角形 + 上面の四角形

正面に加えて、上面の四角形も足してみた。

>> X4 = [0 0 0; 1 0 0; 1 1 0; 0 1 0; 0 0 1; 1 0 1;];
>> tet4 = [1 2 3 4; 1 2 6 5];
>> trep = TriRep(tet4, X4)

trep = 

  TriRep のプロパティ:

                X: [6×3 double]
    Triangulation: [2×4 double]

>> [tri4 xf4] = freeBoundary(trep)

tri4 =

     1     3     4
     2     4     3
     2     1     4
     2     3     1
     1     5     6
     2     6     5
     2     1     6
     2     5     1


xf4 =

     1     0     0
     0     0     0
     1     1     0
     0     1     0
     1     0     1
     0     0     1

2つの四角形から8つの三角形(tri4)が生成される。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?