Posts: 10
Threads: 2
Joined: Sep 2019
I am trying to generate building walls using Prefabs.
The building spline is linear and nodes are placed on grid so they can form a polygon with regular walls (90 degrees turns). I am trying to fill it with groups of GO.
1. How to set up Generator to spawn Prefabs exactly on corners of the linear spline?
2. Or how to find spots on corners?
3. How Curvy calculates a width of the prefab when spawning along the spline? It looks like the pivot of the GameObect is not so important.
4. Can I set the width of a prefab manually somehow? Just to convine the Generator that prefab has 0 (zero) or other specific width?
Sorry for so many questions but I am digging just to check if I can generate houses with Curvy
Piotr
Posts: 2,118
Threads: 93
Joined: Jun 2017
Sorry I haven't answered you today. I will try to do so tomorrow.
Thanks for your patience, and 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.
Posts: 10
Threads: 2
Joined: Sep 2019
Don't worry. I understand that you are busy and really appreciate that you spent time helping us with sometimes even stupid questions
Posts: 2,118
Threads: 93
Joined: Jun 2017
- If you place objects through the generator, you can only place them with defined spacing. You can't set a dynamic spacing such as "at each corner"
- In your case, using a linear spline, corners are always positioned were your control points (CP for short) are. So just put your prefabs at the same position as your CPs.
- The calculation is based on the bounding volume of the object's mesh (and if any its collider too)
- You can by modifying the code. But there is a simpler method: just modify the value of "Space before" or "Space after" (both can be negative)
https://curvyeditor.com/documentation/generator/modules/volumespots?redirect=1#group
Please let me know if you have any other questions
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.
Posts: 10
Threads: 2
Joined: Sep 2019
Thank you so much. I will be back after some testing.
Posts: 10
Threads: 2
Joined: Sep 2019
I am trying to prepare additional module to provide "Spots" with exact positions of the control points. Not computed.
Can you give me a hint please?
I am inside BuildRasterizedPath.cs
How to get list of Control Points (corners when Linear)
Can I get the CGShape data in InPath somehow to iterate on Positions and normals?
Posts: 10
Threads: 2
Joined: Sep 2019
I made this template to build rectangular mesh with corners based on the linear Curvy Spline:
The effect of the mesh spawning:
The problem was how to get Spline data directly from SplineInput. I couldn't find the reference through the InPath.
I did a hack and added serialized property to reference the same Spline again in my custom module.
With Spline ref I made CGPath by adding transform.localPosition and rotation from SplineSegments.
But maybe I could get a reference for Spline from InputSpline module directly?
Posts: 2,118
Threads: 93
Joined: Jun 2017
Raterize Path module takes a CGPath Spline Input module as an input. CGPath is just a succession of points. This means that the notion of a spline (control points, interpolation mode, etc) is not there. Your hack seems efficient enough knowing the constrains. Otherwhise, and to answer your question, you could do something like rasterizePathModule.InputLinks.First().ModuleID to get the id of the input 0f the module, then look in curvyGenerator.Modules for the one with the same id, cast it to InputSplinePath, then get its Spline property
Please consider leaving a
review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.