Skip to content

Commit 2efcc16

Browse files
author
Onur R. Bingol
committed
Minor bug fixes
1 parent 0ae46e1 commit 2efcc16

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

geomdl/_utilities.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,9 @@ def check_params(params):
102102
:return: True if defined in the domain [0, 1]. False, otherwise.
103103
:rtype: bool
104104
"""
105-
tol = 10e-8
106105
# Check parameters
107106
for prm in params:
108107
if prm is not None:
109-
if not (0.0 - tol) <= prm <= (1.0 + tol):
108+
if not 0.0 <= prm <= 1.0:
110109
return False
111110
return True

geomdl/abstract.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,10 @@ def tessellate(self, **kwargs):
17691769

17701770
# Re-evaluate vertex coordinates
17711771
for idx in range(len(self._tsl_component.vertices)):
1772-
self._tsl_component.vertices[idx].data = self.evaluate_single(self._tsl_component.vertices[idx].uv)
1772+
uv = self._tsl_component.vertices[idx].uv
1773+
if self._kv_normalize and not utl.check_params(uv):
1774+
continue
1775+
self._tsl_component.vertices[idx].data = self.evaluate_single(uv)
17731776

17741777
def reset(self, **kwargs):
17751778
""" Resets control points and/or evaluated points.

geomdl/vis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def vconf(self):
7878

7979
@property
8080
def mconf(self):
81-
""" Visualization module internal configuration directives
81+
""" Configuration directives for the visualization module (internal).
8282
8383
This property controls the internal configuration of the visualization module. It is for advanced use and
8484
testing only.

geomdl/visualization/VisMPL.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,14 @@ def render(self, **kwargs):
448448
trisurf_params['color'] = plot['color']
449449

450450
# Create MPL Triangulation object
451-
triangulation = mpltri.Triangulation(pts[:, 0], pts[:, 1], triangles=tri_idxs)
452-
# Use custom Triangulation object and the choice of color/colormap to plot the surface
453-
ax.plot_trisurf(triangulation, pts[:, 2], alpha=self.vconf.alpha, **trisurf_params)
454-
# Add to legend
455-
plot_proxy = mpl.lines.Line2D([0], [0], linestyle='none', color=plot['color'], marker='^')
456-
legend_proxy.append(plot_proxy)
457-
legend_names.append(plot['name'])
451+
if pts.size != 0:
452+
triangulation = mpltri.Triangulation(pts[:, 0], pts[:, 1], triangles=tri_idxs)
453+
# Use custom Triangulation object and the choice of color/colormap to plot the surface
454+
ax.plot_trisurf(triangulation, pts[:, 2], alpha=self.vconf.alpha, **trisurf_params)
455+
# Add to legend
456+
plot_proxy = mpl.lines.Line2D([0], [0], linestyle='none', color=plot['color'], marker='^')
457+
legend_proxy.append(plot_proxy)
458+
legend_names.append(plot['name'])
458459

459460
# Plot bounding box
460461
if plot['type'] == 'bbox' and self.vconf.display_bbox:

0 commit comments

Comments
 (0)