# How to afix multiple lines of points to edges

Alright. So I have a line of points. But not only 1 line. Multiple lines. I say "lines", because the points have all been projected to the same magnitude. So they're all lined up. I used what I learned in this other question to get the lines of points.

Now that they're all lined up, I want to scale them and fit them to their respective edges. The edges are just that: edges of a mesh. The problem is that each point-line is either smaller or larger than its respective edge. And misaligned too. I want them to match up, while still retaining the proportional distance of the points. Like this:

I've thought of a number of half-baked ideas:

1. The first instinct was to reach for the attribute statistics node. But as far as I'm aware, that thing can only work a single set of attributes at a time. It can't work each group of points individually.

2. Using the accumulate field node, each point-line can have their points added up, then divided to get the average. On my first test, I fooled myself into believing that actually got the middle point of each point-line. But no, the average is weighted to either one side or the other. I tried a bunch of stuff using this weighted average, but couldn't figure anything out. My guess is that I need the middle point. If only I could just get the minimum and maximum of each point-line. ðŸ¤”

3. Pursuing the middle point(vainly?), I turned to the Points to Curve node. Perhaps turning each point-line to a curve, I can select the middle of the curve, which would also be the middle of the point-line. Or, alternatively, I could just move the curve by selecting the ends, and moving them to the ends of the edges. I couldn't figure out either of these things. The endpoint selection node baffled me. I selected something, but I'm not sure they were the endpoints. If they were , then that means the end points aren't actually at the ends. Which means the Points to Curve node selected middle points as curve ends.

Well in any case. I'm stuck. Any ideas?

• Can you produce some .blend file with an example input and desired output for it? What I'm specifically interested in is if you already have some mapping of the point group to an edge, or you want to find the nearest edge? Ad 1: repeat zone. Ad 2: this gives you the average or mean point. By middle point you probably mean the center of the bounding box. Ad 3: you could discover it by converting the points to a curve and sampling at 50% factor. Dec 12, 2023 at 23:00
• For a minute, I thought curve sampling at 50% factor was the key. It appears that the resulting points are where they're supposed to be. However, when I subtract from their position, everything goes all lopsided. I suppose I will have to upload a file so you can see what I mean. How do I do that? Where's the file sharing button? Dec 13, 2023 at 21:13
• blender.meta.stackexchange.com/q/3050/60486 Dec 13, 2023 at 22:08
• Thanks. I added the file to the main post. The geometry node is pretty messy. Sorry about that. I wanted to clean it up, but I kept getting new ideas and trying them out. I thought that perhaps with the curve sample node, I could sample both ends of each curve, and then use that to get their lengths, and then scale the projected points to fit the edges. However, I noticed that the creation of the curves seem to rearrange the points??? ðŸ¤” idk. But using the mix node, it reveals how the points go from their curve position to a completely different position. It's all random. Dec 14, 2023 at 4:10