Help splitting the edges on a curve at the original vertices

Hello! First time posting and very new to blender. I’ve been messing around with nodes trying to build a little wall generator as a learning exercise, but I’ve hit a little roadblock. It’s my first post so apparently I can’t attach more than a single image so unfortunately all my screenshots are lumped together at the end, apologies.

I’ve used a bezier curve to set down my wall path and then resampled it to the length of bricks which I plan to instance on later, however the resample isn’t dealing well with right angles in the original curve because the brick length can’t always divide perfectly by the wall length (see screenshot 1).

I thought I had a solution by converting the original curve to a mesh, splitting the edges, converting back to a curve and then resampling each wall individually (see screenshot 2). And this does work with right angles, however if the wall has a curve between two points the convert to mesh is adding extra vertices (presumably to preserve to curve?) which then get split and resampled separately meaning it’s just not even at all (see screenshot 3). I’ve instanced mesh to all the points to demonstrate where the extra vertices are getting added (screenshots 4 and 5).

I’ve been messing with the capture attribute and index nodes trying get something from the original curve to plug into the split edge selection port but my understanding is just not quite complete enough to be able to do that sort of thing without following a tutorial, and after extensive googling I’ve had no luck. Any help is very much appreciated!

Couldn’t figure it out, I Built this Geo nodes tool that lets you draw walls using the curve draw tool you can add it basically any curve just make sure to apply the scale, and add just a basic cube in the general shape you wan’t and and that to the instance section hopefully this will be useful.
(Blender 4.5)

Here’s the shader if you wan’t it as well.

You can use this setup to split bezier curve to its segments while keeping interpolation:

Nice set up!

Good luck on your projects.

Thank you so much, higgsas that’s perfect! And thank you NerdY1 too for your help, I will be analysing your set up carefully for tips.