curve B
B1--------------------------B0
You define distances:
|A0 B0|
|A0 B1|
|A1 B0|
|A1 B1|
And find the smallest one. Then, based on the number of the shortest distance:
Flip A, Leave B
Flip A, Flip B
Leave A, Leave B
Leave A, Flip B
A more advanced metric would be to create all 4 blends, then pick the one that is shortest. Maybe that works better for what you want, maybe not.
--
David Rutten
david@mcneel.com…
Added by David Rutten at 8:09am on February 11, 2014
Yes you are right, It is also best to use a scale NU and just scale BB on X and Y and not Z. I will make some experiment with clipper and come back if it is good.
Hi,
Graft curves and it will work
don't forget to edit path radius 3 and effect distance 85
and find a way to get rid of the points when reach centre, otherwise they will create a crowd
Added by Mohamed Naeim at 5:58am on January 17, 2017
Hi Agneesh,Check the attached file.
Btw, I lowered the number of "populate 2d" component points (from 85 to 15) due to poor performance of my PC. You can get it back if you wish.
Sub RunScript(ByVal x As OnCurve, ByVal y As Integer)
'your code here…
Dim BB As OnBoundingBox
BB = x.BoundingBox
Dim minPt As On3dPoint
minPt = BB.Corner(0, 0, 0)
Dim minx As Double = minPt.x
Dim miny As Double = minPt.y
Dim minz As Double = minPt.z
Dim maxPt As On3dPoint
maxPt = BB.Corner(1, 1, 1)
Dim maxx As Double = maxPt.x
Dim maxy As Double = maxPt.y
Dim maxz As Double = maxPt.z
Dim sx As Double = maxx - minx
Dim sy As Double = maxy - miny
Dim sz As Double = maxz - minz
Dim i As Integer
Dim RdPts As New List(Of On3dPoint)
Dim aa As Double
Dim dd As Double
Dim cc As Double
Randomize()
For i = 0 To y
Dim num As New Random
Dim Rnd As Integer = num.Next(1, 10)
aa = minx + sx * Rnd / 10
dd = miny + sy * Rnd / 10
cc = minz + sz * Rnd / 10
Dim pt As New On3dPoint (aa, dd, cc)
RdPts.Add(pt)
Next
A = RdPts…
--------------
Version 1.0
85 composants Grasshopper permettant entre autre l’analyse d’un terrain, l’étude de projet linéaire ou encore l’étude de plateforme.
…