We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f6d53f commit 297a8b2Copy full SHA for 297a8b2
curve2d/ex_curve04.py
@@ -9,6 +9,13 @@
9
import os
10
from geomdl import NURBS
11
12
+# Try to load the visualization module
13
+try:
14
+ render_curve = True
15
+ from geomdl.visualization import VisMPL
16
+except ImportError:
17
+ render_curve = False
18
+
19
# Fix file path
20
os.chdir(os.path.dirname(os.path.realpath(__file__)))
21
@@ -27,6 +34,13 @@
27
34
# Evaluate curve
28
35
curve.evaluate()
29
36
37
+# Draw the control point polygon and the evaluated curve
38
+if render_curve:
39
+ vis_comp = VisMPL.VisCurve2D(plot_ctrlpts=True)
40
+ vis_comp.figure_size([8, 8])
41
+ curve.vis = vis_comp
42
+ curve.render()
43
30
44
# Save control points and evaluated curve points
31
45
curve.save_curvepts_to_csv("curvepts04_orig.csv")
32
46
curve.save_ctrlpts_to_csv("ctrlpts04_orig.csv")
0 commit comments