I am attempting to draw an Arc using a CatmulRomSpline. I am setting 3 control points and then using evaluate to generate the points in between. I am evaluating 200 points which I thought would be enough. The Arc displays, but appears flattened, a little more like an ellipse sector than a circle sector. I have attached a document with the display using the points from the spline as well as points using our own function based upon a circle sector.
-
I see that there are firstTangent and lastTangent optional parameters. Will these allow me to control the shape of the arc? How are these used? I cannot find an example. I see that it is a Cartesian3 value rather than an angular based value.
-
Do I need to set more control points?
-
Should I be using a different type of spline or another method?
I appreciate you help with this.
Thanks,
Lori
``
``
Arcs.docx (1.82 MB)
I did some more research and experimented a little more. I ended up adding more control points for the spline (1 before the center cp and after. It did give me the curve I wanted…
Just for curiosity could I have don the same thing using the tangent inputs?
Lori
You won’t be able to create a circular arc with a Catmull-Rom spline. I think a Bezier spline could work as a pretty good approximation of a half circle. There is an implementation of Bezier splines in the splines branch. The only type of spline that I know can represent any length of a circular arc are NURBS. Though, they are complex and we don’t have any plans on implementing them.
The tangents for the first and last points of the Catmull-Rom spline do affect the shape. If they aren’t provided, we take a guess at good values based on the first/last three points. They are computed here. Let me know if you still decide to use Catmull-Rom splines and I can reply with an example.
Dan
I was able to use the Cesium Catmull-Rom spline class to draw the arc in the shape I needed. I ended up supplying 2 more points. One between the first and middle, and one between the middle and last. These provided enough information on the shape of the curve I needed. I then evaluated points inbetween to get my arc.
Regards,
Lori