2
$\begingroup$

I need to generate circle curves from a list of triads of points that come from an external object. Here I reproduced what I need form an arbitrary list of points generated by three bezier curves. I can generate a single circle using an integer index, but I need to generate as many as I want without replicating this cell N times because N can also be a parameter. Is there any way to do that? In the case showed in the figure I would need N=16 circles, one for each point in the sampled bezier curve. Thanks in advance

Here is a single circle curve of the example

PS I add a capture of the original nodes (here I replaced the bezier curves for the original nodes doing some involved calculation with matrices) and a viewer node showing the series of points generated for one of these nodes. There are three series of points like that and I nee a circle curve passing for each triad formed by the nth point of each series of points.

here is a capture of the output of one of these nodes

And I also added the original blend file here

$\endgroup$
6
  • $\begingroup$ How does the 'list of triads' associate the 3 points shared by a triad? $\endgroup$
    – Robin Betts
    Oct 17, 2023 at 19:51
  • $\begingroup$ The first triad is generated by the first point of each of the bezier lines, here sampled using the input index=0. More in general I wan to be able to generate a collection of circles with positions and radii obtained from a list, or even better from a list of triads of points. Each of these points comes from a three different geometries. Thanks $\endgroup$ Oct 18, 2023 at 4:55
  • 1
    $\begingroup$ Thanks! IMHO, I think you're going to have to give us a step back from here.. how the triads are generated, and presented to this part of your system. e.g Selected, somehow, from existing geometry? Read from a file? $\endgroup$
    – Robin Betts
    Oct 18, 2023 at 5:01
  • $\begingroup$ Oh yes I tried to simplify because each series of points comes from a another node that make some involved calculations. I added a screenshot of the original nodes, the internal of the node projection is not important but it generates the series of points displayed by the viewer node. Each of the three projection nodes generates a similar series of points and I need one circle passing for each triad. For example the 10th circle curve is determined by the three 10th points coming out from each of the projection nodes. Thanks. $\endgroup$ Oct 18, 2023 at 6:22
  • 1
    $\begingroup$ Thanks Robin, I suppose that the general idea can be understood even with the original nodes that are a stereographic projection of an inferse hopf fibration, so I attached the original blend file $\endgroup$ Oct 18, 2023 at 6:56

2 Answers 2

2
$\begingroup$

GN Primitives expect constants, not field, parameters, so unfortunately, we can't create circles from points to order.

Instead, we can create the appropriate number of unit, un-transformed, circle-instances, and transform those to order, so each becomes the circumcircle of its corresponding triad of points.

This group, given 3 points, returns the centre, radius, and (anticlockwise-facing) normal of their circumcircle, using this representation of the problem:

enter image description here

It can transform the instances according to the points provided by your projections, transferred as shown:

enter image description here

With this kind of result:

enter image description here

$\endgroup$
3
  • $\begingroup$ I won't even try to understand this setup. I see the more complicated part generates the points, so maybe I actually could... $\endgroup$ Oct 19, 2023 at 10:38
  • $\begingroup$ Hello, @MarkusvonBroady Hehe.. I'm ashamed to say I haven't looked up 'stereographic projection of an inverse hopf fibration', either, yet, that's OP's business... :D .. all I was looking for was the circumcircle of a triangle. $\endgroup$
    – Robin Betts
    Oct 19, 2023 at 10:50
  • $\begingroup$ Thanks for this answer @RobinBetts, it works as expected an made me understand the basics behind how the curves are put together with geonodes. I still have some problems with the projections and some of the circles are not mapped as they should be, but probably is a problem from my side. $\endgroup$ Oct 20, 2023 at 6:45
2
$\begingroup$

Blender 4

As of writing this, Blender 4.0 is in beta - theoretically it should mean it might have bugs but the functionality shouldn't change.

Using R.B.'s answer we can modify it to use the new Repeat Zone to generate multiple circles using the internal algorithm for circumscribing the circle:

this serves as both a generalized alternative on how to spawn multiple elements with varying properties, as well as a confirmation of Robin's math being correct:

(black is R.B., orange is mine answer, and the z-fighting means they overlap perfectly)

The low circle resolution shows discrepancy, I don't know if it's of any importance…

$\endgroup$
5
  • $\begingroup$ Aha! New opportunities for laziness! Always welcome. :) I have to get my head round GN loops $\endgroup$
    – Robin Betts
    Oct 19, 2023 at 11:21
  • 1
    $\begingroup$ @RobinBetts in a way, the introduction of the repeat zone strips the GN from some magic of having to come up with creative solutions under harsh limitations… Now that it's Turing-complete (it seems), it's just programming… $\endgroup$ Oct 19, 2023 at 11:29
  • $\begingroup$ Loops.. I wonder what the implications are for current/planned parallel processing, and therefore performance? $\endgroup$
    – Robin Betts
    Oct 19, 2023 at 11:35
  • 2
    $\begingroup$ @RobinBetts You're asking the right questions... I haven't tested it yet, but I expect some design decisions that made geonodes fast, are also incompatible with the stuff you would typically put inside repeat zones. The set position node is probably well optimized to take the array of data, put it on a stack (fast CPU memory), and iterate over it, whereas doing something like setting each vertex $x$ to previous vertex $x + 1$ inside a repeat zone is likely not only to copy that memory from RAM to CPU on each iteration of the loop, but also copy the entire array instead of just one vertex... $\endgroup$ Oct 19, 2023 at 13:50
  • $\begingroup$ Thank you both for the answers, this second one of @MarkusvonBroady exposes the new potential of the simulation zone in Blender 4. I was doing this using Python but it was extremely slow, now I am considering to move to geonodes. $\endgroup$ Oct 20, 2023 at 6:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .