-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a20fee9
commit 15195b6
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { | ||
MeshComponent, | ||
MeshComponentParams | ||
} from '../../core/MeshComponent'; | ||
|
||
import { | ||
Mesh, | ||
OctahedronBufferGeometry, | ||
OctahedronGeometry | ||
} from 'three'; | ||
|
||
interface OctahedronParams extends MeshComponentParams { | ||
|
||
/** Geometry parameters */ | ||
geometry?: { | ||
|
||
/** | ||
* Radius of the octahedron. | ||
* Default is 1. | ||
*/ | ||
radius?: number; | ||
|
||
/** | ||
* Setting this to a value greater than zero add vertices making it no longer an octahedron. | ||
* Default is 0. | ||
*/ | ||
detail?: number; | ||
} | ||
|
||
/** | ||
* Sets whether to build a buffered geometry | ||
* Default is false. | ||
*/ | ||
buffer?: boolean; | ||
} | ||
|
||
export class Octahedron extends MeshComponent { | ||
|
||
/** | ||
* @constructor Creates an Octahedron | ||
* @param params parameters | ||
*/ | ||
constructor(params?: OctahedronParams); | ||
|
||
/** | ||
* Build lifecycle creates a mesh using input params. | ||
* @param params | ||
*/ | ||
build(params?: OctahedronParams): Mesh; | ||
|
||
/** | ||
* Builds the geometry | ||
* @param params | ||
*/ | ||
buildGeometry(params?: OctahedronParams): OctahedronGeometry | OctahedronBufferGeometry; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters