alias_api.AlCurveOnSurface

class alias_api.AlCurveOnSurface

Bases: AlObject, AlPickable

Interface to curves on surfaces geometry.

AlCurveOnSurface is the interface to Alias’ curve on surface data objects. Curves on surfaces are created and added to a surface by allocating an AlCurveOnSurface, then calling the create() method, and then calling AlSurfaceNode’s add_curve_on_surface() method to add it to a surface.

Curves on surfaces can also be read in from wire file and modified with this class. Curves on surfaces will be deleted when the surface they are attached to is deleted.

When constructing a curve on surface, you will notice that you need to specify a matrix that has dimensions [number_of_control_points][4]. Each point has 4 values, for u, v, zero and w. The “u” and “v” specify the point in U-V parametric space. The third component is zero because this component is not used. The “w” component is the homogeneous value, which is usually 1.0.

control_point(self: alias_api.AlCurveOnSurface, index: SupportsInt) tuple[int, std::array<double,4>]

Given a valid index, return the value of the control point in ‘point’.

A valid index is one in the range 0 to numberOfControlPoints()-1.

Note the control point is represented by the quadruple [u v 0.0 w], where “u” and “v” represent the control point in U-V parameter space, the “0.0” is unused, and the “w” is the homogeneous coordinate.

Parameters

index (int) – A valid index of the control point to return.

Returns

A tuple containing (1) the status code result of the operation:

Success - the control point was returned InvalidArgument - the index was not valid or ‘point’ was NULL InvalidObject - the curve was invalid Failure - an error occurred

and (2) the control point value.

Return type

tuple

copy_wrapper(self: alias_api.AlCurveOnSurface) alias_api.AlObject

Return an exact duplicate of this AlCurveOnSurface wrapper.

degree(self: alias_api.AlCurveOnSurface) int

Return the degree of the curve. Return -1 if the curve is not valid.

delete_object(self: alias_api.AlCurveOnSurface) int

Delete the AlCurveOnSurface from the Alias Universe and return the status of the performed operation.

form(self: alias_api.AlCurveOnSurface) alias_api.AlCurveFormType

Return the form of the curve, which is kOpen, kClosed or kPeriodic.

If a curve on surface is periodic, it is tangent continuous at the point where it is closed. (If you use the “close” menu item in the interactive Alias pacakge, you actually make a curve periodic.) If a curve is periodic, it implies that it is closed. If a curve is kClosed, then it just means that its endpoints are coincident. Otherwise, the curve is kOpen.”

in_trim(self: alias_api.AlCurveOnSurface) int

Returns True if this curve on surface is being used to trim the surface it is on, else False.

insert(self: alias_api.AlCurveOnSurface, parametric_value: SupportsFloat) int

Insert an edit point into the curve.

Parameters

parametric_value (float) – The parametric value of the new edit point on the curve.

Returns

The status code result of the operation: Success - the operation was successful InvalidObject - the given object is not valid InvalidArgument - parametric_value is out of bounds Failre - an error occurred

Return type

int(AlStatusCode)

knot_value(self: alias_api.AlCurveOnSurface, index: SupportsInt) float

Given a valid knot index, return the value of the knot in ‘knotValue’.

A valid knot index is one in the range of 0 - numberOfKnots()-1.

Parameters

index (int) – A valid index of hte knot value to return.

Returns

The value of the knot for the given index.

Return type

float

next_curve_on_surface(self: alias_api.AlCurveOnSurface) alias_api.AlCurveOnSurface

Return the next curve on surface in the list of curves on surfaces that are attached to a specific surface. Return None if there is no next curve on surface.

number_of_control_points(self: alias_api.AlCurveOnSurface) int

Return the number of control points.

number_of_knots(self: alias_api.AlCurveOnSurface) int

Return the number of knots (just number of spans + 1). Return -1 if the curve is not valid.

number_of_spans(self: alias_api.AlCurveOnSurface) int

Return the number of spans in the curve. Return -1 if the curve is not valid.

prev_curve_on_surface(self: alias_api.AlCurveOnSurface) alias_api.AlCurveOnSurface

Return the previous curve on surface in the list of curves on surfaces that are attached to a specific surface. Return None if there is no next curve on surface.

real_number_of_knots(self: alias_api.AlCurveOnSurface) int

Return the actual number of knots on the curve. That is number_of_spans + 2*degree -1. Return -1 if the operation failed.

reverse(self: alias_api.AlCurveOnSurface) int

Reverse the direction of this curve on surface.

set_control_point(self: alias_api.AlCurveOnSurface, index: typing.SupportsInt, point: std::array<double, 4>) int

Given a valid index, set the value of the control point in ‘point’.

A valid index is one in the range 0 to numberOfControlPoints()-1.

Note the control point is represented by the quadruple [u v 0.0 w], where “u” and “v” represent the control point in U-V parameter space, the “0.0” is unused, and the “w” is the homogeneous coordinate.

Parameters

index (int) – A valid index of the control point to set.

Returns

The status code result of the operation: Success - the control point was returned InvalidArgument - the index was not valid or ‘point’ was NULL InvalidObject - the curve was invalid Failure - an error occurred

Return type

int(AlStatusCode)

set_knot_value(self: alias_api.AlCurveOnSurface, index: SupportsInt, knot_value: SupportsFloat) int

Given a valid knot index, set the value of hte knot to be ‘knotValue’.

A valid knot index is one in the range of 0 - numberOfKnots()-1.

Parameters
  • index (int) – A valid index of hte knot value to set.

  • knot_value (float) – The knot value to set.

Returns

The status code result of the operation Success - the knot value was set InvalidArgument - the ‘index’ was not in the range 0…#knots-1 InvalidObject - the curve was invalid AlreadyCreated - the curve was already in a trim Failure - an internal error occured

Return type

int(AlStatusCode)

set_visible(self: alias_api.AlCurveOnSurface, visible: SupportsInt) int

Set the visibility of the curve on surface.

surface(self: alias_api.AlCurveOnSurface) AlSurface

Return the surface that this curve is on.

type(self: alias_api.AlCurveOnSurface) alias_api.AlObjectType

Return the AlCurveOnSurface type identifier.

visible(self: alias_api.AlCurveOnSurface) int

Return True if this curve is visible, else False if it is invisible.