Knurled Surface Library v2

by aubenc Oct 9, 2012
Download All Files

Thing Apps Enabled

Please Login to Comment

Thanks for the library! I had been trying to do knurling in FreeCad, but no luck; so getting into OpenSCAD is an interesting approach; and that I'm able to bring .csg files into FreeCad makes life good!
One question tho: I don't see how to put a knurl onto a portion of (not the whole) cylinder. Say I have a "knob" design that's 15mm high; I want to knurl the center 3/4 of the OD surface. Is there a way to spec that?
Thanks for the good job!

It took a while, sorry, but I had to take a look to the code (I did this thing some 7 years ago).

Also, not sure to fully understand your question.

Do you mean... 3/4 of the height ( 3*15/4mm ) or the perimeter ( 240 degrees ) ?

The first one it's very easy to achieve with OpenSCAD, you only need to use "union()" and "translate()".

For the second one you should have to modify the library to compute the number of "knurls" for only a fraction of the perimeter. It shouldn't be so difficult.

Please feel free to take a look to the PDF available to download in this thing's ancestor. More details in the instructions.


Hi, is there a way to have the knurls on a cone?
Thanks in advance

Unfortunatelly not.

Hi ! I had dropped this script on the folder's directory of openScad. But, when i try to Render your other file called "Knurled Pencils Pot", a message shows up "No top level geometry to render". What can i do ? I'm getting started with OpenScad.
Thanks for helping

I cant seem to change the height on knurl_example_07. what am I missing?

Don't really know what to answer, just because I don't know how are you trying it.
Anyway, I think you cannot change much from the examples.
You need to to change the parameters to your desired values in the modules in the library itself.
It should be quite straight forward.
(sorry for the late answer)

A basic flat knurled surface, for anyone's need:

module knurl_flat(size=[10,10],knurl=[4,2,1])
    module knurl1(size)

    translate([0,0,-.001]) { // To get a simple object
        intersection() {
            for (xx=[0:knurl.x:size.x+knurl.x]) {
                for (yy=[0:knurl.y:size.y+knurl.y]) {

Hi, I have used your knurled library in my MoneySpinner fidget toy: http://www.thingiverse.com/thing:1937473

I intend to upload my OpenSCAD script to Thingiverse Customizer so individuals can make spinners relevant to their country and the size of their coins.

As you may know, the Customizer only allows once SCAD file and minimal access to the 'use' function for libraries. I have therefore incorporated your library file (including attribution) in my SCAD file for uploading. I hope you don't mind :)

by GeoffB

Thanks for using the library and doing the best thing to do so others can also use it!
Nice thing btw

Thank you. I have managed to get the Customizer going now, so you can see how I dealt with your code. Thank you for your efforts with the library.

OpenScad is depreciating the assign module... this is the error that appears

DEPRECATED: The assign() module will be removed in future releases. Use a regular assignment instead.

I read some info in a OpenScad forum and there was talk of using for instead. Do you have a view as to what would work? Or... till it really stops working in OpenScad, should we just ignore the warning.

Thanks for the cool tool. I am using it to make repair for a portable sprlinkler right now... Will post when I finish my guess and test of the measurements. =)

Yes, you're right, OpenSCAD doesn't support variables, in the past, the "assign" trick was the only way to "assign" different values to a constant. Now you can do a direct assignment just using the equal sign.
I don't use the assign module any more in my new OpenSCAD scripts which often call (use/include) my old libraries with assigns without any problem but the warning message in the console.
I can live with that.
One day it will not work any more and I will have to do something about it unless someone else takes the time to post a derivative without those assigns ;)
Thanks for the comment!

Wow, I was looking to make a knob for the Z axis screw on my Printrbot Simple Metal and I like knurled knobs. Google turned up your library. I have made a flat plate of knurling but was wondering how to do it on a Cylinder. Thanks!!

You're welcome, thanks!

Do you have a source repository where we can follow the history/fork?

Sorry for the late answer, I'm finding some little technical issues with the Thingiverse's comments system.

No, I don't have such a thing, sometimes I think I should but I know I wouldn't be able to maintain it, I'm constantly jumping from one design back to an old one and suddenly starting something new... I never ever get to finish anything, what I upload here is that small portion of designs that are close to completion, or at least, functional enough to be published.

There wouldn't be any need to maintain it, just to make sure people can always find the latest version without having to search for the latest related thing. With version control it would also be very easy for others to help out with expanding the code.

would there be a way to make a flat piece for an anti-slip surface?

I did this by rotating a long cube 45 degrees and making a bunch of them in a for loop, then do it again at -45 degrees.
Probably a better way to do this (I am new at OpenSCAD) but here is what I have:
module cross_hatching() {
intersection() {
for(i = [1:110]) {
translate([1.5i,-L/4,0])rotate([45,90,0])rotate([0,0,45])cube([1,1,5W], center=true);
translate([1.5i,L/4,0])rotate([-45,90,0])rotate([0,0,45])cube([1,1,5W], center=true);
translate([L/2,0,0])cube([0.9L,0.9W, 10], center = true);
module to

No, not with this library (sorry) it only works for cylinders :(