mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-01 01:00:20 +02:00
fix knurling to work with cones (at least mostly)
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
// knurled_cylinder(l=30, r=20, count=20, profile=120, helix=30);
|
||||
// knurled_cylinder(l=30, r=20, count=20, profile=120, helix=0.01);
|
||||
// knurled_cylinder(l=30, r=20, count=20, profile=140, helix=60);
|
||||
// knurled_cylinder(l=30, r1=20, r2=12, count=40, profile=90, helix=55);
|
||||
module knurled_cylinder(
|
||||
l,
|
||||
r=undef, r1=undef, r2=undef,
|
||||
@@ -79,8 +80,11 @@ module knurled_cylinder(
|
||||
vertices = concat(
|
||||
[
|
||||
for (layer = [0:1:layers], pt=path)
|
||||
(layer%2)? [pt.x, pt.y, layer*knob_h-layers*knob_h/2] :
|
||||
rot(180/count, p=[pt.x, pt.y, layer*knob_h-layers*knob_h/2])
|
||||
let(scale_factor = lerp(1,r2/r1,layer/layers))
|
||||
scale([scale_factor,scale_factor,1],
|
||||
(layer%2)? [pt.x, pt.y, layer*knob_h-layers*knob_h/2] :
|
||||
rot(180/count, p=[pt.x, pt.y, layer*knob_h-layers*knob_h/2])
|
||||
)
|
||||
], [
|
||||
[0,0,-layers*knob_h/2],
|
||||
[0,0, layers*knob_h/2]
|
||||
|
Reference in New Issue
Block a user