Switch between multiple Patches to process incomming data in a performant way

Im working on a nodeset to process a 3d path for a clay printer. there will be source nodes like a gcode importer or other generative sources, some processing nodes to modify the points on the path, speed or material extrusion and a gcode file saver to finally print the processed printpath.

i took that project as an opportunity to finally get started with vl and some things worked out quite well so far (like the gcode importer which would be a bit complicated to realise in vvvv, as you have to save data inbetween slices and use it in other slices) but for other things im struggling a lot (sometimes just small things which are a bit different than in vvvv and sometimes its because of all the new concepts introduced . (for example all this operation you can specifiy but the sametime the patch seems to have an execution order as well, then the pads which seem to save information at different time etc… its all quite confusing to me, but i remember i felt the same way when i started with vvvv long time ago and now it feels very transparent)

so for this specific project i decided to create a datatype called PrintPath, which atm has the properties:
PointPosition : Spread, E (MaterialExtrusion): Spread, F (Feedrate/Speed): Spread, PointNormals Spread.

All this properties have Pads assigned to to Set Operation and a Get operation.

In the VL Node called “SetPath” i want to get any one of these properties (could be position or material extrusion for example) and process it with values comming from an outside node (perlin noise for example). now my problem is that i want to switch to which of those properties (XYZ, E, F, Normals) the incomming modifier spread is added/calculated. so you could use the perlin noise to either move the points along ther normal, along their z axis or also control the amound of material being extruded via the e property.

While patching this i found out that the switch node in vl only has two inputs and it cant be configured to more via inspector. i asked on the vvvv riot chat how to solve this, and got informed that under vl, unlike than in vvvv, all the incoming pins and the connected graph above are always computed. which in this case is not a good idea, because the printpath for a 3d printer usually is made ou of several thousand of points, and i only want to calculate the modification for one the paths properties. this should happend preferably runtime so you can modify the design and see its outcome at interactive framerates.
I thought maybe this could be done via delegates (im not really understanding this entirely, so please correct me if thats the wrong direction of thinking). so for every property of printpath i would have another delegate which i can switch)

Please check my attached patches if something is unclear…

NodeSet.zip (28.5 KB)

the most easy and expressive way is to use IF regions. if they are enabled they process everything inside and if the condition is false nothing gets called and the data at the inputs is directly passed to the corresponding output.

with that you can enable/disable parts in your processing chain. i’d create one big manager patch that contains all of them and inputs that control the processing.

Oh, IF regions, makes totally sense,i was thinking to far/in the wrong direction! thanks for that tip…

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.