# Unexpected behavior of curve resampling

**URL:** <https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188>\
**Category:** Support\
**Created:** [February 25, 2022, 11:55pm UTC](https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188 "2022-02-25T23:55:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [February 25, 2022, 11:55pm UTC](https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188/1 "2022-02-25T23:55:34Z")

</div>

I used the “Resample” menu in the Markups module to resample a curve and constrain it to a surface model. Unlike in previous versions, the curve was not constrained to the surface, as seen below:

 ![CaptureRC.PNG](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/6/96392baa0b8e32ce79fad64683a95eb5b4d11d02.jpeg)

If I set “Constrain to model” under the “Curve settings” menu first, then I get the resampled curve snapped to my surface model, shown below. Is this change from previous behavior of curve resampling intended? If so, should resample curves be updated to remove the surface constraint?

 ![CaptureRC2.PNG](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/2/f2fd0566d4c44cc25b2d1ac18dde4936ac461b59.jpeg)

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [March 1, 2022, 11:25pm UTC](https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188/2 "2022-03-01T23:25:33Z")

</div>

@lassoan @Connor-Bowley could you comment on whether setting the curve type before resampling is intended as part of the addition of the curve settings menu, or is a bug?

I am using the windows rev 30663.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 1, 2022, 11:35pm UTC](https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188/3 "2022-03-01T23:35:55Z")

</div>

Since constraining to model is now available in “Curve settings” it is not needed anymore in “Resample curve”, so it should be removed from there. If the projection settings (in “Advanced” section) are all available in “Curve settings” then those too can be removed from “Resample curve” section.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 8, 2022, 11:45pm UTC](https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188/4 "2022-03-08T23:45:36Z")

</div>

I’ll remove these redundant settings from the curve resampling section today or tomorrow.

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [March 8, 2022, 11:47pm UTC](https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188/5 "2022-03-08T23:47:11Z")

</div>

I just got back to this and was about to submit a pull request.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 8, 2022, 11:48pm UTC](https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188/6 "2022-03-08T23:48:23Z")

</div>

Have you already started working on it?

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [March 8, 2022, 11:51pm UTC](https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188/7 "2022-03-08T23:51:14Z")

</div>

Yes, I just finished testing and was rebasing my branch. But it’s a pretty simple fix if it’s faster for you to submit.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 8, 2022, 11:52pm UTC](https://discourse.slicer.org/t/unexpected-behavior-of-curve-resampling/22188/8 "2022-03-08T23:52:09Z")

</div>

Please submit it then, I’ll review and consolidate it with my WIP changes.
