Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Questions about Generator: mesh/objects within spline, snap to control point
#1
Hello,

New Curvy user here, loving it so far guys! Smile 

I'm wondering if it's possible to do the following things:
1) Creating a custom shape using curvy and using it to create a mesh with the shape (eg., creating a patch of dirt)
2) Using spline created by curvy as boundaries to generate bushes (eg., growing tall grass on the patch of dirt)
3) Generate object and snap it to connected control points (eg., adding T- and Cross-junctions to road)

Thank you for your time!
Reply
#2
Hi

Glad to hear that you are loving the asset

1- You can do that using the Spline To Mesh tool in the toolbar: https://curvyeditor.com/documentation/toolbar/start#tools
2- I guess there are different ways to determine if a point is inside a spline, which you will probably find on the internet, but one (maybe not efficient) that I thought about is to compute the cross product of the following vectors:
Vector A: the delta between a point and its nearest point on the spline (using yourSpline.GetNearestPointTF)
Vector B: the tangent of the spline at that point (using yourSpline.GetTangent)
The cross product's direction should tell you if a point is inside the closed spline or not.
3- Using yourSpline.Connections, you can get a list of the connections on your spline. Use their transforms to place your object.

Let me know if I missed something
If and when you feel like it, please leave a review for the asset, that helps a lot.

Have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Hi Aka,

Thanks for the helpful reply! I have a couple more questions:
1) I'm using similar shapes with varying heights to create a path using Variable Mix Shapes, but the areas that are shorter does not look accurate to the shape I have created. Is there a way to make sure the mesh stays true to the shapes I'm using?
2) Is it possible to change materials or apply decals midway down a mesh I've generated with a spline?

Thanks again!
Reply
#4
Hi
1) Please send me a scene with the issue, and I will look into it. If your shapes are just the same shape but with different Y scaling, then you can use the Scale tab in the Shape Extrusion module instead.
2) Not in the same mesh, at least for now. You can though make multiple shape extrusions, each one having different values for the path's range, and having a different material for each one of them. Is the explanation clear enough?
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#5
Hi,
Thanks again for your replies! Yes, your explanations are clear, thank you. How would I apply a decal on a generated mesh then?

What is your email address? I can't send them via the email feature in the forum.

I have a few more questions:
1) When creating road paths, I tried using a generated rectangle as the path, but for some reason, the rectangle is slanted on the vertical, especially when my height value is very small. Is there a way to work around that?
2) Is there any way I can mirror splines and apply a template I created in Curvy Generator?
Reply
#6
(06-09-2021, 05:43 AM)dartboard Wrote: What is your email address? I can't send them via the email feature in the forum.
I will send you my email address via PM. I am not posting it here because of bots that scrap forum posts and spam found email addresses.
Otherwise, my contacts are in the publisher's page on the asset store: https://assetstore.unity.com/publishers/304

(06-09-2021, 05:43 AM)dartboard Wrote: How would I apply a decal on a generated mesh then?
I am not familiar with decals on Unity. I am tempted to say the same way you would do on any other mesh, since generated meshes are just regular meshes

(06-09-2021, 05:43 AM)dartboard Wrote: 1) When creating road paths, I tried using a generated rectangle as the path, but for some reason, the rectangle is slanted on the vertical, especially when my height value is very small. Is there a way to work around that?
I believe it is because of the "Optimize" option in the Shape Extrusion module, under the Cross tab. Deactivate it and the problem should be fixed.

(06-09-2021, 05:43 AM)dartboard Wrote: 2) Is there any way I can mirror splines and apply a template I created in Curvy Generator?
There is no mirror tool, but you can select all the control points of the spline and rotate them 180°
If needed, you can change the surface orientation using the Shape Extrusion's Reverse Normal parameter (in the Cross tab) and/or the Volume Mesh's Reverse Tri Order parameter.

Anything else?
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to generate gameobject on the control point Yang Yi 0 1 Yesterday, 11:43 AM
Last Post: Yang Yi
  Can Deform Mesh shrink as well as stretch? davelloyd 1 3 Yesterday, 11:16 AM
Last Post: _Aka_
  Method of scattering objects along spline joebain 1 3 11-26-2024, 03:20 PM
Last Post: _Aka_
  Is it possible to make the face at the end of mesh? Chanon 3 6 11-14-2024, 04:38 PM
Last Post: _Aka_

Forum Jump: