# Clarification on periodic cubic bezier vertex counts

**URL:** <https://forum.aousd.org/t/clarification-on-periodic-cubic-bezier-vertex-counts/1128>\
**Category:** USD\
**Created:** [January 14, 2024, 9:21pm UTC](https://forum.aousd.org/t/clarification-on-periodic-cubic-bezier-vertex-counts/1128 "2024-01-14T21:21:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![deadpin](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@deadpin](https://forum.aousd.org/u/deadpin)\
**Post date:** [January 14, 2024, 9:21pm UTC](https://forum.aousd.org/t/clarification-on-periodic-cubic-bezier-vertex-counts/1128/1 "2024-01-14T21:21:43Z")

</div>

The [UsdGeomBasisCurves](https://openusd.org/dev/api/class_usd_geom_basis_curves.html#details) documentation is filled with great details, but there’s one thing that is somewhat confusing about it.

In the context of periodic cubic bezier, it says that:  
`For periodic curves, at least one of the curve's initial vertices are repeated to close the curve. For cubic curves, the number of vertices repeated is '4 - vstep'.`

It also provides some other validity and count examples (for vstep of 3), which imply that 6 verts would be correct:  
`validity : (curveVertexCounts[i]) % vstep == 0`  
`example : periodic	cubic	bezier	[6 9 6]`

But if I understand correctly, if you do repeat at least one of the curve’s initial vertices, then the count should be 7 in this case? How many vertices should actually be present in the file?

---

<div class="post-metadata">

**Author:** ![deadpin](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@deadpin](https://forum.aousd.org/u/deadpin)\
**Post date:** [January 26, 2024, 2:49am UTC](https://forum.aousd.org/t/clarification-on-periodic-cubic-bezier-vertex-counts/1128/2 "2024-01-26T02:49:21Z")

</div>

Does anyone know for sure?

---

<div class="post-metadata">

**Author:** ![nvmkuruc](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@nvmkuruc](https://forum.aousd.org/u/nvmkuruc)\
**Post date:** [January 26, 2024, 1:10pm UTC](https://forum.aousd.org/t/clarification-on-periodic-cubic-bezier-vertex-counts/1128/3 "2024-01-26T13:10:02Z")

</div>

Hi Jesse. The reason only six points are required to define a two segment periodic curve is that the repetition that closes the curve occurs _on the imaging side_ not in scene description. That can be achieved in the renderer directly or in a hydra pipeline.

---

<div class="post-metadata">

**Author:** ![deadpin](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@deadpin](https://forum.aousd.org/u/deadpin)\
**Post date:** [January 26, 2024, 6:03pm UTC](https://forum.aousd.org/t/clarification-on-periodic-cubic-bezier-vertex-counts/1128/4 "2024-01-26T18:03:03Z")

</div>

Got it. So the application is expected to do the duplication, if needed, internally on their side.

A .usd file with 7 vertices, in this case for example, is invalid. Is that correct?

---

<div class="post-metadata">

**Author:** ![nvmkuruc](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@nvmkuruc](https://forum.aousd.org/u/nvmkuruc)\
**Post date:** [January 27, 2024, 12:12am UTC](https://forum.aousd.org/t/clarification-on-periodic-cubic-bezier-vertex-counts/1128/5 "2024-01-27T00:12:58Z")

</div>

For `periodic` `bezier`, yes. I think that should be fine for `catmullRom` and `bspline` though.
