mango.utils.geometry module

mango.utils.geometry.create_circle_data(sections=8, degree=3, radius=1, sweep=360, normal=(0, 0, 1), center=(0, 0, 0))

Create a curve data object, this data object can be used together with the NurbsCurveField and the generation of its default values. This data object can be initialized as a OpenMaya.MFnNurbsCurve. This function is a helper function to easily creating a circle.

Parameters:
  • sections (int) –
  • degree (int) – 1 or 3
  • radius (int/float) –
  • sweep (int/float) –
  • normal (tuple(int/float)) –
  • center (tuple(int/float)) –
Returns:

Circle data

Return type:

OpenMaya.MObject

mango.utils.geometry.create_curve_data(points, degree=1, form=<sphinx.ext.autodoc._MockObject object>)

Create a curve data object, this data object can be used together with the NurbsCurveField and the generation of its default values. This data object can be initialized as a OpenMaya.MFnNurbsCurve by calling the following command.

Example:
mfn_nurbs_curve_data = create_curve_data(points=[[0, 0, 0], [0, 1, 0], degree=1])
mfn_nurbs_curve = OpenMaya.MFnNurbsCurve(mfn_nurbs_curve_data)
print(mfn_nurbs_curve.degree)
Parameters:
  • points (list[tuple]) –
  • degree (int) –
  • form (int) –
Returns:

Curve data

Return type:

OpenMaya.MObject