# ClosedPath AssertionError

**URL:** https://discourse.julialang.org/t/closedpath-assertionerror/74671
**Category:** New to Julia
**Tags:** error-message
**Created:** [January 15, 2022, 3:01pm UTC](https://discourse.julialang.org/t/closedpath-assertionerror/74671 "2022-01-15T15:01:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fadil](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@fadil](https://discourse.julialang.org/u/fadil)
#### Post date: [January 15, 2022, 3:01pm UTC](https://discourse.julialang.org/t/closedpath-assertionerror/74671/1 "2022-01-15T15:01:16Z")

</div>

I get the problem when trying to create interior of the ClosedPath.

z1 = 0 + 0im; z2 = 3 + 1im; z3 = 2 + 2im; z4 = 1 + 3im;  
p = ClosedPath([Segment(z1, z2), Segment(z2, z3), Segment(z3, z4), Segment(z4, z1)])  
interior(p)

I get the following error:  
ERROR: AssertionError: Curve endpoints do not match for pieces 1 and 2

Why? How to solve the problem?

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [January 15, 2022, 4:02pm UTC](https://discourse.julialang.org/t/closedpath-assertionerror/74671/2 "2022-01-15T16:02:05Z")

</div>

You should indicate the package you are using. If it is `ComplexRegions`, then there could be a bug related to numerical checks around point `z1 = 0 + 0 im`.

Changing `z1` to a small number seems to fix the problem, for ex: `z1 = 1e-3 + 0im`. Perhaps you could open an issue in github.

---

<div class="post-metadata">

### Author: ![fadil](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@fadil](https://discourse.julialang.org/u/fadil)
#### Post date: [January 15, 2022, 4:38pm UTC](https://discourse.julialang.org/t/closedpath-assertionerror/74671/3 "2022-01-15T16:38:27Z")

</div>

Yes, z1 = 1e-3+ 0im is the solution!!!

I am so thankfull, thanks, thanks, thanks!!!💓💓💓💓

Regards from Fadil Galjic
