Itoo Software Forum

Author Topic: How to place objects based on the size of closed Spline  (Read 302 times)

Grey_Rift

  • Newbie
  • *
  • Posts: 1
How to place objects based on the size of closed Spline
« on: October 15, 2019, 01:42:11 PM »
Hey Guys,

I want to create a railclone that places different buildings depending on the size of the spline. 
Using the Conditional operator didn't seem to do anything.
I believe this is because the conditional only read open splines ( I could be wrong about this).

I've added the graph with the conditional statement as an attachment.

After this didn't work I tried to write my own macro that would compare the surface of the spline and if the Spline had a bigger surface than the input number it would put the other building. But this didn't work either. An image has been attached to post aswell with the formula that I used.

Can anyone help me achieve my goal?

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2520
    • iToo
Re: How to place objects based on the size of closed Spline
« Reply #1 on: October 17, 2019, 09:32:57 AM »
Hi

I have constructed a simple scene where segment is chosen depending on area size:


Hope this helps
Rokas
iToo Software

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1736
Re: How to place objects based on the size of closed Spline
« Reply #2 on: October 17, 2019, 09:46:43 AM »
Hi,

it would be „safer“ to check both lengths instead of the area - for example by the following expression, where exported X Size & Y Size attributes of the Segment are being used to evaluates if it fits or not:

return if(XSplineLength>Input1 && YSplineLength>Input2,2,1);

Best regards,