-
-
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.
Adds types for Group, adds missing extrude file #297
- Loading branch information
1 parent
e659b55
commit 8e52826
Showing
6 changed files
with
141 additions
and
6 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,105 @@ | ||
import {MeshComponent, MeshComponentParams} from '../../core/MeshComponent'; | ||
import { | ||
BufferGeometry, | ||
CurvePath, | ||
ExtrudeGeometry, | ||
Mesh, | ||
Shape, | ||
Vector | ||
} from 'three'; | ||
|
||
interface ExtrudeParams extends MeshComponentParams { | ||
|
||
/** Geometry parameters */ | ||
geometry: { | ||
shapes: Shape | Array<Shape>, | ||
options?: { | ||
/** | ||
* Number of points on the curves. | ||
* Default is 12. | ||
*/ | ||
curveSegments?: number; | ||
|
||
/** | ||
* Number of points used for subdividing segments along the depth of the extruded spline. | ||
* Default is 1. | ||
*/ | ||
steps?: number; | ||
|
||
/** | ||
* Depth to extrude the shape. Default is 100. | ||
*/ | ||
amount?: number; | ||
|
||
/** | ||
* Apply beveling to the shape. | ||
* Default is true. | ||
*/ | ||
bevelEnabled?: boolean; | ||
|
||
/** | ||
* How deep into the original shape the bevel goes. | ||
* Default is 6. | ||
*/ | ||
bevelThickness?: number; | ||
|
||
/** | ||
* Distance from the shape outline that the bevel extends. | ||
* Default is bevelThickness minus 2. | ||
*/ | ||
bevelSize?: number; | ||
|
||
/** | ||
* Number of bevel layers. | ||
* Default is 3. | ||
*/ | ||
bevelSegments?: number; | ||
|
||
/** | ||
* A 3D spline path along which the shape should be extruded (creates Frames if frames aren't defined). | ||
*/ | ||
extrudePath?: CurvePath<Vector>; | ||
|
||
/** | ||
* An object containing arrays of tangents, normals, binormals for each step along the extrudePath. | ||
*/ | ||
frames?: Object; | ||
|
||
/** | ||
* An object that provides UV generator functions | ||
*/ | ||
UVGenerator?: Object; | ||
} | ||
}; | ||
|
||
/** | ||
* Whether to create buffered geometry or not. | ||
* Default is false. | ||
*/ | ||
buffer?: boolean; | ||
} | ||
|
||
interface ExtrudeParamsOptions { | ||
|
||
} | ||
|
||
export class Extrude extends MeshComponent { | ||
|
||
/** | ||
* @constructor Creates an extruded geometry from a path shape. | ||
* @param params parameters | ||
*/ | ||
constructor(params?: ExtrudeParams); | ||
|
||
/** | ||
* Build lifecycle creates a mesh using input params. | ||
* @param params | ||
*/ | ||
build(params?: ExtrudeParams): Mesh; | ||
|
||
/** | ||
* Builds the geometry | ||
* @param params | ||
*/ | ||
buildGeometry(params?: ExtrudeParams): ExtrudeGeometry | BufferGeometry; | ||
} |
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,21 @@ | ||
import { | ||
MeshComponent, | ||
MeshComponentParams | ||
} from '../../core/MeshComponent'; | ||
|
||
import {Object3D} from 'three'; | ||
|
||
export class Group extends MeshComponent { | ||
|
||
/** | ||
* @constructor Creates a Group of meshes | ||
* @param objects spread Meshes | ||
*/ | ||
constructor(...objects: Array<MeshComponent>); | ||
|
||
/** | ||
* Returns a new Object3D | ||
*/ | ||
build(): Object3D; | ||
|
||
} |
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
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