Itoo Software Forum

Author Topic: Place exactly 1 segment at center of spline section  (Read 6291 times)

George

  • Full Member
  • ***
  • Posts: 122
Place exactly 1 segment at center of spline section
« on: December 09, 2013, 01:41:50 AM »
I have the following (attached) segments. The RC object should be as follows:

CornerA - MidA (repeat as necessary) - MidB (middle) - MidC (repeat as necessary) - CornerB

I can do 90% of that, using a conditional for MidA and MidC (greater and less than 50% of the spline section) but I can't work out how to place MidB in the centre, and most importantly only once.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Place exactly 1 segment at center of spline section
« Reply #1 on: December 09, 2013, 10:09:58 AM »
I'm afraid there is no way to place a "Default" segment exactly at spline's center, because these segments are used to fill the gaps between spline sections. And the only rules that may "break" the spline and create sections are Evenly and Corner.

You would use an "Evenly" segment and adjust the distance parameter to place an unique piece at center, but each spline will require a different distance. Other alternative is to add a vertex manually at the spline's center, and use the Corner rule. Unfortunately i cannot see any automatic method for this case.
Carlos Quintero
iToo Software

George

  • Full Member
  • ***
  • Posts: 122
Re: Place exactly 1 segment at center of spline section
« Reply #2 on: December 09, 2013, 11:07:40 PM »
I think "evenly" is the way to go too. I was thinking you could have the option to express the distance as a percentage, but a more "node-friendly" way to do this might be to have a SplineInfo and SectionInfo node, where each one outputs, amongst other things, a length parameter. That way I could apply some arithmetic to it (length / 2) and feed it into the "evenly distance" parameter.

George

  • Full Member
  • ***
  • Posts: 122
Re: Place exactly 1 segment at center of spline section
« Reply #3 on: December 10, 2013, 02:13:53 AM »
Apologies Carlos, I just found the expression variables in the arithmetic mode - this may solve my problem!

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Place exactly 1 segment at center of spline section
« Reply #4 on: December 10, 2013, 08:04:00 AM »
Yes, i tried also using an Arithmetic (expression) operator to define the distance, according to the spline's length. Unfortunately that doesn't work because the Evenly partition is done before evaluating the scene's operators.

I'm looking some way to avoid this limitation, although it's not simple because internally certain processes must be done in a strict order.
Carlos Quintero
iToo Software