Itoo Software Forum
RailClone => RailClone Pro (*) => Topic started by: Pixelab on October 16, 2020, 05:08:05 PM
-
Here is a glass railing from above, I'm trying to make a formula that automatically makes the space between the glass. Circled in red are the corner not working properly (180°+ angles)
Looks like RC do the job correctly for sub 180 angles.
I've tried many solution but can't get the right trigo formula. Would be nice to be able to paramter it with min/max spacing values.
FWIW I've attached the file I'm working on but the expression is a mess. RC version is 3.1.8b, Max 2016
(https://i.imgur.com/ZrUdqXi.png)
-
Hi
How should it look correctly when angle>= 180 ?
-
Hi
How should it look correctly when angle>= 180 ?
With a space enough to avoid collision between the elements (see the overlap circled in red)
I guess the formula will give infinite for 360°
-
Hi
Check this generator. I added a few more parameters so now you can have different spacers for Evenly and Corners 1 & 2 which are controled by the Angel Threshold parameter.
Please let me know if this is works for you.
And as Rokas ask, we need to know how spacing will change when angle is greater than 180.
Best Regards
Dragan
-
I just saw you are using RC 3...
Please go to RC4, you will not regret it ;)
I`m not sure this will work on RC3 but you can try.
-
Thanks for the help, but what I'm looking for is a dynamic formula that spaces the glass enough to avoid collisions.
I know it involves trigonometry but so far my attempts have been unsuccessful.
This was for example a formula to scale an object based on the Vertex Angle
return 100/cos((pi-XVertexAngle)/2);
-
Ok, I finally found the formula I was looking for.
I've attached the max file for those who are intrested
return (tan((pi-XVertexAngle)/2)*Input1)+Input2;
Input1 is the space you want at 270°
Input2 is the minimum space used for sub 180° angles
(https://i.imgur.com/47HGkhb.png)
-
Please, try this one.
The distance you are calculating depends on Y size and XvertexAngle. I set the GlassMid segment to be Master for the Y size.
I had to change Y alignment to Center but you can still adjust it with the Y offset parameter.
The Spacer is both for Evenly and Corner but I can make them separate if you need.
-
Please, try this one.
Thanks, it's indeed much more elegant ! I knew that the second variable could be deducted from Y size but simplifying the overall style is nice
Glad the formula is still there and that I didn't scratch my head for nothing ;)