1
1
"""
2
2
.. module:: BSpline
3
3
:platform: Unix, Windows
4
- :synopsis: Provides data storage and evaluation functionality for B-spline curves and surfaces
4
+ :synopsis: Provides data storage and evaluation functionality for B-spline geometries
5
5
6
6
.. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com>
7
7
8
8
"""
9
9
10
10
import pickle
11
+
11
12
from . import abstract
12
- from . import utilities
13
13
from . import evaluators
14
14
from . import operations
15
15
from . import tessellate
16
- from ._utilities import export
16
+ from . import _utilities as utl
17
17
from .exceptions import GeomdlException
18
18
19
19
20
- @export
20
+ @utl . export
21
21
class Curve (abstract .Curve ):
22
22
""" Data storage and evaluation class for n-variate B-spline (non-rational) curves.
23
23
@@ -150,7 +150,7 @@ def evaluate(self, **kwargs):
150
150
151
151
# Check parameters
152
152
if self ._kv_normalize :
153
- if not utilities .check_params ([start , stop ]):
153
+ if not utl .check_params ([start , stop ]):
154
154
raise GeomdlException ("Parameters should be between 0 and 1" )
155
155
156
156
# Clean up the curve points
@@ -177,7 +177,7 @@ def evaluate_single(self, param):
177
177
178
178
# Check parameters
179
179
if self ._kv_normalize :
180
- if not utilities .check_params ([param ]):
180
+ if not utl .check_params ([param ]):
181
181
raise GeomdlException ("Parameters should be between 0 and 1" )
182
182
183
183
# Evaluate the curve point
@@ -203,7 +203,7 @@ def evaluate_list(self, param_list):
203
203
res = []
204
204
for prm in param_list :
205
205
if self ._kv_normalize :
206
- if utilities .check_params ([prm ]):
206
+ if utl .check_params ([prm ]):
207
207
res .append (self .evaluate_single (prm ))
208
208
else :
209
209
res .append (self .evaluate_single (prm ))
@@ -241,7 +241,7 @@ def insert_knot(self, param, **kwargs):
241
241
242
242
# Check parameters are correct
243
243
if self ._kv_normalize :
244
- if not utilities .check_params ([param ]):
244
+ if not utl .check_params ([param ]):
245
245
raise GeomdlException ("Parameters should be between 0 and 1" )
246
246
247
247
# Get keyword arguments
@@ -273,7 +273,7 @@ def remove_knot(self, param, **kwargs):
273
273
274
274
# Check param parameters are correct
275
275
if self ._kv_normalize :
276
- if not utilities .check_params ([param ]):
276
+ if not utl .check_params ([param ]):
277
277
raise GeomdlException ("Parameters should be between 0 and 1" )
278
278
279
279
# Get keyword arguments
@@ -355,7 +355,7 @@ def binormal(self, parpos, **kwargs):
355
355
return operations .binormal (self , parpos , ** kwargs )
356
356
357
357
358
- @export
358
+ @utl . export
359
359
class Surface (abstract .Surface ):
360
360
""" Data storage and evaluation class for B-spline (non-rational) surfaces.
361
361
@@ -656,7 +656,7 @@ def evaluate(self, **kwargs):
656
656
657
657
# Check parameters
658
658
if self ._kv_normalize :
659
- if not utilities .check_params ([start_u , stop_u , start_v , stop_v ]):
659
+ if not utl .check_params ([start_u , stop_u , start_v , stop_v ]):
660
660
raise GeomdlException ("Parameters should be between 0 and 1" )
661
661
662
662
# Clean up the surface points
@@ -706,7 +706,7 @@ def evaluate_list(self, param_list):
706
706
res = []
707
707
for prm in param_list :
708
708
if self ._kv_normalize :
709
- if utilities .check_params (prm ):
709
+ if utl .check_params (prm ):
710
710
res .append (self .evaluate_single (prm ))
711
711
else :
712
712
res .append (self .evaluate_single (prm ))
@@ -755,7 +755,7 @@ def insert_knot(self, u=None, v=None, **kwargs):
755
755
756
756
# Check if the parameter values are correctly defined
757
757
if self ._kv_normalize :
758
- if not utilities .check_params ([u , v ]):
758
+ if not utl .check_params ([u , v ]):
759
759
raise GeomdlException ("Parameters should be between 0 and 1" )
760
760
761
761
# Get keyword arguments
@@ -791,7 +791,7 @@ def remove_knot(self, u=None, v=None, **kwargs):
791
791
792
792
# Check if the parameter values are correctly defined
793
793
if self ._kv_normalize :
794
- if not utilities .check_params ([u , v ]):
794
+ if not utl .check_params ([u , v ]):
795
795
raise GeomdlException ("Parameters should be between 0 and 1" )
796
796
797
797
# Get keyword arguments
@@ -855,7 +855,7 @@ def normal(self, parpos, **kwargs):
855
855
return operations .normal (self , parpos , ** kwargs )
856
856
857
857
858
- @export
858
+ @utl . export
859
859
class Volume (abstract .Volume ):
860
860
""" Data storage and evaluation class for B-spline (non-rational) volumes.
861
861
@@ -981,7 +981,7 @@ def evaluate(self, **kwargs):
981
981
982
982
# Check if all the input parameters are in the range
983
983
if self ._kv_normalize :
984
- if not utilities .check_params ([start_u , stop_u , start_v , stop_v , start_w , stop_w ]):
984
+ if not utl .check_params ([start_u , stop_u , start_v , stop_v , start_w , stop_w ]):
985
985
raise GeomdlException ("Parameters should be between 0 and 1" )
986
986
987
987
# Clean up the evaluated points
@@ -1008,7 +1008,7 @@ def evaluate_single(self, param):
1008
1008
1009
1009
# Check if all parameters are in the range
1010
1010
if self ._kv_normalize :
1011
- if not utilities .check_params (param ):
1011
+ if not utl .check_params (param ):
1012
1012
raise GeomdlException ("Parameters should be between 0 and 1" )
1013
1013
1014
1014
# Evaluate the volume point
@@ -1035,7 +1035,7 @@ def evaluate_list(self, param_list):
1035
1035
res = []
1036
1036
for prm in param_list :
1037
1037
if self ._kv_normalize :
1038
- if utilities .check_params (prm ):
1038
+ if utl .check_params (prm ):
1039
1039
res .append (self .evaluate_single (prm ))
1040
1040
else :
1041
1041
res .append (self .evaluate_single (prm ))
@@ -1061,7 +1061,7 @@ def insert_knot(self, u=None, v=None, w=None, **kwargs):
1061
1061
1062
1062
# Check if the parameter values are correctly defined
1063
1063
if self ._kv_normalize :
1064
- if not utilities .check_params ([u , v , w ]):
1064
+ if not utl .check_params ([u , v , w ]):
1065
1065
raise GeomdlException ("Parameters should be between 0 and 1" )
1066
1066
1067
1067
# Get keyword arguments
@@ -1101,7 +1101,7 @@ def remove_knot(self, u=None, v=None, w=None, **kwargs):
1101
1101
1102
1102
# Check if the parameter values are correctly defined
1103
1103
if self ._kv_normalize :
1104
- if not utilities .check_params ([u , v , w ]):
1104
+ if not utl .check_params ([u , v , w ]):
1105
1105
raise GeomdlException ("Parameters should be between 0 and 1" )
1106
1106
1107
1107
# Get keyword arguments
0 commit comments