|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I'm trying to use the KnurledCylinder.inc, from cshake, and I'm getting overlap
at start/finish?
How would I formulate how many peaks, instead of horizontalspacing? Probably
based on radius and some other math...
#include "KnurledCylinder.inc"
//KnurledCylinder(Radius, CylinderHeight, KnurlDepth, HorizontalSpacing,
// VerticalSpacing, FlattenPercent, RaisePercent)
KnurledCylinder(.98/2,.34,.02,.065/2,.095/2,.50,.50)
object{KnurledCylinder(.98/2,.4,.02,.065/2,.095/2,.50,.50) translate<0,.425,0>}
It's with other CSG and moved around.
I'll post a picture.
Stephen S
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I'm trying to use the KnurledCylinder.inc, from cshake, and I'm getting
> overlap
> at start/finish?
> How would I formulate how many peaks, instead of horizontalspacing?
> Probably
> based on radius and some other math...
>
> #include "KnurledCylinder.inc"
> //KnurledCylinder(Radius, CylinderHeight, KnurlDepth, HorizontalSpacing,
> // VerticalSpacing, FlattenPercent, RaisePercent)
> KnurledCylinder(.98/2,.34,.02,.065/2,.095/2,.50,.50)
> object{KnurledCylinder(.98/2,.4,.02,.065/2,.095/2,.50,.50)
> translate<0,.425,0>}
>
> It's with other CSG and moved around.
> I'll post a picture.
I had a look at the macro...
The cylinder height is wrong because intersections
work poorly with mesh2, and the mesh goes a bit high.
The inside vector is outside as well, which can't be good.
Attached is a modified include that fixes that stuff.
As for using a count of peaks that's just 2*pi*radius...
// example
#declare rad = 0.5; // radius
#declare hpeaks = 32; // number of peaks
#declare hspacing = (2*pi*rad)/hpeaks;
#declare kc = KnurledCylinder(rad,1,0.025,hspacing,0.05,0.50,0.25);
Post a reply to this message
Attachments:
Download 'us-ascii' (5 KB)
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tim Attwood" <tim### [at] anti-spamcomcastnet> wrote:
> The cylinder height is wrong because intersections
> work poorly with mesh2, and the mesh goes a bit high.
Intersections work perfectly fine with mesh2 provided that there are no
openings, and the "inside vector" is good...
> The inside vector is outside as well, which can't be good.
> Attached is a modified include that fixes that stuff.
.... which, by the way, despite common misconception is a pure direction, and not
a point in space (hence the name "inside vector" instead of "inside location" or
"inside point"), so it cannot be "outside".
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tim Attwood" <tim### [at] anti-spamcomcastnet> wrote:
....
> // example
> #declare rad = 0.5; // radius
> #declare hpeaks = 32; // number of peaks
> #declare hspacing = (2*pi*rad)/hpeaks;
> #declare kc = KnurledCylinder(rad,1,0.025,hspacing,0.05,0.50,0.25);
Thank you, will work with this.
The macro seems to force an odd number of peaks so they line up at the
start/finish, I think this is the part not working as expected.
Stephen S
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"StephenS" <nomail@nomail> wrote:
....
> The macro seems to force an odd number of peaks so they line up at the
> start/finish, I think this is the part not working as expected.
Replaceing line 43
//#local divs=floor((pi*mean_radius*2/horiz_spacing)/2)*2+1;
#local divs=floor((pi*mean_radius*2/horiz_spacing)/2)*2;
the +1 part at the end, seems to be closer to what I want.
Stephen S
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
StephenS wrote:
> "StephenS" <nomail@nomail> wrote:
> ....
>> The macro seems to force an odd number of peaks so they line up at the
>> start/finish, I think this is the part not working as expected.
> Replaceing line 43
>
> //#local divs=floor((pi*mean_radius*2/horiz_spacing)/2)*2+1;
> #local divs=floor((pi*mean_radius*2/horiz_spacing)/2)*2;
>
> the +1 part at the end, seems to be closer to what I want.
>
> Stephen S
>
Thanks, I guess I missed the error at start/finish on this version. The
odd-forcing code came from a previous algorithm I tried that did require
odd numbers, and it seems this one requires even.
As for the peak count issue, I went with the parameter I did because of
the way that real knurling works (a tool with a specific pattern is
pressed into the cylinder), where the 'specified' parameters are the
spacing, which doesn't depend on radius.
As you can see on line 43 (v1.0), it calculates the number of divisions
based on the radius and spacing. If you really want to control how many
divisions there are, just do that formula backwards.
New version (v1.1) has just been uploaded that incorporates fixes from
you and Tim Attwood (The CSG part)
As clipka noted the 'inside_vector' wasn't wrong, I intentionally put it
pointing out the side because it is more important for the knurl surface
to be correct than the end caps. Though it doesn't make a difference on
this object.
CShake
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|