openpyscad
openpyscad copied to clipboard
How do I read graphic data in a python recognized type?
a = ops.Cube([10,10,10])
b = ops.Cube([4,4,4]).translate([4,4,4])
c = a & b
For example, how do I read data from c in a format that python recognizes,such as math, np.array and so on.
Or how do I know if A is empty? The A here is the graph after the combination of graphics logic. Since I need to perform logical operation on the created graph, I want to know whether the graph is intersected by logical operation.
I couldn't find an operation to convert the data from solidpython into a type recognized by python.
Thank you very much!
@Frank-bool This tool does generate scad text source code. This doesn't calculate any mathematical stuff, which should be done in OpenSCAD itself. You can just get values you put in, but that's it.
>>> a = ops.Cube([10,10,10])
>>> print(a.size)
[10, 10, 10]
>>> b = ops.Cube([4,4,4]).translate([4,4,4])
>>> print(b.v)
[4, 4, 4]
Or how do I know if A is empty? Sorry I am not sure what do you mean by A.