Mirroring a Spline

Hello all,

I have a spline, along which I have a flat plane mesh.

I would like to create a mirror of the spline above, so that the adjacent spline mesh components seamlessly fit together vertically.

I have set up a blueprint containing a spline component, and I am creating a SplineMeshComponent using the spline’s start/end tangents and locations, except with a transform providing a vertical offset.

Screenshots

1 - Second spline mesh created above with an offset - they do not meet (expected).

18371-2014-10-19-6e138u2e.png

2 - Second spline mesh created above as before, with last two components of tangent vector inverted. Slightly better result, however meshes still don’t meet.


Is there a way to get the second SplineMeshComponent to meet the first? The intended use for this is for a tillable mesh (say for a cave wall) that can be deformed using one spline, and can be offset above on a specified axis (as above).

Cheers!

Alan

Hello AlanEdwardes,

I believe I know a tutorial that will be able to help you out. This shows procedural generation through loops.

Cheers

Hi Rudy,

Thanks for the response! That’s an interesting technique, but not exactly what I would like to do here - I’d like to vertically mirror SplineMeshComponent; the tutorial goes into how to create meshes that follow a straight path to a point.

Cheers!

Hi ,did you find out how mirror Spline?

You have to iterate through each spline point and mirror it programmatically to do this.

Each spline point is defined by a Location, Arrive Tangent, Leave Tangent, and Up Vector. These are all simply 3D vectors and can be worked with in local or world space. I recommend using local. You’ll need to get each of these vectors, mirror them, and set them to the mirrored values.

Put all this in a for loop and do this to each point.

Here’s an implementation I got working. It’s pretty crude as I didn’t add a way to specify a mirror normal, but simply using a local axis suffices for my needs right now. You can also use MirrorVectorByPlane() instead.

Hope this helps anyone who happens to by here from a web search.