Graphscad
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Graphscad

Graphscad : The Graphic Nodal Editor for OpenScad
 
HomeLatest imagesSearchRegisterLog in

 

 Enhanced node_for

Go down 
2 posters
AuthorMessage
ChrisLT




Messages : 45
Date d'inscription : 2017-01-30
Localisation : Newbury, Berkshire, England

Enhanced node_for Empty
PostSubject: Enhanced node_for   Enhanced node_for Icon_minitimeThu 9 Mar - 1:29

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
Enhanced node_for Attachmentnode_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
Back to top Go down
Admin
Admin



Messages : 59
Date d'inscription : 2017-01-08

Enhanced node_for Empty
PostSubject: Re: Enhanced node_for   Enhanced node_for Icon_minitimeTue 14 Mar - 21:24

HI. and thanks for sharing.

I will release a version 1.0.8.

As suggested, i created a directory userplugins, additionnaly to plugins directory.
Now icons and .PY of plugins must be present in plugins or userplugins directory (before, icons of plugins where in icons directory, it now reserved to app icons).

To avoid problems you should create your own user plugins with differents names. For example, you upgraded node_add, rename it to node_addmultiple... and put it in userplugins directory.

Back to top Go down
https://graphscad.forumotion.com
Admin
Admin



Messages : 59
Date d'inscription : 2017-01-08

Enhanced node_for Empty
PostSubject: Re: Enhanced node_for   Enhanced node_for Icon_minitimeWed 15 Mar - 0:31

Will use your code in next version for a node called 'formulti'
Back to top Go down
https://graphscad.forumotion.com
Sponsored content





Enhanced node_for Empty
PostSubject: Re: Enhanced node_for   Enhanced node_for Icon_minitime

Back to top Go down
 
Enhanced node_for
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Graphscad :: show your creations-
Jump to: