hello, I have another Bezier question.

I'm splitting a bezier curve with ON_BezierCurve::Split, and I get two pieces. Lets call them first and rest. Then I need to split "first" again into first1, first2. Is it possible to join first2 and rest into one bezier curve? there shouldnt be any problems mathematically since they were originally attached as one curve.

there exists a function to create a ON_BezierCurve from an existing ON_BezierCurve, but i dont think thats what I want.

thanks,
chris

On 07/11/2012 01:26 AM, phoenix wrote:
Hi, Chris!

> i have a few questions regarding working with ON_BezierCurves. I want to > evaluate the tangents at the start and end points of a bezier curve. the
> function ON_BezierCurve::TangentAt() seems to be what i want, but it
> takes a double as its argument instead of a point. what does the double
> represent? distance from the beginning of the curve? how can i get the
> tangent at the beginning/end points of the curve?

The input double is the parameter, I think. A Bezier curve is a parametric curve. The parameter t is usually between 0 to 1. So for the beginning point, you can set t = 0, while for the end point, you can set t = 1. See: http://en.wikipedia.org/wiki/B%C3%A9zier_curve

> also, is it possible to access specific control points of an
> ON_BezierCurve? I'm mostly concerned with the first and last points of
> the curve. the ON_BezierCurve::PointAt() looks close, but again, it
> takes a double as its argument and i'm not sure what to do with it.

The control points are accessible. Just use the double *CV(int cv_index) method to return the control point, or use the GetCV method. The PointAt() method returns the evaluating result of parameter t. For the first and last control points of the curve, you can use CV(0) and CV(xx.CVCount() - 1). For evaluation results, you can maybe use PointAt(0) and PointAt(1).

Cheers!
Wu


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to