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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
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 5 13 10-29-2024, 10:19 AM
Last Post: _Aka_
  I have to refresh generator manualy :( GameDeveloperek4123 4 13 10-07-2024, 05:36 PM
Last Post: _Aka_
  Bug: Save Generator Outputs still saves outputs if object is disabled curvymesher 1 3 08-30-2024, 09:19 AM
Last Post: _Aka_
  How can I set the generator to stop updating? emerrryjones 1 10 07-26-2024, 10:07 AM
Last Post: _Aka_

Forum Jump: