diff options
author | Marius Kintel <marius@kintel.net> | 2013-06-08 06:12:06 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-06-08 06:12:06 (GMT) |
commit | f2f019f57ea1923e5378b36f463335888f262b56 (patch) | |
tree | d107ea2a0930c6de8715e2285a2af947dd373496 /src/primitives.cc | |
parent | 58e09b1351a53bef508786f78e5cf8f8e6bbe8c3 (diff) |
clamp to 3. Fixes #395
Diffstat (limited to 'src/primitives.cc')
-rw-r--r-- | src/primitives.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/primitives.cc b/src/primitives.cc index 9b755ef..89c1573 100644 --- a/src/primitives.cc +++ b/src/primitives.cc @@ -242,9 +242,8 @@ AbstractNode *PrimitiveModule::instantiate(const Context *ctx, const ModuleInsta */ int get_fragments_from_r(double r, double fn, double fs, double fa) { - if (r < GRID_FINE) return 0; - if (fn > 0.0) - return (int)fn; + if (r < GRID_FINE) return 3; + if (fn > 0.0) return (int)(fn >= 3 ? fn : 3); return (int)ceil(fmax(fmin(360.0 / fa, r*2*M_PI / fs), 5)); } |