Modifications
ModifyObject
Class containing all the possible modifications which can be applied to a scalar field.
Attributes: |
|
---|
Parameters: |
|
---|
modifications: list
property
All the modifications which were applied to the geometry in chronological order.
Returns: |
|
---|
modified_object: Callable[[np.ndarray, tuple], np.ndarray]
property
SDF of the modified geometry.
Returns: |
|
---|
original_object: Callable[[np.ndarray, tuple], np.ndarray]
property
SDF of the unmodified geometry.
Returns: |
|
---|
elongation(elon_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. rounding_radius: Radius by which the edges are rounded and the object thickened.
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 a shape.
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)
Invert 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. 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: |
|
---|
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: |
|
---|
custom_modification(modification, modification_parameters, modification_name='custom')
Applies a custom user-specified modification to a scalar (Signed Distance Function) field.
Parameters: |
|
---|
Returns: |
|
---|
sigmoid_falloff(amplitude, width)
Applies a sigmoid to the scalar (Signed Distance Function) field.
Parameters: |
|
---|
Returns: |
|
---|
positive_sigmoid_falloff(amplitude, width)
Applies a sigmoid, shifted to the positive velues by the value of the width parameter, to the scalar (Signed Distance Function) field.
Parameters: |
|
---|
Returns: |
|
---|
capped_exponential(amplitude, width)
Applies a decreasing exponential functon to the scalar (Signed Distance Function) field. to the scalar (Signed Distance Function) field.
Parameters: |
|
---|
Returns: |
|
---|
hard_binarization(threshold)
Binarizes the Signed Distance field/pattern based on a threshold. Values below the threshold are 1 and values above are 0.
Parameters: |
|
---|
Returns: |
|
---|
linear_falloff(amplitude, width)
Applies a decreasing linear function to the scalar (Signed Distance Function) field.
Parameters: |
|
---|
Returns: |
|
---|
relu(width)
Applies the ReLU function to the scalar (Signed Distance Function) field.
Parameters: |
|
---|
Returns: |
|
---|
smooth_relu(smooth_width, width=1, threshold=0.01)
Applies the "squareplus" function to the scalar (Signed Distance Function) field. 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 scalar (Signed Distance Function) field.
Parameters: |
|
---|
Returns: |
|
---|
gaussian_boundary(amplitude, width)
Applies the Gaussian to the scalar (Signed Distance Function) field.
Parameters: |
|
---|
Returns: |
|
---|
gaussian_falloff(amplitude, width)
Applies the Gaussian to the positive values of the scalar (Signed Distance Function) field.
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 based ona 3x3 convolutional kernel.
Parameters: |
|
---|
Returns: |
|
---|
custom_post_process(function, parameters, post_process_name='custom')
Applies a custom user-specified post-processing function to a scalar (Signed Distance Function) field.
Parameters: |
|
---|
Returns: |
|
---|
ModifyVectorObject
Class containing all the possible modifications which can be applied to a vector field.
Attributes: |
|
---|
Parameters: |
|
---|
modifications: list
property
All the modifications which were applied to the vector field in chronological order.
Returns: |
|
---|
modified_object: Callable[[np.ndarray, tuple], np.ndarray]
property
Modified vector field.
Returns: |
|
---|
original_object: Callable[[np.ndarray, tuple], np.ndarray]
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: |
|
---|