Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: GT4505 on May 15, 2015, 11:09:02 AM

Title: (Diamond) facade pattern question
Post by: GT4505 on May 15, 2015, 11:09:02 AM
Hi all,

I've been experimenting with the diamond pattern facade tutorial released by itoosoft.
While recreating the rc pattern I encountered a problem.
The pattern is constructed upon a rectangle (which works very nice), but if I try to alter the dim of the rectangle the script seems to be incomplete to handle all sizes.

Have a look at the attachments, the corners are working fine, but the default pattern doesn't always connects correctly to the corners. Possibly because the pattern isn't composed with the full sequenced objects?
What would be the obvious way to fix this?

Thank you
Pieter
Title: Re: (Diamond) facade pattern question
Post by: Paul Roberts on May 15, 2015, 01:53:22 PM
Hi,

This problem occurs because the pattern can terminate on a diagonal segment angled up or a segment angled down, depending on the length of the side. The corners however expect only one type of adjacent segment. We can get around this by combining a diagonal up and diagonal down using a Compose operator. In that way the segments will always terminate with the correct piece at the corners.

To do this, just replace the sequence operator marked below with a compose operator (you may need to change the order of segments).

(http://i.imgur.com/XbTwIa5.png)

(http://i.imgur.com/8aghAeg.gif)

I hope that helps, please let me know if I can assist further.

Many thanks,

Paul
Title: Re: (Diamond) facade pattern question
Post by: GT4505 on May 15, 2015, 03:44:51 PM
Hi Paul,

Ah great! Thank you for the quick reply ;)
So if I understand correct the sequence operator combines objects in a certain way, but they can still individually be used, according to the available space.
Where a compose operator is seen as one object by rc, undevidable.
If I understand it correct, the compose object is always used along the spline?

Thank you!
Title: Re: (Diamond) facade pattern question
Post by: Paul Roberts on May 15, 2015, 03:51:56 PM
Hi

That's it exactly. The sequence operator is creating a repeating pattern of individual elements but the compose operator combines them so that 2 (or more) segments will be treated as though they are 1.

Many thanks,

Paul