Modifications
ModifyObject
Class containing all the possible modifications which can be applied to a scalar field.
| Attributes: |
|
|---|
| Parameters: |
|
|---|
modifications
property
All the modifications which were applied to the geometry in chronological order.
| Returns: |
|
|---|
modified_object
property
SDF of the modified geometry.
| Returns: |
|
|---|
original_object
property
SDF of the unmodified geometry.
| Returns: |
|
|---|
elongation(elongate_vector)
Elongates the geometry along a certain vector by the length of the vector in each respective direction.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rounding(rounding_radius)
Rounds off the geometry - effectively thickening it by the rounding radius.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rounding_cs(rounding_radius, bb_size)
Rounds off the geometry, but the geometry will be contained in its bounding box. Bounding box size must be specified.
| Parameters: |
|
|---|
| Returns: |
|
|---|
boundary()
Get the boundary of the SDF.
| Returns: |
|
|---|
signed_old(co_resolution)
Transform an Unsigned Distance Function into a Signed Distance Function.
| Parameters: |
|
|---|
| Returns: |
|
|---|
signed(co_resolution)
Transform an Unsigned Distance Function into a Signed Distance Function.
| Parameters: |
|
|---|
| Returns: |
|
|---|
invert(direct=False)
Inverts the sign of the SDF.
| Parameters: |
|
|---|
| Returns: |
|
|---|
sign(direct=False)
Get the sign of the SDF.
| Parameters: |
|
|---|
| Returns: |
|
|---|
recover_volume(interior)
Recovers the interior of the SDF if a function which outputs the correct value (-1 or 1) is provided. This function should take the same parameters as the SDF. Typically, this function is the output of self.sign().
| Parameters: |
|
|---|
| Returns: |
|
|---|
define_volume(interior, interior_parameters)
Defines the interior of the SDF if with a function.
| Parameters: |
|
|---|
| Returns: |
|
|---|
onion(thickness)
Transforms the geometry into a surface with some thickness. Args: thickness: Thickness of the resulting shape.
| Returns: |
|
|---|
concentric(width)
Transforms an isosurface into two concentric isosurfaces which are apart by the value of width parameter. Transforms a volume into an isosurface and rounds it by width/2.
| Parameters: |
|
|---|
| Returns: |
|
|---|
revolution(radius)
Revolves a 2D shape around the y-axis to generate a 3D shape. First the 2D shape is translated along the x-axis by the radius of revolution, then it is revolved around the y-axis.
| Parameters: |
|
|---|
| Returns: |
|
|---|
axis_revolution(radius, angle)
Revolves a 2D shape around an axis to generate a 3D shape. First the 2D shape is translated along the x-axis by the radius of revolution, then it is revolved around the axis of revolution. The axis of revolution is angled by the specified angle with respect to the y-axis.
| Parameters: |
|
|---|
| Returns: |
|
|---|
extrusion(distance)
Extrudes a 2D shape along the z-axis so that the height of the object is equal to the specified distance.
| Parameters: |
|
|---|
| Returns: |
|
|---|
twist(pitch)
Twists the geometry around the z-axis based on the position along the z-axis and the pitch.
| Parameters: |
|
|---|
| Returns: |
|
|---|
bend(radius, angle)
Bends the geometry around the z-axis, based on the specified bending radius and angle. The length of the bent section is radius*angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
shear_xz(angle)
Displaces the points parallel to the x-axis of the coordinate system around the z-axis by the specified angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
shear_yz(angle)
Displaces the points parallel to the y-axis of the coordinate system around the z-axis by the specified angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
shear_xy(angle)
Displaces the points parallel to the x-axis of the coordinate system around the y-axis by the specified angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
shear_zy(angle)
Displaces the points parallel to the z-axis of the coordinate system around the y-axis by the specified angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
shear_yx(angle)
Displaces the points parallel to the y-axis of the coordinate system around the x-axis by the specified angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
shear_zx(angle)
Displaces the points parallel to the z-axis of the coordinate system around the x-axis by the specified angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
shear(angle, sheared_axis, fixed_axis)
Displaces the points parallel to the sheared axis of the coordinate system around the fixed axis by the specified angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
displacement(displacement_function, displacement_function_parameters)
Displaces the surface of an object based on the values of the displacement function. Should be applied last.
| Parameters: |
|
|---|
| Returns: |
|
|---|
infinite_repetition(distances)
Infinitely repeats geometry in space on a cubic lattice.
| Parameters: |
|
|---|
| Returns: |
|
|---|
finite_repetition(size, repetitions)
Repeats the geometry finite amount of times along each axis within a defined bounding box.
| Parameters: |
|
|---|
| Returns: |
|
|---|
finite_repetition_rescaled(size, repetitions, instance_size, padding)
Repeats the geometry finite amount of times along each axis within a defined bounding box. The geometry is rescaled based on the provided geometry bounding box size and padding along each axis. Args: size: Size of the bounding box along each axis in which the geometry is repeated. repetitions: Number of repetitions along each axis inside the bounding box. instance_size: Size of the bounding box around one instance of geometry along each axis. padding: Padding around each instance along each axis.
| Returns: |
|
|---|
symmetry(axis)
Applies symmetry along an axis of the object.
| Parameters: |
|
|---|
| Returns: |
|
|---|
mirror(a, b)
Applies mirroring along an axis connecting the two specified points.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotational_symmetry(n, radius, phase)
Applies n-fold rotational symmetry to the object.
| Parameters: |
|
|---|
| Returns: |
|
|---|
linear_instancing(n, a, b)
Instances the geometry n-times along the length of a segment defined by two points.
| Parameters: |
|
|---|
| Returns: |
|
|---|
curve_instancing(f, f_parameters, t_range)
Instances the geometry n-times along the length of a parametric curve defined by a function.
| Parameters: |
|
|---|
| Returns: |
|
|---|
aligned_curve_instancing(f, f_parameters, t_range)
Instances the geometry n-times along the length of a parametric curve defined by a function. The x-axis of the geometry is aligned with the tangent vector of the parametric curve.
| Parameters: |
|
|---|
| Returns: |
|
|---|
fully_aligned_curve_instancing(f, f_parameters, t_range)
Instances the geometry n-times along the length of a parametric curve defined by a function. The x-axis of the geometry is aligned with the tangent vector of the parametric curve. The y-axis of the geometry is aligned with the normal vector of the parametric curve. The z-axis of the geometry is aligned with the binormal vector of the parametric curve.
| Parameters: |
|
|---|
| Returns: |
|
|---|
move_sdf(move_vector)
Modifies the original SDF so that the origin is translated by the 'move_vector'.
| Parameters: |
|
|---|
| Returns: |
|
|---|
scale_sdf(scale_factor)
Modifies the original SDF by scaling it by the 'scale_factor'.
| Parameters: |
|
|---|
Returns: Modified SDF.
rotate_sdf(rotation_matrix)
Modifies the original SDF by rotating it by the 'rotation_matrix'.
| Parameters: |
|
|---|
| Returns: |
|
|---|
custom_modification(modification, modification_parameters, modification_name='custom')
Applies a custom user-specified modification to the function defining the scalar field (Signed Distance Function).
| Parameters: |
|
|---|
| Returns: |
|
|---|
sigmoid_falloff(amplitude, width)
Applies a sigmoid to the function defining the scalar field (Signed Distance Function).
| Parameters: |
|
|---|
| Returns: |
|
|---|
positive_sigmoid_falloff(amplitude, width)
Applies a sigmoid to the function defining the scalar field (Signed Distance Function). The sigmoid is shifted towards the positive values by the value of the width parameter.
| Parameters: |
|
|---|
| Returns: |
|
|---|
capped_exponential(amplitude, width)
Applies the Capped Exponential function to the function defining the scalar field (Signed Distance Function).
| Parameters: |
|
|---|
| Returns: |
|
|---|
hard_binarization(threshold)
Binarizes the output of a function defining a scalar field (Signed Distance Function). Values below the threshold are 1 and values above are 0.
| Parameters: |
|
|---|
| Returns: |
|
|---|
linear_falloff(amplitude, width)
Applies a decreasing linear function to the function defining the scalar field (Signed Distance Function).
| Parameters: |
|
|---|
| Returns: |
|
|---|
relu(width)
Applies the ReLU function to the function defining the scalar field (Signed Distance Function).
| Parameters: |
|
|---|
| Returns: |
|
|---|
smooth_relu(smooth_width, width=1, threshold=0.01)
Applies the "squareplus" function to the function defining the scalar field (Signed Distance Function). https://en.wikipedia.org/wiki/Rectifier_(neural_networks)
| Parameters: |
|
|---|
| Returns: |
|
|---|
slowstart(smooth_width, width=1, threshold=0.01, ground=True)
Applies the SlowStart function to the function defining the scalar field (Signed Distance Function).
| Parameters: |
|
|---|
| Returns: |
|
|---|
gaussian_boundary(amplitude, width)
Applies the Gaussian function to the function defining the scalar field (Signed Distance Function).
| Parameters: |
|
|---|
| Returns: |
|
|---|
gaussian_falloff(amplitude, width)
Applies the Gaussian Falloff function to the function defining the scalar field (Signed Distance Function).
| Parameters: |
|
|---|
| Returns: |
|
|---|
conv_averaging(kernel_size, iterations, co_resolution)
Averages the field using an averaging convolutional kernel of the specified size.
| Parameters: |
|
|---|
| Returns: |
|
|---|
conv_edge_detection(co_resolution)
Edge detection with a 3x3 convolutional kernel.
| Parameters: |
|
|---|
| Returns: |
|
|---|
custom_post_process(function, parameters, post_process_name='custom')
Applies a custom user-specified post-processing function to the function defining the scalar field (Signed Distance Function).
| Parameters: |
|
|---|
| Returns: |
|
|---|
ModifyVectorObject
Class containing all the possible modifications which can be applied to a vector field.
| Attributes: |
|
|---|
| Parameters: |
|
|---|
modifications
property
All the modifications which were applied to the vector field in chronological order.
| Returns: |
|
|---|
modified_object
property
Modified vector field.
| Returns: |
|
|---|
original_object
property
Unmodified vector field.
| Returns: |
|
|---|
add(second_field)
Adds a number, vector, or a vector field of the same shape to the vector field.
| Parameters: |
|
|---|
| Returns: |
|
|---|
subtract(second_field)
Subtracts a number, vector, or a vector field of the same shape to the vector field.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rescale(second_field)
Rescales the lengths of vectors in the vector field by a number, vector, or a vector field of the same shape.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_phi(phi)
Rotates vectors in a 3D vector field by some azimuthal angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_theta(theta)
Rotates vectors in a 3D vector field by some polar angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_x(alpha)
Rotates vectors in a 3D vector field by some angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_y(alpha)
Rotates vectors in a 3D vector field by some angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_z(alpha)
Rotates vectors in a 3D vector field by some angle.
| Parameters: |
|
|---|
| Returns: |
|
|---|
rotate_axis(axis, alpha)
Rotates vectors in a 3D vector field by some angle around some axis.
| Parameters: |
|
|---|
| Returns: |
|
|---|
revolution_x(co)
Revolves a 2D vector field around the x-axis to generate a 3D vector field.
| Parameters: |
|
|---|
| Returns: |
|
|---|
revolution_y(co)
Revolves a 2D vector field around the y-axis to generate a 3D vector field.
| Parameters: |
|
|---|
| Returns: |
|
|---|
revolution_z(co)
Revolves a 2D vector field around the z-axis to generate a 3D vector field.
| Parameters: |
|
|---|
| Returns: |
|
|---|
normalize()
Normalizes the vector field.
| Returns: |
|
|---|