Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openpyscad as a python wrapper for openscad #29

Open
edmundsj opened this issue Oct 5, 2020 · 2 comments
Open

openpyscad as a python wrapper for openscad #29

edmundsj opened this issue Oct 5, 2020 · 2 comments

Comments

@edmundsj
Copy link

edmundsj commented Oct 5, 2020

Have you thought about turning openpyscad into a full wrapper for openscad, instead of just a source code generator? I think it would require minimal additional effort depending on how it is done, as openscad has a command line API, so you could just invoke openscad and, for example, directly generate an STL file, i.e.:

import openpyscad as ops

ops.Cube([10, 10, 10]).write('input.scad')
os.system('openscad -o output.stl input.scad')

Or directly open the viewer:

import openpyscad as ops

ops.Cube([10, 10, 10]).write('input.scad')
os.system('openscad input.scad')

This would be nice for those of us (me) that love to work in python as much as possible and hate working in other people's UIs/programs except for stuff like simple viewing. An example of a software package that does this well is gdspy. It provides all the logic for generating structures and a (very) simple viewer for the output file, and is a very popular package. You could even perhaps bundle openscad and openpyscad as a single conda package.

@lingster
Copy link

This sounds like an interesting idea. Just checking on the openscad command line api:
[openscad api] (https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment)
and it would be fairly straight foward to create a class to wrap around all the command lines api.

@taxpon
Copy link
Owner

taxpon commented Feb 14, 2021

Thanks, let me look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants