[OpenSCAD] Difference between modelling with Openscad and Freecad
Doug Moen
doug at moens.org
Thu Oct 3 09:05:43 EDT 2019
On Thu, Oct 3, 2019, at 12:03 PM, adrianv wrote:
> In my experience, the answer to your question is that you want to do some
> kind of rounding or edge treatment that finishes before the heat death of
> the universe---or maybe just part of the model needs to be rounded. So
> minkowski() is out. I made a model based on a sine wave shape. The model
> wasn't designed around some spec that required certain dimensions for
> everything, so some things were arbitrary, but I still wanted to round off
> those arbitrary ends. I'm not saying it can't be done, but you're going to
> need calculus and you might potentially need to solve a transcendental
> equation, which means you need to implement an iterative solver (e.g
> Newton's method using tail recursion) unless you want to just hard code
> values.
What would be even better was if OpenSCAD had operations for rounding and edge treatment that finish before the heat death of the universe. It's definitely possible to implement, and it's definitely useful. Lots of other CAD programs have these operations. It's arguably a missing feature that OpenSCAD should have.
In Curv, I have special version of union, intersection and difference that add "treatment" to the corners and edges generated by these operations. The two most useful are "smooth", which generates rounded fillets and rounded edges, and "chamfer". I don't have to do any math, I just need to specify the radius over which the edge treatment is applied. I use these operations a lot.
In Curv, at least, these operations are fast. I think that Minkowski sum is inherently expensive, because it requires global knowledge: in principle you are comparing every point in shape A with every point in shape B. But with, for example, my rounded intersection operator, the intersection operator "knows" where the new edges are being generated as the two shapes are intersected, so rounding those edges doesn't require global knowledge. So these kinds of operations can be fast.
In OpenSCAD, I don't think it is possible to implement these operations within the language itself, because you don't have access to the triangle mesh of a shape. So we would have to either fix that (which is being discussed in another thread), or implement these operations in C++ and add them to the core language.
More information about the Discuss
mailing list