Spline3D
Class Spline3D()
Spline3D(parent='MODEL', name='DeformableCurve_n', label='DeformableCurve_n',
active=True, type='FILE', extrap='NORMAL', csv_file='', xy_value=[0, 0, 0, 0, 0, 0, 0, 0, 0],
z_value=[0, 0], y_scale=[1, 1], y_offset=[0, 0], x_scale=1, x_offset=0,
z_scale=1, z_offset=0, is_file_valid=False)
A Spline3D is an extension of 2D curve and is a series of X:Y data for a finite set of Z values.
Keyword Arguments
Argument | Data Type | Description | Default |
---|---|---|---|
name | String | The variable name. | Spline3D_n, for next available integer n. |
label | String | The descriptive label. | Spline3D_n, for next available integer n. |
parent | Object | The parent. | MODEL |
active | Boolean | Used to activate or deactivate this entity. | True |
type | Enum | Indicates the usage of an external file or a set of values as input data. One of FILE or VALUE. | FILE |
extrap | Enum | Determines if linear extrapolation should be used in the Y data. One of NORMAL or EXTRAP. | NORMAL |
csv_file | File | The file path of the .csv file when the spline is defined with FILE as the type. | '' |
xy_value | NumericVector | Represents a list consisting of X column data and Y columns data created when the data is provided either through an external file (using the FILE type) or as values (using the VALUE type). List should be in the format: [x_value, y0_value, y1_value]. | [0,0,0,0,0,0,0,0,0] |
z_value | NumericVector | The list of Z values that corresponds to a set of Y column data. | [0,0] |
y_scale | NumericVector | The scale value applied to the Y data. | [1.0,1.0] |
y_offset | NumericVector | The offset value applied to the Y data. | [0,0] |
x_scale | Double | The scale value applied to the X data. | 1 |
x_offset | Double | The offset value applied to the X data. | 0 |
z_scale | Double | The scale value applied to the Z data. | 1 |
z_offset | Double | The offset value applied to the Z data. | 0 |
is_file_valid | Boolean | Determines whether the format of the .csv file is valid or not. | False |
Readonly Properties
Argument | Data Type | Description | Default |
---|---|---|---|
x | NumericVector | Returns the X column data of the spline. This array inherits the values from either the xy_value array (when the type is set to VALUE) or from the .csv file when the type is set to FILE) and factors in the x_scale and x_offset applied. | [0,0,0] |
y | NumericVector | Returns the Y column data of the spline. This array inherits the values from either the xy_value array (when the type is set to VALUE) or from the .csv file when the type is set to FILE) and factors in the y_scale and y_offset applied. | [[0,0,0],[0,0,0]] |
z | NumericVector | Returns the Z column data of the spline. This array inherits the values from either the z_value array (when the type is set to VALUE) or from the .csv file when the type is set to FILE) and factors in the z_scale and z_offset applied. | [0,0,0] |
Examples
>>> # Import mview module
>>> from hw import mview
>>> spl = mview.Spline3D()
>>> spl.type
'FILE'
>>> # Change the type to values
>>> spl.type = 'VALUE'
>>> spl.type
'VALUE'
>>> # Modify the x, y and z values
>>> spl.z_value = [1,2,3]
>>> spl.xy_value=[1,2,3,4,5,6,7,8,9,10,11,12]
>>> # Change the z scale to 2
>>> spl.z_scale = 2