Mandelbulb.js

### インストール

1. Mandelbulb.js ファイルを (HOME フォルダ)/Application Support/Cheetah3D/scripts/Polygonobj フォルダに移動します。
2. Mandelbulb ファイルを (HOME フォルダ)/Application Support/Cheetah3D/scripts/Polygonobj フォルダに移動します。

5.5 より以前のバージョンの Cheetah3D を使用する場合

1. Mandelbulb.js ファイルの execPath 変数の値を Mandelbulb コマンドラインプログラムの絶対パスで書き換えます。
2. Mandelbulb.js ファイルを (HOME フォルダ)/Application Support/Cheetah3D/scripts/Polygonobj フォルダに移動します。

### Mandelbulb のテスト

3. 次に同梱の Mandelbulb が動くかどうかテストしてみて下さい。ターミナル.app で、

path/to/Mandelbulb (リターン)
（出力）
*** Mandelbulb[***] result Mandelbulb volume_size:64, detected_set:4; triangles:0, vertices:0

上記の出力が表示され、正常に終了するようであれば、そのまま使えます。

10.6 SDK でコンパイルしているので、それ以外の 10.5 等では動かないかもしれません（未確認）
その場合は、同梱の XCode プロジェクトを使って各自コンパイルして使用して下さい。

### 使用法

メニューバーの ツール -> スクリプト -> ポリゴンスクリプト -> Mandelbulb.js を選択して、シーンに配置して下さい。

mode: mesh / points ポリゴン化するか、ポイントのみを作成するか
mesh connect: FracFrac が生成した三角ポリゴンを結合してオブジェクトを生成します。既存ポイントの捜査に時間がかかりますが、滑らかなサーフェスを生成したい場合にはチェックを入れて下さい。
resolution: 計算の細かさを設定します。値を大きくするとそれだけ細かいメッシュ・ポイントのオブジェクトを生成出来ますが、生成時間・メモリが多く必要になります。
min value/max value: 計算開始・終了値

exceptions: 一応使えますが、古いテストコードの名残。
inner: これより小さい範囲はフラクタルの計算をしません
outer: これより大きい範囲はフラクタルの計算をしません

これ以降の基本的なフラクタルパラメータは http://www.subblue.com で配布されている Mandelbulb と同じです。

iso: ポリゴンメッシュ生成のしきい値
surface smooth: ポリゴンメッシュの滑らかさ

### 使用ライブラリ・コード等

#### Mandelbulb

// Copyright (c) 2009 Tom Beddard
// http://www.subblue.com
//
// Licensed under the MIT License:
// http://www.opensource.org/licenses/mit-license.php
//
//
// Credits and references
// ======================
// For the story behind the 3D Mandelbrot see the following page:
// http://www.skytopia.com/project/fractal/mandelbulb.html
//
// The original forum disussion with many implementation details can be found here:
// http://www.fractalforums.com/3d-fractal-generation/true-3d-mandlebrot-type-fractal/

#### コマンドラインオプションのパース

 * Copyright (c) 2007-2008 Dave Dribin
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.

#### マーチンキューブ法によるポリゴンメッシュ生成

//  Created by Steve Challis.
//  Copyright 2010 All rights reserved.
//    from http://github.com/schallis/marchingcubes
