clifford.tools.g3c

Tools for 3DCGA (g3c)

3DCGA Tools

Generation Methods

random_bivector(*[, rng])

Creates a random bivector on the form described by R.

standard_point_pair_at_origin()

Creates a standard point pair at the origin

random_point_pair_at_origin(*[, rng])

Creates a random point pair bivector object at the origin

random_point_pair(*[, rng])

Creates a random point pair bivector object

standard_line_at_origin()

Creates a standard line at the origin

random_line_at_origin(*[, rng])

Creates a random line at the origin

random_line(*[, rng])

Creates a random line

random_circle_at_origin(*[, rng])

Creates a random circle at the origin

random_circle(*[, rng])

Creates a random circle

random_sphere_at_origin(*[, rng])

Creates a random sphere at the origin

random_sphere(*[, rng])

Creates a random sphere

random_plane_at_origin(*[, rng])

Creates a random plane at the origin

random_plane(*[, rng])

Creates a random plane

generate_n_clusters(object_generator, …[, rng])

Creates n_clusters of random objects

generate_random_object_cluster(n_objects, …)

Creates a cluster of random objects

random_translation_rotor([…])

generate a random translation rotor

random_rotation_translation_rotor([…])

generate a random combined rotation and translation rotor

random_conformal_point([l_max, rng])

Creates a random conformal point

generate_dilation_rotor(scale)

Generates a rotor that performs dilation about the origin

generate_translation_rotor(euc_vector_a)

Generates a rotor that translates objects along the euclidean vector euc_vector_a

Geometry Methods

intersect_line_and_plane_to_point(line, plane)

Returns the point at the intersection of a line and plane If there is no intersection it returns None

val_intersect_line_and_plane_to_point(…)

quaternion_and_vector_to_rotor(quaternion, …)

Takes in a quaternion and a vector and returns a conformal rotor that implements the transformation

get_center_from_sphere(sphere)

Returns the conformal point at the centre of a sphere by reflecting the point at infinity

get_radius_from_sphere(sphere)

Returns the radius of a sphere

point_pair_to_end_points(T)

Extracts the end points of a point pair bivector

val_point_pair_to_end_points(T)

get_circle_in_euc(circle)

Extracts all the normal stuff for a circle

circle_to_sphere(C)

returns the sphere for which the input circle is the perimeter

line_to_point_and_direction(line)

converts a line to the conformal nearest point to the origin and a euc direction vector in direction of the line

get_plane_origin_distance(plane)

Get the distance between a given plane and the origin

get_plane_normal(plane)

Get the normal to the plane

get_nearest_plane_point(plane)

Get the nearest point to the origin on the plane

val_convert_2D_polar_line_to_conformal_line(…)

Converts a 2D polar line to a conformal line

convert_2D_polar_line_to_conformal_line(rho, …)

Converts a 2D polar line to a conformal line

val_convert_2D_point_to_conformal(x, y)

convert_2D_point_to_conformal(x, y)

Convert a 2D point to conformal

val_distance_point_to_line(point, line)

Returns the euclidean distance between a point and a line

distance_polar_line_to_euc_point_2d(rho, …)

Return the distance between a polar line and a euclidean point in 2D

midpoint_between_lines(L1, L2)

Gets the point that is maximally close to both lines Hadfield and Lasenby AGACSE2018

val_midpoint_between_lines(L1_val, L2_val)

midpoint_of_line_cluster(line_cluster)

Gets a center point of a line cluster Hadfield and Lasenby AGACSE2018

val_midpoint_of_line_cluster(array_line_cluster)

Gets a center point of a line cluster Hadfield and Lasenby AGACSE2018

val_midpoint_of_line_cluster_grad(…)

Gets an approximate center point of a line cluster Hadfield and Lasenby AGACSE2018

get_line_intersection(L3, Ldd)

Gets the point of intersection of two orthogonal lines that meet Xdd = Ldd*no*Ldd + no Xddd = L3*Xdd*L3 Pd = 0.5*(Xdd+Xddd) P = -(Pd*ninf*Pd)(1)/(2*(Pd|einf)**2)[0]

val_get_line_intersection(L3_val, Ldd_val)

project_points_to_plane(point_list, plane)

Takes a load of points and projects them onto a plane

project_points_to_sphere(point_list, sphere)

Takes a load of points and projects them onto a sphere

project_points_to_circle(point_list, circle)

Takes a load of point and projects them onto a circle The closest flag determines if it should be the closest or furthest point on the circle

project_points_to_line(point_list, line)

Takes a load of points and projects them onto a line

iterative_closest_points_on_circles(C1, C2)

Given two circles C1 and C2 this calculates the closest points on each of them to the other

closest_point_on_line_from_circle(C, L[, eps])

Returns the point on the line L that is closest to the circle C Uses the algorithm described in Appendix A of Andreas Aristidou’s PhD thesis

closest_point_on_circle_from_line(C, L[, eps])

Returns the point on the circle C that is closest to the line L Uses the algorithm described in Appendix A of Andreas Aristidou’s PhD thesis

iterative_closest_points_circle_line(C, L[, …])

Given a circle C and line L this calculates the closest points on each of them to the other.

iterative_furthest_points_on_circles(C1, C2)

Given two circles C1 and C2 this calculates the closest points on each of them to the other

sphere_beyond_plane(sphere, plane)

Check if the sphere is fully beyond the plane in the direction of the plane normal

sphere_behind_plane(sphere, plane)

Check if the sphere is fully behind the plane in the direction of the plane normal, ie the opposite of sphere_beyond_plane

Misc

meet_val(a_val, b_val)

meet(A, B)

The meet algorithm as described in [LLW04].

normalise_n_minus_1(mv)

Normalises a conformal point so that it has an inner product of -1 with einf

val_normalise_n_minus_1(mv_val)

val_apply_rotor(mv_val, rotor_val)

apply_rotor(mv_in, rotor)

Applies rotor to multivector in a fast way

val_apply_rotor_inv(mv_val, rotor_val, …)

apply_rotor_inv(mv_in, rotor, rotor_inv)

Applies rotor to multivector in a fast way takes pre computed adjoint

euc_dist(conf_mv_a, conf_mv_b)

Returns the distance between two conformal points

mult_with_ninf(mv)

Convenience function for multiplication with ninf

val_norm(mv_val)

norm(mv)

Alias of clifford.MultiVector.__abs__()

val_normalised(mv_val)

normalised(mv)

Alias of clifford.MultiVector.normal()

val_up(mv_val)

fast_up(mv)

Fast jitted up mapping

val_normalInv(mv_val)

val_homo(mv_val)

val_down(mv_val)

fast_down(mv)

A fast version of down()

dual_func(a_val)

fast_dual(a)

Fast dual

disturb_object(mv_object[, …])

Disturbs an object by a random rotor

project_val(val, grade)

get_line_reflection_matrix(lines[, n_power])

Generates the matrix that sums the reflection of a point in many lines

val_get_line_reflection_matrix(line_array, …)

Generates the matrix that sums the reflection of a point in many lines

val_truncated_get_line_reflection_matrix(…)

Generates the truncated matrix that sums the reflection of a point in many lines

interpret_multivector_as_object(mv)

Takes an input multivector and returns what kind of object it is

normalise_TR_to_unit_T(TR)

Takes in a TR rotor extracts the R and T normalises the T to unit displacement magnitude rebuilds the TR rotor with the new displacement rotor returns the new TR and the original length of the T rotor

scale_TR_translation(TR, scale)

Takes in a TR rotor and a scale extracts the R and T scales the T displacement magnitude by scale rebuilds the TR rotor with the new displacement rotor returns the new TR rotor

val_unsign_sphere(S)

Root Finding

dorst_norm_val(sigma_val)

check_sigma_for_positive_root_val(sigma_val)

check_sigma_for_positive_root(sigma)

Square Root of Rotors - Checks for a positive root

check_sigma_for_negative_root_val(sigma_value)

check_sigma_for_negative_root(sigma)

Square Root of Rotors - Checks for a negative root

check_infinite_roots_val(sigma_value)

check_infinite_roots(sigma)

Square Root of Rotors - Checks for a infinite roots

positive_root_val(sigma_val)

negative_root_val(sigma_val)

positive_root(sigma)

Square Root of Rotors - Evaluates the positive root

negative_root(sigma)

Square Root of Rotors - Evaluates the negative root

general_root_val(sigma_value)

general_root(sigma)

The general case of the root of a grade 0, 4 multivector

val_annihilate_k(K_val, C_val)

annihilate_k(K, C)

Removes K from C = KX via (K[0] - K[4])*C

pos_twiddle_root_val(C_value)

neg_twiddle_root_val(C_value)

pos_twiddle_root(C)

Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg

neg_twiddle_root(C)

Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg

square_roots_of_rotor(R)

Square Root and Logarithm of Rotors in 3D Conformal Geometric Algebra Using Polar Decomposition Leo Dorst and Robert Valkenburg

n_th_rotor_root(R, n)

Takes the n_th root of rotor R n must be a power of 2

interp_objects_root(C1, C2, alpha)

Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly linearly interpolates conformal objects Return a valid object from the addition result C

general_object_interpolation(…[, kind])

Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 This is a general interpolation through the

average_objects(obj_list[, weights, …])

Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly averages conformal objects Return a valid object from the addition result C

val_average_objects_with_weights(obj_array, …)

Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly averages conformal objects Return a valid object from the addition result C

val_average_objects(obj_array)

Hadfield and Lasenby, Direct Linear Interpolation of Geometric Objects, AGACSE2018 Directly averages conformal objects Return a valid object from the addition result C

rotor_between_objects(X1, X2)

Lasenby and Hadfield AGACSE2018 For any two conformal objects X1 and X2 this returns a rotor that takes X1 to X2 Return a valid object from the addition result 1 + gamma*X2X1

val_rotor_between_objects_root(X1, X2)

val_rotor_between_objects_explicit(X1, X2)

Lasenby and Hadfield AGACSE2018 For any two conformal objects X1 and X2 this returns a rotor that takes X1 to X2

calculate_S_over_mu(X1, X2)

Lasenby and Hadfield AGACSE2018 For any two conformal objects X1 and X2 this returns a factor that corrects the X1 + X2 back to a blade

val_rotor_between_lines(L1_val, L2_val)

Implements a very optimised rotor line to line extraction

rotor_between_lines(L1, L2)

Implements a very optimised rotor line to line extraction

rotor_between_planes(P1, P2)

return the rotor between two planes

val_rotor_rotor_between_planes(P1_val, P2_val)

Submodules

object_fitting

Tools for fitting geometric primitives to point clouds