-
-
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.
Adding Tube, Torus, Torusknot, Terahedron type definitions - #297
- Loading branch information
ChaseWhite3
authored and
ChaseWhite3
committed
Jul 16, 2017
1 parent
0fe8cdc
commit d9a7c74
Showing
5 changed files
with
222 additions
and
2 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,38 @@ | ||
import {MeshComponent, MeshComponentParams} from '../../core/MeshComponent'; | ||
import { | ||
Mesh | ||
} from 'three'; | ||
|
||
interface TetrahedronParams extends MeshComponentParams { | ||
|
||
/** Parameters */ | ||
parameters?: { | ||
|
||
/** | ||
* Radius of the tetrahedron. | ||
* Default is 1. | ||
*/ | ||
radius?: number; | ||
|
||
/** | ||
* Setting this to a value greater than 0 adds vertices making it no longer a tetrahedron. | ||
* Default is 0. | ||
*/ | ||
detail?: number; | ||
|
||
} | ||
} | ||
|
||
export class Tetrahedron extends MeshComponent { | ||
/** | ||
* @constructor Creates Tetrahedron | ||
* @param params | ||
*/ | ||
constructor(params?: TetrahedronParams); | ||
|
||
/** | ||
* Build lifecycle creates a mesh using input params. | ||
* @param params | ||
*/ | ||
build(params?: TetrahedronParams): Mesh; | ||
} |
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 | ||
} from 'three'; | ||
|
||
interface TorusParams extends MeshComponentParams { | ||
|
||
/** Parameters */ | ||
parameters?: { | ||
|
||
/** | ||
* Radius. | ||
* Default is 100. | ||
*/ | ||
radius?: number; | ||
|
||
/** | ||
* Diameter of the tube. | ||
* Default is 40. | ||
*/ | ||
tube?: number; | ||
|
||
/** | ||
* The number of segments going along the tube. | ||
* Default is 6. | ||
*/ | ||
tubularSegments?: number; | ||
|
||
/** | ||
* The number of segments going along the radius. | ||
* Default 8 | ||
*/ | ||
radialSegments?: number; | ||
|
||
/** | ||
* Central angle.. | ||
* Default is Math.PI * 2. | ||
*/ | ||
arc?: number; | ||
|
||
} | ||
} | ||
|
||
export class Torus extends MeshComponent { | ||
/** | ||
* @constructor Creates Torus | ||
* @param params | ||
*/ | ||
constructor(params?: TorusParams); | ||
|
||
/** | ||
* Build lifecycle creates a mesh using input params. | ||
* @param params | ||
*/ | ||
build(params?: TorusParams): Mesh; | ||
} |
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,62 @@ | ||
import {MeshComponent, MeshComponentParams} from '../../core/MeshComponent'; | ||
import { | ||
Mesh | ||
} from 'three'; | ||
|
||
interface TorusknotParams extends MeshComponentParams { | ||
|
||
/** Parameters */ | ||
parameters?: { | ||
|
||
/** | ||
* Radius. | ||
* Default is 100. | ||
*/ | ||
radius?: number; | ||
|
||
/** | ||
* Diameter of the tube. | ||
* Default is 40. | ||
*/ | ||
tube?: number; | ||
|
||
/** | ||
* The number of segments going along the tube. | ||
* Default is 8. | ||
*/ | ||
tubularSegments?: number; | ||
|
||
/** | ||
* The number of segments going along the radius. | ||
* Default 64 | ||
*/ | ||
radialSegments?: number; | ||
|
||
/** | ||
* This value determines, how many times the geometry winds around its axis of rotational symmetry. | ||
* Default is 2. | ||
*/ | ||
p?: number; | ||
|
||
/** | ||
* This value determines, how many times the geometry winds around a circle in the interior of the torus. | ||
* Default is 3. | ||
*/ | ||
q?: number; | ||
|
||
} | ||
} | ||
|
||
export class Torusknot extends MeshComponent { | ||
/** | ||
* @constructor Creates Torusknot | ||
* @param params | ||
*/ | ||
constructor(params?: TorusknotParams); | ||
|
||
/** | ||
* Build lifecycle creates a mesh using input params. | ||
* @param params | ||
*/ | ||
build(params?: TorusknotParams): Mesh; | ||
} |
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,60 @@ | ||
import {MeshComponent, MeshComponentParams} from '../../core/MeshComponent'; | ||
import { | ||
LineCurve3, | ||
Mesh, | ||
TextGeometry | ||
} from 'three'; | ||
|
||
interface TubeParams extends MeshComponentParams { | ||
|
||
/** Parameters */ | ||
geometry?: { | ||
|
||
/** | ||
* Curve - A path that inherits from the Curve base class | ||
* Default is LineCurve3(new Vector3(0, 0, 0), new Vector3(0, 0, 1)). | ||
*/ | ||
path?: LineCurve3; | ||
|
||
/** | ||
* The number of segments that make up the tube. | ||
* Default is 20. | ||
*/ | ||
segments?: number; | ||
|
||
/** | ||
* The radius of the tube. | ||
* Default is 2. | ||
*/ | ||
radius?: number; | ||
|
||
/** | ||
* The number of segments that make up the cross-section. | ||
* Default is 8. | ||
*/ | ||
radiusSegments?: number; | ||
|
||
/** | ||
* Is the tube open or closed. | ||
* Default is false. | ||
*/ | ||
closed?: boolean; | ||
|
||
|
||
|
||
} | ||
} | ||
|
||
export class Tube extends MeshComponent { | ||
/** | ||
* @constructor Creates a tube that extrudes along a 3d curve. | ||
* @param params | ||
*/ | ||
constructor(params?: TubeParams); | ||
|
||
/** | ||
* Build lifecycle creates a mesh using input params. | ||
* @param params | ||
*/ | ||
build(params?: TubeParams): Mesh; | ||
} |
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export * from './Box'; | ||
export * from './Sphere'; | ||
export * from './Cone'; | ||
export * from './Text'; | ||
export * from './Sphere'; | ||
export * from './Text'; | ||
export * from './Tetrahedron'; | ||
export * from './Torus'; | ||
export * from './Torusknot'; | ||
export * from './Tube'; |