Skip to content

Commit

Permalink
Change function names
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayvv committed Jun 13, 2024
1 parent ef1a8c6 commit 54c9229
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/scaffoldmaker/meshtypes/meshtype_3d_bladder1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/scaffoldmaker/meshtypes/meshtype_3d_bladderurethra1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 6 additions & 8 deletions src/scaffoldmaker/utils/spheremesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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 = []
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 54c9229

Please sign in to comment.