-
Notifications
You must be signed in to change notification settings - Fork 1
/
Pipeline.ts
79 lines (63 loc) · 2 KB
/
Pipeline.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
* Pipeline.ts
* Define a series of operations on shapes for specific purposes.
* Like making cutting plans or different representations of the model.
* Able to run automatically or manually
*
* Pipeline have a common structure:
* - assemble
* - layout (including disassemble)
* - annotate
* - process - process shapes
* - [ pages ]
* - [ toolpaths ]
*/
import { Point, Vector, PointLike, isPointLike, ShapeCollection, Shape, Vertex, Edge, Wire, Face, Geom } from './internal'
import { AnyShape, AnyShapeOrCollection, Layout } from './internal'
import { gp_Ax3, gp_Trsf, gp_Pnt } from '../libs/archiyou-opencascade/archiyou-opencascade'
import { checkInput } from './decorators' // NOTE: needs to be direct
import { FACE_CIRCLE_RADIUS, FACE_PLANE_WIDTH, FACE_PLANE_DEPTH } from './internal' // Face
//// SETTINGS ////
interface PipelineAnnotate
{
// TODO
}
export class Pipeline
{
//// SETTINGS ////
//// END SETTINGS ////
_oc; // is set in constructor prototype when Geom once OC is loaded - IMPORTANT: Don't assign here!
_geom:Geom; // also set on Pipeline prototype when making Geom
name:string;
_shapes:ShapeCollection
/** Create a Pipeline */
constructor(name:string)
{
this.name = name;
}
/** Select shapes that go into the Pipeline */
@checkInput('AnyShapeOrCollection', 'ShapeCollection')
shapes(shapes:AnyShapeOrCollection)
{
this._shapes = shapes as ShapeCollection; // auto converted
return this;
}
/** Disassemble and layout in a given order */
layout(layout:Layout):Pipeline
{
// TODO
return this;
}
/** Annotate shapes */
annotate(options:PipelineAnnotate):Pipeline
{
// TODO
return this;
}
/** Process Shapes or pipeline */
process(fn:(shape:AnyShape, index:number, all:ShapeCollection) => any):Pipeline
{
// TODO
return this;
}
}