Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: George on December 11, 2013, 01:39:46 AM

Title: Problem scaling segment to "best fit" (arithmetic)
Post by: George on December 11, 2013, 01:39:46 AM
I've attached a file showing what i'm trying to do. Here's some pseudo-code:

segmentWidth = 4.2
sectionLength = XSectionLength

newSegmentWidth = sectionLength / floor(sectionLength / segmentWidth)

scaleFactor = (newSegmentWidth / segmentWidth) * 100

But it's not doing this, and the one time it was working, it seemed to be working at low-precision (I was getting gaps and snapping).
Title: Re: Problem scaling segment to "best fit" (arithmetic)
Post by: George on December 11, 2013, 08:47:55 AM
Ok, it's definitely casting everything to integers. Piping the output of an expression to, say, ScaleX makes no difference if it's 8.0-1.0 or 8.0-0.01.
Title: Re: Problem scaling segment to "best fit" (arithmetic)
Post by: iToo on December 11, 2013, 12:27:14 PM
I can confirm the bug: some arithmetic expressions are evaluated as integer values. We've already identified and fixed the problem in our internal build.

Have you considered to use the new Adaptive (http://www.itoosoft.com/railclone/reference/refgenl1s.php#default) mode ? I think it does exactly what you need. If not, we would prepare a custom patch for you.
Title: Re: Problem scaling segment to "best fit" (arithmetic)
Post by: George on December 11, 2013, 10:50:29 PM
I'm doing something a bit more complicated, where some segments should stretch to fit and others should be fixed (using a sequence node). A patch would be much appreciated!
Title: Re: Problem scaling segment to "best fit" (arithmetic)
Post by: iToo on December 12, 2013, 08:45:14 AM
Please, tell me your Max version. We'll prepare it.
Title: Re: Problem scaling segment to "best fit" (arithmetic)
Post by: George on December 12, 2013, 10:54:58 PM
Max 2014 64 (and the rendernode too if it's different!)
Title: Re: Problem scaling segment to "best fit" (arithmetic)
Post by: iToo on December 13, 2013, 10:13:46 AM
I just sent you the patch by e-mail. Render nodes use the same files.
Title: Re: Problem scaling segment to "best fit" (arithmetic)
Post by: George on December 13, 2013, 10:21:36 AM
Thanks Carlos!

I actually used a work-around to get the job out today, but I'm going to have a play with this on Monday.