-
-
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
15195b6
commit 72b8251
Showing
3 changed files
with
78 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,61 @@ | ||
import { | ||
MeshComponent, | ||
MeshComponentParams | ||
} from '../../core/MeshComponent'; | ||
|
||
import { | ||
Mesh, | ||
ParametricBufferGeometry, | ||
ParametricGeometry, | ||
} from 'three'; | ||
|
||
interface ParametricParams extends MeshComponentParams { | ||
|
||
/** Geometry parameters */ | ||
geometry?: { | ||
|
||
/** | ||
* A function that takes in a u and v value each between 0 and 1 and returns a Vector3 | ||
* Default is (u, v) => new Vector3(u, v, 0) | ||
*/ | ||
func?: Function; | ||
/** | ||
* | ||
* Default is 10. | ||
*/ | ||
slices?: number; | ||
|
||
/** | ||
* | ||
* Default is 10. | ||
*/ | ||
stacks?: number; | ||
}; | ||
|
||
/** | ||
* Sets whether to build a buffered geometry | ||
* Default is false. | ||
*/ | ||
buffer?: boolean; | ||
} | ||
|
||
export class Parametric extends MeshComponent { | ||
|
||
/** | ||
* @constructor Creates a Parametric | ||
* @param params parameters | ||
*/ | ||
constructor(params?: ParametricParams); | ||
|
||
/** | ||
* Build lifecycle creates a mesh using input params. | ||
* @param params | ||
*/ | ||
build(params?: ParametricParams): Mesh; | ||
|
||
/** | ||
* Builds the geometry | ||
* @param params | ||
*/ | ||
buildGeometry(params?: ParametricParams): ParametricGeometry | ParametricBufferGeometry; | ||
} |
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