Skip to content

Commit

Permalink
small changes in geodesic api.
Browse files Browse the repository at this point in the history
  • Loading branch information
portnov committed Nov 10, 2024
1 parent 96e8b5f commit 704bf8c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions utils/geodesic.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,24 +452,20 @@ def exponential_map(surface, uv_center, radius, radius_steps=10, angle_steps=8,
BY_LENGTH = 'L'
def curve_exponential_map(surface, uv_curve, v_radius, u_steps, v_steps, u_mode=BY_PARAMETER, length_resolution=50, closed_u=False, closed_v=False):
u_min, u_max = uv_curve.get_u_bounds()
center_us = np.linspace(u_min, u_max, num=u_steps)
if u_mode == BY_PARAMETER:
orig_us = center_us
center_us = np.linspace(u_min, u_max, num=u_steps)
else:
curve_3d = SvCurveOnSurface(uv_curve, surface, axis=2)
calculator = SvCurveLengthSolver(curve_3d)
calculator.prepare('SPL', length_resolution)
length = calculator.get_total_length()
lengths = np.linspace(0, length, num=u_steps)
orig_us = calculator.solve(lengths)
orig_vs = np.linspace(0, v_radius, num=v_steps)
center_us = lengths
orig_centers = np.zeros((u_steps, 3))
orig_centers[:,0] = center_us

grid_us, grid_vs = np.meshgrid(orig_us, orig_vs)
grid_us = grid_us.flatten()
grid_vs = grid_vs.flatten()

uv_starts = uv_curve.evaluate_array(orig_us)
uv_tangents = uv_curve.tangent_array(orig_us)

Expand Down

0 comments on commit 704bf8c

Please sign in to comment.