Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improved the demo

  • Loading branch information...
commit a1cb7865e200a1a72565629cd7fd6682afa9a12c 1 parent be96a6e
@cuadue authored
Showing with 11 additions and 11 deletions.
  1. +3 −3 gear.js
  2. +8 −8 index.html
View
6 gear.js
@@ -101,7 +101,8 @@
function draw_gear(R, opts) {
opts = $.extend({
root_r: 90,
- clearance_r: 95,
+ // Not yet implemented
+ //clearance_r: 95,
pitch_r: 100,
addendum_r: 120,
num_teeth: 20,
@@ -152,10 +153,9 @@
var methods = {
init: function(obj) {
- // Unfortunately width and height need to be passed
var width = obj.width, height = obj.height
- r = Raphael(this[0], width, height)
+ r = Raphael(this.attr('id'), width, height)
r.setViewBox(-width / 2, -height / 2, width, height)
$(this).data(r)
return this
View
16 index.html
@@ -54,16 +54,16 @@ <h3 id=scale_label></h3>
$(function() {
$('#holder').laser_gears({
width: 600,
- height: 400
+ height: 600
})
var update = $.each({
- root_r: [90, 'Root Radius'],
- clearance_r: [95, 'Clearance Radius'],
- pitch_r: [100, 'Pitch Radius'],
- addendum_r: [120, 'Addendum Radius'],
- num_teeth: [20, 'Tooth Count'],
- gutter_angle: [8, 'Gutter Angle']
+ root_r: [260, 'Root Radius'],
+ //clearance_r: [250, 'Clearance Radius'],
+ pitch_r: [270, 'Pitch Radius'],
+ addendum_r: [300, 'Addendum Radius'],
+ num_teeth: [40, 'Tooth Count'],
+ gutter_angle: [4, 'Gutter Angle']
}, function(key, val) {
$('#params').append($('<div class=control-group/>').
append($('<label class=control-label/>').attr('for', key).text(val[1])).
@@ -81,7 +81,7 @@ <h3 id=scale_label></h3>
result[key] = parseFloat($('[name=' + key + ']').val())
})
$('#holder').laser_gears('draw', result)
- })
+ }).trigger('submit')
})
</script>
</body>
Please sign in to comment.
Something went wrong with that request. Please try again.