Itoo Software Forum

Author Topic: help with procedure with expression  (Read 1812 times)

ezmerel2

  • Newbie
  • *
  • Posts: 13
help with procedure with expression
« on: November 20, 2015, 08:50:04 PM »
Hi,
I have the following situation to accomplish- any help provided is much appreciated.
I have a unique segment (simple vertical plane is enough to understand the object) that i must evenly space along a straight spline.
The segments xSize must be any value between 1.0 and 1.15, and all segments spaced along the spline must always be the same xSize.
All segments must have a separation/padding of .02m
The first and last segments must each be inserted exactly at the endpoints of the path, meaning the first object to the left of the path (looking at a front view) must have its bottom left vertex inserted at the beginnig of the path, and the last object must have its bottom right vertex inserted at the end of the path (I'm attaching a file for further clarification).
I understand I need an expression to evaluate the spline  length and divide it by the possible number of objects that can fit into it being larger than 1m and smaller than 1.15, while keeping a separation of 2cm between them. In some cases I understand the spline may NOT be able to fit a certain amount of objects of those min/max sizes while keeping a 2cm separation between them so I am unsure whether this is at all possible with using expressions, as it would be great in this specific case to be able to also use a certain tolerance for distance between objects (min/max padding sort of thing).
Ideally, I would like this to work for an object with several subplines attached...
I have no idea of how to set this up...

Thanx

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: help with procedure with expression
« Reply #1 on: November 23, 2015, 10:50:01 AM »
Hi,

Thanks for the question. I've attached a file with a possible solution that uses expressions.

It works by calculating the number of panels of the minimum sized panel plus a gap that can fit into a spline. It then uses this value to scale the panels to fit. If the panel exceeds a Maximum threshold then an additional panel is added. Finally, if an additional panel is added but it takes the size below the minimum threshold it adjusts the padding between the panels instead.

Also attached is a screen grab with an explanation for each part of the graph.

I hope that helps, if you have any questions about this style please let me know.

Many thanks!

Paul

Paul Roberts
iToo Software

ezmerel2

  • Newbie
  • *
  • Posts: 13
Re: help with procedure with expression
« Reply #2 on: November 23, 2015, 11:30:28 AM »
wow.
I am speechless.
Thank you. It is exactly what I need. I will test it thoroughly although it appears to work as expected, even with multiple splines attached.
The soultion you provide appears to be very complex, although your explanation is extremely helpful.
I believe I would have never even gotten close to solving this example. It will definitely be very useful for further projects.
Your support for this program is outstanding.

Best Regards

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: help with procedure with expression
« Reply #3 on: November 23, 2015, 01:07:27 PM »
Hi,

No problem at all, glad we could help out. It is a bit of a tricky one, but if you have any questions about the expressions used please let me know.

Kind regards,

Paul
Paul Roberts
iToo Software