Itoo Software Forum

Author Topic: closed path/wheel rays  (Read 753 times)

TeapotCreation

  • Newbie
  • *
  • Posts: 14
closed path/wheel rays
« on: February 04, 2016, 04:09:06 PM »
Hi,
I'm actually working on a bike wheel using RailClone and 3dsmax 2011.
However it seems that using closed/circular spline as linear1S is not as easy as expected.

I need to explain a bit the situation : I've got to distribute some rays around the hub of the wheel. The distribution is regular, but varies for certain numbers of rays.
I've got a NGon (16 sides) as path spline at the hub's place. This path is in X/Y axis.

When using an axis-aligned mesh (see n1 on the attached pic), it works fine for a particular positioning (radial repartition). Slightly rotate the segments makes the whole array bugs and displays "No Geometry".
I noticed that if the path is a circular ngon, setting the segment count to 1 lets 1 segment per path's segment... so I've to set the side number = to the final rays number.

Another repartition needs that the rays of the wheel crossed, so I modified the mesh so that the ray isn't aligned with the center of the hub (the rays follow the tangent of the hub) (see n2 on the pic).
But when I set this mesh as segment, the RC element bugs and displays "No Geometry".
Is there a known issue with custom meshes used as segments in a similar configuration ?

Also I continued with the first segment, and managed to rotate them... and this is absolutely weird. The rotation center, which is positioned at the center of the object - and not the pivot point, seems to "move" as I change the value. I'm completely unable to adjust the angle nor the position of the ray correctly. Also if the value goes out of some bounds (+- 17.5), the array bugs again. Using translations and padding is hard, and doesn't fit my needs.
Is there a better way to make such a thing ? Is it possible with RailClone ?

Thanks a lot, and don't worry about asking if I wasn't clear enough...
« Last Edit: February 08, 2016, 02:33:51 PM by TeapotCreation »

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1593
Re: closed path/wheel rays
« Reply #1 on: February 04, 2016, 06:01:02 PM »
Hi!

This is an interesting questions. Fortunately I think it can be done easily with RailClone using the technique you describe, by just changing a couple of things:

  • Make sure the spoke geometry's pivot is aligned to the end that will attach to the hub.
  • In the RailClone object, go to the Segment properties and change the X, Y and Z Alignment setting to Pivot. (This will stop the position from sliding around as you adjust the angle. Normally RailClone uses the centre of the object to align the Geometry on the X axis, so if you change the angle the bounding box gets larger and therefore the centre point moves too. Locking the position to the pivot resolves this).


     
  • When you rotate the segments the bounding box get's larger on the X Axis and overlap with adjacent spokes - causing an error. Therefore we need to specify a fixed size to use for calculating the X dimension of the bounding box to trick RailClone into allowing adjacent segments to overlap. To do this, in the Segment's properties set the Fixed Size > X value to something very small, for example 0.001 and turn off Scale Segment.




By changing the angle of the spokes you should be able to get some interesting different patterns.



Please see the attached file for an example. I hope that helps, but please let me know if you have further questions.

Many thanks!

Paul
« Last Edit: February 04, 2016, 06:09:11 PM by Paul Roberts »
Paul Roberts
iToo Software

TeapotCreation

  • Newbie
  • *
  • Posts: 14
Re: closed path/wheel rays
« Reply #2 on: February 08, 2016, 10:20:48 AM »
Hi,

thanks for these informations !
The worflow is efficient, it does exactly what I needed.
Thanks a lot !

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1593
Re: closed path/wheel rays [resolved]
« Reply #3 on: February 08, 2016, 11:10:02 AM »
No problem at all, glad I could help out.
Paul Roberts
iToo Software

TeapotCreation

  • Newbie
  • *
  • Posts: 14
Re: closed path/wheel rays
« Reply #4 on: February 08, 2016, 02:37:09 PM »
Hi again :)
I'm facing another question :
Is there a way to adapt the ray length using parameters ?
I mean setting a Numeric parameter to ajust the length of the rays.
I've seen the tutorial "building bridges" but it uses an XsplineCoord, and in my case the spline is circular so I probably have to use another parameter, but don't know which one.
Also there is a doubt for me : is the Fixed Size of a transform node used as Local coords of the segment object ? Or World ones ?

EDIT : I've found that using Y fixed scale does the work, but the scaling doesn't fit the units, even with "Scene Units" enabled. Such as 1/3 smaller than expected.
(Using Yfixed size sets the other axis' size to 0, and the object is flat.)$
EDIT2 : Scene Units seems just not work : setting 100cm is the same than setting 100 as Integer or float or %.
« Last Edit: February 08, 2016, 03:03:56 PM by TeapotCreation »

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1593
Re: closed path/wheel rays
« Reply #5 on: February 08, 2016, 03:50:12 PM »
Hi!

The Fixed Scale value uses a percentages and any other number type connected to its input will also be converted to percentages which is why you're not seeing the expected results. To get around this you can use a little maths to calculate the percentage, (Current Size / New  Size) * 100. To create this:

- First exposethe size of the Segment on the X axis by right clicking on the Segment node and clicking Export Attributes > X Size
- Create a new Parameter node and rename it Spoke Length.
- Create a new Arithmetic node and wire Spoke Length to the first input and the Segment's Exported X Size to the second input. Change the arithmetic mode to Division.
- Wire the Arithmetic node to a Second Arithmetic node that's set to Multiply. Wire a Constant node with a value of 100 to the second input. We have now worked out the scale percentage needed to make the segment's length match the Spoke Length parameter.
- Create a transform node. Wire the Segment to its input and Export the X Fixed Scale parameter. Wire this to the second arithmetic node.



I've attached the amended file. I hope that helps but please let me know if there's anything else I can do.

Thanks!

Paul
Paul Roberts
iToo Software

TeapotCreation

  • Newbie
  • *
  • Posts: 14
Re: closed path/wheel rays
« Reply #6 on: February 08, 2016, 04:24:19 PM »
Hi, unfortunately the file you send me can't be open, I use 3dsmax 2011 (you probably have a more recent version).
However my setup is a bit different. I've attached my file to explain you best.
With your setup, it works by setting the Spoke Length in Percentage, but weird... If I want a 30 cm lenght I have to set 30%.
In my setup the length comes from another arithmetic node which calls a subtract between 2 unit values (the exterior rim diameter - the interior rim diameter, in cm).
See the attached file, in the extreme right side of the style editor.

Also I want to adapt the angle of the ray to the hub width, so it's necessary to have cm units for me. (arctan with purcentages is pretty hard :))

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1593
Re: closed path/wheel rays
« Reply #7 on: February 08, 2016, 05:47:53 PM »
Hi,

Here's a 2010 version of the file with a few changes. Although it still uses percentages in the Transform operator this shouldn't affect your ability to use real world measurements because there's an equation in the graph that converts these to percentages on the fly. To test this I've added Parameters for the Wheel Radius and the Hub Radius.

Thanks!

Paul
Paul Roberts
iToo Software

TeapotCreation

  • Newbie
  • *
  • Posts: 14
Re: closed path/wheel rays
« Reply #8 on: February 09, 2016, 09:56:27 AM »
Well does the rays length change when changing the value of the wheel radius by your side ?
It doesn't even with your file for me.
The idea is to allow the real-time modification of the array by using these values.
Also I don't understand why you first substract the hub radius, and then re-add it to the wheel radius ?

Thanks a lot for your help.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1593
Re: closed path/wheel rays
« Reply #9 on: February 09, 2016, 12:35:50 PM »
Hi,

That's odd, the Wheel Radius parameter definitely works on my side, although you're right that the Hub Radius parameter is redundant in that version because it is added and then subtracted from the total. Actually that node was left accidentally because I was trying to automatically calculate the length of the spokes so that they adapt to match an angle parameter. I've since managed to achieve this using the Law of Sines , the video below shows this in action on your style. To use it you need to enter the radius of the NGon used for the hub and the intended radius of the wheel. No matter what angle you use for the spokes they should scale to maintain the wheel diameter.


I've attached this file, please let me know if it doesn't work on your configuration and let me know your RailClone version. Perhaps  there is a difference if you are using an older version.

Many thanks!

Paul
Paul Roberts
iToo Software

TeapotCreation

  • Newbie
  • *
  • Posts: 14
Re: closed path/wheel rays
« Reply #10 on: February 09, 2016, 01:40:33 PM »
Hi again,

this time the file works good, thanks for your help, it'll be useful soon.
Atm I got the length working (using only radial repartition for now), but i'm looking for a correct setup to automatically adjust the "vertical" incidence of the rays in the rim.
However i've got a slight difference between my result and what I should have. Does Railclone round the results of arithmetics functions ? If yes, how ?

Btw I'm using Railclone Pro 2.5.0.

TeapotCreation

  • Newbie
  • *
  • Posts: 14
Re: closed path/wheel rays
« Reply #11 on: February 09, 2016, 02:04:03 PM »
Ok, I figured out why it didn't work : I had to set the Y Fixed Rotation in a second Transform node, after the one with the Y scale.
Instead of that I had both in the same node, and Railclone didn't set any priority and scaled after the rotation.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1593
Re: closed path/wheel rays
« Reply #12 on: February 09, 2016, 02:26:14 PM »
Hi,

I'm glad you identified the problem. I've updated my file to incorporate the vertical offset you mentioned alongside the ability to angle the spokes.



I hope it helps.

Thanks!

Paul
Paul Roberts
iToo Software

TeapotCreation

  • Newbie
  • *
  • Posts: 14
Re: closed path/wheel rays
« Reply #13 on: February 09, 2016, 02:58:10 PM »
Wow !
You're awesome, many many thanks !
I'll adapt your file to mine, and I'll let you know if it works as I want !

Thanks again !