Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending Curvy Generator for Advanced Lofting - Feasibility Check
#1
Exclamation 
I am exploring the possibility of extending the Curvy Generator to achieve CAD-like lofting capabilities. Specifically, I'm looking to enhance the functionality of blending multiple cross sections along a path, similar to what you would find in a CAD software's loft feature. Here are the key requirements I'm interested in developing:

1. Mix more than two cross sections along a path, not limited to a binary mix between Shape A and Shape B.
2. Implement a weighted blend of these cross sections, where I can control the influence each shape has over the final extruded form along the spline path.
Additionally, I want to build upon the existing "Variable Mix Shapes" node within the Curvy Generator. I see this as a development of the current node, expanding it to handle multiple shapes and providing more nuanced blending controls.

Has anyone undertaken a similar customization of the "Variable Mix Shapes" node, or any other part of the Curvy Generator, for advanced lofting or blending of shapes? Any insights into the feasibility of this enhancement and suggestions on how to approach it would be greatly appreciated.
Reply
#2
Hi

You can connect multiple Variable Mix Shapes together to blend more than 2 shapes. This has the advantage of not needing to code, but it is not the easiest to use.
Your suggested solution would be indeed easier to use, but will need coding.

Your solution should not be difficult to implement. You basically will have to replace lerping between two values, as it is now in Variable Mis Shapes, with weighted sum of the values.
Don't let yourself affraid with lines looking like this

positionsArray[i].x = aPosition.x + ((shapeBPositionsList[i].x - aPosition.x) * interpolationTime);
positionsArray[i].y = aPosition.y + ((shapeBPositionsList[i].y - aPosition.y) * interpolationTime);
positionsArray[i].z = aPosition.z + ((shapeBPositionsList[i].z - aPosition.z) * interpolationTime);

These are simply lerping between aPosition and shapeBPositionsList[i], but written in a manner that consumes less CPU.

About the inputs, the module has 2 inputes,
[HideInInspector]
[InputSlotInfo(
typeof(CGShape),
Name = "Shape A"
)]
public CGModuleInputSlot InShapeA = new CGModuleInputSlot();

[HideInInspector]
[InputSlotInfo(
typeof(CGShape),
Name = "Shape B"
)]
public CGModuleInputSlot InShapeB = new CGModuleInputSlot();

In your case, you will need something like

[HideInInspector]
[InputSlotInfo(
typeof(CGShape),
Name = "Shapes",
Array = true
)]
public CGModuleInputSlot InShapes = new CGModuleInputSlot();

You would probably need another input which will be a list of weights.

I hope this helped.
Have a nice day.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Heart 
Thank you, Will try this and will ask if there's any more help is required.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 10 04-03-2024, 03:16 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
  Generating GO only on CPs in Generator GameDeveloperek4123 1 7 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: