1
1

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 3 years have passed since last update.

qhullのインストール for mac

Posted at

Voronoi

ボロノイ図とは、複数の点(母点)が存在する時に、同一平面(空間)上の他の点が、どの母点に最も近いかを領域によって分割した図です。
ボロノイ図を実際に作成すると次のようになります。

qhull

qhullを使ってボロノイ分割の計算が可能です。
その他にもドロネー三角形分割なども可能です。
以前CentOS 7に導入してしていたのですが、今回はmacにインストールしてみます。

インストール

Homebrewからインストールできます。

brew install qhull

おわり ( Homebrew 便利。)

動作確認

以下のコマンドで確認してみます。

qhull

qhull -- compute convex hulls and related structures.  Qhull 2020.1.r 2020/05/29
    input (stdin): dimension, number of points, point coordinates
    comments start with a non-numeric character
    halfspace: use dim+1 and put offsets after coefficients

options (qh-quick.htm):
    d    - Delaunay triangulation by lifting points to a paraboloid
    d Qu - furthest-site Delaunay triangulation (upper convex hull)
    v    - Voronoi diagram as the dual of the Delaunay triangulation
    v Qu - furthest-site Voronoi diagram
    H1,1 - Halfspace intersection about [1,1,0,...] via polar duality
    Qt   - triangulated output
    QJ   - joggled input instead of merged facets
    Tv   - verify result: structure, convexity, and point inclusion
    .    - concise list of all options
    -    - one-line description of each option
    -?   - this message
    -V   - version

Output options (subset):
    s    - summary of results (default)
    i    - vertices incident to each facet
    n    - normals with offsets
    p    - vertex coordinates (if 'Qc', includes coplanar points)
           if 'v', Voronoi vertices
    FA   - report total area and volume
    Fp   - halfspace intersections
    FS   - total area and volume
    Fx   - extreme points (convex hull vertices)
    G    - Geomview output (2-d, 3-d and 4-d)
    m    - Mathematica output (2-d and 3-d)
    o    - OFF format (if 'v', outputs Voronoi regions)
    QVn  - print facets that include point n, -n if not
    TI file - input file, may be enclosed in single quotes
    TO file - output file, may be enclosed in single quotes

examples:
    rbox D4 | qhull Tv                        rbox 1000 s | qhull Tv s FA
    rbox 10 D2 | qhull d QJ s i TO result     rbox 10 D2 | qhull v Qbb Qt p
    rbox 10 D2 | qhull d Qu QJ m              rbox 10 D2 | qhull v Qu QJ o
    rbox c d D2 | qhull Qc s f Fx | more      rbox c | qhull FV n | qhull H Fp
    rbox d D12 | qhull QR0 FA                 rbox c D7 | qhull FA TF1000
    rbox y 1000 W0 | qhull Qc                 rbox c | qhull n

無事にインストール完了です。

次回qhullの機能qvoronoiを使ったvoronoi解析方法を説明しようと思います。

環境

  • macOS Catalina (10.15.7)
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?