# Extracting Interpolated Curve Construction Points

Developer: RhinoScript
Summary: How to reverse engineer an interpolated curve using RhinoScript.

## Question

Is it possible to obtain the original points used when creating an interpolated curve using Rhino's InterpCrv command or RhinoScript's AddInterpCurveEx method?

If the curve has a degree of 3, then the answer is yes. Just get the curve's knots, or knot vector, and then evaluate each knot value.

## Example

The following example demonstrates how to extract an interpolated curve's original construction points.

```   Function ExtractInterpCrvPoints(curve)

' local variables
Dim points(), knots, i

' default result
ExtractInterpCrvPoints = Null

' verify the curve
If Not IsNull(curve) And Rhino.IsCurve(curve) Then

' verify the degree of the curve
If Rhino.CurveDegree(curve) = 3 Then

' get the curve's knots
knots = Rhino.CurveKnots(curve)

' verify the curve's knots
If IsArray(knots) Then

' evaluate the curve at each knot value
ReDim points(UBound(knots))
For i = 0 To UBound(knots)
points(i) = Rhino.EvaluateCurve(curve, knots(i))
Next

' cull any duplicate points
ExtractInterpCrvPoints = Rhino.CullDuplicatePoints(points)

End If

End If

End If

End Function```
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8548601269721985, "perplexity": 2291.752239246917}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232256958.53/warc/CC-MAIN-20190522203319-20190522225319-00325.warc.gz"}