This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com
Helper class for SplineObject. All values returned are in global space. The slow part is the InitSpline.
| Return type: | SplineHelp |
|---|---|
| Returns: | A new splinehelp object. |
Call before using the spline help class. (Must be called before any other command.)
| Parameters: |
|
|---|---|
| Return type: | bool |
| Returns: | True if successful, otherwise False. |
Gets the number of segments in the spline.
Note
Unlike the way CINEMA 4D handles segments where a segmenet count of 0 means there’s either no segments or 1 segment, this returns 1 segment if there is 1 and 0 if there are 0.
| Return type: | int |
|---|---|
| Returns: | Segment count. |
Useful check to see if the spline helper contains data and has been inited.
| Return type: | bool: |
|---|---|
| Returns: | True if the spline helper is ready to use, otherwise False. |
Retrieves a full matrix for a specific point of the line.
Note
This is not the spline vertex, but instead the line object’s vertex. (Calculated with LOD=1.0.)
| Parameter: | index (int) – Line object vertex index, 0 <= index < lineobjectpointcount. |
|---|
Converts a natural offset value to a real percentage offset value.
Note
This percentage uses the realworld units for its offset, so regardless of how the spline’s points and interpolation is set, a gap of 2% on a 100m long spline will always be 2m whereas normally in spline natural space, a gap of 2% can vary a great deal depending on the spline’s interpolation etc.
| Parameters: |
|
|---|---|
| Return type: | float |
| Returns: | The realworld percentage offset. |
Converts a natural offset value to a real percentage offset value.
Note
This percentage uses the realworld units for its offset, so regardless of how the spline’s points and interpolation is set, a gap of 2% on a 100m long spline will always be 2m whereas normally in spline natural space, a gap of 2% can vary a great deal depending on the spline’s interpolation etc.
| Parameters: |
|
|---|---|
| Return type: | int |
| Returns: | The nearest line object point index, rounded down. |
Converts a natural offset value to a real percentage offset value.
Note
This percentage uses the realworld units for its offset, so regardless of how the spline’s points and interpolation is set, a gap of 2% on a 100m long spline will always be 2m whereas normally in spline natural space, a gap of 2% can vary a great deal depending on the spline’s interpolation etc.
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: | The position given by offset. |
Gets a tangent vector for any point along the spline.
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: | The tangent. |
Gets a normal vector for any point along the spline.
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: | The tangent. |
Gets a cross normal vector (i.e. perpendicular to the normal and the tangent) for any point along the spline.
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: | The tangent. |
Returns the spline’s realworld unit length including all segments.
| Param: | Returns the spline’s realworld unit length including all segments. If argument i is NOT_OK, the whole spline length will be returned, otherwise the specific segment’s length returns. |
|---|---|
| Return type: | float |
| Returns: | The length |
Converts a spline vertex index to its corresponding line object vertex index.
| Parameter: | index (int) – The spline vertex index. |
|---|---|
| Return type: | int |
| Returns: | The line object vertex index. |