Itoo Software Forum

Author Topic: How to check if segment was clipped ?  (Read 758 times)

Infected.bo

  • Newbie
  • *
  • Posts: 32
How to check if segment was clipped ?
« on: October 20, 2015, 04:19:14 PM »
Hello
Since there is no capping possibility in railclone (am i right ?) i wanted to make a way to cap geometry when it was cut.
So for example i am making tiles with a custom shape (not just a box one) on a wall where i have several gaps. Near these gaps tiles are being cut and thus sliced. I need to cap those because from the side it will look really bad.
What i want to do is a piece of geometry which "caps" that hole, and i need to check when geometry is sliced - and place it there.
Is there a way to do that ?
Thanks !

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: How to check if segment was clipped ?
« Reply #1 on: October 20, 2015, 09:35:03 PM »
Hi,

The boolean operation in RailClone is carried as a last step after the array has been built so I'm afraid there isn't away to detect which segments have been sliced and use that information in the graph.

If you are using V-Ray there may be a workaround that used the VRayDistanceTex to perform a render-time boolean and capping effect. To use it you can to follow these steps.

1 - Create your array as usual but turn off Slice for the Tile segments
2 - In the generator's settings change the Clipping Area > For No Slice setting to Preserve
3 - Create solid geometry to represent the area you want to remove from the tiles. Any part of the tile inside this volume will not be rendered. Open the geometry's properties and turn off Renderable.
4 - In the Tile Material, add a VRayDistanceTex and turn on Inside Separate and Inside Solid. Set the distance to 0

5 - Add the boolean volume created in step 3 to the VRayDistanceTex's Objects list. If you render now you should have a render time boolean. This has the added bonus of retaining full instancing.
6 - To add the caps, duplicate the boolean geometry and apply a new cap material.
7 - Create the cap material however you like, but add another VRayDistanceTex map to the opacity slot. As before turn on Inside Separate and Inside Solid. Set the distance to 0 and this time set the Inside Colour to White
8 - Add the RailClone objects to the  VRayDistanceTex's Objects list.

If you render now you should have booleans with capped ends that have a separate material.



For an example of this set-up please see the attached file.

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

Many thanks,

Paul
Paul Roberts
iToo Software

Infected.bo

  • Newbie
  • *
  • Posts: 32
Re: How to check if segment was clipped ?
« Reply #2 on: October 21, 2015, 11:17:08 AM »
Thank you , Paul for reminding me about this trick , it is quite useful. Though thing is that i am trying to find a simple way , but looks like there is no simple way with this one :)
Looks like i will just make a slight scale deformations so it will fit properly...
Actually i have one more question. For example i have a rectangle full of tiles , and a rectangle inside excluding a part of the big one. Tiles are being cut on the small one as i use that one as a clipping shape. Is there a way to make them to scale-fit instead of being sliced ? This goes for all the sides of the small rectangle.
Thanks for your help, Paul !

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: How to check if segment was clipped ?
« Reply #3 on: October 21, 2015, 12:04:41 PM »
Hi,

No problem at all.

Regarding rescaling tiles to accommodate the rectangle, as mentioned unfortunately the clipping operation is carried out as the very last step after the arrays have been built,  so I'm afraid RailClone can't use it to rescale segments. I'll mention it to our dev team and see if there's a way of doing something with this for a future version but in the current release it isn't possible.

The only workaround I can thing of is to split the wall into several RailClone objects for each side of the rectangle so that they can be scaled independently but  this would take a bit of manual labour.

Thanks,

Paul.
Paul Roberts
iToo Software

Infected.bo

  • Newbie
  • *
  • Posts: 32
Re: How to check if segment was clipped ?
« Reply #4 on: October 21, 2015, 12:42:18 PM »
What about if i will use surface instead of clipping spline , will that make any difference ?

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: How to check if segment was clipped ?
« Reply #5 on: October 21, 2015, 02:18:07 PM »
I'm afraid not - arrays can be conformed to follow a surface but surfaces themselves don't perform any clipping functions or affect the dimensions of the array.
Paul Roberts
iToo Software