Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

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

Discussion in 'Works In Progress' started by methusalah999, Jul 25, 2017.

Thread Status:
Not open for further replies.
  1. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    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.
    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.
    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
     

    Attached Files:

    Last edited: Nov 27, 2017
  2. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,023
    sounds great. Any way to do intersections etc when extruding a road?
     
    neoshaman likes this.
  3. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    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.
     
  4. PeteMichaud

    PeteMichaud

    Joined:
    Jul 11, 2015
    Posts:
    22
    Any progress on releasing this? I'm quite interested!
     
  5. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    Yup I'm still polishing things, and I'm glad to hear that someone is interested ^^

    I'll give news here soon.
     
  6. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    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.

     

    Attached Files:

    frankslater likes this.
  7. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    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.
    upload_2017-8-26_22-54-57.png
     
  8. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    Extruder in situation

     
  9. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    frankslater likes this.
  10. Kemonono

    Kemonono

    Joined:
    Nov 7, 2013
    Posts:
    295
    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.
     
  11. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    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.
     
  12. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    exemple :
    upload_2017-11-8_21-31-57.png
     
    frankslater likes this.
  13. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    Code is now commented and there is one more sample in the demo scene
    upload_2017-11-11_2-41-2.png
     
    frankslater likes this.
  14. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    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 !
     
  15. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
  16. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    135
    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!
     
  17. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    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 ^^
     
  18. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    73
    We can continue the discussion on the assets forum here.

    @admin, this thread should be closed now.
     
Thread Status:
Not open for further replies.