Closed curve question!

Closed curve question!

D_D_K
Advocate Advocate
602 Views
2 Replies
Message 1 of 3

Closed curve question!

D_D_K
Advocate
Advocate

Hi,

How do I get the derivative at the last point of a closed curve as this's illustration.

Is there a better way than finding the approximate point?

 

image.png

 

Thanks in advance!

0 Likes
Accepted solutions (1)
603 Views
2 Replies
Replies (2)
Message 2 of 3

tbrammer
Advisor
Advisor
Accepted solution

In general you can use AcDbCurve::getFirstDeriv(double param, AcGeVector3d& firstDeriv) to calculate the derivative at the parameter param. This should also work for both start- and the end-parameter of a closed curve.

 

The bigger problem is to deal with "points of C1 discontinuity". I think the only safe way to find those points for general AcDbCurves is to retrieve the geometrically identical AcGeCurve3d with

 

AcDbCurve::getAcGeCurve (AcGeCurve3d*& pGeCurve, const AcGeTol& tol) 

 

and use

 

Adesk::Boolean AcDbCurve::explode(
   AcGeVoidPointerArray& explodedCurves,
   AcGeIntArray& newExplodedCurves,
   const AcGeInterval* intrvl = NULL
) const;

 

to split it into C1-continuous curves and determine their derivatives at start/end-parameters.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 3 of 3

D_D_K
Advocate
Advocate

Thanks sir,

this is exactly what I needed. 🤠

0 Likes