### Author Topic: Evenly - specify by count  (Read 2748 times)

#### IT1371

• Full Member
• Posts: 172
##### Evenly - specify by count
« on: September 07, 2014, 09:07:25 AM »
How can I specify the Evenly parameter to show up by a specific count  per segment and not by length? (for example I need a post to be placed only 3 times in a segment, no matter the distance)
I can't do it via Default Count, as it is used for something else, and they must be in the same object.

Is there a way to do so?

3Ds Max 2014
Vray 3.00.07
Railclone 2.3.4

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 1823
##### Re: Evenly - specify by count
« Reply #1 on: September 08, 2014, 11:56:41 AM »
Hi,

Thanks for your question. Ideally to solve this we would use an expression wired to the Evenly Distance property that divides the spline segment length by a count value. Unfortunately this isn't currently supported but we have added it to our wish list for a future release.

In the meantime we can create the same effect manually by using a sequence operator and an expression to scale the segments and create the same effect as using the evenly settings. Please find attached a file to illustrate this technique.

• Wire the Default segment to a Transform operator. Export the X Fixed Size property by right clicking on the Transform node.
• Wire a new Arithmetic operator to the X Fixed Size input. Set it to Expression and wire a new Numeric node to Input1 and a Constant to Input2. The numeric node will hold the count value and the Constant needs to be set to the X Length of the "Evenly" geometry
• Create and expression as follows:

(XSectionLength-(Input1*Input2))/(Input1+1)

This takes the current section length and subtracts the combined widths of the evenly segments. This value is then divided by the number of Evenly segments (the count) + 1 as there is always 1  more default segment than evenly.

If you are also using segments in the start, end or corner inputs you'll have to take these into consideration too. This equation assumes using the same evenly segment in the start, end and corner inputs (where X Pivot is set to automatic).

(XSectionLength-(Input1*Input2+1.5*Input2))/(Input1+1)
• Wire the transform node to the first input of a new sequence operator, wire the evenly segment to the second. Attach the sequence operator to the Default input and set the Sequence Mode to Reset at Spline Section
• Attach corner and segment nodes if required. Go to the generator's properties and set Corner > Bevel Mode to None. The final node tree should look like this:

I hope that helps,

Please let me know if you have further queries.

Many thanks,

Paul

Paul Roberts
iToo Software

#### Paul Roberts

• iToo Software
• Hero Member
• Posts: 1823
##### Re: Evenly - specify by count
« Reply #2 on: September 08, 2014, 12:08:28 PM »
Attached is also a version that adds only the posts, in the event that you didn't require default segments.
Paul Roberts
iToo Software