Divide a segment by Minimun Dimension Constrain

#1

Hi there,

I hope you are well.

I am wondering how to split/divide a “curve” having a Minimum Spacing Contrain, (like the curtain wall in Revit). I can make it work by number of segment, distance but I could not figure out how I can do it with a minimum Spacing constrain.

Is it posisble?

Thank you very much.

#2

Something similar to this?

#3

Tom, thank you for the quick answer.

Please correct if I am wrong, the formule does not work as a minimun Spacing constrain. From what I see there, it divides the curve in equal spaces, having a different starting point, isn’t it? Please let me know if I am missing something.

What I am trying to achieve is the same idea as curtain wall. You have any geomtry and I want to split the geometry in equal segments but not going less than a known dimension.

As the exmaple show, the curtain wall / segment is divided in 746 equal parts as the minimun spacing constrain is 700.

Thanks

#4

I am not totally sure to understand how to use a minimum value since the result could be any greater number. Would that mean that the result should be the closest value? Or is a parameter missing, such as the number of divisions?
Anyway, to get started on something, you could simply try to divide your segment with this minimum spacing constraint, get the floor integer of this number:
http://dictionary.dynamobim.com/#/Core/Math/Action/Floor
Retrieve one from another and allocate the result proportionally to every segment, or anything along this line, and send a screenshot of what you tried so that we can see clearly where the issue lies.

#5

Hi Yna,

Thank you for the reply.

Well it is the tricky scnario right.

Probably my english is not good enough to explain what I am trying to achieve. Let me try again:

“It is divide a curve equally with the minimun dimnesion possible, but not less than a dimension known”. I know the Math Floor action, but I do not think it will solve the problem unless I am missing something.

A few picture as requested, it could help to undertnad the problem as you said
.

As you can see I do not want to have 621 (as an example) as it is less than 700 (as an example). the line is divide by 700 perfectely but obviously the the whole dimension cannot be divided equally by 700, the last bit is less than 700.

I hope it make easier to undertand my goal.

Thank you very much.

#6

10400 / 700 = 14.8571…
MathFloor(14.8571…) = 14
14 x 700 = 9800
10400 - 9800 = 600
600 / 14 = 42.8571…
700 + 42.8571… = 742.8571… = closest eligible value from the minimum constraint.
Is this what you’re after?

1 Like
#7

Edit: Looks like @Yna_Db beat me too it. Here’s an image to go along with it.

1 Like
#8

I usually prefer that users try something first, it helps more to learn than just copy-pasting and requires to get involved somewhat…
For further information on this topic, see here:
http://dynamoprimer.com/en/07_Code-Block/7-3_shorthand.html
http://dynamoprimer.com/en/04_The-Building-Blocks-of-Programs/4-2_math.html
http://dictionary.dynamobim.com/#/Geometry/Curve/Action/PointAtSegmentLength

#9

Thank you guys.

It is great.

#10

I completely agree, but his graph was pretty close already. He was just mixing up a few minor details.

#11

This is exactly what I mean :slight_smile: