Rails and swept section profile is round corners

Hi, i'm having an issue where whenever i use a profile to create a bspline surface by sweeping along a rail, it rounds the corners of the curve that i'm using as the profile. The curve itself is only comprised of 2 arcs and 2 lines. I've tried splitting the arc at various points and that improves things, but the corner doesn't ever become truly 90 degress, it stays rounded albeit with less of a radius. Has anyone encountered a similar issue?

  • Hi Jonathan,

    I have had this issue before as well, and filed an enhancement request.

    I think the issue for me (from memory) was that whenever I had a complex curve (arcs and lines combined), and then used something like Curve.CopyTransferGeometricContents, GC will actually generate that new instance as a BSplineCurve instead. You can verify this by inspecting the properties of the transformed curve, or by zooming in at the vertices and it will appear as a BSplineCurve that is trying to do a "best fit"; it will still have rounded edges though and a heap of additional vertices either side of the corner to try and straighten it out, instead of retaining the original components and transition. Not sure why it does this but it is incredibly annoying and misrepresents the geometry entirely!

    The good news is there are a few work-arounds that I can think of. If the profile does not change as you move along the alignment:

    • Create the arcs and lines in-place at the start of the curve, and then combine into a single curve using Curve.CompositeCurves, then use the sweep profiles along method
    • Create a cell for the profile, place it at the start of the alignment. Then extract the geometry in-place using Curve.FromElementsInCell so that it is represented correctly. Then use the sweep profiles along method
    • As above but place the cell at points of interest, then use BSplineSurface.LoftCurves to create your surface. You can apply order = 3 or 4 to smooth the surface out, but this method does not follow the alignment exactly so it is less accurate

    If the profile does change as you move along the alignment:

    • Place the Arcs / Lines separately at each location, then combine them together into a single curve using Curve.CompositeCurves for each instance. This is much more resource-intensive than the other solutions above. You can then loft between them
    • Alternatively create a parametric cell, and then use the custom node I created in this GitHub repository https://github.com/edashbolt/generative-components. You can then drop the curve geometry down and loft between them as above

    Edit - out of curiosity I just tried to replicate the issue to see if it was still there and I could not seem to get it to do the same thing. I am working in update 6 now; originally had this issue back in update 2 and I think it was still there in update 3, so perhaps try updating GC to the latest version and that might fix it. Below is an image I sent to the GC product lead back then: On the LHS is the Curve.CopyTransformGeometricContents result, on the RHS is the original Curve. As you can see once transformed GC was creating a BSplineCurve for some reason.

    Cheers,

    Ed

  • Hi Edward, thanks for such an informative response.

    I'm actually creating the sections themselves as curves using the CompositeCurve method, but am still getting rounded edges. Essentially anytime any of my curves contain a arc, the edges get rounded when sweep along a rail. Lofting works fine, but this is for interior tunnel structures, meaning everything needs to follow the alignment and be adjustable as needed.

    We are working in Update 6, but can't update to 7 right now as the project is heavily underway and upgrading everyone would be a task in and of itself.

  • Ah ok I see. Are you able to share the relevant transactions to help illustrate the process?

  • Here you go. I just recreated a test file, it's not my project file, but the issue is still evident.Support Test.dgn

  • That makes it a lot easier to see what is going on, thanks for the test file. This is without a doubt a bug; pretty much the exact same issue as my case, where the input geometry was misrepresented as a BSplineCurve by the Curve.CopyTransformGeometricContents method... in your case it is the BSplineSurface.FromRailsAndSweptSections method that is the issue. If you lodge a service request now you might be lucky and get a fix included in the next update, which I think is due sometime in the next few weeks.

    I have done a few tunnels as well, and tend to just use the loft method with an "order" set to 4. This will give you the same output result of a smooth flowing surface / solid, maintaining the necessary accuracy to the alignment provided you set the spacing for profiles correctly, since a tunnel alignment will tend to have a very large bend radii. If for some reason it does have sharp transitions, (which for example you might find with a cut & cover road tunnel at entry/exit ramp locations), then you can "split" the solids at those locations so that you retain the correct angle of inflection. I have updated your test file with 2 methods, one which is simply sweeping a single profile along the alignment to form a solid (but this method does not allow for transitions to different profiles), and the other using the above mentioned loft technique. Hopefully that helps you out in the meantime until a bug fix is available.

    As a side note, you may already be aware of this but just in case, be careful using a BSplineCurve as your input for an alignment since CoordinateSystems and Planes will rotate seemingly at random as you place them along a BSplineCurve, due to the maths that are used to form the geometry of a BSpline. This can be corrected for by specifying a coordinatesystem up vector, or if you need to follow the grade of the vertical alignment then you can place a coordinatesystem by specifying each individual vector and this will get you the result you need, however it does come at a performance penalty over simply using a PolyLine as your input. If you receive your inputs from OpenRoads for example and are worried about the accuracy you can reference the horizontal alignment (2D) to ensure that you have the exact location and tangent to the curve at any given point, and then just project that point up to the 3D alignment string from their output (polyline) to find the vertical position RL. Hopefully we will see an alignment node in the near future that will simplify this process.

    Good luck with it!

    Ed

    0876.Support Test.dgn