-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hand calculations suggest equations for polynomial spirals are not documented accurately. #146
Comments
@peterrdf @apinzenoehler @czapplitec @jmirtsch I've been at this for months and have not been able to compute accurate geometry. I'm not an expert in the rail domain, so I'm not familiar with all the concepts. However, if I had the correct equations, I could program them to produce accurate results. I apologize if my frustration is showing through. |
Hello Rick! The Pointlists you used for comparison of your results have been produced by me using the documented parameter functions from IfcAlignmentHorizontalSegmentTypeEnum and IfcAlignmentCantSegmentTypeEnum. Since I was doing a completely independent implementation from IFC geometry, @peterrdf and I used such lists to find divergences between implementations. At the end Peter's IFC implementation and my implementation without IFC produced sufficiently close values to be sure that his IFC implementation is working. I am very happy to have a couple of telcos with you to discuss open issues, especially if we can improve the documentation during this process. But: I am off to vacation in two hours till Thursday next week, so this would have to wait a little bit. In the meantime it might be a good idea to look into Peter's enrichment application to move forward. I would bet a medium amount of money or some liquor that his code works ;-) |
@apinzenoehler Thank you - A telco with you and/or @peterrdf would be great. I would not take your bet as I'm sure Peter's implementation is rock solid. I am the one that is lacking knowledge. Ping me when you return from vacation, and we can set something up. |
Dear @RickBrice, lets plan a meeting to see where the issue lies. Comming to the standard is a long process and there were many different versions before our final ADD2 release. We always supported the intermediate versions and there could very well be an issue on our side also, there is always the risk of validation against your own and others incorrect interpretation of attributes and entities definition, especially when code grows with changes in the definition of the draft versions of IFC4.3. There was a very thorough checking process with several different implementations for IFC side processing and as @apinzenoehler already mentioned a fully seperate python implementation from him, one from us and two more independent implementations from Jon and Igor of all relevant cases in the business logic for single segments of most different transition curves and composiron tables for these cases. The IFC files can be found here https://github.com/bSI-RailwayRoom/IFC-Rail-Unit-Test-Reference-Code/tree/master/alignment_testset/IFC-WithGeneratedGeometry as well as the sources of the Enrich application and comparison tables. As you can see we keep on updating these examples and sources to follow feedback we are getting from implementers. In the last months we had several important improvements in the sources due to small changes between ADD1 and ADD2 as well as on Cubic and Linear Placement. These files are validated against the latest IFC4.3 ADD2 schema. |
@peterrdf Thank you for pointing me to the correct test files. I was able to figure out what was happening.
but has different geometry parameters
When using the geometry parameters from the IFC-RAIL-Unit-Test-Reference-Code project, I can match the (X,Y) exactly for the one test case I've been working on. I will compare with all the polynomial spiral test cases for horizontal alignment over the next few days and report back. |
Hi @evandroAlfieri, could you update the examples on the official bSI GitHub pages? |
I can @peterrdf . However, to avoid this becoming a recurring task I propose to move this very good set of examples to the official bSI GitHub repository. And avoid maintaining (pointing people to) two parallel repositories. Shall I proceed? |
As long as the complete set, including Enrich example and all other relevant code to create and convert these examples can be moved too I am happy to have it at another location. Maybe good to ask @apinzenoehler what is the best option here. |
I'm trying to implement geometry calculations for the polynomial spiral curves from the IFC specifications (IfcSecond,Third,SeventhOrderPolynomialSpiral). As the following calculations illustrate, the equations do not appear to be accurately documented.
Problem Statement
Compute the curve coordinate (x,y) at a distance of 25 m from the start of the IfcThirdOrderPolynomialSpiral and compare to the values reported in the bSI-RailwayRoom sample files.
IFC Source File: GENERATED__Bloss_100.0_inf_300_1_Meter.ifc.txt. The source file is taken from https://github.com/bSI-RailwayRoom/IFC-Rail-Sample-Files/blob/main/1_Alignment%20with%20Cant%20(AWC)/UT_AWC_0_(Synthetic_Cases)/Horizontal/SyntheticTestcases/Bloss/TS1_Bloss_100.0_inf_300_1_Meter/GENERATED__Bloss_100.0_inf_300_1_Meter.ifc in the IFC Rail Room Sample Files. The file in the Railway Room is for IFC4x3 RC 4 and does not pass the bSI validation service checks. The attached file has been modified by hand to use IFC4.3 ADD2 and to pass the bSI validation service checks.
The coordinate reported is (24.9999615671293000, 0.0292968339890285).
The reported values are listed in https://view.officeapps.live.com/op/view.aspx?src=https%3A%2F%2Fraw.githubusercontent.com%2FbSI-RailwayRoom%2FIFC-Rail-Sample-Files%2Fmain%2F1_Alignment%2520with%2520Cant%2520(AWC)%2FUT_AWC_0_(Synthetic_Cases)%2FHorizontal%2FSyntheticTestcases%2FBloss%2FTS1_Bloss_100.0_inf_300_1_Meter%2FTS1_Bloss_100.0_inf_300_1_Meter.xlsx&wdOrigin=BROWSELINK.
The third order polynomial spiral parameters are
Calculations
From the curve definition
The governing equations as provided in the IFC documentation are:
Substitute curve parameters into equations
$$\theta(t) = \frac{-531.329284591306 t^4 }{4|(-531.329284591306)^5|}+\frac{t^3}{3 (1000^3)}$$
Evaluate the integrals with the trapezoid rule
$$\int_a^b f(x) dx \approx \sum{0.5(f(a) + f(b))(b-a)}$$
Sum the values in the last two columns to get$x$ and $y$ .
Compare the computed and reported values.
The following graph compares the computed and reported values for the entire curve.
As you can see, there is a stark difference in the computed and reported values. The reported values appear to be quite reasonable which leads me to the conclusion that there are inaccuracies in the documented equations.
Additionally, IFC 4.2.2.2.2 contains some probable inaccuracies.
The documentation makes the statement "The parameter value is defined as the deflection, i.e. bearing angle &Theta". The equation provided in 8.9.3.72 is parameterized on$u$ , distance along the curve. The unit of measure for $t$ must be length else $\theta(t)$ is not a unitless quantity. Is the statement from the IFC documentation accurate? If so, further explanation is needed.
The documentation also states the qubic term (which should be cubic term) is$L/\sqrt[3]2$ and quadratic term is $L/\sqrt3$ . Using the curve parameters from the example the curve length can be computed from either term.
The result is different curve lengths. Is the information provided accurate?
Lastly, computed and reported values for curvature are compared. Curvature is defined by the equation
Graph of computed curvature
Graph of reported coordinates and curvature
Again the comparison shows stark differences with the reported values seeming quite reasonable. This further suggests that the equations provided in the IFC documentation have inaccuracies.
The text was updated successfully, but these errors were encountered: