[OpenSCAD] sumUp() to Replace Difference() (in most cases)
pproj at posteo.de
Fri Oct 7 09:58:28 EDT 2016
thanks for the good words, in fact i was thinking of naming the
predicates positive() and negative().
but this could not accomodate for the addBeforeRemoving() predicate
which is very useful in real world cases.
say when you construct holes and put screws in them.
my take was that calling it add() and remove() is less mathematical and
should be a little bit more intuitively understood by just looking at
at least this is what your module is doing: it "adds" stuff to your
main model, then it "removes" some and than it can add new stuff (think
screws in the holes) in one iteration. putting both things in the same
iterationv(no nesting of sumUp needed) simplifies the code for the
real-world-tasks for me a lot
On 07.10.2016 02:34, don bright wrote:
> That is very cool, seems a little bit like using "negative objects"
> and "positive objects".
> don bright
> hmbright at fastmail.com
> On Thu, Oct 6, 2016, at 02:55 PM, pproj at posteo.de wrote:
>> hello after few years of work on my quite complex cad project, which
>> i created using openscad .(my love to openscad was hampered by quite
>> few a limittions for a compex project- but i am still working with
>> i have decided it is time to share with others some of the things i
>> have discovered and developed in the years of use.
>> i will start with the sumUp(). which is an advanced replacement for
>> the difference() keyword and allows for holes inside modules, and
>> reduced nesting producing simpler code among other things.
>> i have put it it under:
>> https://github.com/solidboredom/sumUp 
>> but to show you why i have been using it so much: it can produce
>> this example. the code below and the lib is all you need
>> //== modules below ==
>> module lidWithNailsAndWasher()
>> add() //washer
>> addAfterRemoving() //top cover without holes
>> i have been quite happy with thhe library (actually its predecessor)
>> so i hope you will find it useful too.
>> i have been using it so much i would like to have its approach
>> somehow integrated in openscad itself.
>> this perhaps could resolve its main drawback: speed on complex
>> models: openscad creates a lot groups and getting much slower on
>> complex models than with the difference().
>> i would also like to share another library: essentially a human(not
>> linear algebra robot) oriented syntax rewrite library for basic
>> openscad operations i use a lot, but still need to make it ready for
>> publishing and documented first.
>> so whats your take folks?
>> OpenSCAD mailing list
>> Discuss at lists.openscad.org
>  https://github.com/solidboredom/sumUp
> OpenSCAD mailing list
> Discuss at lists.openscad.org
More information about the Discuss