Itoo Software Forum

Author Topic: Markers with evenly distance  (Read 490 times)

Adnan Malkoç

  • Newbie
  • *
  • Posts: 30
Markers with evenly distance
« on: February 15, 2021, 08:44:47 AM »
Hello again!

I'm still working on my ultimate retail design library. Until now I'm really happy with the results to create frame systems with fixed evenly distance.

I have frames repeating every 60/90/120cm for example and there are connectors between them. (frames, connectors, everything parametrically created with nested generators). If I go all 60cm that's ok. But when I try to place few 90cm here and there things get messed up. I can't make things adaptive/random, because we will produce all units afterwards. Everything should size as I set them.

Markers seems really really good for me because I can easily select location to put different sized connectors anywhere I like. Marker point arranges units coming after but don't do anything beforehand. Probably evenly array is not the answer for this, I don't know.

I tried sequence. Playing with simple boxes with default array, seems easy and promising. If I put 4 segments gives me nice combination chain. But not practical for long walls and feels like breaking DNA chain with brute force. Also I'm not sure I can implement my current style to this or not.

Please check my images. There is a simple box setup with 3 rows. 1st row is my default array. 2nd and 3rd rows are examples for what I need. If I can place 90s with markers this will be the best thing for us!

Sorry for long explanation. Huge thanks in advance!


Adnan Malkoç

  • Newbie
  • *
  • Posts: 30
Re: Markers with evenly distance
« Reply #1 on: February 15, 2021, 09:51:03 AM »
OK... As I mentioned before, evenly distribution may not be the answer. So I changed to default. Generally seems ok but I have two small problems.

(all 60cm default, 90cms added with marker)
If you check the first gif file you'll see when I move 2nd marker closer to 1st one, RC doesn't remove the 60cm segment between them.

If I want to add 90cm to the end, somehow it doesn't work. It keeps last 60cm segment.

Bonus material; Even if I place my markers on correct positions with exact dimensions, some false segments left after markers. To fix it I have to move end vertex of my spline. As you can see on the final gif, it acts glitchy. I have to play a little bit to hit the sweet spot! Maybe that's because of fractions.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1990
Re: Markers with evenly distance
« Reply #2 on: February 15, 2021, 02:01:48 PM »
Hi!

Please take a look at the attached file and let me know if it helps.

I've used markers as you suggest but in a slightly different way. The markers in this set up are used to set the transition points from one size to another, This means the next new segment will use the markers setting, so they won't actually affect the previous segments.  I've also set it up so that a new section will not be added at the end of a spline unless there is space to do so. This will mean that the shelving may be shorter than the spline, but this makes sense to me if you only ever want to use whole unscaled segments.

Cheers!

Paul
Paul Roberts
iToo Software

Adnan Malkoç

  • Newbie
  • *
  • Posts: 30
Re: Markers with evenly distance
« Reply #3 on: February 15, 2021, 03:19:02 PM »
Hi Paul!

I'm super impressed the way you arranged it. Actually it's much simpler and more effective. Transition point was a thing I was wish for. This way I may easily create combinations like AAABBBBBBBAAA. Fewer markers for long sections. Only I added a simple selector at the beginning so I can start with preferred segment.

It works as a transition point because you didn't plug the segments into marker node right? It keeps default array but marker is a kind of breaking point I think.

I know it simple for you but could you please explain the expression? XSplineLength means total length or remaining length after current segment/point? 
So it checks remaining empty space for "divider+shelf" fits or not, after every new step?

One last question; How can I center this array on the spline. In order to prevent loop, I created a new L1S. Connected the same spline, connected previous array on start node. Finally I exported X Size from first array into an expression like this;
"return (XSplineLength - input1) / 2;"  I connected this into "padding start". It says expression ok but nothing happens. What am I doing wrong? You may check the image.


Again, huge thanks for your solution and your support. Really appreciate that!

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1990
Re: Markers with evenly distance
« Reply #4 on: February 15, 2021, 06:28:14 PM »
Hi,

Glad it helps. I'll do my best to answer your questions below.

It works as a transition point because you didn't plug the segments into marker node right? It keeps default array but marker is a kind of breaking point I think.

That's it. The marker is just being used to change the segment used for the Default geometry but it doesn''t actually break the array. The Selector operator uses the ID of the previous marker found on the spline.

I know it simple for you but could you please explain the expression? XSplineLength means total length or remaining length after current segment/point? 
So it checks remaining empty space for "divider+shelf" fits or not, after every new step?

Sure. The expression is finding out how much space is left in the spline. If there isn't enough space left for a whole segment, it chooses an empty (null) segment instead which kills the array. To achieve this we use a few properties:

- XSplineLength | This is the full length of the current X Spline
- XSplinePosition | This is the position along the spline measured from 0.0 at the start to 1.0 at the end.

By multiplying these two together you can find the distance of the spline before the current segment. XSplinePosition*XSplineLength

By subtracting the result of that from XSplineLength you can find out how much of the spline remains. XSplineLength-(XSplinePosition*XSplineLength)

The If statement is therefore checking to see if remaining space on the spline is sufficient to add a new segment.


One last question; How can I center this array on the spline. In order to prevent loop, I created a new L1S. Connected the same spline, connected previous array on start node. Finally I exported X Size from first array into an expression like this;
"return (XSplineLength - input1) / 2;"  I connected this into "padding start". It says expression ok but nothing happens. What am I doing wrong? You may check the image.

Certain paramenter are evaluated at the start and cannot be controlled using expressions. You could do the same thing though by wiring the generator through a Transform node and using the expression to control the Left Padding. You should be aware though, that this approach will only really work your spline is oriented perfectly along the X X Axis. Any other direction will result in the array being rotated twice. I can't currently think of another way to align the array to the center of a spline. If I can come up with a solution, I'll post here.

Paul
Paul Roberts
iToo Software

Adnan Malkoç

  • Newbie
  • *
  • Posts: 30
Re: Markers with evenly distance
« Reply #5 on: February 16, 2021, 06:19:22 AM »
Thank you very much for the detailed explanations. It helped me a lot to understand it. I know you are a busy team but we, users, definitely need some detailed manuals and tutorials focused on expressions.

If you think centering array works on X axis only, I should cancel it I think. I'll keep balancing manually for now. Probably It won't work on splines with multiple/separate splines in it too.

Super thanks!





Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1990
Re: Markers with evenly distance
« Reply #6 on: February 16, 2021, 09:36:56 AM »
No problem,

We would indeed like to create some tutorials on expressions, but it's tricky to find a balance of content that won't scare off new users but can still be useful for more advanced artists. We do have some reference for expressions here that you might find useful: https://docs.itoosoft.com/railclone/style-editor/operators#Operators-ExpressionsSyntax

Cheers,

Paul
Paul Roberts
iToo Software