ITOOSOFT Forum

Author Topic: Expressions - section length between corners  (Read 41 times)

nubo

  • Jr. Member
  • **
  • Posts: 67
Expressions - section length between corners
« on: Today at 11:46:16 am »
Hi,
I was wondering if there's a way to get current line length of the actual spline (between vertices) regardless of evenly and markers divisions?
My precise use case is that I need to find the longest line of a closed spline and then generate evenly segments along that line only. Unfortunately XSectionLength is affected by the evenly so it gives me only the virtual spline section length not the actual spline's line length.

Michal Karmazín

  • ITOOSOFT
  • Hero Member
  • *****
  • Posts: 3209
Re: Expressions - section length between corners
« Reply #1 on: Today at 11:50:41 am »
Hi,

Yes, the XSectionAdjustedLength attribute returns the length of the current section on the X Spline, subtracting the size of any adjacent Start, End, Corner, Evenly, or Marker segments. I hope this helps.

Best regards,

nubo

  • Jr. Member
  • **
  • Posts: 67
Re: Expressions - section length between corners
« Reply #2 on: Today at 12:16:55 pm »
Thanks Michal,
But the XSectionAdjustedLength will return the real distance left for the default segment. What I need is the length between one vertex and another regardless of whether there is any evenly subdivision and regardless of the X size of the segments assigned to start, evenly, corner and end nodes. Correct me if I'm wrong.
Maybe I didn't explain my case clearly.
Let's say I have a spline that is an uneven edged triangle. I need the evenly segments generated only along the longest side of the triangle. Will XSectionAdjustedLength help me here?

Michal Karmazín

  • ITOOSOFT
  • Hero Member
  • *****
  • Posts: 3209
Re: Expressions - section length between corners
« Reply #3 on: Today at 02:12:14 pm »
You’re right. This attribute doesn’t help in this case. Unfortunately, I can’t currently see a style setup that would work for this purpose, due to the consecutive way in which RailClone evaluates base splines. We’ll see what can be done in future versions.

Best regards,

nubo

  • Jr. Member
  • **
  • Posts: 67
Re: Expressions - section length between corners
« Reply #4 on: Today at 02:26:59 pm »
Thanks Michal,

Now I realized that I'm not even able to determine which section is the longest even without the presence of evenly so this is a more complex problem than I previously thought.
Any chance on introducing loop statements for expressions?  ;D
If so it would be also very helpful if more iterable data was exposed like spline segments indeces.

Best regards,
Przemek