Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bifrost Nodegraph - average of an array coords

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
gioria.giulio
436 Views, 4 Replies

Bifrost Nodegraph - average of an array coords

Hi Everyone,

my first post here. I approched to Bifrost just few weeks ago, and I have a question: how can I obtain the average of an array that contain coords?

I have 2 intersecting objects, a vertical plane and an horizontal cylinder to create an irregular section. I want to track the nearest point of the plane on the cylinder surface, obtaining a single point as average and next using it to set translations of another geometry. At this time I've solved only the problem about projecting point on the surface (see attachment). I've not found a node that return an average, so I think the best way is to use an iteration after my sample property node. I've just watched the tutorial by Jonah Friedman (https://forums.autodesk.com/t5/bifrost-forum/introduction-to-bifrost-iteration-tutorial/td-p/8949069) but I can't get it work, maybe I am missing something. Please, someone could help me to connect properly nodes inside the iteration or suggest other solution?

Best.

Giulio.bifrost_average_v01.JPG

4 REPLIES 4
Message 2 of 5
mjcg91
in reply to: gioria.giulio

To get the average value of an array, you must sum the array's elements, and divide the result by the array's size.

array_average.jpg

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 3 of 5
gioria.giulio
in reply to: mjcg91

Hi, thank you for your prompt response, but I have some problems to get it work (see attachment)

I added a watchpoint and I see there are no data inside it.

Thanks in advance

bifrost_average_v02.JPG

Message 4 of 5
mjcg91
in reply to: gioria.giulio

This is because construct_points takes an array as input, and not a single value. If you pay attention, you can see that the input port on construct_points is hat shaped, which means that it is an array.

To make this work, you can use "build_array" before "construct_strands". Alternatively, you can right click on the point_position port, check "Fan-in", and then plug the value coming from the divide node.

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
Message 5 of 5
gioria.giulio
in reply to: mjcg91

Thank your help! now it works.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report