Skip to content

Commit dcc89c5

Browse files
committed
changed signature of RhionNurbsSurface.from_frame
1 parent 8b11fba commit dcc89c5

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/compas_rhino/geometry/surfaces/surface.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def from_plane(cls, plane, box):
189189
return cls.from_rhino(rhino_surface)
190190

191191
@classmethod
192-
def from_frame(cls, frame, u_interval, v_interval, uv_degrees=(1, 1), uv_point_counts=(2, 2)):
192+
def from_frame(cls, frame, u_interval, v_interval, u_degree=1, v_degree=1, u_point_count=2, v_point_count=2):
193193
"""Creates a NURBS surface from a frame and parametric domain information.
194194
195195
Parameters
@@ -201,10 +201,14 @@ def from_frame(cls, frame, u_interval, v_interval, uv_degrees=(1, 1), uv_point_c
201201
The parametric domain of the U parameter. u_interval[0] => u_interval[1].
202202
v_interval : tuple(float, float)
203203
The parametric domain of the V parameter. v_interval[0] => v_interval[1].
204-
uv_degrees : tuple(int, int)
205-
Degree of U and V parameters. Default is 1 in both directions for a simple planar surface.
206-
uv_point_counts : tuple(int, int)
207-
Number of control points in each parameter. Default is 2 in both directions for a simple planar surface.
204+
u_degree : int
205+
Degree of the U parameter. Default is 1 in both directions for a simple planar surface.
206+
v_degree : int
207+
Degree of the V parameter. Default is 1 in both directions for a simple planar surface.
208+
u_point_count : int
209+
Number of control points in the U direction. Default is 2 in both directions for a simple planar surface.
210+
v_point_count : int
211+
Number of control points in the V direction. Default is 2 in both directions for a simple planar surface.
208212
209213
Returns
210214
-------
@@ -220,16 +224,16 @@ def from_frame(cls, frame, u_interval, v_interval, uv_degrees=(1, 1), uv_point_c
220224
rhino_plane,
221225
Rhino.Geometry.Interval(*u_interval),
222226
Rhino.Geometry.Interval(*v_interval),
223-
uv_degrees[0],
224-
uv_degrees[1],
225-
uv_point_counts[0],
226-
uv_point_counts[1],
227+
v_degree,
228+
u_degree,
229+
v_point_count,
230+
u_point_count,
227231
)
228232
if not surface:
233+
msg = "Failed creating NurbsSurface from "
234+
msg += "frame:{} u_interval:{} v_interval:{} u_degree:{} v_degree:{} u_point_count:{} v_point_count:{}"
229235
raise ValueError(
230-
"Failed creating NurbsSurface from frame:{} u_interval:{} v_interval:{} uv_degrees:{} uv_point_count:{}".format(
231-
frame, u_interval, v_interval, uv_degrees, uv_point_counts
232-
)
236+
msg.format(frame, u_interval, v_interval, u_degree, v_degree, u_point_count, v_point_count)
233237
)
234238
return cls.from_rhino(surface)
235239

0 commit comments

Comments
 (0)