Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: LH2287 on April 04, 2017, 10:45:05 AM

Title: Sequence not working properly
Post by: LH2287 on April 04, 2017, 10:45:05 AM
Greeting,

I am working on a project that I want to create a sequence in the order showed in the attached images. I am starting with 4 elements which are assembled in 3 sequences. Those sequences need to follow another sequence in order to create a module of 22322 (as per attached image) which in other hand needs to be assigned in a third sequence in order to create the whole pattern of module 1 repeated 4 times followed by 22322 repeated 4 times as well.

Please see attached images with all the descriptions I can think of. I don't know how to resolve this. I think it should be working the way I made the railclone and unfortunately it isn't. Can someone please explain if I am doing something wrong in sequences' orders or if there is a way to achieve this?

(http://i.imgur.com/jd0Ob8K.jpg)

(http://i.imgur.com/kFDW1tu.jpg)

PS: I only managed to succeed making the module 22322 and after I assign it to another sequence to repeat it 4 times with the other element, it breaks and has no order as it should. Also I have attached the images in case you can't view the previews.

Thanks in advance
Title: Re: Sequence not working properly
Post by: Michal KarmazĂ­n on April 04, 2017, 04:42:03 PM
Hi,

Though combining Sequence Operators can be very useful in situations where Increment at X / Y changes - to complement these Sequences, but for similar purposes as yours I would suggest you to use Compose Operators (http://docs.itoosoft.com/display/RAILCLONE/Operators#Operators-Compose) - to join together these "blocks" of Segments. Attaching a sample scene. Hope that helps.

Best regards,
Title: Re: Sequence not working properly
Post by: iToo on April 05, 2017, 09:34:52 AM
I guess we should explain why in this case Sequence operator doesn't work as you expected:

Sequencer uses internally a counter to define the index of next item. This index is incremented only when node is evaluated.
Lets see this example with three Sequence nodes (AB, AC, AB-AC).

(http://i.imgur.com/TZAggnO.jpg)

- Segment 1)  SeqAB_AC is evaluated, its initial index is 1, so it takes the first input (SeqAB). Same for SeqAB which returns A. The indexes of SeqAB_AC and SeqAB are incremented (set to 2)
- Segment 2)  SeqAB_AC is and evaluated. Since its index is 2, it takes the second input (SeqAC, index = 1), which returns A. The index of SeqAB_AC is incremented and reset to 1, and SeqAC index is set to 2.
- Segment 3)  SeqAB_AC (index = 1) returns SeqAB again, which once evaluated ( index 2) returns B. Both indexes are incremented.
- Segment 4)  SeqAB_AC (index = 2) returns SeqAC, and this returns C.

So the final sequence is AABC, not ABAC.

Instead, Compose operator seems similar but works completely different. All input segments are chained together and handled as an unique Segment.

For example, when used as Corner or Evenly, Compose returns multiple sub-segments, but Sequence only one.
Sequence operator allows to modify its internal index (i.e. exporting it as a parameter), but Compose not.

I hope everything is clear now. If not, please don't hesitate to ask.

Title: Re: Sequence not working properly
Post by: LH2287 on April 05, 2017, 01:03:32 PM
Hello and thank you for the replies.

This helps a lot in understanding how the operators work and I will test my geometry as soon as possible in the next few days, but I believe it will work out as intended.

Best regards