Points on ARC by Spacing

Hi All,

Just wondering how I would go about spacing points along an ARC at a given spacing (say 1650mm) but evenly space those between each end. For example if the arc was not a clean divisor of the required spacing how to ensure the 2 end panels equal at each end.

There may be a method I am missing but I started down the path of thinking I would have to write an expression that looked at the ARC length

For example:

Arc length: 21120mm

Divide this by 1650

21120 / 1650 = 12.8

Round this down to a whole number = 12

12 x 1650 = 19800

Subtract this from the original line length

21120 – 19800 = 1320

Divide this by 2

1320 / 2 = 660mm

This gives me the 2 end panel widths.

But I am now stuck on the best way to input this into a point.

Should I then try and create a number series and put that into point ByIncramentalDistanceAlongCurve?

Just as a reference this is to be applied to a tapering set of arcs (over 100) if it was just one I would probably just punch it in manually J

Thanks

Wayne

  • Hi Wayne,

    I've just try to solve this issue with Point.ByFunction but it is working only with single curve/arc.

    I dont know why it is not working with multiple {curves/arcs} :/

    function (ICurve InputCurve, double divLength)
    {
        double divQnty = Floor(InputCurve.Length/divLength);
        double divEdge = ((InputCurve.Length-(divQnty*divLength))/2);
        
        
        Point p01 = new Point(this);
        p01.ByDistanceAlongCurve(InputCurve,Series(divEdge,InputCurve.Length,divLength));
        
    }

    Uupss... Looks like i just forget to add curve as an array :)  Please check below code for updated version.

    function (ICurve[] InputCurve, double divLength)
    {
        double divQnty = Floor(InputCurve.Length/divLength);
        double divEdge = ((InputCurve.Length-(divQnty*divLength))/2);
        
        
        Point p01 = new Point(this);
        p01.ByDistanceAlongCurve(InputCurve,Series(divEdge,InputCurve.Length,divLength));
        
    }

    Answer Verified By: Wayne Dickerson 

  • Hi Emre,

    Thank you for posting your response. Both versions work in AECOsim Building Designer CONNECT Edition Update 2 with GenerativeComponents as companion feature. The first version is the preferred version, because GC applies the replication across all inputs as applicable to the operations inside the function.

    The only change I would suggest is to create Point p01 as new Point(). This will reduce the level of nesting in the resultant point array. It requires to return p01 to the caller of the function (the Point.ByFunction node).

    The last three lines of your function then look like this:

        Point p01 = new Point();
        p01.ByDistanceAlongCurve(InputCurve,Series(divEdge,InputCurve.Length,divLength));
        return p01; 

    Then the result is a two-dimensional array of points.

    If inclusion of the curves' start and end points is desired, it requires an additional step:

    Add a FunctionCall node with the following function:

    function (Point[] startPoints, Point[][] pointArray, Point[] endPoints)
    {
        pointArray.Insert(0, startPoints);
        pointArray.Add(endPoints);
       
        return pointArray;
    }

    Important is to transpose the point array that was generated previously when passing it into this function. The reason is that the point array's rows are its second dimension (the first dimension is the vertical stacking, assuming the curves on which the points sit are vertically stacked). Start points and end points are vertically stacked like the curves, i.e. they are "columns" already. Using <name of point node>.Transpose() when wiring the point node to the function call will align the point arrays correctly.

    Another challenge may be that with constant bay width and changing curve lengths a varying number of points are generated along the curves so that even and uneven numbers of bays may result. (Wayne, let's cross that bridge when/if you get there.)

    Wishing you all best success!

       Volker

       

    Answer Verified By: Wayne Dickerson 

  • Thanks Emre, that is great. 

    I really need to brush up on my function skills :)

    I followed along to a point, have the points positioned where I need them just can't get the last function call to work.

    Volker what are the startPoints and endPoints looking for? I tried a few different inputs but I am a bit lost.

    And you are correct, the tower is tapering and it will go from probably 19 panels to 14 or so at the top. I thought I could manually manipulate the curves so that I could select by color using a range box for say the set that will have 19 panels etc etc up the tower. giving control over the end points. I am sure you have a much nicer way of doing it.

    thanks again

    Wayne

  • Here a Version without using a Function but with (a bit complex) Series

    Point4 is a Startpoint calculated with these Term:    (arc1.Length-(Floor((arc1.Length/Panel_width))*Panel_width))/2       where Panel_width is an expression defining the Façade Panel Width.  So Point4 is the first/left not complete Panel

    Point5 is a Series for the complete Panels.    Series(point4.DistanceAlongCurve,(Floor(arc1.Length/Panel_width)+1)*Panel_width,Panel_width)



  • Hi Wayne,

    Not sure about "a much nicer way"...

    The start and end points are the StartPoint and EndPoint properties of the curves. If the curves "MyCurves" are replicated, then all their start points are MyCurves.StartPoint.

    The function inputs then are MyCurves.StartPoint, the point array from Emre's function (with the change I suggested) and transposed, e.g. MyPointArray.Transpose(), and MyCurves.EndPoint.

    The attached file shows what these pieces would look like. The step-down causes Polygon.ByPointGrid to generate a triangle toward the end of the second row from the top. This is indication how the ByPointGrid technique is a "fair weather" technique that handles this situation robustly; however, most likely the result is not what one might desire.

    In this situation there are several approaches that could be taken, for example center the triangle in its row. This would mean to use ByFunction to generate the polygons rather than ByPointGrid.

    Considering redistributing the panels when numbers change has other side effects: there will be triangular gaps in the façade. This is perhaps tolerable, or the next row up is offset so that there is a protective overlap that allows for easier weather-proofing.

    Here is a screen capture of a changed façade algorithm, generating the points by function and the polygon "grid" by function. Script is included, too, with some of the missteps, and a last transaction outlining a potential trajectory of further expansion of the script.

    PointsOnArcBySpacing.zip

    HTH,

       Volker