Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Tube, Torus, Torusknot, Terahedron type definitions - #297 #299

Merged
merged 1 commit into from
Jul 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions types/components/meshes/Tetrahedron.d.ts
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;
}
56 changes: 56 additions & 0 deletions types/components/meshes/Torus.d.ts
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;
}
62 changes: 62 additions & 0 deletions types/components/meshes/Torusknot.d.ts
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;
}
60 changes: 60 additions & 0 deletions types/components/meshes/Tube.d.ts
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;
}
8 changes: 6 additions & 2 deletions types/components/meshes/index.d.ts
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';