Itoo Software Forum

Author Topic: Tangency problems  (Read 2163 times)

trimitek

  • Newbie
  • *
  • Posts: 27
    • My models @ TurboSquid
Tangency problems
« on: August 28, 2015, 05:52:32 PM »
Hi there,

I'm trying to align some corner elements with a surface, but can't find a way to get it right.
It works good on the 90 degree corners I have, but bezier corners are problematic.
I had tried every trick I know, but it seems like that in this case nothing fixes it.
Here is how it looks like:

(The corner elements are on separate Linear 1S generator)

Any magic tricks to solve this?


By the way, Max always had a problem with this type of bezier corners - try making an offset (outline) on such spline and you will get something like this:


Maybe it's related.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Tangency problems
« Reply #1 on: August 28, 2015, 07:51:26 PM »
Hi,

I'm having a little trouble reproducing the issue.

(file attached)

Would you be able to attach your scene file so I can take a closer look?

Many thanks,

Paul
Paul Roberts
iToo Software

trimitek

  • Newbie
  • *
  • Posts: 27
    • My models @ TurboSquid
Re: Tangency problems
« Reply #2 on: August 29, 2015, 12:32:11 PM »
That's weird. I had made some more experiments, but nothing really helped much.

It's a very large scene, but I had extracted the problematic elements and attaching a file for you to look at.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Tangency problems
« Reply #3 on: August 30, 2015, 12:48:05 PM »
Hi,

I have attached a new file, hopefully it is working correctly.

I've changed just a couple of things, mainly I rotated the source geometry to that the roof and rafter were aligned along the Y axis of world space and reset the XForms so that it's not longer necessary to compensate for their rotation inside RailClone. I often find this makes the style a lot less confusing if you are finding issues with orientation. I've then set all the rotation values in the RailClone style itself back to 0. You'll also need to turn on Align to Path in the corner Generator's Properties > Corner settings. When this is on RailClone will align the corner segments by bisecting the angle at the corner.




I hope that helps, please let me know if you have further questions.

Many thanks,

Paul
Paul Roberts
iToo Software

trimitek

  • Newbie
  • *
  • Posts: 27
    • My models @ TurboSquid
Re: Tangency problems
« Reply #4 on: August 30, 2015, 04:07:29 PM »
Wow!
I had tried almost all of the things you did, but obviously didn't hit the right combination.

There is some problem with the vertical positioning of the corner elements now, but I'm not sure if this can be avoided. I might need to make different segments for some of the corners.

Please don't fiddle more with this today Paul, I'm feeling guilty for making you work on Sunday.
Thank you very much for your help!

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Tangency problems
« Reply #5 on: August 30, 2015, 05:06:51 PM »
Hi,

No problem at all, I'm glad we could help out. I did notice that but I didn't change it in case it was intentional. The angle of the rafter's source geometry doesn't quite match the angle of roof, if you edit them you should find it lines up ok.

Many thanks!

Paul
Paul Roberts
iToo Software

trimitek

  • Newbie
  • *
  • Posts: 27
    • My models @ TurboSquid
Re: Tangency problems
« Reply #6 on: August 30, 2015, 06:19:01 PM »
I had modeled the rafter to match a 90 degree intersections and it fits well on those, but I didn't realize that the angles in between will be so far off, so I have to find some kind of workaround I guess.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Tangency problems
« Reply #7 on: August 30, 2015, 08:49:18 PM »
Of course you're right, I'm not think straight. The rafter will need to be rotated based on the corner angle. Probably this is possible with an expression. I'll have a think about it and post here if I find a solution.

Many thanks,

Paul
« Last Edit: August 30, 2015, 11:48:38 PM by Paul Roberts »
Paul Roberts
iToo Software

trimitek

  • Newbie
  • *
  • Posts: 27
    • My models @ TurboSquid
Re: Tangency problems
« Reply #8 on: September 09, 2015, 11:10:12 AM »
Hi,
Sorry for the late reply. I had to jump to another urgent project.

I'm now back again on this one and I had made a few experiments using expression with the XVertexAngle variable, feeding the result to a Y Fixed Rotation of a Transform operator, but I have the feeling that it returns some kind of average angle for the whole spline (instead of feeding separate angle for every vertex). It looks like it rotates all segments on the same angle, so I'm probably doing something wrong.
I couldn't find similar examples in the manual.
Can you give me some hints for the proper use of expression in my case?

trimitek

  • Newbie
  • *
  • Posts: 27
    • My models @ TurboSquid
Re: Tangency problems
« Reply #9 on: September 11, 2015, 04:14:18 PM »
By the way I think it will be useful, for similar cases, if the Conditional operator has an option to be able to select a range for the Angle (for example - if Angle is between 70-90°)

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Tangency problems
« Reply #10 on: September 11, 2015, 08:02:15 PM »
Hi,

Apologies for the late reply. I have worked out a solution that automatically calculates the length and angle of the hipped corners. It uses a few trigonometric expressions which I've split over several arithmetic operators to make it a little simpler to understand.



Please feel free to download the attached file and take a look. If anything needs explaining, please let me know.

Regarding using an angle range. You can do this using two Conditional operators wired together. In the first one set it to test if the Angle > 70 degree. Wire this to the True input of a second Conditional operator. In the second node set the condition to be angle < 90°.

I hope that helps.

Many thanks,

Paul

 
Paul Roberts
iToo Software

trimitek

  • Newbie
  • *
  • Posts: 27
    • My models @ TurboSquid
Re: Tangency problems
« Reply #11 on: September 11, 2015, 09:53:51 PM »
That looks brilliant!
It offers even more than I needed.
Thank you very much for taking the time to make this style.
It offers a lot of control and can be a nice base for some cool roof styles in the next RC release :)


P.S. I just don't get what is the logic behind using these Y Random Rotation Inputs on the Transform operators (instead of the Fixed one). Is this some kind of workaround?
« Last Edit: September 11, 2015, 10:15:39 PM by trimitek »

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Tangency problems
« Reply #12 on: September 13, 2015, 03:45:42 PM »
Hi,

Glad we could help out. In this case Random rotation is used because it  takes place after the rafters have been scaled. If you use Fixed rotation it is applied before scaling and the rafters are incorrectly deformed.

Many thanks!

Paul
Paul Roberts
iToo Software