I’m making a fence with geometry nodes. I want the segments to be defined by a constant length but also I want to add poles on the curve points so that the fence follows the curve exactly.
Right now I can do either the constant length or the curve points but I can’t do both at the same time:
Here’s my file with some pointers :
fence_geo-nodes_ba.blend (1.2 MB)
Any idea what node setup I need to combine both concepts?
Is what you want to achieve even geometrically possible? Could you provide a screenshot where you place the poles manually the way you expect them?
Maybe by spliting each segments and making the begining of a segment, a pole, then constant spacing for each pole, and finish a segment with only the fence no poles. Etc. ?
I cannot treat the fence separately to the poles because I will then put it on a 3D ground with varying height and each segment should be straight but 2 segments may have different height (so they’d behave like stairs). As long as I find a proper solution to my first question the rest should be fine.
This is what it would look like on a flat surface (I treated the fence separately in this screenshot), although, now that I look at it, I don’t like those very short segments. I should find a way to avoid that too
But yes it’s geometrically possible, it’s just a matter of understanding how the nodes work and doing the math.
I found a simple but not yet ideal apporach by using the Subdivide Curve node. It lets me use a desired constant segment length while still putting poles on curve points. It avoids very short segments close to the corners, however, if I use the node setup on a curve with high point density, the desired constant segment length quickly has no effect anymore, as you can see here:
I’d like to be able to feed my node setup any curve with any point density and not have to do anything else.
The best solution would be to implement a “Simplify Curve” node group with an angle threshold parameter from which to decide whether to remove curve points or not.
I know how to get the angles as shown in the spreadsheet of the attached file, now I have to figure out how to use it.
fence_geo-nodes_ba2.blend (1.2 MB)
Say you only have two segments to your curve, one is 1 m long, the other 0.773 m. How do you propose to place the poles such that
a) each segment has equal length and
b) there is a pole at the corner?
Hurray I figured it out !
Look at this:
And the node setup is way simpler than what I got myself into in the beginning.
Here’s the file:
fence_geo-nodes_ba3.blend (1.3 MB)
@LordoftheFleas I understand what you mean, that’s why I used the words “desired constant length” (although not at the beginning). The latest setup finds the closest length to the desired one such that the segment is divided equally. The longer the curve segment, the closer the fence segment gets to the desired length.
And then the angle threshold deletes points based on their angle.
Now I can move on to implementing more customization parameters and handle displaced grounds.
Thanks for trying to help. I’ll make sure to upload the final result here and on blendswap.
2 Likes
I’m quite satisfied with my results. This will definitely speedup my workflow.
fence_geo-nodes_ba4.blend (2.2 MB)
I might do a demo video of the parameters and an english version of the file.
3 Likes