# How to judge a curve model obtained with vtkplanecut or vtkcutter is closed?

**URL:** <https://discourse.slicer.org/t/how-to-judge-a-curve-model-obtained-with-vtkplanecut-or-vtkcutter-is-closed/24470>\
**Category:** Development\
**Tags:** vtk, python\
**Created:** [July 24, 2022, 6:01pm UTC](https://discourse.slicer.org/t/how-to-judge-a-curve-model-obtained-with-vtkplanecut-or-vtkcutter-is-closed/24470 "2022-07-24T18:01:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [July 24, 2022, 6:01pm UTC](https://discourse.slicer.org/t/how-to-judge-a-curve-model-obtained-with-vtkplanecut-or-vtkcutter-is-closed/24470/1 "2022-07-24T18:01:25Z")

</div>

How to judge a curve model obtained with vtkplanecut or vtkcutter is closed?

> **[Google Drive: Sign-in](https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1hrCsY3-2dZxRI4_Z1dilN3F5clqqpTfB%2Fview%3Fusp%3Dsharing&followup=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1hrCsY3-2dZxRI4_Z1dilN3F5clqqpTfB%2Fview%3Fusp%3Dsharing&ifkv=AaSxoQwr6Ah4bcpuff7nmepNzbiWmFlvFPtz6GvOwRdxTbUv8Om4oyazHZHqhlz8-7qeQCEGrXoKUQ&osid=1&passive=1209600&service=wise&flowName=GlifWebSignIn&flowEntry=ServiceLogin&dsh=S-50260005%3A1715915191449189&ddm=0)**
>
> Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/2/52051d7cd6aacf10930f0f4c0d49ff6dbd10e1d6.png)

@lassoan@Juicy@jamesobutler @jcfr @pieper@ jmhuie @manjula @szhang

---

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [July 24, 2022, 8:15pm UTC](https://discourse.slicer.org/t/how-to-judge-a-curve-model-obtained-with-vtkplanecut-or-vtkcutter-is-closed/24470/2 "2022-07-24T20:15:15Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/9/39244b453341c5798449c1f69eb952056eaf154f.png)

I try to use the [vtkFeatureEdges](https://vtk.org/doc/release/6.0/html/classvtkFeatureEdges.html), but got the wrong result👆🏻, what’s wrong?

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [July 24, 2022, 11:17pm UTC](https://discourse.slicer.org/t/how-to-judge-a-curve-model-obtained-with-vtkplanecut-or-vtkcutter-is-closed/24470/3 "2022-07-24T23:17:38Z")

</div>

One solution is to traverse the curve and check if you arrive to the starting point

---

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [July 24, 2022, 11:33pm UTC](https://discourse.slicer.org/t/how-to-judge-a-curve-model-obtained-with-vtkplanecut-or-vtkcutter-is-closed/24470/4 "2022-07-24T23:33:21Z")

</div>

but howto traverse the model to the curve?

---

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [July 25, 2022, 10:07am UTC](https://discourse.slicer.org/t/how-to-judge-a-curve-model-obtained-with-vtkplanecut-or-vtkcutter-is-closed/24470/5 "2022-07-25T10:07:04Z")

</div>

I trasverse the model to the curve, and `IsA('vtkMRMLOpenCurveNode')` , but got the wrong result too👇🏻…

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/2/b29950f99986153c007cd23e22acc2ef74a873a0.jpeg)

😰 👿

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/1/f11e30a51a6d535aff12a48d744bf344aa4f25ab.jpeg)

---

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [July 25, 2022, 10:01pm UTC](https://discourse.slicer.org/t/how-to-judge-a-curve-model-obtained-with-vtkplanecut-or-vtkcutter-is-closed/24470/6 "2022-07-25T22:01:30Z")

</div>

@lassoan@Juicy@jamesobutler @jcfr @pieper@ jmhuie @manjula @szhang
