[WIP] Spline Mesh - a plugin for those who like curves !

Hi there !

Edit 27/11/2017
SplineMesh has been submitted to the Asset Store team ! This plugin will be free and open-source. You can have a peek already at the public repository.
3159294--256194--AssetStoreKeyLarge.png

Edit 21/08/2017
Now with some serious performances and more precise deformations.


Edit 27/08/2017
Spline extruder now has a cool user interface for profile drawing.

I'm working on a plugin that will let you play with splines and deform your meshes.
3159294--240348--upload_2017-7-26_0-19-15.png

It contains a complete editor to create splines, plus a component allowing to bend meshes. The spline itself is independant and can be used for anything else needing bezier curves.

The plugin already contains three samples to start with :
- SplineMesh : deform a mesh to follow the spline (eg pipe, fence, tentacle...)
- SplineExtrusion : you draw a 2D shape to be extruded along the spline (eg road, roller coaster, bridge...)
- SplineSower : place meshes along the spline (eg asteroid belt, footsteps, street lights...)

These samples show how things work. I did my best to keep things simple and clear. You will certainly want to extand them to your own needs. Everything works in edit mode.

I'm still working on it but I intend to release it in a month or so.

Do you think it may be usefull for your projects ?

Ben

3159294--240347--upload_2017-7-26_0-6-55.png

3 Likes

sounds great. Any way to do intersections etc when extruding a road?

1 Like


For road intersections you will need a graph, which is out of the scope of this plugin.

But you may use the CubicBezierCurve class of this plugin, which is independant, to manage curved road segments between the graph nodes. It allows to get locations and tangents on curve, given a time or a distance.

Any progress on releasing this? I'm quite interested!

Yup I'm still polishing things, and I'm glad to hear that someone is interested ^^

I'll give news here soon.

Locations and tangent are now correctly interpolated, giving more precise deformations.

Optimizations on bending code now allow to work on meshes with a lot of vertices smoothlessly in the editor, performance are quite good.


3190358--243633--upload_2017-8-21_0-35-6.png

1 Like

Addition of a cool editor to draw a shape to be extruded along a spline. Normals are shown with red lines, and sliders allow to move things. Result is realtime in editor.
3197864--244356--upload_2017-8-26_22-54-57.png

Extruder in situation

https://www.youtube.com/watch?v=Nz0tjkOQsZc

Showcasing samples, almost ready ! Follow me on twitter

3276640--253367--Showcase.PNG.jpg

1 Like

Can you convert the spline itself to a baked mesh? (i.e. 3dsmax spline)
Looking for some quick way to add wires to a street scene.

Create a wire between two pillars takes seconds with that plugin. but I understand the need of having baked meshes if you need a lot of wires, or if you want to export your scene.

The extruder generate a single mesh from a 2D shape, extruded along the whole spline.

The other exemples uses a mesh bender that use cubic bezier curves only, resulting in one bended mesh for each spline segment. If you need to bend a single mesh along a whole spline, you will have hack the existing bender a little.

Generated meshes are standard Mesh object, sent to MeshFilter components. The plugin doesn't include any exporting tool, though.

exemple :
3281168--253799--upload_2017-11-8_21-31-57.jpg

1 Like

Code is now commented and there is one more sample in the demo scene
3283857--254092--upload_2017-11-11_2-41-2.jpg

1 Like

Hi there !

I have a lot of private messages about the pricing, so let's clarify things: SplineMesh is released free and open-source ! I will submit a paid version (without any additionnal feature), for those feeling generous.

The plugin has been submitted to the Unity team. I expect to have some work to do before it is accepted on the store but it is on its way.

In the meanwhile, you can have a peek at the public repository on GitHub. Don't hesitate to star it, it helps !

The plugin is now available on the asset store.

https://assetstore.unity.com/packages/tools/modeling/splinemesh-104989

Paid Version : https://assetstore.unity.com/packages/tools/modeling/splinemesh-paid-version-104998 (no additional content, buy this only if you want to support the author)

If you enjoy, please write a review, that helps a lot.

1 Like

Hi - first off, thanks for making this asset free, I've been getting a lot of use out of it and really appreciate the work you've put into it.

Secondly; is there a way to find the distance along a spline from a spline location? I have a known point location on my spline and am trying to plot a second point X distance ahead of it on the spline. If I had a GetDistanceFromLocation function, I could pass my known point, get it's distance, add X more distance and call the standard GetLocationAlongSpline to find the second point's location. Do you have any ideas on how to construct a GetDistanceFromLocation function? I've tried but haven't had any success :)

Thanks for the help - I'll be leaving a positive review soon as this asset has been really helpful for me!

You say that you have a point on the spline, but the only ways to ensure the point is on the spline is to select a node, or find it with GetLocationAlongSpline. In both cases, you know the distance. Can you tell more on the subject?

In any other cases, your point will be "nearly" on the spline. Then you could take sample points along the spline at an increasing distance from the spline start until you find a sample that is close enough. You may want to take the next sample too and interpolate between the two, to find a more precise projection of your point on the spline.

The correctness of the result will depend on the precision you ask, and more samples may lead to performance issues.

Hope it helps ^^

We can continue the discussion on the assets forum here .

@ , this thread should be closed now.