-
Notifications
You must be signed in to change notification settings - Fork 8
/
README
121 lines (82 loc) · 3.52 KB
/
README
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Cad Canvas - a 3d CAD/CAM Preview frame in HTML5 Canvas
=======================================================
I will be adding a readme here. But for the time being your best way to
learn what Cad Canvas is and how it works is to head over to the example
and take a look at it's source.
- source at: examples/gcode_canvas.html
or
- live demo at: http://www.d1plo1d.com/cad_canvas/examples/gcode_canvas.html
Also sorry about some of the variable names.. I was learning ruby at the same
time I was writing this and some of the ruby_variable_names may have
bled over [ sad panda ].
A basic knowledge of JQuery is assummed by this README.
Features
==========
- EMC 2 AXIS Inspired
- EMC2 AXIS style mouse bindings
- scroll to zoom
- click to drag
- right click to rotate
(alternatively for mac peoples + right-click haters: ctrl + click)
- EMC2 AXIS style interactions
- rotation is done on the object, not the camera for a more intuitive interaction
- non-linear zoom (again for a more intuitive interaction)
- EMC2 AXIS style ui (where red => blue)
- Configurable because you might just be crazy enough to hate on EMC 2 AXIS
- optional build platform grid (similar to the RepRap Host Software's)
- optional buld platform outlines
- optional toolhead display
- all colors are configurable (through js.. anyone want to make more css-based stuff?)
- css configurable background color (TODO: more css-based color options)
CNC Build Canvas
==================
The most usefull aspect of cad canvas atm. This is a cad canvas specifically for
cnc and cam preview screens.
To create a cnc build canvas for the "canvasDiv" element you can simply call:
$("#canvasDiv").CNCBuildCanvas();
Of course realistically we usually need some non-default config options:
var options = { platform: {grid: true} };
$("#canvasDiv").CNCBuildCanvas(options);
And more to the point what we come here to do is actually display stuff. So
if you first load a gcode object into the string gcode you can then load it using
the drawGCode method (this is a temporary hack. expect ajax loads in the future):
$("#canvasDiv").CNCBuildCanvas();
var gcode = "some gcode string (this string would not work so well)";
//drawing the gcode behind the scenes
canvas.drawGCode(gcode);
//updating the rendered display
canvas.model.updateRender();
CNCBuildCanvas Configuration Options (including default values):
drawDimensions: true,
measurementUnit: "mm",
endcapSize: 0.25,
toolEnabledColor: "FFFFFF",
toolDisabledColor: "999999",
toolHistoryColor: "0033CC",
platformColor: "0088FF",
dimensionColor: "0088FF",
platform: {
grid: false,
outline: true,
size: [10, 10],
ruleIncrement: [0.5, 0.5],
},
toolhead: {
enabled: true
}
Dependancies
==============
- Three.js (D1plo1d fork required for text, rotation and a couple other things)
- JQuery (1.4.2)
- JQuery MouseWheel (bindings for the mouse scroll wheel)
Want to help? Heres a breif TODO List
=======================================
- add STL rendering
++ Tony Buser has graciously ported his stl rendering to three.js: http://github.com/tbuser/three.js/blob/master/examples/stl_viewer.html)
- add gcode/stl ajax loading
- moar css-based cad canvas styling!
- make 3d text transforms (fork D1plo1d's Three.js Fork) so cnc build canvas measurements are less fugly and annoying.
- ..and anything else that can make cad canvas more awesome! (fork it. make it awesome. i will pull it!)
Oh yeah.. and this is all super-beta and liable to change (but you already figured that out, right?)
Happy Hacking!
Rob