Polyhedron generation from two parallel polygones?

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

Re: Polyhedron generation from two parallel polygones?

adrianv
Personally I think the approach dotSCAD uses is a little broken.  If you do
like he suggests and you install two libs that both provide sweep.scad
you'll not be sure which one you're using.  If you provide code to someone
else they won't know which of many sweep.scad files were intended.  So what
you should actually do is create a libraries/dotSCAD directory and copy
everything from dotSCAD/src into that location.  Add "libraries" to your
path.  And then you should be able to do

use<dotSCAD/sweep.scad>

for example.  (Note that trailing semicolons are not needed.)  Now it is
unambiguous.  





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

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

Re: Polyhedron generation from two parallel polygones?

dpa
Hi Adrianv,
good point. And this works for me.
thank you

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

Re: Polyhedron generation from two parallel polygones?

caterpillar
In reply to this post by dpa
dpa wrote
> I see thank you. This reminds me of a long unsuccessful run. I just tried
> it - again no success..  am I to stupid for this? I entered the correct*
> path into every .profile:
> (* when I call this path in Finder (via cmd+shift+g)
> /Users/dpa/Documents/OpenSCAD/libraries/dotSCAD/src then I end up at the
> correct path)

Are you using Windows? If that's your case, you should `SET
PATH=/Users/dpa/Documents/OpenSCAD/libraries/dotSCAD/src` in your cmd.




-----
https://openhome.cc
--
Sent from: http://forum.openscad.org/

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

Re: Polyhedron generation from two parallel polygones?

dpa
Are you using Windows?

No, I'm on mac.

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

Re: Polyhedron generation from two parallel polygones?

caterpillar
In reply to this post by adrianv
adrianv wrote
> Personally I think the approach dotSCAD uses is a little broken.  If you
> do
> like he suggests and you install two libs that both provide sweep.scad
> you'll not be sure which one you're using.  If you provide code to someone
> else they won't know which of many sweep.scad files were intended.


That's because I'm developing dotSCAD out of the `libraries` folder of
OpenSCAD. Setting `OPENSCADPATH` is convenient for me. I don't have to tell
myself I'm using dotSCAD when I'm developing dotSCAD.

People can have different ways to manage their libraries when using
OpenSCAD.

Coping everything from dotSCAD/src into a libraries/dotSCAD and `use
<dotSCAD/sweep.scad>;` also cause errors when you send your code to someone
because he prefers to put the dotSCAD repo in the libraries folder of
OpenSCAD.

What users should do is reading `OpenSCAD User Manual/Libraries` carefully
and deciding how to manage their libraries. Before you send code to others,
write a document for it.





-----
https://openhome.cc
--
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: Polyhedron generation from two parallel polygones?

caterpillar
In reply to this post by dpa
dpa wrote
>> Are you using Windows?
>>
>
> No, I'm on mac.
>
> _______________________________________________
> OpenSCAD mailing list

> Discuss@.openscad

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Sorry, I have no experience about mac so cannot provide any help.



-----
https://openhome.cc
--
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: Polyhedron generation from two parallel polygones?

nophead
I think OPENSCADPATH is intended to point to a folder of libraries, not a single library. I point mine a folder called OpenSCADLibs where I put libraries and include everything with <LIbName/file.scad> because even though I only have my own library at the moment, I don't want to rule out using another library.

On Wed, 8 Jul 2020 at 13:32, caterpillar <[hidden email]> wrote:
dpa wrote
>> Are you using Windows?
>>
>
> No, I'm on mac.
>
> _______________________________________________
> OpenSCAD mailing list

> Discuss@.openscad

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Sorry, I have no experience about mac so cannot provide any help.



-----
https://openhome.cc
--
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: Polyhedron generation from two parallel polygones?

JordanBrown
On 7/8/2020 6:25 AM, nop head wrote:
I think OPENSCADPATH is intended to point to a folder of libraries, not a single library. I point mine a folder called OpenSCADLibs where I put libraries and include everything with <LIbName/file.scad> because even though I only have my own library at the moment, I don't want to rule out using another library.

That seems like a good convention for libraries with more than one file, but a library with a single file shouldn't require a folder to contain that one file.


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

Re: Polyhedron generation from two parallel polygones?

rew
In reply to this post by nophead
On Wed, Jul 08, 2020 at 02:25:29PM +0100, nop head wrote:
> I think OPENSCADPATH is intended to point to a folder of libraries, not a
> single library.

I don't know about the MAC and I don't know about OpenSCAD's
implementation, but guessing from the name: In classical Unix, a path
is a list of directories where the objects of interest might be found.

How to specify the second entry in the list (separated by a space?
Colon? Comma?) depends on the implementation.

        Roger.

--
** [hidden email] ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

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

Re: Polyhedron generation from two parallel polygones?

nophead
Actually, yes you can put several paths in OPENSCADPATH. It should have been called OPENSCADPATHS!

The separator is ; on Windows and : on Linux. Mac is probably the same as Linux.

On Wed, 8 Jul 2020 at 14:35, Rogier Wolff <[hidden email]> wrote:
On Wed, Jul 08, 2020 at 02:25:29PM +0100, nop head wrote:
> I think OPENSCADPATH is intended to point to a folder of libraries, not a
> single library.

I don't know about the MAC and I don't know about OpenSCAD's
implementation, but guessing from the name: In classical Unix, a path
is a list of directories where the objects of interest might be found.

How to specify the second entry in the list (separated by a space?
Colon? Comma?) depends on the implementation.

        Roger.

--
** [hidden email] ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

_______________________________________________
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: Polyhedron generation from two parallel polygones?

acwest
That is pretty much the standard for path separators. So is the name Path instead of PATHS, I agree that PATHS would be clearer, but to fix it, you would need a time machine and access to Bell Labs in the 70s (possibly earlier) 

On Wed, 8 Jul 2020, 09:58 nop head, <[hidden email]> wrote:
Actually, yes you can put several paths in OPENSCADPATH. It should have been called OPENSCADPATHS!

The separator is ; on Windows and : on Linux. Mac is probably the same as Linux.

On Wed, 8 Jul 2020 at 14:35, Rogier Wolff <[hidden email]> wrote:
On Wed, Jul 08, 2020 at 02:25:29PM +0100, nop head wrote:
> I think OPENSCADPATH is intended to point to a folder of libraries, not a
> single library.

I don't know about the MAC and I don't know about OpenSCAD's
implementation, but guessing from the name: In classical Unix, a path
is a list of directories where the objects of interest might be found.

How to specify the second entry in the list (separated by a space?
Colon? Comma?) depends on the implementation.

        Roger.

--
** [hidden email] ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

_______________________________________________
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: Polyhedron generation from two parallel polygones?

nophead
However if you do point it directly to several libraries I think you could get conflicts between filenames. So I think it is still better to point it to a folder of libraries, or several folders of libraries, and always prefix the include with the library name.

On Wed, 8 Jul 2020 at 15:07, A. Craig West <[hidden email]> wrote:
That is pretty much the standard for path separators. So is the name Path instead of PATHS, I agree that PATHS would be clearer, but to fix it, you would need a time machine and access to Bell Labs in the 70s (possibly earlier) 

On Wed, 8 Jul 2020, 09:58 nop head, <[hidden email]> wrote:
Actually, yes you can put several paths in OPENSCADPATH. It should have been called OPENSCADPATHS!

The separator is ; on Windows and : on Linux. Mac is probably the same as Linux.

On Wed, 8 Jul 2020 at 14:35, Rogier Wolff <[hidden email]> wrote:
On Wed, Jul 08, 2020 at 02:25:29PM +0100, nop head wrote:
> I think OPENSCADPATH is intended to point to a folder of libraries, not a
> single library.

I don't know about the MAC and I don't know about OpenSCAD's
implementation, but guessing from the name: In classical Unix, a path
is a list of directories where the objects of interest might be found.

How to specify the second entry in the list (separated by a space?
Colon? Comma?) depends on the implementation.

        Roger.

--
** [hidden email] ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

_______________________________________________
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

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

Re: Polyhedron generation from two parallel polygones?

cacb
On 2020-07-08 16:15, nop head wrote:
> However if you do point it directly to several libraries I think you
> could get conflicts between filenames. So I think it is still better
> to point it to a folder of libraries, or several folders of libraries,
> and always prefix the include with the library name.

That is obviously the correct approach, consistent with other systems.
Also, you can add new libraries without changing the OPENSCADPATH
variable this way.

Carsten Arnholm

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

Re: Polyhedron generation from two parallel polygones?

adrianv
In reply to this post by caterpillar
Before you send code to others you write a document??  That's not a good
strategy for being able to share code easily.  If I post a snippet to the
forum I shouldn't have to write a document to explain how to use the code.  

I understand that your approach makes sense for you as the dotSCAD developer
given that you aren't using other libraries.  Though as a library developer
myself I actually do sometimes run code based on other libraries.  (I also
have installed several different sweep.scad files from difference sources,
including dotSCAD and list-comprehension-demos.) I suppose it depends on
your intent.  Are you writing the library just for your own use and just
incidentally making it available online?  Or is your intent to write a
library for others to use?  If you're just writing it for yourself, then of
course you should do what makes sense to you.  But if your intent is to
distribute the library for broad use, I think it's worth thinking a bit
about the bigger picture and how your users will use it, and what makes
sense for them rather than what makes sense for you.  

Broadly speaking about any library, instead of every piece of code coming
with a document, the *library* should come with an installation document
that explains the one official correct way to install and reference the
library.  The current dotSCAD instructions suggest that you might put src on
the openscad path or maybe not and then prefix everything with dotSCAD/src.  
Instead a library should specify THE CORRECT way it is to be done rather
than suggesting that users kind of figure something out independently.  The
method of installation should presume that the user has and uses other
libraries as well, and your library should coexist with other libraries that
include files with the same name.  Suggesting that the dotSCAD src directory
be on the openscad path really doesn't make sense for anybody except the
dotSCAD developer and is hostile to coexistence with other libraries.  (And
it could really confuse users who don't really understand what is going on
but who try to install two libs.)  With one official way to use the code,
all the examples and all the dotSCAD code should be written to look the
same.  So if you really prefer "use<dotSCAD/src/sweep.scad>" then so be it.
You write that every time, in every example.  When you or anybody posts an
example to the forum it says "use <dotSCAD/src/...>".  The current situation
where there's one system for the library developer and another system for
everybody else and the examples are all written for the developer rather
than for the user---it kind of doesn't make sense.  Who is supposed to use
those examples?  Users or the developer?  It's a nuisance that any time I
want to run one of your examples I have to modify it first.  Or I have to
stick it into your src directory.

You're right that my earlier suggestion still creates incompatibilities.  
The most portable way to install dotSCAD right now means writing the clumsy
full statements "use<dotSCAD/src/...&quot;, since that is how the library
comes packaged. Another observation: if I see some code that says
&quot;use&lt;dotSCad/src/sweep.scad>" then a quick google search for dotSCAD
takes me right to your library so it's easy to figure out how to get the
code, even if it got separated from use instructions.   If I see "use
<sweep.scad>" and do a search for that then dotSCAD is not even on the first
page of hits.  It's not even among the first 5 pages of hits.   But some
other sweep.scad files turn up.  The ambiguity of "sweep.scad" is not a good
thing.  

Also please note that I'm not trying to attack your library but rather
making a suggestion for improvement.  It is better for OpenSCAD if libraries
are used in a consistent way, and in a way that as much as possible,
prevents them from conflicting with each other.   Yes, people *can* have
different ways of managing libraries, but this is not a good idea.  There
should be a standard way of doing it to minimize confusion and complication
of using libraries.  In other languages you don't see each user devising
their own library management scheme, with different strategies for where the
libraries are installed, how to set up the path, and how to include the
libraries in their code!


caterpillar wrote

> adrianv wrote
>> Personally I think the approach dotSCAD uses is a little broken.  If you
>> do
>> like he suggests and you install two libs that both provide sweep.scad
>> you'll not be sure which one you're using.  If you provide code to
>> someone
>> else they won't know which of many sweep.scad files were intended.
>
>
> That's because I'm developing dotSCAD out of the `libraries` folder of
> OpenSCAD. Setting `OPENSCADPATH` is convenient for me. I don't have to
> tell
> myself I'm using dotSCAD when I'm developing dotSCAD.
>
> People can have different ways to manage their libraries when using
> OpenSCAD.
>
> Coping everything from dotSCAD/src into a libraries/dotSCAD and `use
> &lt;dotSCAD/sweep.scad&gt;;` also cause errors when you send your code to
> someone
> because he prefers to put the dotSCAD repo in the libraries folder of
> OpenSCAD.
>
> What users should do is reading `OpenSCAD User Manual/Libraries` carefully
> and deciding how to manage their libraries. Before you send code to
> others,
> write a document for it.
>
>
>
>
>
> -----
> https://openhome.cc
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list

> Discuss@.openscad

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org





--
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: Polyhedron generation from two parallel polygones?

lar3ry
In reply to this post by caterpillar
On 8 Jul 2020 at 4:59, caterpillar wrote:
> Are you using Windows? If that's your case, you should `SET
> PATH=/Users/dpa/Documents/OpenSCAD/libraries/dotSCAD/src` in your cmd.

Will this append the path to the PATH variable? I have always added it to the
current contents of PATH using Notepad++. If it appends, Great!

I hesitate to just try it.


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

Re: Polyhedron generation from two parallel polygones?

JordanBrown
In reply to this post by nophead
On 7/8/2020 6:57 AM, nop head wrote:
Actually, yes you can put several paths in OPENSCADPATH. It should have been called OPENSCADPATHS!

No.  The word "path" is overloaded:  it refers both to the set of nodes that one walks to traverse the directory tree to reach a particular file, and it refers to the set of directories that one walks to to find a desired file, a search path.  It's used here (and in other UNIX-derived contexts) in that latter sense.


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

Re: Polyhedron generation from two parallel polygones?

lar3ry
In reply to this post by lar3ry
On 8 Jul 2020 at 9:13, [hidden email] wrote:
> On 8 Jul 2020 at 4:59, caterpillar wrote:
> > Are you using Windows? If that's your case, you should `SET
> > PATH=/Users/dpa/Documents/OpenSCAD/libraries/dotSCAD/src` in your cmd.
>
> Will this append the path to the PATH variable? I have always added it to the
> current contents of PATH using Notepad++. If it appends, Great!
>
> I hesitate to just try it.

Never mind. Just tried it, after making sure I could revert to my current PATH
settings.

No, it does not append.

Oh, and as far as I know the PATH environmental variable is only for finding
executables.

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

Re: Polyhedron generation from two parallel polygones?

caterpillar
In reply to this post by adrianv
You might make
adrianv wrote
> Before you send code to others you write a document??  That's not a good
> strategy for being able to share code easily.  If I post a snippet to the
> forum I shouldn't have to write a document to explain how to use the code.  
>
> I understand that your approach makes sense for you as the dotSCAD
> developer
> given that you aren't using other libraries.  Though as a library
> developer
> myself I actually do sometimes run code based on other libraries.

You might misunderstand my points. As I said before,  Setting `OPENSCADPATH`
is convenient for me.

I never rule out other libraries. I just said that people can have different
ways to manage their libraries when using OpenSCAD. The internal
implementation of dotSCAD supports this (always use a relative path to use
other modules/functions).

That's why users can set `OPENSCADPATH`, copy src or just put all repo into
the libraries folder.



-----
https://openhome.cc
--
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: Polyhedron generation from two parallel polygones?

caterpillar
In reply to this post by adrianv
adrianv wrote
> There
> should be a standard way of doing it to minimize confusion and
> complication
> of using libraries.  In other languages you don't see each user devising
> their own library management scheme, with different strategies for where
> the
> libraries are installed, how to set up the path, and how to include the
> libraries in their code!

It is another story. For now, OpenSCAD itself doesn't have proper namespace
management. The so-called standard way is first heard by me. Actually, I can
see other languages that users devise their own library management scheme.
For example, JavaScript before ES6.

ES6 took the experience from those users devising their own library
management scheme and came up with the standard module system.

That's why I think users should decide their own way to manage their
libraries. If OpenSCAD will come up with its own namespace management, it
will know what users really want.






-----
https://openhome.cc
--
Sent from: http://forum.openscad.org/

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