The best libraries

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

The best libraries

adrianv
This is a continuation of a topic I titled "Learning how to use OpenSCAD".  I
think the title may be giving people the wrong idea about my goals.  But
also it became apparent from that discussion that libraries are very
important and probably the most serious problem facing OpenSCAD.  

Here's the short version:  This is a really important topic because I think
the lack of a clear set of well documented libraries is *really* hurting
OpenSCAD adoption.  The community needs to get behind some selection of
libraries and get them documented as well as the base OpenSCAD language, so
that they can be regarded as similar to the standard libraries that come
with C++, or using numpy with python.  Please respond to this message if
there are libraries or modules that you think are great that you use
regularly.  Or maybe you wrote a fantastic library or highly sophisicated
module that you use.   What are the core capabilities that libraries should
offer?   What are advanced capabilities that exist in libraries?  I'm hoping
to start by creating a list of what's out there.   If there are multiple
versions of something, what is the difference?  

My problem is not that I am trying to learn the basics, which was what my
previous subject line suggested to many readers.  I'm trying to understand
how to become an OpenSCAD *expert*. Are there multiple ways to model
something?  Is one better?  More elegant?  More efficient?  Or maybe more
importantly, how can I write code that I can still understand an hour later?
How can I avoid struggling with getting elements in the model oriented the
right way and positioned correctly.    And also I'm trying to understand how
one avoids reinventing the wheel.  The more I dig around the more it becomes
apparent that standard practice in OpenSCAD is that everybody does in fact
just reinvent the wheel.

A few libraries are listed here:

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Libraries

But the list is quite incomplete.  It seems that mostly to find stuff you
have to stumble over it on github or thingiverse.  Perhaps you find a
discussion on this list that mentions it.  As I keep poking around I am
finding more and more unrelated libraries that provide a lot of the same
basic level functionality.   In the previous thread I learned about BOSL.
Then there is the dotSCAD library.  It seems that sweep() has been written
multiple times---or are they forks of each other.  I'm not sure.  And the
version of sweep() I was looking at depended on yet another utility library,
scad-utils.   And possibly the sweep() functionality is duplicated by BOSL.
It's hard to tell because documentation doesn't seem to be great and sweep()
is a pretty sophisticated function---I haven't figured out its full
capabilities.  There's also skin().   This is the sort of thing that should
be codified and established as standard library code both to save people
effort and because in many cases, writing these functions is difficult.  As
a user, which sweep() should I use and what's the difference?   In the case
of sweep there should probably be a 20 page long tutorial explaining what it
can do and how to use it.  

I think this situation really hurts OpenSCAD adoption.  The basic OpenSCAD
functions are pretty limited and to the new user, many types of more complex
models seem pretty difficult or impossible to construct.  I have also found
that the complexity of my code rapidly mounts and the code becomes very hard
to understand.  But with supporting libraries, things can be much easier.
Consider the user experience of looking at the tutorial entitled "advanced
rounding" which is a ways down on this archived page (that is reference from
the OpenSCAD site):

https://archive.is/KdaWr

The author wants to round off a corner of a triangle.  He shows a page of
trigonometric calculations needed to figure out how to position the rounding
cylinder.  Now that seems like a pain.  I'm not scared off by a little trig,
but I'd probably make an effort to avoid it.  However, I think the vast
majority of potential users don't have degrees in mathematics like I do and
they are going to see that and run away.  Certainly I have addressed
problems like this using trial-and-error because I could get a tolerably
rounded surface by shifting the cutting shape around until it was "close
enough".  This is not a satisfying design method.  Also this code is not
really comprehensible next week, since the derivation isn't in the program.  
And it's also brittle since changes in code parameters will probably mess
with the trial-and-error result.  

But you can solve the same problem with the polyRound function using
basically a single call:

linear_extrude(height = w, center = true, convexity = 10, twist = 0)
polygon(polyRound([[0,0,0],[h,0,3],[0,b,0]]));

No mess.  No fuss.  No math.  That's accessible, powerful and generic.  But
it's also completely obscure and undocumented!

Functions like sweep() and skin() extend the functionality of OpenSCAD in
ways that are interesting, powerful, useful, and completely beyond anybody
but a very advanced user to write on their own.  This is why this sort of
thing should be codified somehow for the community.   The sweep() module I
found was in a "library" called list-comprehension-demos.  That's really
pushing obscurantism to the ultimate if you ask me.  




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: The best libraries

Parkinbot
This is a lot of demands you put together into one simple and innocent post.
Instead of answering them, let me put them into a different light. After all
OpenSCAD is an open source product and not a commercial thing that gives its
users the right to claim what ever was written on the box.
I can understand your wish to find your way through the jungle of libs and
techniques and to increase your productivity by having a reliable toolset
that contains more than cube, cylinder, linear_extrude and some Boolean
operations to combine them. But I don't know whether it is the right
approach to assemble and maintain some standard libraries for additional
stuff like skin, sweep, fillets and so on, which commerical products with a
completely different usage approach (GUI orientation) offer.

I have personally written a large number of libraries mainly meant for
solving my personal needs. And I have also brushed up some of them with help
functionality and useful documentation which I published in Thingiverse
(excluding commercial use) and explicitly NOT in Github. If you publish in
Git, you will give birth to a project that is prone to cost you a lot time
in the future, as others might come up with own branches and pull requests.
Additionally people will confront you with error reports, usage problems and
feature requests. After a while and of course depending on the popularity of
your project, you will find yourself serving all these pings and needs and
not doing your own work any more.

So your argument that people willing to adopt OpenSCAD will save time and
effort, if they can profit from a better maintained and more consistent lib
landscape has a severe drawback: It will cost more and more time of others,
who already have gone the stony way and are capable to do that work.  

My personal way in getting better with OpenSCAD was indeed WRITING my own
libraries and not USING the libs of others. And, discussing the stuff I
don't understand or I need with others in this forum. And reading the
threads about solutions and solution paths that have already been posted by
others.  

To give you an example, because you mentioned it: There is no such a sweep
lib, a novice user will be able to profit from, without having understood
what it means to create a manifold and what implications it has, to create
polyhedra with thousands up to millions of vertices. In order to be able to
flawlessly use sweeps he will have to write his own functions, use and
understand list comprehension and to know a lot about math and describing
things in an affine way. I indeed could write a whole book about it, but why
should one write a book, he won't gain anything from - especially within an
open source community.

Also, there will not be just a gear library empowering everybody to create
the most fancy gearing systems, without having understood what it means to
model gears and create objects with OpenSCAD up to the limits of memory.

So if you have time to spend and want some (unpaid) job, offer an OpenSCAD
library and try to keep up with giving maintainance, documentation and
support for it.






--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: The best libraries

adrianv
Parkinbot wrote

> This is a lot of demands you put together into one simple and innocent
> post.
> Instead of answering them, let me put them into a different light. After
> all
> OpenSCAD is an open source product and not a commercial thing that gives
> its
> users the right to claim what ever was written on the box.
> I can understand your wish to find your way through the jungle of libs and
> techniques and to increase your productivity by having a reliable toolset
> that contains more than cube, cylinder, linear_extrude and some Boolean
> operations to combine them. But I don't know whether it is the right
> approach to assemble and maintain some standard libraries for additional
> stuff like skin, sweep, fillets and so on, which commerical products with
> a
> completely different usage approach (GUI orientation) offer.

The question seems to be what is OpenSCAD for.  If it is meant to be a toy
system, where you can play a little bit, maybe learn some geometry, that's
one possibility.  But if people are to use it to design real things, why
impose artificial limits.  Just because some other (commercial?) system can
do something doesn't mean OpenSCAD should not try to do it.  

And I think libraries do more than just raise productivity by being a
reliable toolset.  They also teach more sophisticated techniques.  And they
raise productivity because you can build up from a higher starting point.
And by reading the library code, one may learn something.  


> If you publish in
> Git, you will give birth to a project that is prone to cost you a lot time
> in the future, as others might come up with own branches and pull
> requests.
> Additionally people will confront you with error reports, usage problems
> and
> feature requests. After a while and of course depending on the popularity
> of
> your project, you will find yourself serving all these pings and needs and
> not doing your own work any more.

As you say, it's open source.  Ultimately open source will work only if
people are willing, at some level, to donate their time to the cause.  I
have been maintaining a package that is part of linux for 22 years so I have
some idea that this can require some time.   (My package is small, only
about 20k lines of code and support files.)  I think maintaining a few
OpenSCAD functions would be much less of a labor, though maintaining a large
library could be a significant amount of work.  


> So your argument that people willing to adopt OpenSCAD will save time and
> effort, if they can profit from a better maintained and more consistent
> lib
> landscape has a severe drawback: It will cost more and more time of
> others,
> who already have gone the stony way and are capable to do that work.  
>
> My personal way in getting better with OpenSCAD was indeed WRITING my own
> libraries and not USING the libs of others. And, discussing the stuff I
> don't understand or I need with others in this forum. And reading the
> threads about solutions and solution paths that have already been posted
> by
> others.  

This perspective is fundamentally in opposition to how we (try to) use
computer systems in the modern era.  I suppose you may like to write
programs in assembly language.  And you can insist that everybody do the
same.  But most programmers do not even know how to do this.  We do not
insist that everybody write their own version of Python all on their own,
and their own libraries to go with it.   (Note that Python is open source.)  


> To give you an example, because you mentioned it: There is no such a sweep
> lib, a novice user will be able to profit from, without having understood
> what it means to create a manifold and what implications it has, to create
> polyhedra with thousands up to millions of vertices. In order to be able
> to
> flawlessly use sweeps he will have to write his own functions, use and
> understand list comprehension and to know a lot about math and describing
> things in an affine way. I indeed could write a whole book about it, but
> why
> should one write a book, he won't gain anything from - especially within
> an
> open source community.

First of all, the idea that you can only gain from a complex library by
writing it yourself is peculiar.  Generally it is much easier to learn by
reading the methods that clever people have already developed, rather than
inventing your own from scratch.  And I say, if the topic so so big, then
you could write the book.  And sell it---for money.   Most large open source
projects have books.  The notion that everybody should learn by re-inventing
everything from the ground is peculiar.  Did you reinvent calculus, or did
somebody tell you how it worked?   Do you understand all the details of how
your computer works, how the CPU functions, how it executes the machine
language  that executes when you process a model in OpenSCAD?  Or do you
perhaps just use it?  


> So if you have time to spend and want some (unpaid) job, offer an OpenSCAD
> library and try to keep up with giving maintainance, documentation and
> support for it.

Yes, building something useful takes work.  And open source is (usually) not
paid.  Nobody has paid me for my contributions.  The support for libraries
can be done by the community---not necessarily just one individual--if there
is a big enough and strong enough community.   To establish such a
community, which it appears may not yet exist, I think the potential of
OpenSCAD needs to be more clear to potential users.  Is it a toy, and real
modeling is to be done in "commercial products" or is it a useful, powerful
environment of its own?  




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: The best libraries

nophead
No it isn't a toy. People do real modelling in it. The point is we don't need to use other people's libraries to do real modelling. 3D modelling isn't as complicated as general purpose computer programming by many orders of magnitude. I don't have the time or ability to write all the Python libraries I use but I do have the time to model all the 3D objects I need from scratch. Comparing OpenSCAD script that describes objects to the libraries needed to do general purpose programming is like apples and pears.

Yes I also have my own version of sweep, is is 100 lines of code. It is less capable than some other people's but it has a simpler interface and handles the initial orientation the way I like. If I was using a common library I would have to use a more complicated version as it would have to do everything for everybody. As all I use it for is making springs and ribbon cables speed is the most important criteria for me, not flexibility. If I was designing aerofoils or needed holes through the middle then I would need a more complex version.

There is an overhead using other people's code. It is harder to understand and debug when things go wrong. You get subjected to other people's interface changes, etc, and legacy issues. When it gets to a certain size or complexity the balance tips clearly in favour of using common libraries. When it is only a few pages of code such as sweep and Bezier writing your own can be more efficient, especially when there is lots of code to crib from. Those are the most complicated things I use. Everything else is trivial in comparison, like rounded cubes.

On Tue, 26 Feb 2019 at 23:02, adrianv <[hidden email]> wrote:
Parkinbot wrote
> This is a lot of demands you put together into one simple and innocent
> post.
> Instead of answering them, let me put them into a different light. After
> all
> OpenSCAD is an open source product and not a commercial thing that gives
> its
> users the right to claim what ever was written on the box.
> I can understand your wish to find your way through the jungle of libs and
> techniques and to increase your productivity by having a reliable toolset
> that contains more than cube, cylinder, linear_extrude and some Boolean
> operations to combine them. But I don't know whether it is the right
> approach to assemble and maintain some standard libraries for additional
> stuff like skin, sweep, fillets and so on, which commerical products with
> a
> completely different usage approach (GUI orientation) offer.

The question seems to be what is OpenSCAD for.  If it is meant to be a toy
system, where you can play a little bit, maybe learn some geometry, that's
one possibility.  But if people are to use it to design real things, why
impose artificial limits.  Just because some other (commercial?) system can
do something doesn't mean OpenSCAD should not try to do it. 

And I think libraries do more than just raise productivity by being a
reliable toolset.  They also teach more sophisticated techniques.  And they
raise productivity because you can build up from a higher starting point.
And by reading the library code, one may learn something. 


> If you publish in
> Git, you will give birth to a project that is prone to cost you a lot time
> in the future, as others might come up with own branches and pull
> requests.
> Additionally people will confront you with error reports, usage problems
> and
> feature requests. After a while and of course depending on the popularity
> of
> your project, you will find yourself serving all these pings and needs and
> not doing your own work any more.

As you say, it's open source.  Ultimately open source will work only if
people are willing, at some level, to donate their time to the cause.  I
have been maintaining a package that is part of linux for 22 years so I have
some idea that this can require some time.   (My package is small, only
about 20k lines of code and support files.)  I think maintaining a few
OpenSCAD functions would be much less of a labor, though maintaining a large
library could be a significant amount of work. 


> So your argument that people willing to adopt OpenSCAD will save time and
> effort, if they can profit from a better maintained and more consistent
> lib
> landscape has a severe drawback: It will cost more and more time of
> others,
> who already have gone the stony way and are capable to do that work. 
>
> My personal way in getting better with OpenSCAD was indeed WRITING my own
> libraries and not USING the libs of others. And, discussing the stuff I
> don't understand or I need with others in this forum. And reading the
> threads about solutions and solution paths that have already been posted
> by
> others.   

This perspective is fundamentally in opposition to how we (try to) use
computer systems in the modern era.  I suppose you may like to write
programs in assembly language.  And you can insist that everybody do the
same.  But most programmers do not even know how to do this.  We do not
insist that everybody write their own version of Python all on their own,
and their own libraries to go with it.   (Note that Python is open source.) 


> To give you an example, because you mentioned it: There is no such a sweep
> lib, a novice user will be able to profit from, without having understood
> what it means to create a manifold and what implications it has, to create
> polyhedra with thousands up to millions of vertices. In order to be able
> to
> flawlessly use sweeps he will have to write his own functions, use and
> understand list comprehension and to know a lot about math and describing
> things in an affine way. I indeed could write a whole book about it, but
> why
> should one write a book, he won't gain anything from - especially within
> an
> open source community.

First of all, the idea that you can only gain from a complex library by
writing it yourself is peculiar.  Generally it is much easier to learn by
reading the methods that clever people have already developed, rather than
inventing your own from scratch.  And I say, if the topic so so big, then
you could write the book.  And sell it---for money.   Most large open source
projects have books.  The notion that everybody should learn by re-inventing
everything from the ground is peculiar.  Did you reinvent calculus, or did
somebody tell you how it worked?   Do you understand all the details of how
your computer works, how the CPU functions, how it executes the machine
language  that executes when you process a model in OpenSCAD?  Or do you
perhaps just use it? 


> So if you have time to spend and want some (unpaid) job, offer an OpenSCAD
> library and try to keep up with giving maintainance, documentation and
> support for it.

Yes, building something useful takes work.  And open source is (usually) not
paid.  Nobody has paid me for my contributions.  The support for libraries
can be done by the community---not necessarily just one individual--if there
is a big enough and strong enough community.   To establish such a
community, which it appears may not yet exist, I think the potential of
OpenSCAD needs to be more clear to potential users.  Is it a toy, and real
modeling is to be done in "commercial products" or is it a useful, powerful
environment of its own? 




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: The best libraries

Parkinbot
This post was updated on .
Adrianv, according to your last posts you complain about OpenSCAD being to
slow in rendering, you ask how to get a power user without having to watch
bad videos, you want better libraries for OpenSCAD in order to leave toy
ground, you want a better infrastructure to be more efficient, better
documentation, and so on. As I wrote, this is a lot you want and all at the same
time.
Better take OpenSCAD where it is and how it is and follow how it is making
its path. There is nothing you can force. It is developed and maintained by
a small group of enthusiasts. There is a lot of potential still unused and a
lot of critics one can have. So what? Most or lets say all of the points you
are adressing have been discussed in this forum previously and is regularily readressed.
That is what this forum is for.

What I tried to tell you, was that especially for functionality based on
polyhedron and polygon like sweep there is no off the shelf usage, a novice
would be able to profit from without having spent a certain amount of time with OpenSCAD
programming and dealing with the peculiarities of its approach. Many novice users create
self intersecting designs and blame OpenSCAD or the library for it, because
they don't understand what is going on behind the scenes, what is a manifold, or what it means
that they have to avoid self-intersection at any price. Or they will start
to repair rotten STLs with the "usual suspects" and blame OpenSCAD for not
being capable to work with them.

As things are, sweep just can't be implemented in a way to guarantee correct
results. This technique easily gives you astonishing and extremly powerful
results, but this comes with a price. The implementation that can be done in user
space with reasonable effort is for runtime reasons doomed to ignore
self-intersection and simple polygon checks needed to ensure valid results.
You would be the first who complains, if it is getting slow.
Therefore: Anyone who wants to play (or even work) with it, will have to
know what he does. And it needs time to come to that point.  

 



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: The best libraries

lostapathy
In reply to this post by nophead
People have made this same argument in most (all?) programming languages for decades.  And they still do, even in modern package-happy javascript land. 

That hasn't stopped other languages from using libraries and a package manager, nor has it stopped the vast majority of software being built on top of libraries, regardless of how simple or complex it is.

The beauty about one day having a healthy ecosystem of libraries/packages for OpenSCAD is that it in no way detracts from the way you want to work.  You're free to ignore that ecosystem forever.

I can't imagine programming in any other language without the benefits of a healthy library system (including its package manager).  I actually see the potential for good libraries to be one of the greatest potential strengths OpenSCAD could have over traditional CAD systems - I don't understand why the mailing list seems to be hostile to people looking to explore that.


On 2/27/19 2:14 AM, nop head wrote:
No it isn't a toy. People do real modelling in it. The point is we don't need to use other people's libraries to do real modelling. 3D modelling isn't as complicated as general purpose computer programming by many orders of magnitude. I don't have the time or ability to write all the Python libraries I use but I do have the time to model all the 3D objects I need from scratch. Comparing OpenSCAD script that describes objects to the libraries needed to do general purpose programming is like apples and pears.

Yes I also have my own version of sweep, is is 100 lines of code. It is less capable than some other people's but it has a simpler interface and handles the initial orientation the way I like. If I was using a common library I would have to use a more complicated version as it would have to do everything for everybody. As all I use it for is making springs and ribbon cables speed is the most important criteria for me, not flexibility. If I was designing aerofoils or needed holes through the middle then I would need a more complex version.

There is an overhead using other people's code. It is harder to understand and debug when things go wrong. You get subjected to other people's interface changes, etc, and legacy issues. When it gets to a certain size or complexity the balance tips clearly in favour of using common libraries. When it is only a few pages of code such as sweep and Bezier writing your own can be more efficient, especially when there is lots of code to crib from. Those are the most complicated things I use. Everything else is trivial in comparison, like rounded cubes.

On Tue, 26 Feb 2019 at 23:02, adrianv <[hidden email]> wrote:
Parkinbot wrote
> This is a lot of demands you put together into one simple and innocent
> post.
> Instead of answering them, let me put them into a different light. After
> all
> OpenSCAD is an open source product and not a commercial thing that gives
> its
> users the right to claim what ever was written on the box.
> I can understand your wish to find your way through the jungle of libs and
> techniques and to increase your productivity by having a reliable toolset
> that contains more than cube, cylinder, linear_extrude and some Boolean
> operations to combine them. But I don't know whether it is the right
> approach to assemble and maintain some standard libraries for additional
> stuff like skin, sweep, fillets and so on, which commerical products with
> a
> completely different usage approach (GUI orientation) offer.

The question seems to be what is OpenSCAD for.  If it is meant to be a toy
system, where you can play a little bit, maybe learn some geometry, that's
one possibility.  But if people are to use it to design real things, why
impose artificial limits.  Just because some other (commercial?) system can
do something doesn't mean OpenSCAD should not try to do it. 

And I think libraries do more than just raise productivity by being a
reliable toolset.  They also teach more sophisticated techniques.  And they
raise productivity because you can build up from a higher starting point.
And by reading the library code, one may learn something. 


> If you publish in
> Git, you will give birth to a project that is prone to cost you a lot time
> in the future, as others might come up with own branches and pull
> requests.
> Additionally people will confront you with error reports, usage problems
> and
> feature requests. After a while and of course depending on the popularity
> of
> your project, you will find yourself serving all these pings and needs and
> not doing your own work any more.

As you say, it's open source.  Ultimately open source will work only if
people are willing, at some level, to donate their time to the cause.  I
have been maintaining a package that is part of linux for 22 years so I have
some idea that this can require some time.   (My package is small, only
about 20k lines of code and support files.)  I think maintaining a few
OpenSCAD functions would be much less of a labor, though maintaining a large
library could be a significant amount of work. 


> So your argument that people willing to adopt OpenSCAD will save time and
> effort, if they can profit from a better maintained and more consistent
> lib
> landscape has a severe drawback: It will cost more and more time of
> others,
> who already have gone the stony way and are capable to do that work. 
>
> My personal way in getting better with OpenSCAD was indeed WRITING my own
> libraries and not USING the libs of others. And, discussing the stuff I
> don't understand or I need with others in this forum. And reading the
> threads about solutions and solution paths that have already been posted
> by
> others.   

This perspective is fundamentally in opposition to how we (try to) use
computer systems in the modern era.  I suppose you may like to write
programs in assembly language.  And you can insist that everybody do the
same.  But most programmers do not even know how to do this.  We do not
insist that everybody write their own version of Python all on their own,
and their own libraries to go with it.   (Note that Python is open source.) 


> To give you an example, because you mentioned it: There is no such a sweep
> lib, a novice user will be able to profit from, without having understood
> what it means to create a manifold and what implications it has, to create
> polyhedra with thousands up to millions of vertices. In order to be able
> to
> flawlessly use sweeps he will have to write his own functions, use and
> understand list comprehension and to know a lot about math and describing
> things in an affine way. I indeed could write a whole book about it, but
> why
> should one write a book, he won't gain anything from - especially within
> an
> open source community.

First of all, the idea that you can only gain from a complex library by
writing it yourself is peculiar.  Generally it is much easier to learn by
reading the methods that clever people have already developed, rather than
inventing your own from scratch.  And I say, if the topic so so big, then
you could write the book.  And sell it---for money.   Most large open source
projects have books.  The notion that everybody should learn by re-inventing
everything from the ground is peculiar.  Did you reinvent calculus, or did
somebody tell you how it worked?   Do you understand all the details of how
your computer works, how the CPU functions, how it executes the machine
language  that executes when you process a model in OpenSCAD?  Or do you
perhaps just use it? 


> So if you have time to spend and want some (unpaid) job, offer an OpenSCAD
> library and try to keep up with giving maintainance, documentation and
> support for it.

Yes, building something useful takes work.  And open source is (usually) not
paid.  Nobody has paid me for my contributions.  The support for libraries
can be done by the community---not necessarily just one individual--if there
is a big enough and strong enough community.   To establish such a
community, which it appears may not yet exist, I think the potential of
OpenSCAD needs to be more clear to potential users.  Is it a toy, and real
modeling is to be done in "commercial products" or is it a useful, powerful
environment of its own? 




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: The best libraries

lostapathy
In reply to this post by Parkinbot
I don't think we have to take Adrianv in such a negative way, I certainly don't.

I'm all for making your own libraries, and indeed I have tried (and even made a package manager).  The fact is, there just isn't really *any* "best practice" knowledge that's publicly shared. That makes it hard for beginners to write good libraries - either for themselves or to share with the community.

By the time a new user figures out how to make a good library, they've done enough things poorly that their library is unfit for open sourcing (because design issues will make it a support nightmare).  So it doesn't get released.

I don't see how anyone loses if we figured out a way to break that cycle.


On 2/27/19 5:00 AM, Parkinbot wrote:
Adrianv, according to your last posts you complain about OpenSCAD being to
slow in rendering, you ask how to get a power user without having to watch
bad videos, you want better libraries for OpenSCAD in order to leave toy
ground, you want a better infrastructure to be more efficient, better
documentation, and so on. As I wrote, this is a lot you want and at the same
time. 
Better take OpenSCAD where it is and how it is and follow how it is making
its path. There is nothing you can force. It is developed and maintained by
a small group of enthusiasts. There is a lot of potential still unused and a
lot of critics one can have. So what? Most or lets say all of the points you
are adressing have been discussed in this forum and regularily readressed.
That is what this forum is for. 

What I tried to tell you, was that especially for functionality based on
polyhedron and polygon like sweep there is no off the self usage, a novice
would be able to profit from without having spent his time with OpenSCAD
programming and the peculiarities of its approach. Many novice users create
self intersecting designs and blame OpenSCAD or the library for it, because
they don't understand what is going on behind the scenes or what it means
that they have to avoid self-intersection at any price. Or they will start
to repair rotten STLs with the "usual suspects" and blame OpenSCAD for not
being capable to work with them. 

As things are, sweep just can't be implemented in a way to guarantee correct
results. This technique easily gives you astonishing and extremly powerful
results, but it has it price. The implementation that can be done in user
space with reasonable effort is doomed for runtime reasons to ignore
self-intersection and simple polygon checks needed to ensure valid results.
You would be the first who complains, if it is getting slow. 
Therefore: Anyone who wants to play (or even work) with it, will have to
know what he does. And this needs time. 

 



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: The best libraries

adrianv
In reply to this post by Parkinbot
Parkinbot wrote

> Adrianv, according to your last posts you complain about OpenSCAD being to
> slow in rendering, you ask how to get a power user without having to watch
> bad videos, you want better libraries for OpenSCAD in order to leave toy
> ground, you want a better infrastructure to be more efficient, better
> documentation, and so on. As I wrote, this is a lot you want and all at
> the same
> time.
> Better take OpenSCAD where it is and how it is and follow how it is making
> its path. There is nothing you can force. It is developed and maintained
> by
> a small group of enthusiasts. There is a lot of potential still unused and
> a
> lot of critics one can have. So what? Most or lets say all of the points
> you
> are adressing have been discussed in this forum previously and is
> regularily readressed.
> That is what this forum is for.

I don't believe I have "complained about OpenSCAD being slow in rendering".
I'm not sure which post you are talking about.  Minkowski is slow, so one
must use it with care---a fact, not a complaint.  I wrote about the
minkowskiRound library, which seems too slow for most things due to its 3
applications of minkowski().  There is the issue about preview being
completely unusable under certain circumstances.  It would be nice to have
an idea of how to avoid this situation, but once I understood the problem it
was easy to fix by just never using preview.  Without the forum I probably
would have filed a bug report about this behavior because it looked like a
bug to me.  But the FAQ that I was sent to explains what the problem
is---without explaining methods for solving it (wrapping the model in
render()).

I have not asked for "better libraries".  I have asked "what is out there"?
What I want is better organization and documentation for the existing
libraries, so that there's a clear path forward for someone wanting to
learn, and to facilitate more readable, simpler code, and more modular
design methods.  Also this would create a path forward for someone who might
be interested in writing or extending a library.  It is not an efficient use
of the community's resource that ten people write the same thing, each
thinking it hasn't been done yet.  I'm trying to understand what already
exists.  What is the current state of libraries for OpenSCAD?  

I think the role of libraries in many cases is not to extend functionality
in any significant way but just to make the code easier to read and write.
Libraries to do these basic things are not hard to write.  And the advantage
of standardization is that then you can share code more easily.   But even
if the library may be easy to write, sometimes one must have the insight
that a particular idea is useful.  So for example I think the attachments
library would have simplified a design I did recently.  But the idea of this
did not occur to me.   Many of the modules in the BOSL library are simple.
Consider mirror_copy().  It doesn't add anything new.  But when I saw that
function I realized that it was important because I think every time I have
used mirror() it has been to make a copy, so this function simplifies the
code.   Perhaps it's a question of thinking like a mathematician vs.
thinking like a computer scientist.  

You say that I should take OpenSCAD where it is. But the way that open
source projects improve and flourish it not from users saying, oh, well, I
guess that's it.  Instead it's because those users who have the interest
become developers: they set out a path and pursue it and try to move the
project forward.  It appears to me that with regards to library
infrastructure, this is not happening.  I have an interest in making it
better and a willingness to contribute some effort to this.  But it seems
the community is not interested.  Instead I'm being told to take things as
they are, work alone in a corner, and don't try to improve it.  This is a
sad situation.  


> What I tried to tell you, was that especially for functionality based on
> polyhedron and polygon like sweep there is no off the shelf usage, a
> novice
> would be able to profit from without having spent a certain amount of time
> with OpenSCAD
> programming and dealing with the peculiarities of its approach. Many
> novice users create
> self intersecting designs and blame OpenSCAD or the library for it,
> because
> they don't understand what is going on behind the scenes, what is a
> manifold, or what it means
> that they have to avoid self-intersection at any price. Or they will start
> to repair rotten STLs with the "usual suspects" and blame OpenSCAD for not
> being capable to work with them.

This sounds to me like a problem in documentation and instruction.  But I
never insisted that anything in particular needed to be included in standard
libraries.  Rather I asked, what *should* be in standard libraries.  Instead
of ideas I get the answer that nothing should be in standard libraries.
Such libraries should not exist.  Everybody should write their own, personal
libraries.   Or the interesting capabilities are so complex that users
cannot possibly understand.  I do not think this is a productive way of
thinking.    


> As things are, sweep just can't be implemented in a way to guarantee
> correct
> results. This technique easily gives you astonishing and extremly powerful
> results, but this comes with a price. The implementation that can be done
> in user
> space with reasonable effort is for runtime reasons doomed to ignore
> self-intersection and simple polygon checks needed to ensure valid
> results.
> You would be the first who complains, if it is getting slow.
> Therefore: Anyone who wants to play (or even work) with it, will have to
> know what he does. And it needs time to come to that point.  

I wonder if you underestimate the comprehension users can have if things are
actually documented.  If, for example, I had a sweep() module of some sort
and it had a "fast=true" option that was documented to work only when no
self-intersection occurred and the default behavior was much slower but
handled self intersections, this would be a very usable module for users.  

You complain that users don't understand.  But part of the reason for that
is that gaining understanding when there is no documentation is difficult.
If I stumble across an undocumented sweep() module and try to use it, but
have trouble, then maybe I ask on the forum, when some examples of how
things can go wrong with polygon intersection in a manual might clarify
matters easily.   It appears that really a very good way to gain
understanding is to write questions here.  You complain about the time
required to write documentation.  But there is also time spent answering
questions on the mailing list.  When I was in a position where many
questions came to me because of a prominent role on a forum I found it
expedient to write up documents that answered common questions so that I
could do it once, rather than over and over.   There is a price to having
the forum be the sole platform for user education.  
 




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: The best libraries

bradipao
In reply to this post by adrianv
adrianv wrote
> But also it became apparent from that discussion that libraries are very
> important and probably the most serious problem facing OpenSCAD.

I found openscad about one year ago and I immediately fell in love with it.
I am still astonished at the power of the tool. Now I design my own models
for 3D printing.

After a few months of designing and printing and after some attempts to make
my own library, I think that libraries in openscad are almost impossible to
standardize just like libraries and packages in java, python and other
languages.

IMO the problem is the back-compatibility of output when updated. In fact,
while a java/python libraries has a simple specific output, easily
back-compatible, a complex 3D shape generated by a parametric algorythm is
easily non-back-compatible with some combination of parameters. And if a 3D
shape in your design is slightly different after a library update, you
design is likely broken.

In other words, I cannot see how you can guarantee that any 3D shape
generated by the parametric library is identical to the previous version
(except for trivial ones, or trivial updates). For this reason, the best
approach I imagined is to use library, but store together with design and
never update it (unless you review the whole design).



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: The best libraries

lostapathy
This is exactly what I've advocated doing with a versioned package manager.

scad_bundler supports exactly this use case of locking your project's libraries to a specific version https://github.com/lostapathy/scad_bundler

On 2/27/19 12:09 PM, bradipao wrote:
In other words, I cannot see how you can guarantee that any 3D shape
generated by the parametric library is identical to the previous version
(except for trivial ones, or trivial updates). For this reason, the best
approach I imagined is to use library, but store together with design and
never update it (unless you review the whole design).


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org