discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

openscad+python

SP
Sanjeev Prabhakar
Tue, Dec 27, 2022 2:33 PM

Hi All,

I was working on creating various models in OpenScad where the points are
calculated through python (Jupyter Notebook).

Written a library of functions called openscad1.py (
https://github.com/sprabhakar2006/openSCAD)

you can make you own libraries once you are familiar with the process
followed

Just wanted to share the way it works:

  1. download anaconda distribution from
    https://www.anaconda.com/products/distribution

  2. follow the steps to install it.

  3. open a terminal or command prompt and you should see something like this
    in macbook:

(base) sanjeevprabhakar@Sanjeevs-MacBook-Air python %
for windows also it should start with (base)

  1. create a virtual environment by typing following in the terminal:

conda create --name openscad

you can change 'openscad' to any other name you like

  1. activate 'openscad' environment by typing following:

conda activate openscad

now you will see (base) is changed to (openscad) in terminal
to get back to base environment type:

conda deactivate

  1. Once you have activated the openscad environment, following libraries
    needs to be installed
    • pandas
    • scipy
    • numpy
    • matplotlib
    • jupyter

to do that type following in the terminal or command prompt

pip install pandas scipy numpy matplotlib jupyter

  1. now close the terminal, go to the folder you want to work in and
    download following files in the same folder:
    example of various functions.ipynb
    openscad1.py
    dependencies2.scad (copy or move this file to the "libraries" folder of
    openscad)

  2. open a new terminal from your working folder

  3. activate openscad environment by: conda activate openscad

  4. type in terminal: jupyter notebook and press enter
    this will open the home directory and you can see the downloaded files

  5. click open the file "example of various functions.ipynb"

  6. you need to learn how to run the code in the cells: "DO NOT RUN ALL THE
    CODES AT ONCE" please
    you can click inside a cell and

  • press ctrl+enter in windows
  • press command+enter in macbook

Note: in the examples path to the file "trial.scad" is given and you need
to change it as per your path in each example

My settings for openScad:

  • version: 2022.12.09 (git 972d18464)
  • Preferences-> Features
    check following boxes:
    fast-csg, lazy-union, vertex-object-renderers,
    vertex-object-renderers-indexing, vertex-object-renderers-direct,
    vertex-object-renderers-prelloc, import-function

I don't know what all of these things mean, but it works

go to Preferences-> Advanced
check box: Stop on first warning

I hope this works for you

Sanjeev

Hi All, I was working on creating various models in OpenScad where the points are calculated through python (Jupyter Notebook). Written a library of functions called openscad1.py ( https://github.com/sprabhakar2006/openSCAD) you can make you own libraries once you are familiar with the process followed Just wanted to share the way it works: 1. download anaconda distribution from https://www.anaconda.com/products/distribution 2. follow the steps to install it. 3. open a terminal or command prompt and you should see something like this in macbook: (base) sanjeevprabhakar@Sanjeevs-MacBook-Air python % for windows also it should start with (base) 4. create a virtual environment by typing following in the terminal: conda create --name openscad you can change 'openscad' to any other name you like 5. activate 'openscad' environment by typing following: conda activate openscad now you will see (base) is changed to (openscad) in terminal to get back to base environment type: conda deactivate 6. Once you have activated the openscad environment, following libraries needs to be installed - pandas - scipy - numpy - matplotlib - jupyter to do that type following in the terminal or command prompt pip install pandas scipy numpy matplotlib jupyter 7. now close the terminal, go to the folder you want to work in and download following files in the same folder: example of various functions.ipynb openscad1.py dependencies2.scad (copy or move this file to the "libraries" folder of openscad) 8. open a new terminal from your working folder 9. activate openscad environment by: conda activate openscad 10. type in terminal: jupyter notebook and press enter this will open the home directory and you can see the downloaded files 11. click open the file "example of various functions.ipynb" 12. you need to learn how to run the code in the cells: "DO NOT RUN ALL THE CODES AT ONCE" please you can click inside a cell and - press ctrl+enter in windows - press command+enter in macbook Note: in the examples path to the file "trial.scad" is given and you need to change it as per your path in each example My settings for openScad: - version: 2022.12.09 (git 972d18464) - Preferences-> Features check following boxes: fast-csg, lazy-union, vertex-object-renderers, vertex-object-renderers-indexing, vertex-object-renderers-direct, vertex-object-renderers-prelloc, import-function I don't know what all of these things mean, but it works go to Preferences-> Advanced check box: Stop on first warning I hope this works for you Sanjeev
J
jon
Tue, Dec 27, 2022 3:10 PM

And THIS stunningly long list of things-to-do is why I avoid Linux and
Python entirely.

Jon

On 12/27/2022 9:33 AM, Sanjeev Prabhakar wrote:

Hi All,

I was working on creating various models in OpenScad where the points
are calculated through python (Jupyter Notebook).

Written a library of functions called openscad1.py (
https://github.com/sprabhakar2006/openSCAD)

you can make you own libraries once you are familiar with the process
followed

Just wanted to share the way it works:

  1. download anaconda distribution from
    https://www.anaconda.com/products/distribution

  2. follow the steps to install it.

  3. open a terminal or command prompt and you should see something like
    this in macbook:

(base) sanjeevprabhakar@Sanjeevs-MacBook-Air python %

for windows also it should start with (base)

  1. create a virtual environment by typing following in the terminal:

conda create --name openscad

you can change 'openscad' to any other name you like

  1. activate 'openscad' environment by typing following:

conda activate openscad

now you will see (base) is changed to (openscad) in terminal
to get back to base environment type:

conda deactivate

  1. Once you have activated the openscad environment, following
    libraries needs to be installed
        - pandas
        - scipy
        - numpy
        - matplotlib
        - jupyter

to do that type following in the terminal or command prompt

   pip install pandas scipy numpy matplotlib jupyter

  1. now close the terminal, go to the folder you want to work in and
    download following files in the same folder:
    example of various functions.ipynb
    openscad1.py
    dependencies2.scad (copy or move this file to the "libraries" folder
    of openscad)

  2. open a new terminal from your working folder

  3. activate openscad environment by: conda activate openscad

  4. type in terminal: jupyter notebook and press enter
    this will open the home directory and you can see the downloaded files

  5. click open the file "example of various functions.ipynb"

  6. you need to learn how to run the code in the cells: "DO NOT RUN
    ALL THE CODES AT ONCE" please
    you can click inside a cell and

  • press ctrl+enter in windows
  • press command+enter in macbook

Note: in the examples path to the file "trial.scad" is given and you
need to change it as per your path in each example

My settings for openScad:

  • version: 2022.12.09 (git 972d18464)
  • Preferences-> Features
      check following boxes:
    fast-csg, lazy-union, vertex-object-renderers,
    vertex-object-renderers-indexing, vertex-object-renderers-direct,
    vertex-object-renderers-prelloc, import-function

I don't know what all of these things mean, but it works

go to Preferences-> Advanced
check box: Stop on first warning

I hope this works for you

Sanjeev


OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

And THIS stunningly long list of things-to-do is why I avoid Linux and Python entirely. Jon On 12/27/2022 9:33 AM, Sanjeev Prabhakar wrote: > Hi All, > > I was working on creating various models in OpenScad where the points > are calculated through python (Jupyter Notebook). > > Written a library of functions called openscad1.py ( > https://github.com/sprabhakar2006/openSCAD) > > you can make you own libraries once you are familiar with the process > followed > > Just wanted to share the way it works: > > 1. download anaconda distribution from > https://www.anaconda.com/products/distribution > > 2. follow the steps to install it. > > 3. open a terminal or command prompt and you should see something like > this in macbook: > > (base) sanjeevprabhakar@Sanjeevs-MacBook-Air python % > > for windows also it should start with (base) > > 4. create a virtual environment by typing following in the terminal: > > conda create --name openscad > > you can change 'openscad' to any other name you like > > 5. activate 'openscad' environment by typing following: > > conda activate openscad > > now you will see (base) is changed to (openscad) in terminal > to get back to base environment type: > > conda deactivate > > 6. Once you have activated the openscad environment, following > libraries needs to be installed >     - pandas >     - scipy >     - numpy >     - matplotlib >     - jupyter > > to do that type following in the terminal or command prompt > >    pip install pandas scipy numpy matplotlib jupyter > > 7. now close the terminal, go to the folder you want to work in and > download following files in the same folder: > example of various functions.ipynb > openscad1.py > dependencies2.scad (copy or move this file to the "libraries" folder > of openscad) > > 8. open a new terminal from your working folder > > 9. activate openscad environment by: conda activate openscad > > 10. type in terminal: jupyter notebook and press enter > this will open the home directory and you can see the downloaded files > > 11. click open the file "example of various functions.ipynb" > > 12. you need to learn how to run the code in the cells: "DO NOT RUN > ALL THE CODES AT ONCE" please > you can click inside a cell and > - press ctrl+enter in windows > - press command+enter in macbook > > Note: in the examples path to the file "trial.scad" is given and you > need to change it as per your path in each example > > My settings for openScad: > - version: 2022.12.09 (git 972d18464) > - Preferences-> Features >   check following boxes: > fast-csg, lazy-union, vertex-object-renderers, > vertex-object-renderers-indexing, vertex-object-renderers-direct, > vertex-object-renderers-prelloc, import-function > > I don't know what all of these things mean, but it works > > go to Preferences-> Advanced > check box: Stop on first warning > > I hope this works for you > > Sanjeev > > > > > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
EC
Eric Concha
Tue, Dec 27, 2022 3:27 PM

Come on my friend, the "long" list shared by Sanjeev is produced just
because he is given us in detail all the steps necessaries to run his
library from a computer even without python ... however, if you have
python and JN already installed (my case) go directly to step 12 ... I
use both python and openscad, and I think it is a fantastic idea, I will
explore your code Sanjeev ... thank you very much for sharing your work
... !!!

Eric.

On 27-12-22 12:10, jon wrote:

And THIS stunningly long list of things-to-do is why I avoid Linux and
Python entirely.

Jon

On 12/27/2022 9:33 AM, Sanjeev Prabhakar wrote:

Hi All,

I was working on creating various models in OpenScad where the points
are calculated through python (Jupyter Notebook).

Written a library of functions called openscad1.py (
https://github.com/sprabhakar2006/openSCAD)

you can make you own libraries once you are familiar with the process
followed

Just wanted to share the way it works:

  1. download anaconda distribution from
    https://www.anaconda.com/products/distribution

  2. follow the steps to install it.

  3. open a terminal or command prompt and you should see something
    like this in macbook:

(base) sanjeevprabhakar@Sanjeevs-MacBook-Air python %

for windows also it should start with (base)

  1. create a virtual environment by typing following in the terminal:

conda create --name openscad

you can change 'openscad' to any other name you like

  1. activate 'openscad' environment by typing following:

conda activate openscad

now you will see (base) is changed to (openscad) in terminal
to get back to base environment type:

conda deactivate

  1. Once you have activated the openscad environment, following
    libraries needs to be installed
        - pandas
        - scipy
        - numpy
        - matplotlib
        - jupyter

to do that type following in the terminal or command prompt

   pip install pandas scipy numpy matplotlib jupyter

  1. now close the terminal, go to the folder you want to work in and
    download following files in the same folder:
    example of various functions.ipynb
    openscad1.py
    dependencies2.scad (copy or move this file to the "libraries" folder
    of openscad)

  2. open a new terminal from your working folder

  3. activate openscad environment by: conda activate openscad

  4. type in terminal: jupyter notebook and press enter
    this will open the home directory and you can see the downloaded files

  5. click open the file "example of various functions.ipynb"

  6. you need to learn how to run the code in the cells: "DO NOT RUN
    ALL THE CODES AT ONCE" please
    you can click inside a cell and

  • press ctrl+enter in windows
  • press command+enter in macbook

Note: in the examples path to the file "trial.scad" is given and you
need to change it as per your path in each example

My settings for openScad:

  • version: 2022.12.09 (git 972d18464)
  • Preferences-> Features
      check following boxes:
    fast-csg, lazy-union, vertex-object-renderers,
    vertex-object-renderers-indexing, vertex-object-renderers-direct,
    vertex-object-renderers-prelloc, import-function

I don't know what all of these things mean, but it works

go to Preferences-> Advanced
check box: Stop on first warning

I hope this works for you

Sanjeev


OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

Come on my friend, the "long" list shared by Sanjeev is produced just because he is given us in detail all the steps necessaries to run his library from a computer even without python ... however, if you have python and JN already installed (my case) go directly to step 12 ... I use both python and openscad, and I think it is a fantastic idea, I will explore your code Sanjeev ... thank you very much for sharing your work ... !!! Eric. On 27-12-22 12:10, jon wrote: > > And THIS stunningly long list of things-to-do is why I avoid Linux and > Python entirely. > > Jon > > > On 12/27/2022 9:33 AM, Sanjeev Prabhakar wrote: >> Hi All, >> >> I was working on creating various models in OpenScad where the points >> are calculated through python (Jupyter Notebook). >> >> Written a library of functions called openscad1.py ( >> https://github.com/sprabhakar2006/openSCAD) >> >> you can make you own libraries once you are familiar with the process >> followed >> >> Just wanted to share the way it works: >> >> 1. download anaconda distribution from >> https://www.anaconda.com/products/distribution >> >> 2. follow the steps to install it. >> >> 3. open a terminal or command prompt and you should see something >> like this in macbook: >> >> (base) sanjeevprabhakar@Sanjeevs-MacBook-Air python % >> >> for windows also it should start with (base) >> >> 4. create a virtual environment by typing following in the terminal: >> >> conda create --name openscad >> >> you can change 'openscad' to any other name you like >> >> 5. activate 'openscad' environment by typing following: >> >> conda activate openscad >> >> now you will see (base) is changed to (openscad) in terminal >> to get back to base environment type: >> >> conda deactivate >> >> 6. Once you have activated the openscad environment, following >> libraries needs to be installed >>     - pandas >>     - scipy >>     - numpy >>     - matplotlib >>     - jupyter >> >> to do that type following in the terminal or command prompt >> >>    pip install pandas scipy numpy matplotlib jupyter >> >> 7. now close the terminal, go to the folder you want to work in and >> download following files in the same folder: >> example of various functions.ipynb >> openscad1.py >> dependencies2.scad (copy or move this file to the "libraries" folder >> of openscad) >> >> 8. open a new terminal from your working folder >> >> 9. activate openscad environment by: conda activate openscad >> >> 10. type in terminal: jupyter notebook and press enter >> this will open the home directory and you can see the downloaded files >> >> 11. click open the file "example of various functions.ipynb" >> >> 12. you need to learn how to run the code in the cells: "DO NOT RUN >> ALL THE CODES AT ONCE" please >> you can click inside a cell and >> - press ctrl+enter in windows >> - press command+enter in macbook >> >> Note: in the examples path to the file "trial.scad" is given and you >> need to change it as per your path in each example >> >> My settings for openScad: >> - version: 2022.12.09 (git 972d18464) >> - Preferences-> Features >>   check following boxes: >> fast-csg, lazy-union, vertex-object-renderers, >> vertex-object-renderers-indexing, vertex-object-renderers-direct, >> vertex-object-renderers-prelloc, import-function >> >> I don't know what all of these things mean, but it works >> >> go to Preferences-> Advanced >> check box: Stop on first warning >> >> I hope this works for you >> >> Sanjeev >> >> >> >> >> >> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email todiscuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
SP
Sanjeev Prabhakar
Tue, Dec 27, 2022 5:31 PM

Thanks Eric

I find this approach quite interesting and might be of interest to someone.

Sanjeev

On Tue, 27 Dec 2022, 20:57 Eric Concha, ericconchamunoz@gmail.com wrote:

Come on my friend, the "long" list shared by Sanjeev is produced just
because he is given us in detail all the steps necessaries to run his
library from a computer even without python ... however, if you have python
and JN already installed (my case) go directly to step 12 ... I use both
python and openscad, and I think it is a fantastic idea, I will explore
your code Sanjeev ... thank you very much for sharing your work ... !!!

Eric.

On 27-12-22 12:10, jon wrote:

And THIS stunningly long list of things-to-do is why I avoid Linux and
Python entirely.

Jon

On 12/27/2022 9:33 AM, Sanjeev Prabhakar wrote:

Hi All,

I was working on creating various models in OpenScad where the points are
calculated through python (Jupyter Notebook).

Written a library of functions called openscad1.py (
https://github.com/sprabhakar2006/openSCAD)

you can make you own libraries once you are familiar with the process
followed

Just wanted to share the way it works:

  1. download anaconda distribution from
    https://www.anaconda.com/products/distribution

  2. follow the steps to install it.

  3. open a terminal or command prompt and you should see something like
    this in macbook:

(base) sanjeevprabhakar@Sanjeevs-MacBook-Air python %
for windows also it should start with (base)

  1. create a virtual environment by typing following in the terminal:

conda create --name openscad

you can change 'openscad' to any other name you like

  1. activate 'openscad' environment by typing following:

conda activate openscad

now you will see (base) is changed to (openscad) in terminal
to get back to base environment type:

conda deactivate

  1. Once you have activated the openscad environment, following libraries
    needs to be installed
    • pandas
    • scipy
    • numpy
    • matplotlib
    • jupyter

to do that type following in the terminal or command prompt

pip install pandas scipy numpy matplotlib jupyter
  1. now close the terminal, go to the folder you want to work in and
    download following files in the same folder:
    example of various functions.ipynb
    openscad1.py
    dependencies2.scad (copy or move this file to the "libraries" folder of
    openscad)

  2. open a new terminal from your working folder

  3. activate openscad environment by: conda activate openscad

  4. type in terminal: jupyter notebook and press enter
    this will open the home directory and you can see the downloaded files

  5. click open the file "example of various functions.ipynb"

  6. you need to learn how to run the code in the cells: "DO NOT RUN ALL
    THE CODES AT ONCE" please
    you can click inside a cell and

  • press ctrl+enter in windows
  • press command+enter in macbook

Note: in the examples path to the file "trial.scad" is given and you need
to change it as per your path in each example

My settings for openScad:

  • version: 2022.12.09 (git 972d18464)
  • Preferences-> Features
    check following boxes:
    fast-csg, lazy-union, vertex-object-renderers,
    vertex-object-renderers-indexing, vertex-object-renderers-direct,
    vertex-object-renderers-prelloc, import-function

I don't know what all of these things mean, but it works

go to Preferences-> Advanced
check box: Stop on first warning

I hope this works for you

Sanjeev


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks Eric I find this approach quite interesting and might be of interest to someone. Sanjeev On Tue, 27 Dec 2022, 20:57 Eric Concha, <ericconchamunoz@gmail.com> wrote: > Come on my friend, the "long" list shared by Sanjeev is produced just > because he is given us in detail all the steps necessaries to run his > library from a computer even without python ... however, if you have python > and JN already installed (my case) go directly to step 12 ... I use both > python and openscad, and I think it is a fantastic idea, I will explore > your code Sanjeev ... thank you very much for sharing your work ... !!! > > Eric. > > > > On 27-12-22 12:10, jon wrote: > > And THIS stunningly long list of things-to-do is why I avoid Linux and > Python entirely. > > Jon > > > On 12/27/2022 9:33 AM, Sanjeev Prabhakar wrote: > > Hi All, > > I was working on creating various models in OpenScad where the points are > calculated through python (Jupyter Notebook). > > Written a library of functions called openscad1.py ( > https://github.com/sprabhakar2006/openSCAD) > > you can make you own libraries once you are familiar with the process > followed > > Just wanted to share the way it works: > > 1. download anaconda distribution from > https://www.anaconda.com/products/distribution > > 2. follow the steps to install it. > > 3. open a terminal or command prompt and you should see something like > this in macbook: > > (base) sanjeevprabhakar@Sanjeevs-MacBook-Air python % > for windows also it should start with (base) > > 4. create a virtual environment by typing following in the terminal: > > conda create --name openscad > > you can change 'openscad' to any other name you like > > 5. activate 'openscad' environment by typing following: > > conda activate openscad > > now you will see (base) is changed to (openscad) in terminal > to get back to base environment type: > > conda deactivate > > 6. Once you have activated the openscad environment, following libraries > needs to be installed > - pandas > - scipy > - numpy > - matplotlib > - jupyter > > to do that type following in the terminal or command prompt > > pip install pandas scipy numpy matplotlib jupyter > > 7. now close the terminal, go to the folder you want to work in and > download following files in the same folder: > example of various functions.ipynb > openscad1.py > dependencies2.scad (copy or move this file to the "libraries" folder of > openscad) > > 8. open a new terminal from your working folder > > 9. activate openscad environment by: conda activate openscad > > 10. type in terminal: jupyter notebook and press enter > this will open the home directory and you can see the downloaded files > > 11. click open the file "example of various functions.ipynb" > > 12. you need to learn how to run the code in the cells: "DO NOT RUN ALL > THE CODES AT ONCE" please > you can click inside a cell and > - press ctrl+enter in windows > - press command+enter in macbook > > Note: in the examples path to the file "trial.scad" is given and you need > to change it as per your path in each example > > My settings for openScad: > - version: 2022.12.09 (git 972d18464) > - Preferences-> Features > check following boxes: > fast-csg, lazy-union, vertex-object-renderers, > vertex-object-renderers-indexing, vertex-object-renderers-direct, > vertex-object-renderers-prelloc, import-function > > I don't know what all of these things mean, but it works > > go to Preferences-> Advanced > check box: Stop on first warning > > I hope this works for you > > Sanjeev > > > > > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > >