Skip to content

Commit

Permalink
Add: some checks were added
Browse files Browse the repository at this point in the history
  • Loading branch information
OberGue committed Jul 2, 2024
1 parent 6737fb8 commit bb185e4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions splinepy/helpme/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ def swept(
raise NotImplementedError("Sweep only works for splines")
if not isinstance(trajectory, _Spline):
raise NotImplementedError("Sweep only works for splines")
if not trajectory.para_dim == 1:
raise NotImplementedError("Trajectory must be 1D")
if not len(cross_section_normal) == 3:
raise ValueError("Cross section normal must be 3D")

# setting default value for cross_section_normal
if cross_section_normal is None:
Expand Down Expand Up @@ -459,7 +463,7 @@ def transformation_matrices(traj, par_value):
# evaluate the par_values-vector indices of the maximum curvature points
max_curv = max(curv)
max_indices = [i for i, x in enumerate(curv) if x == max_curv]
# prepare two matrices for the insertion
# prepare matrix for the insertion
insertion_values = []
# compute the new insertion values
par_values = par_value.ravel()
Expand All @@ -484,7 +488,7 @@ def transformation_matrices(traj, par_value):
# insert knots into the trajectory's knot vector
insertion_values = _np.unique(insertion_values)
trajectory.uniform_refine_fixed_knots(0, len(insertion_values))
# insert knots into the parameter values
# add insertion values to the existing parameter values
par_value = _np.concatenate(
(par_value.reshape(-1), _np.asanyarray(insertion_values))
)
Expand Down Expand Up @@ -551,6 +555,7 @@ def weights(spline):
trajectory_weights, cross_section_weights
).reshape(-1, 1)
spline_type = _NURBS

else:
spline_type = _BSpline

Expand Down

0 comments on commit bb185e4

Please sign in to comment.