$fa and $fs not working as documented for cylinders

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

$fa and $fs not working as documented for cylinders

Apass
Hello
 
The following command will not work as expected:
 
cylinder(h = 2, r = 0.15, center = true, $fs = 0.1);
 
This should draw a cylinder with 2mm height, 0.3mm radius and about 9 to 10 segments as the perimeter is 0.924 (so at leas 9 0.1mm fragments)
"$fa is the minimum angle for a fragment. Even a huge circle does not have more fragments than 360 divided by this number. The default value is 12 (i.e. 30 fragments for a full circle). The minimum allowed value is 0.01. Any attempt to set a lower value will cause a warning.
$fs is the minimum size of a fragment. Because of this variable very small circles have a smaller number of fragments than specified using $fa. The default value is 1. The minimum allowed value is 0.01. Any attempt to set a lower value will cause a warning."
 
All I get is an extruded pentagon.
 
In fact, all of the bellow statements are generating an extruded pentagon.
cylinder(h = 2, r = 0.15, center = true, $fa =12); //this should generate 30 fragments according the the manual
cylinder(h = 2, r = 0.15, center = true, $fs = 0.1, $fa =12);
 
What am I missing?

Reply | Threaded
Open this post in threaded view
|

Re: $fa and $fs not working as documented for cylinders

kintel
Administrator
On Dec 19, 2011, at 09:25 AM, Pasca Andrei wrote:

> cylinder(h = 2, r = 0.15, center = true, $fs = 0.1);

That was a bug which is fixed now.
The number of segments calculated from the $fs parameter was only half the expected number.

> cylinder(h = 2, r = 0.15, center = true, $fa =12); //this should generate 30 fragments according the the manual

This gives 5 segments (the hardcoded minimum), since the implicit $fs parameter has the default value of 1.

> cylinder(h = 2, r = 0.15, center = true, $fs = 0.1, $fa =12);


This now gives 10 segments, limited by $fs as it yields fewer segments than $fa.

 -Marius