Merge branch 'martinbudden-belt_colors'

This commit is contained in:
Chris Palmer 2020-02-22 23:02:03 +00:00
commit 9e826c1a09
5 changed files with 3 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 KiB

After

Width:  |  Height:  |  Size: 764 KiB

View File

@ -196,7 +196,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour
### Modules ### Modules
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| ```belt(type, points, gap = 0, gap_pt = undef)``` | Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified | | ```belt(type, points, gap = 0, gap_pt = undef, belt_colour = grey20, tooth_colour = grey50)``` | Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified |
![belts](tests/png/belts.png) ![belts](tests/png/belts.png)

View File

@ -67,7 +67,7 @@ module belt_test() {
translate([-25, 0]) translate([-25, 0])
layout([for(b = belts) belt_width(b)], 10) layout([for(b = belts) belt_width(b)], 10)
rotate([0, 90, 0]) rotate([0, 90, 0])
belt(belts[$i], [[0, 0, 20], [0, 1, 20]]); belt(belts[$i], [[0, 0, 20], [0, 1, 20]], belt_colour = $i%2==0 ? grey90 : grey20, tooth_colour = $i%2==0 ? grey70 : grey50);
} }
if($preview) if($preview)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

@ -41,9 +41,7 @@ function no_point(str) = chr([for(c = str) if(c == ".") ord("p") else ord(c)]);
// We model the belt path at the pitch radius of the pulleys and the pitch line of the belt to get an accurate length. // We model the belt path at the pitch radius of the pulleys and the pitch line of the belt to get an accurate length.
// The belt is then drawn by offseting each side from the pitch line. // The belt is then drawn by offseting each side from the pitch line.
// //
module belt(type, points, gap = 0, gap_pt = undef) { //! Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified module belt(type, points, gap = 0, gap_pt = undef, belt_colour = grey20, tooth_colour = grey50) { //! Draw a belt path given a set of points and pitch radii where the pulleys are. Closed loop unless a gap is specified
belt_colour = grey20;
tooth_colour = grey50;
width = belt_width(type); width = belt_width(type);
pitch = belt_pitch(type); pitch = belt_pitch(type);
thickness = belt_thickness(type); thickness = belt_thickness(type);