Generative Components - Points on Polyline by Chord Length Function

Hi All,

I have recently switched over to using Computational Design tools in OpenRail Designer CONNECT Edition - 2020 Release 2 Update 8 - Version 10.08.01.3 (previously I was using OpenBuildings Designer CONNECT Edition Update 6 - Version 10.06.03.04) and one I the functions that I used frequently  is no longer working. The function that no longer works is used to place points at a chord length along a 3d line (it is the one Wayne Dickerson provided information on here: https://communities.bentley.com/products/products_generativecomponents/f/generativecomponents---forum/189273/generative-components/).

In OpenBuildings Designer the function worked perfectly, however on OpenRail Designer it works for the first 4-6 points and then it just stops placing points. Does anyone know why this might be happening?

Placing points at a chord length along a 3d line is a very useful function. It would be nice if the Point ByIncrementalDistanceAlongCurve tool worked when the DistanceCurveOption was ChordLength for both a 3d and 2d line (at present it only works for a 2d line) as that would remove the need to create functions to complete this task.

Regards,

Ryan

Parents
  • Hi Ryan,

    It is worth looking at the value that we are putting as an argument since the unit differs in two applications.

    The post looks very long and has lots of information. Can you please share the function here? 

  • function (InputPolyline, Expression InputList)
    {
    //breakpoint;
    Point MyPointList = {};
    Point MyFirstPoint = new Point().ByParameterAlongCurve(InputPolyline,0);
    MyPointList.Add(MyFirstPoint);
    Solid MyFirstSolid = new Solid().SphereByCentroidRadius(MyFirstPoint,InputList[0]);
    BSplineSurface MyFirstSurface = new BSplineSurface().ExtractAllSurfacesFromSolid(MyFirstSolid);
    Point MyFirstIntPoint = new Point().AtCurveSurfaceIntersection(InputPolyline,MyFirstSurface);
     
    
     
    MyPointList.Add(MyFirstIntPoint);
    Point MyNextPoint = MyFirstIntPoint;
    for (int i = 1; i < InputList.Count; ++i)
    {
    Solid MyNextSolid = new Solid().SphereByCentroidRadius(MyNextPoint,InputList[i]);
    BSplineSurface MyNextSurface = new BSplineSurface().ExtractAllSurfacesFromSolid(MyNextSolid);
    Point MyNextIntPoint = new Point().AtCurveSurfaceIntersection(InputPolyline,MyNextSurface);
    
     
    if (MyNextIntPoint.Success == true)
            {
            Point MyNextIntPointCount = MyNextIntPoint.Flatten();
            if (MyNextIntPointCount.Count > 1)
                {
                MyNextPoint = MyNextIntPointCount[1];
                }
            else
                {
                MyNextPoint = MyNextIntPointCount;
                }
            
    
            MyPointList.Add(MyNextPoint);
     
            
            }
            
    else
    {
    i = InputList.Count;
    }
     
     
     
        
    }
     
     
     
     
     
    return MyPointList;
     
     
     
    }

    Hi Anik,

    Please see below for the function.

    Upon further investigation, I do not think that there is an error with the functional but a "bug" with Computational Design in OpenRail Designer CONNECT Edition - 2020 Release 2 Update 8 - Version 10.08.01.3.

    In the images below, I have completed the same task in OpenRail Designer CONNECT Edition - 2020 Release 2 Update 8 - Version 10.08.01.3 and OpenBuildings Designer CONNECT Edition Update 6 - Version 10.06.03.04 and you can see that in OpenRail the results are not working as expected.

    In each scenario I have placed points at 10m intervals along a polyline, created a sphere (solid) at each point, created a b-spline surface from the solid and then turned that b-spline surface into a mesh (I used the mesh so you can see what is and isn't "working"). As you can see in the first image (from OpenRail) the mesh is created sometimes but not others (seems to be random from my testing). In the second image (OpenBuildings) the mesh is created every time.

    Given the function above relies on creating solids and B-spline surfaces to determine intersection points with the polyline, having the software randomly not "work" is causing the function to not also not work.

    OpenRail

    OpenBuildings

    Regards,

    Ryan

  • Hi Anik,

    I have realised my error (user error), I was working too far from the DGN origin in the OpenRail File. Once I moved the polyline closer to the DGN model origin things worked as expected.

    Regards,

    Ryan

    Answer Verified By: Anik Mal 

  • Yes, having model far away from origin can cause lots of problems. You can also have a look at this blog related to this- Setting Up in the Real World or "Where do we model?"

Reply Children
No Data