File tree 6 files changed +19
-38
lines changed
6 files changed +19
-38
lines changed Original file line number Diff line number Diff line change 9
9
import os
10
10
from geomdl import BSpline
11
11
from geomdl import utilities
12
- from geomdl import Multi
13
12
14
13
# Try to load the visualization module
15
14
try :
38
37
bezier = curve .decompose ()
39
38
40
39
# Plot the curves using the curve container
41
- curves = Multi .MultiCurve ()
42
- curves .delta = 0.01
43
- curves .add_list (bezier )
40
+ bezier .delta = 0.01
44
41
45
42
if render_curve :
46
43
vis_comp = VisMPL .VisCurve2D ()
47
- curves .vis = vis_comp
48
- curves .render ()
44
+ bezier .vis = vis_comp
45
+ bezier .render ()
49
46
50
47
# Good to have something here to put a breakpoint
51
48
pass
Original file line number Diff line number Diff line change 9
9
import os
10
10
from geomdl import BSpline
11
11
from geomdl import utilities
12
- from geomdl import Multi
13
12
14
13
# Try to load the visualization module
15
14
try :
35
34
curve .knotvector = utilities .generate_knot_vector (curve .degree , len (curve .ctrlpts ))
36
35
37
36
# Split the curve
38
- curve1 , curve2 = curve .split (0.6 )
37
+ curves = curve .split (0.6 )
39
38
40
39
# Move the 1st curve a little bit far away from the 2nd curve
41
- c2tan = curve2 .tangent (0.0 , normalize = True )
40
+ c2tan = curves [ 1 ] .tangent (0.0 , normalize = True )
42
41
c2tanvec = [- 3 * p for p in c2tan [1 ]]
43
- curve1 .translate (c2tanvec )
42
+ curves [ 0 ] .translate (c2tanvec )
44
43
45
44
# Plot the curves using the curve container
46
- curves = Multi .MultiCurve ()
47
45
curves .delta = 0.01
48
- curves .add (curve1 )
49
- curves .add (curve2 )
46
+
50
47
if render_curve :
51
48
vis_comp = VisMPL .VisCurve2D ()
52
49
curves .vis = vis_comp
Original file line number Diff line number Diff line change 9
9
import os
10
10
from geomdl import BSpline
11
11
from geomdl import utilities
12
- from geomdl import Multi
13
12
14
13
# Try to load the visualization module
15
14
try :
47
46
bezier [2 ].translate (c2tanvec2 )
48
47
49
48
# Plot the curves using the curve container
50
- curves = Multi .MultiCurve ()
51
- curves .delta = 0.01
52
- curves .add_list (bezier )
49
+ bezier .delta = 0.01
53
50
54
51
if render_curve :
55
52
vis_comp = VisMPL .VisCurve2D ()
56
- curves .vis = vis_comp
57
- curves .render ()
53
+ bezier .vis = vis_comp
54
+ bezier .render ()
58
55
59
56
# Good to have something here to put a breakpoint
60
57
pass
Original file line number Diff line number Diff line change 8
8
"""
9
9
import os
10
10
from geomdl import NURBS
11
- from geomdl import Multi
12
11
13
12
# Try to load the visualization module
14
13
try :
36
35
bezier = curve .decompose ()
37
36
38
37
# Plot the curves using the curve container
39
- curves = Multi .MultiCurve ()
40
- curves .delta = 0.01
41
- curves .add_list (bezier )
38
+ bezier .delta = 0.01
42
39
43
40
if render_curve :
44
41
vis_comp = VisMPL .VisCurve2D ()
45
42
vis_comp .figure_size ([8 , 8 ])
46
- curves .vis = vis_comp
47
- curves .render ()
43
+ bezier .vis = vis_comp
44
+ bezier .render ()
48
45
49
46
# Good to have something here to put a breakpoint
50
47
pass
Original file line number Diff line number Diff line change 9
9
import os
10
10
from geomdl import BSpline
11
11
from geomdl import utilities
12
- from geomdl import Multi
13
12
14
13
# Try to load the visualization module
15
14
try :
35
34
curve .knotvector = utilities .generate_knot_vector (curve .degree , len (curve .ctrlpts ))
36
35
37
36
# Split the curve
38
- curve1 , curve2 = curve .split (0.3 )
37
+ curves = curve .split (0.3 )
39
38
40
39
# Move the 1st curve a little bit far away from the 2nd curve
41
- c2tan = curve2 .tangent (0.0 , normalize = True )
40
+ c2tan = curves [ 1 ] .tangent (0.0 , normalize = True )
42
41
c2tanvec = [- 1 * p for p in c2tan [1 ]]
43
- curve1 .translate (c2tanvec )
42
+ curves [ 0 ] .translate (c2tanvec )
44
43
45
44
# Plot the curves using the curve container
46
- curves = Multi .MultiCurve ()
47
45
curves .delta = 0.01
48
- curves .add (curve1 )
49
- curves .add (curve2 )
50
46
if render_curve :
51
47
vis_comp = VisMPL .VisCurve3D ()
52
48
curves .vis = vis_comp
Original file line number Diff line number Diff line change 7
7
Developed by Onur Rauf Bingol (c) 2018
8
8
"""
9
9
from geomdl .shapes import curve2d
10
- from geomdl import Multi
11
10
12
11
# Try to load the visualization module
13
12
try :
31
30
bezier_segments = circle .decompose ()
32
31
33
32
# Prepare Bezier segments for plotting
34
- curves = Multi .MultiCurve ()
35
- curves .add_list (bezier_segments )
36
- curves .delta = 0.01
33
+ bezier_segments .delta = 0.01
37
34
38
35
# Render the Bezier curve segments and their control points polygons
39
36
if render :
40
37
vis_comp = VisMPL .VisCurve2D (plot_ctrlpts = True )
41
38
vis_comp .figure_size ([9 , 8 ])
42
- curves .vis = vis_comp
43
- curves .render ()
39
+ bezier_segments .vis = vis_comp
40
+ bezier_segments .render ()
44
41
45
42
# Good to have something here to put a breakpoint
46
43
pass
You can’t perform that action at this time.
0 commit comments