File tree 2 files changed +18
-5
lines changed
2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 23
23
surf = BSpline .Surface ()
24
24
25
25
# Set evaluation delta
26
- surf .delta = 0.05
26
+ surf .delta = 0.025
27
27
28
28
# Set up surface
29
29
surf .read_ctrlpts_from_txt ("ex_surface02.cpt" )
37
37
38
38
# Draw the control point grid and the evaluated surface
39
39
if render_surf :
40
- vis_comp = VisMPL .VisTriSurf ()
40
+ vis_comp = VisMPL .VisSurfScatter ()
41
41
surf .vis = vis_comp
42
42
surf .render ()
43
43
44
44
# Save control points and evaluated curve points
45
- surf .save_surfpts_to_csv ("surfpts02_orig.csv" )
46
- surf .save_ctrlpts_to_csv ("ctrlpts02_orig.csv" )
45
+ surf .save_surfpts_to_csv ("surfpts02_orig.csv" , mode = 'linear' )
46
+ surf .save_ctrlpts_to_csv ("ctrlpts02_orig.csv" , mode = 'wireframe' )
47
47
48
48
# Evaluate 1st order surface derivative at the given u and v
49
49
u = 0.2
Original file line number Diff line number Diff line change 10
10
import os
11
11
from geomdl import NURBS
12
12
13
+ # Try to load the visualization module
14
+ try :
15
+ render_surf = True
16
+ from geomdl .visualization import VisMPL
17
+ except ImportError :
18
+ render_surf = False
19
+
13
20
# Fix file path
14
21
os .chdir (os .path .dirname (os .path .realpath (__file__ )))
15
22
16
23
# Create a NURBS surface instance
17
24
surf = NURBS .Surface ()
18
25
19
26
# Set evaluation delta
20
- surf .delta = 0.05
27
+ surf .delta = 0.025
21
28
22
29
# Set up surface
23
30
surf .read_ctrlpts_from_txt ("ex_surface03.cptw" )
29
36
# Evaluate surface
30
37
surf .evaluate ()
31
38
39
+ # Draw the control point grid and the evaluated surface
40
+ if render_surf :
41
+ vis_comp = VisMPL .VisSurfWireframe ()
42
+ surf .vis = vis_comp
43
+ surf .render ()
44
+
32
45
# Save control points and evaluated curve points
33
46
surf .save_surfpts_to_csv ("surfpts03_orig.csv" , mode = 'wireframe' )
34
47
surf .save_ctrlpts_to_csv ("ctrlpts03_orig.csv" )
You can’t perform that action at this time.
0 commit comments