You can very easily combine 'for' and 'intersection_for' into a single node type, with a combo box to select 'for' or 'intersection_for'. As all Boolean operations are in one node type, this would seem a lot more consistent to me. Also, it makes much easier to experiment with switching between 'for' and 'intersection_for' while debugging.
It seems to me that both 'for' and 'intersection_for' should be in the same node group as 'boolean' and 'hull'. This is 'operation'. Currently, 'for' is shown as a 'control statement'. This seems inconsistent to me. Very minor point.
Also, OpenSCAD allows multiple variables to be iterated in a 'for' or 'intersection_for'. This makes for a more readable model, so I have added it into the attached zip file. My version of node_for.py is backwards compatible with the current one as far as 'for' is concerned. It implements intersection_for as a combo box option, but would not be correctly identified as the intersection_for node if you were to open an existing .scad file that uses intersection_for. So, for compatibility you could replace the existing node_for by this one, but must still keep the existing node_intersectionfor.
My new version allows up to three variables, so you can do, for instance:
for(i=[10:1:20],j=[0:1:9],k=[1,10,91]){...} with a single node.
The logic in GraphSCAD for hiding unused inputs on nodes isn't totally clear to me. I have found that inputs called 'a', 'b', 'c' etc are never hidden whereas 'a1', 'a2', 'a3' etc are hidden if null. So, the names are significant. If one of the inputs is a combo box the hiding logic is more complex and this caused me to default the combo boxes in node_for to 'i', 'j', 'k' rather than null names.
For backwards compatibility I call the first variable's start value 'start' not 'start1' etc.
My zip file includes dodecahedron.scad that shows intersection_for in action.
- Attachments
- node_for.zip
- ChrisLT's enhanced node_for that also does intersection_for and supports multiple variables
- You don't have permission to download attachments.
- (5 Kb) Downloaded 2 times