Hi there. I’ve started to learn geometry nodes
I want to make a node tree that generates a whole architectural window out of simple geometry.
I have turned the outside edge of the mesh into a curve, and then added a square profile to it, so it would be the frame of the window.
However, instead of giving me a straight frame, it pinches at the corners. Is there any way I could instruct the curve not to pinch the frame in the corners?
And why is this even default behavior? Who would ever want that?
Basically, what I need is something like “Even thickness” checkbox in the solidify modifier. Of course, i don’t get why it even needs to exist, or why it isn’t on by default… Never did I ever not turn it on when using the solidify modifier…
EDIT: My goal is to make it generate a window, based on the shape of the original mesh. That is, you can model any shape of the window in edit mode, design your own inner grid by adding edge loops, and it will create a window, with a frame and glass, and even handles from it. So using Cube primitives for the outer frame won’t really achieve what I want. Yours is cool too though, it’s pretty simple and would be really effective for many archviz. A nice improvement would be, if the dimensions of this window would be set from the bounding box of the original mesh.
There is a new feature comming: Extrude nodes. There’s already a branch for it.
I think that might be the way to go… Will give it a shot.
I cracked the thing, kind of. This works by increasing the curve radius in relation to the angle each point makes with its neighbours (just like @Okidoki figured out). I’ll be honest there is one big point of uncertainty in this modifier : I used a heuristic to map the angle to the thickess. For some reason it’s 2.21, lol so… there’s room for improvement if anybody feels like picking it up.
And then I noticed that if you tilt the view, the increased radius will make the curve grow on other axes (obviously) so I went and flattened those vertices as a final step. The way it works is it takes every point on each side of the Z axis (relative to object origin) and flattens them. So if you build your object aligned to either X or Y axis, it won’t work (you’ll have to change the axes in the node group if you need it aligned to another axis).
Also like @DamianJ explained on the other thread, this works only for a square cross-section. And also only if the shape is flat, since it works on the radius attribute which is one-dimensional. So it’s very specialized, because the approach is simple, but it works (mostly).
It also needs to be a curve (with vector handles), because it works with the element index, and curves are the only way you can ensure connected points follow each other in order.
And by the way it’s a 3.1 file ! (used a couple new nodes such as domain size, etc)
This looks really good!
Hopefully, in the future, the curve to mesh node will simply have an “Even thickness” checkbox, or… would simply work, always, as I don’t quite get why anyone would ever turn that off.
This solution will have to do for now.
That’s the real problem: there is no simple because curves have no thickness. Just because it is superusefull to extrude a profile along a curve this doesn’t mean this profile doesn’t overlap in “sharp” curves and non smooth curves (like 90 degree) aren’t just easy because of the peak in the mathematical derivation… So this is one of those cases where someone just want it done and may not realise that from a mathmatical position there is no pure solution. An even thickness checkbox may be a solution for some cases (special orientatdt profile…see above) and not for other… so the next user complaint about the shitty solution when (s)he tries something which won’t work… so the developers are alwas loosing… (this is not a rant against any person. . but maybe a thought provoking impulse for anyone who reads this? ). Happy blending…
P.S.: to @Hadriscus: 3.1 to the rescue… so development is “one the run”, have still to download it… just using 3.0 for the “new” GN… so much to learn…
Yes opening in 3.0 will throw errors as it’s using new nodes, domain size and compare… I think that’s it. But you can replace compare with compare floats and manually specify domain size, although the setup becomes less procedural as a result
I’ve managed to turn what you came up here with into a group that takes in a curve and spits out a radius scale index.
However, the Z correction thing ain’t gonna work… I think what you have there would only work with square profiles. But what if you want to use custom profiles with complex shapes?
Maybe there’s a way to scale Curve points in XYZ, and not just set a radius?..
EDIT: Here’s an easy way to get even Z thickness for quad profiles: Use a 2D line as the profile curve. Then just extrude the geometry up…
I assume, the solution for complex profile curves would be to use the “Set position” node on the generated geometry, and scale all vertex Z positions down by the same curve radius number, but inverted. However, I can’t figure out how to apply each vertex the correct value…
Here is another possible approach:
Split the curve into lines, Extend the lines, so they would intersect. Boolean subtrack off the ends based on correct angles…
Something like that…
But I’m stuck on the first step: I want to Edge split the mesh, but I can’t figure out how to do it based on an angle
Blender documentation shows an old version of “Edge split” node, and it used to have an “Angle” value, but it’s gone… Why?..
Currently working on a general “even-thickness” offset node-group for Blender 3.0 (as part of a step-resampler and improvements to the z-up-curve-to-mesh node-group) , but in the meantime, I’ve back-ported your work to Blender 3.0 for anyone else who asks: geonodes_regularize_curve_radius (Blender 3.0).blend (113.4 KB)
Thought I’d also make you aware of the end-point selectors which even in 3.0 simplifies this bit for your setup quite a lot:
Left is standard curve-to-mesh with line primitive profile pointing in X+, right is WIP Z-Up-Even-Thickness experiment only offsetting a single point in X+. The “secret-sauce” is that the “scaling-fudge-factor” for some point projected along the normal (curve point’s local X-axis) is 1/sqrt(ang/pi), where ang is the curve-angle (in radians) for that point. (Not doing the radius method - going the route of custom projection like in my Z-Up-Curve-To-Mesh)
More than 14 hours of effort later and still too much of a WIP mess to share the .blend cos I went down the torturous rabbit hole of supporting multiple curves-per-object were any of those curves could be cyclic curves. Lots of cleanup still need to happen and would like to wrap it in a custom curve-to-mesh node-group similar to my Z-Up-Curve-To-Mesh. Just wanted to share the breakthrough of just getting it to work.
This is standard Curve-To-Mesh
…But here you see I’m doing a custom z-stepping of the curve which may not be what others are after but is something I’m working toward…
It was waaaaaaaay more work than I anticipated but I’ve needed something like this for ever so hopefully it’ll be worth it. Will post the final result to tips&tricks (hopefully sometime before Monday).