Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to tell if a spline is straight? / Optimize problems with straight splines
#1
Question 
Dear members of curvy spline community.

Is there a quick wat to evaluate if a spline is straight? 

Currently, I am traversing the spline and evaluating the tangent at each control point. If the traversal detects a different normal , I consider the spline "not straight".   Not sure if this is the best or most efficient way of doing it.  I wonder If curvy have a built-in function for it .

I also want to take advantage of this post and report a weird behaviour when using "Optimize" on a straight spline.  
If a curvy generator has the shape extrusion path "Optimize" parameter enabled, some things could go wrong.

For example:
  • Split: Optimize seems to ignore the "split" parameter (which subdivides the generated extruded geometry). However, if the spline has curvature,   the "split" functionality kicks in as expected.
  • Custom spline profile: We have a code that modifies the profile shape spline based on a provided height value. If optimized is enabled, and the path is straight, curvy ignores our spline profile changes and generates a "flat" mesh (with no height) .  If we disable "optimize" or have it on a "non-straight" spline, curvy works as expected.
  • Shadows casting:  In some instances, we are using curvy spline to generate tunnel geometry. If "Optimize" is enabled on a straight path to generate the tunnel, the geometry can fail to block the light and it does not cast shadows.  once again, if "Optimize" is disabled or we use a "non-straight" spline, curvy works as expected. 

I am using Curvy spline v7.1.6 but I do not think is a problem introduced in this version. I've been using curvy since couple of years and I noticed the problem before. However it is only now that I've managed to understand that "optimize" on a "straight" spline, might cause problems. 


We have a possible work around:

  1. Evaluate if the spline is straight.
  2. If spline is straight, disable "Optimize" 

Thanks for your time and I apologize for the long post. 
Reply


Messages In This Thread
How to tell if a spline is straight? / Optimize problems with straight splines - by MarioBag - 12-24-2021, 11:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Intersection of two curvy splines Einherj 5 11 Yesterday, 10:14 PM
Last Post: _Aka_
  How can I find the point on the spline after applying with offset angle+radius? Chanon 1 3 10-01-2022, 11:50 AM
Last Post: _Aka_
  Scale Deform Mesh Along Spline? / aligning colliders MamasToast 6 33 09-25-2022, 08:47 PM
Last Post: _Aka_
  How can I remove one segment of the road that I made by spline? Chanon 3 7 09-14-2022, 04:44 PM
Last Post: _Aka_

Forum Jump: