TubeMeshDesc
TubeMeshDescクラスは、チューブ(Tube)ジオメトリを描画するためのメッシュです。カトマル・ロム曲線に沿ったチューブ形状を作成できます。
以下のプロパティに加えて、基底クラスの共通プロパティ(position、rotation、scale、matrix、matrixWorld、geodetic、pickable、visible)が利用できます。詳細は MeshDesc を参照してください。
Properties
Section titled “Properties”points
Section titled “points”Type: XYZ[]
Description: チューブの経路を定義する3D座標の配列を指定します。最低2点が必要です。
Example:
{ tube: { points: [ { x: 0, y: 0, z: 0 }, { x: 100, y: 50, z: 0 }, { x: 200, y: 0, z: 0 } ], }}tubularSegments
Section titled “tubularSegments”Type: number
Description: チューブの長さ方向のセグメント数を指定します。
Default: 64
Example:
{ tube: { tubularSegments: 128, }}radius
Section titled “radius”Type: number
Description: チューブの半径を指定します。
Default: 1
Example:
{ tube: { radius: 10, }}radialSegments
Section titled “radialSegments”Type: number
Description: チューブの円周方向のセグメント数を指定します。
Default: 8
Example:
{ tube: { radialSegments: 16, }}closed
Section titled “closed”Type: boolean
Description: チューブを閉じた形状にするかどうかを指定します。
Default: false
Example:
{ tube: { closed: true, }}tension
Section titled “tension”Type: number
Description: カトマル・ロム曲線の張力を指定します。0に近いほど直線的になります。
Default: 0.5
Example:
{ tube: { tension: 0.8, }}Type: Color
Description: チューブの色をColorインスタンスで指定します。Colorクラスは16進数カラーコードやCSS形式の色指定をサポートします。
Default: new Color().setStyle("#ffffff")
Example:
import { Color } from "@navaramap/three";
{ tube: { color: new Color().setHex(0xff8800), }}castShadow
Section titled “castShadow”Type: boolean | undefined
Description: チューブが影を投影するかどうかを指定します。
Default: false
Example:
{ tube: { castShadow: true, }}receiveShadow
Section titled “receiveShadow”Type: boolean | undefined
Description: チューブが影を受けるかどうかを指定します。
Default: false
Example:
{ tube: { receiveShadow: true, }}emissiveColor
Section titled “emissiveColor”Type: Color
Description: チューブの発光色をColorインスタンスで指定します。
Default: new Color().setHex(0x000000)
Example:
import { Color } from "@navaramap/three";
{ tube: { emissiveColor: new Color().setHex(0xff8800), }}emissiveIntensity
Section titled “emissiveIntensity”Type: number
Description: 発光の強度を指定します。
Default: 0
Example:
{ tube: { emissiveIntensity: 1.0, }}opacity
Section titled “opacity”Type: number
Description: チューブの不透明度を0.0から1.0の範囲で指定します。transparentをtrueに設定する必要があります。
Default: 1
Example:
{ tube: { opacity: 0.5, transparent: true, }}transparent
Section titled “transparent”Type: boolean
Description: チューブを半透明にするかどうかを指定します。
Default: false
Example:
{ tube: { transparent: true, opacity: 0.5, }}Config
Section titled “Config”effectIds
Section titled “effectIds”Type: string[] (optional)
Description: このメッシュに適用するセレクティブエフェクトIDの配列を指定します。
Example:
{ tube: { effectIds: ["bloom-effect", "outline-effect"], }}Usage Examples
Section titled “Usage Examples”import ThreeView, { Color } from "@navaramap/three";import { TubeMeshDesc } from "@navaramap/three-default-descs";
const view = new ThreeView();view.registerMesh("tube", TubeMeshDesc);await view.init();
// TubeMeshDescを追加const tubeDesc = view.addMesh<TubeMeshDesc>({ tube: { points: [ { x: 0, y: 0, z: 1000 }, { x: 100, y: 50, z: 1100 }, { x: 200, y: -50, z: 1000 }, { x: 300, y: 0, z: 1000 }, ], radius: 10, tubularSegments: 128, radialSegments: 16, color: new Color().setHex(0xff8800), tension: 0.5, },});