From 54c92291672144c7c660607645fdd01204a17c6c Mon Sep 17 00:00:00 2001 From: Kay Date: Thu, 13 Jun 2024 13:12:50 +1200 Subject: [PATCH] Change function names --- .../meshtypes/meshtype_3d_bladder1.py | 4 ++-- .../meshtypes/meshtype_3d_bladderurethra1.py | 4 ++-- src/scaffoldmaker/utils/spheremesh.py | 14 ++++++-------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/scaffoldmaker/meshtypes/meshtype_3d_bladder1.py b/src/scaffoldmaker/meshtypes/meshtype_3d_bladder1.py index afa806e0..de9a38b3 100644 --- a/src/scaffoldmaker/meshtypes/meshtype_3d_bladder1.py +++ b/src/scaffoldmaker/meshtypes/meshtype_3d_bladder1.py @@ -5,7 +5,7 @@ import copy import math -from cmlibs.maths.vectorops import angle_between_vectors, cross, magnitude, normalize, set_magnitude +from cmlibs.maths.vectorops import angle, cross, magnitude, normalize, set_magnitude from cmlibs.zinc.element import Element from cmlibs.zinc.field import Field from cmlibs.zinc.node import Node @@ -1049,7 +1049,7 @@ def obtainBladderFlatNodes(elementsCountAlongBladder, elementsCountAround, eleme # Find the angle at the bottom of the bladder neck v1 = [0.0, 0.0, bladderLength] v2 = [urethraOpeningRadius, 0.0, bladderLength] - alpha = angle_between_vectors(v1, v2) + alpha = angle(v1, v2) # Find apex to urethra arcLength in minor radius xApexInner = xFinal[0] diff --git a/src/scaffoldmaker/meshtypes/meshtype_3d_bladderurethra1.py b/src/scaffoldmaker/meshtypes/meshtype_3d_bladderurethra1.py index 6053718d..c868c0b8 100644 --- a/src/scaffoldmaker/meshtypes/meshtype_3d_bladderurethra1.py +++ b/src/scaffoldmaker/meshtypes/meshtype_3d_bladderurethra1.py @@ -7,7 +7,7 @@ import copy import math -from cmlibs.maths.vectorops import angle_between_vectors, cross, magnitude, normalize, set_magnitude +from cmlibs.maths.vectorops import angle, cross, magnitude, normalize, set_magnitude from cmlibs.utils.zinc.field import findOrCreateFieldGroup, \ findOrCreateFieldStoredMeshLocation, findOrCreateFieldStoredString from cmlibs.zinc.element import Element @@ -1594,7 +1594,7 @@ def obtainBladderFlatNodes(elementsCountAlongBladder, elementsCountAround, eleme # Find the angle at the bottom of the bladder neck v1 = [0.0, 0.0, bladderLength] v2 = [0.5 * neckDiameter1, 0.0, bladderLength] - alpha = angle_between_vectors(v1, v2) + alpha = angle(v1, v2) # Find apex to urethra arcLength in minor radius minorNodeAlong_x.insert(0, xApexInner) diff --git a/src/scaffoldmaker/utils/spheremesh.py b/src/scaffoldmaker/utils/spheremesh.py index 03afb21e..a1121905 100644 --- a/src/scaffoldmaker/utils/spheremesh.py +++ b/src/scaffoldmaker/utils/spheremesh.py @@ -6,7 +6,7 @@ import math -from cmlibs.maths.vectorops import add_vectors, angle_between_vectors, cross, magnitude, normalize, \ +from cmlibs.maths.vectorops import add_vectors, angle, cross, magnitude, normalize, \ rotate_vector_around_vector, scale_vector, set_magnitude, vector_rejection from cmlibs.utils.zinc.finiteelement import getMaximumNodeIdentifier, getMaximumElementIdentifier from cmlibs.zinc.field import Field @@ -1201,8 +1201,7 @@ def calculate_arc_length(x1, x2, origin): r1 = add_vectors([x1, origin], [1, -1]) r2 = add_vectors([x2, origin], [1, -1]) radius = magnitude(r1) - angle = angle_between_vectors(r1, r2) - return radius * angle + return radius * angle(r1, r2) def sample_curves_on_sphere(x1, x2, origin, elementsOut): @@ -1216,8 +1215,7 @@ def sample_curves_on_sphere(x1, x2, origin, elementsOut): r2 = add_vectors([x2, origin], [1, -1]) deltax = add_vectors([r1, r2], [-1, 1]) normal = cross(r1, deltax) - angle = angle_between_vectors(r1, r2) - anglePerElement = angle/elementsOut + anglePerElement = angle(r1, r2)/elementsOut arcLengthPerElement = calculate_arc_length(x1, x2, origin)/elementsOut nx = [] @@ -1283,9 +1281,9 @@ def intersection_of_two_great_circles_on_sphere(p1, q1, p2, q2): sx = None else: sx = set_magnitude(planes_intersection_vector, magnitude(p1)) - p1q1_angle = angle_between_vectors(p1, q1) - p1s_angle = angle_between_vectors(p1, sx) - p2s_angle = angle_between_vectors(p2, sx) + p1q1_angle = angle(p1, q1) + p1s_angle = angle(p1, sx) + p2s_angle = angle(p2, sx) if p1s_angle > p1q1_angle or p2s_angle > p1q1_angle: sx = scale_vector(sx, -1)