With a fair amount of help from this community, I've figured out how to align instances along edges -- and get wonderful 3d prints in the process. Which brings me to the current challenge. With the constraints of my resin printer's build plate (about 12cm x about 20cm), I need to be able to print objects that "unfold" to up to 1.5x that size for my costume work.
This means that I need to be able to subdivide the objects and fold their edges at the subdivided points, so I can print them "folded" up on the printer, and then "unfold" them.
I'm almost there - I've got a geometry nodes setup that does the subdividing and the folding along the edge normals. The problem is that the edges are being folded at the wrong angle.
I'm using the following formula to calculate the distance to offset the selected vertices (those created by the subdivision itself) based on the desired fold angle:
The next part is that I scale the vector normal of the edge "N" by the distance "D" to get the offset.
And this is where the trouble begins. I know my trig is correct, so I think the issue is how I'm relating the "D" to the vector "N."
Here is my node setup:
With the current reltionship between "D" and "N," I'm getting angles that seem inappropriately scaled. At Angle = 0, and Angle = 180 I'm getting values consistent with a tangent curve, so I think there's an additional factor that needs to be added to the DxN equation that I'm not aware of, but I have no idea what it is. In addition, the fold angles generated are inconsistent between 2D wireframes with no faces and 3D meshes, like the icosphere I actually want to fold and print.
For example, when I run a test on a 2D wireframe mesh, when I enter 120 degrees as the desired bend angle, I get an actual bend angle of 98.21 degrees.
When I run a test on a 3D cube, and enter 90 degrees as the desired bend angle, I get an actual bend of 145.95.
And when I run a test on 2-frequency icosphere, I get different bend angles for the different edge lengths. What should be happening is that the bend angle should always be consistent, regardless of edge length "L." "D" should be adjusting accordingly, but something else is apparently happening.
Here are the images from my tests.
Square
Hex
Cube
Icosa
I've also included the .blend file for anyone who so desires to experiment. I think the fix -- getting selected edges to always fold at the correct angles should be fairly simple... I think it's in what I'm doing with "N" and "D." But again...?
Thanks in advance for your help!
I've included the Blend file for testing. Note, you'll need to have MeasureIt tools enabled in your blender setup to view & manipulate the tests and get accurate decimal angle reads. Also, I'm using blender 3.6.
EDIT 1: Based on recommendation by Chris in the comments below, I corrected the formula in the second image. The fundamental issue remains, however.