SolidCode / SolidPython

A python frontend for solid modelling that compiles to OpenSCAD
1.12k stars 174 forks source link

added comments on alpha value #155

Closed danpeirce closed 3 years ago

danpeirce commented 3 years ago

I was puzzled by the existing documentation in README.rst until I had a good look in utils.py.

I think my little addition to README.rst makes it more clear how to add the alpha value to a color.

danpeirce commented 3 years ago

Found I still could not see through the transparent object. I since found this issue with openscad and the alpha value: http://forum.openscad.org/Alpha-transparency-bug-td1555.html

It made reference to the % operator that I had not been aware of. My current work around is to make my transparent (laser cut) part with solidpython and then make import the resulting *.scad file into a manually created scad file in which I do the assembly. In the assembly scad file I can use the % operator and import stl files of 3D printed parts. If this can be done directly in solidpython I'd like to know?

etjones commented 3 years ago

Thanks for taking this on, Dan. The function you're looking for is either :

solid.background(openscad_obj: OpenSCADObject) -> OpenSCADObject

or <openscad_obj>.set_modifier('%')

These and the other OpenSCAD modifier functions (debug(), root(), disable()) are in objects.py and are definitely not well enough documented.

As for the document change in the PR, how do you feel about it now that we know about OpenSCAD alpha bug? On the one hand, it's good to document what the code is intended to do. On the other hand, if the code doesn't (and can't!) work, we would be making a promise we couldn't keep. What do you think?

etjones commented 3 years ago

v1.0.4 brings SolidPython color/transparency fully in line with OpenSCAD's behavior, so I've taken the README color section out entirely.