Approximating NURBs curve with a polyline. |
It would be helpful for someone
- Who exports the final result from Rhino to other platforms(which has the minor capacity of NURBS)
- Who wants to approximate a curve with a proper number of vertices.
Benefit
- Approximate curve to polyline with a proper amount of points
- As a result of 1, utilize the computer resource efficiently
- Solve the compatibility issue between platforms (E.g. Rhino to AutoCad)
Summary
This article will tackle the method to convert NURBS to polyline that is as similar as possible with a proper amount of vertices.Main
One of the biggest issues between platforms is how to interpolate data. For example, for the curves which we are literally naming curve, there are plenty of problems to import and export it.
If you have ever exported a curve from Rhino and checked in Autocad, you may have found some problems. One that I found is the curve is not represented well enough so that you have to hit "rebuild"(I assume it was the command) to properly check the drawing in Autocad.
From the lecture of Long Nguyen, who is a professor at the University of Stuttgart, he said that it was also a raised issue in Renault.
The plan whereby the converting curve is simple.
First, draw a straight line by using two points at the start and the end. It draws a line by connecting those of two. And it defines a middle point and closest point from the middle point to the original curve.
Second, it evaluates the distance between the closest point and a middle point. If the distance is over the threshold, it doesn't generate a line anymore. But if it's under the threshold, it generates lines by connecting start, closest, and end point.
And it repeats these steps over and over again to comply with the condition.
If you type the small enough number to the tolerance(that will be dependant on your project), it will generate the best approximation of the original NURBS curve.
Conclusion
In practice, there are many cases which fabricator requires Autocad file for their fabrication process. In extreme cases, they require Autocad 2004 version file. I assume it is something in common for the people working in the AEC industry.
So no matter what kind of software you use - that can be Rhino, CATIA or Revit- we have an obligation to convert our result to fit into machine data. I hope this one can solve the data migration problem in case of 2d base fabrication - mostly laser cutting - when you generate something in the NURBS base platform and convert it.
I also attach the original grasshopper code that involves the c-sharp code and the Youtube link of the original lecture.
Adaptive fitting Grasshopper code
Long Nguyen lecture: Adaptive fitting part
If you have ever exported a curve from Rhino and checked in Autocad, you may have found some problems. One that I found is the curve is not represented well enough so that you have to hit "rebuild"(I assume it was the command) to properly check the drawing in Autocad.
From the lecture of Long Nguyen, who is a professor at the University of Stuttgart, he said that it was also a raised issue in Renault.
The plan whereby the converting curve is simple.
The tolerance is around 251. |
First, draw a straight line by using two points at the start and the end. It draws a line by connecting those of two. And it defines a middle point and closest point from the middle point to the original curve.
Second, it evaluates the distance between the closest point and a middle point. If the distance is over the threshold, it doesn't generate a line anymore. But if it's under the threshold, it generates lines by connecting start, closest, and end point.
You can see as the threshold becomes smaller, new line was generated to comply with the condition. |
And it repeats these steps over and over again to comply with the condition.
Conclusion
In practice, there are many cases which fabricator requires Autocad file for their fabrication process. In extreme cases, they require Autocad 2004 version file. I assume it is something in common for the people working in the AEC industry.
So no matter what kind of software you use - that can be Rhino, CATIA or Revit- we have an obligation to convert our result to fit into machine data. I hope this one can solve the data migration problem in case of 2d base fabrication - mostly laser cutting - when you generate something in the NURBS base platform and convert it.
I also attach the original grasshopper code that involves the c-sharp code and the Youtube link of the original lecture.
Adaptive fitting Grasshopper code
Long Nguyen lecture: Adaptive fitting part
댓글
댓글 쓰기