Omniverse curves in Python

Hi everybody,

is it possible to use the functions available in OmniGraph nodes also within python code? I would like to get a point on a curve by specifying a U-value. This is available in omni.curves.nodes.PointOnCurve, but only as an OmniGraph node.

I would like to use functions like this using a python function call.

Thank you
Bruno

Hi Bruno. We don’t expose any Python API for that currently. You could use a third-party Python library for this. Here’s an example for bezier: bezier.curve module — bezier 2021.2.12 documentation

Thank you mati,

That would be acceptable. But could I use it in combination with curves created in Omniverse? I would need to understand how the curve is actually encoded in the BasisCurve prim. I created a curve with 3 vertices, resulting in 7 curve vertices. I also see there is a points attribute containing 7 vertices. I would need to understand the semantics here to set up a curve object using the module you are referring to. Any advice apprecitated.

I was able to resolve this. The points array just holds the nodes for the bezier curve in order, so you can treat it like a cubic bezier and instantiate an object using the bezier library. I just need to create multiple instances as each bezier curve is only 4 nodes long.

Sweet! Glad that worked out.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.