Skip to content

Commit a4bf319

Browse files
committed
Rename quad to wireframe and update documentation
1 parent a83b2a0 commit a4bf319

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

geomdl/BSpline.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,16 @@ def _get_csv_header(self):
11451145
def save_ctrlpts_to_csv(self, filename="", scalar=0, mode='linear'):
11461146
""" Saves control points to a comma separated text file.
11471147
1148+
**Available Modes**
1149+
1150+
The following modes are available via ``mode=`` parameter:
1151+
1152+
* ``linear``: Default mode, saves the stored point array without any change
1153+
* ``zigzag``: Generates a zig-zag shape
1154+
* ``wireframe``: Generates a wireframe
1155+
1156+
Please note that mode parameter does not modify the stored points in the object instance.
1157+
11481158
:param filename: output file name
11491159
:type filename: str
11501160
:param scalar: value of the scalar column in the output, defaults to 0
@@ -1155,7 +1165,7 @@ def save_ctrlpts_to_csv(self, filename="", scalar=0, mode='linear'):
11551165
:rtype: bool
11561166
"""
11571167
# Check possible modes
1158-
mode_list = ['linear', 'zigzag', 'quad']
1168+
mode_list = ['linear', 'zigzag', 'wireframe']
11591169
if mode not in mode_list:
11601170
warnings.warn("Input mode '" + mode + "' is not valid, defaulting to 'linear'.")
11611171

@@ -1178,7 +1188,7 @@ def save_ctrlpts_to_csv(self, filename="", scalar=0, mode='linear'):
11781188
# If the user requested a different point arrangment, apply it here
11791189
if mode == 'zigzag':
11801190
ctrlpts = utils.make_zigzag(ctrlpts, self._control_points_size_v)
1181-
if mode == 'quad':
1191+
if mode == 'wireframe':
11821192
ctrlpts = utils.make_quad(ctrlpts, self._control_points_size_v, self._control_points_size_u)
11831193

11841194
# Loop through control points
@@ -1201,6 +1211,18 @@ def save_ctrlpts_to_csv(self, filename="", scalar=0, mode='linear'):
12011211
def save_surfpts_to_csv(self, filename="", scalar=0, mode='linear'):
12021212
""" Saves evaluated surface points to a comma separated text file.
12031213
1214+
**Available Modes**
1215+
1216+
The following modes are available via ``mode=`` parameter:
1217+
1218+
* ``linear``: Default mode, saves the stored point array without any change
1219+
* ``zigzag``: Generates a zig-zag shape
1220+
* ``wireframe``: Generates a wireframe
1221+
* ``triangle``: Triangulates the points
1222+
* ``mesh``: Generates a quad mesh
1223+
1224+
Please note that mode parameter does not modify the stored points in the object instance.
1225+
12041226
:param filename: output file name
12051227
:type filename: str
12061228
:param scalar: value of the scalar column in the output, defaults to 0
@@ -1211,7 +1233,7 @@ def save_surfpts_to_csv(self, filename="", scalar=0, mode='linear'):
12111233
:rtype: bool
12121234
"""
12131235
# Check possible modes
1214-
mode_list = ['linear', 'zigzag', 'quad', 'triangle']
1236+
mode_list = ['linear', 'zigzag', 'wireframe', 'triangle', 'mesh']
12151237
if mode not in mode_list:
12161238
warnings.warn("Input mode '" + mode + "' is not valid, defaulting to 'linear'.")
12171239

@@ -1235,8 +1257,14 @@ def save_surfpts_to_csv(self, filename="", scalar=0, mode='linear'):
12351257
# If the user requested a different point arrangment, apply it here
12361258
if mode == 'zigzag':
12371259
points = utils.make_zigzag(self._surface_points, int((1.0 / self._delta) + 1))
1238-
elif mode == 'quad':
1260+
elif mode == 'wireframe':
12391261
points = utils.make_quad(self._surface_points, int((1.0 / self._delta) + 1), int((1.0 / self._delta) + 1))
1262+
elif mode == 'triangle':
1263+
warnings.warn("Triangle mode has not been implemented yet!")
1264+
points = self._surface_points
1265+
elif mode == 'mesh':
1266+
warnings.warn("Mesh mode has not been implemented yet!")
1267+
points = self._surface_points
12401268
else:
12411269
points = self._surface_points
12421270

0 commit comments

Comments
 (0)