diff --git a/curve2d/ex_curve01_decompose.py b/curve2d/ex_curve01_decompose.py index 4c5c37d..cdefd15 100644 --- a/curve2d/ex_curve01_decompose.py +++ b/curve2d/ex_curve01_decompose.py @@ -9,7 +9,6 @@ import os from geomdl import BSpline from geomdl import utilities -from geomdl import Multi # Try to load the visualization module try: @@ -38,14 +37,12 @@ bezier = curve.decompose() # Plot the curves using the curve container -curves = Multi.MultiCurve() -curves.delta = 0.01 -curves.add_list(bezier) +bezier.delta = 0.01 if render_curve: vis_comp = VisMPL.VisCurve2D() - curves.vis = vis_comp - curves.render() + bezier.vis = vis_comp + bezier.render() # Good to have something here to put a breakpoint pass diff --git a/curve2d/ex_curve01_split.py b/curve2d/ex_curve01_split.py index dbaba10..5682fe6 100644 --- a/curve2d/ex_curve01_split.py +++ b/curve2d/ex_curve01_split.py @@ -9,7 +9,6 @@ import os from geomdl import BSpline from geomdl import utilities -from geomdl import Multi # Try to load the visualization module try: @@ -35,18 +34,16 @@ curve.knotvector = utilities.generate_knot_vector(curve.degree, len(curve.ctrlpts)) # Split the curve -curve1, curve2 = curve.split(0.6) +curves = curve.split(0.6) # Move the 1st curve a little bit far away from the 2nd curve -c2tan = curve2.tangent(0.0, normalize=True) +c2tan = curves[1].tangent(0.0, normalize=True) c2tanvec = [-3 * p for p in c2tan[1]] -curve1.translate(c2tanvec) +curves[0].translate(c2tanvec) # Plot the curves using the curve container -curves = Multi.MultiCurve() curves.delta = 0.01 -curves.add(curve1) -curves.add(curve2) + if render_curve: vis_comp = VisMPL.VisCurve2D() curves.vis = vis_comp diff --git a/curve2d/ex_curve02_decompose.py b/curve2d/ex_curve02_decompose.py index 0f0db85..b019521 100644 --- a/curve2d/ex_curve02_decompose.py +++ b/curve2d/ex_curve02_decompose.py @@ -9,7 +9,6 @@ import os from geomdl import BSpline from geomdl import utilities -from geomdl import Multi # Try to load the visualization module try: @@ -47,14 +46,12 @@ bezier[2].translate(c2tanvec2) # Plot the curves using the curve container -curves = Multi.MultiCurve() -curves.delta = 0.01 -curves.add_list(bezier) +bezier.delta = 0.01 if render_curve: vis_comp = VisMPL.VisCurve2D() - curves.vis = vis_comp - curves.render() + bezier.vis = vis_comp + bezier.render() # Good to have something here to put a breakpoint pass diff --git a/curve2d/ex_curve04_decompose.py b/curve2d/ex_curve04_decompose.py index 8f516eb..3daffb2 100644 --- a/curve2d/ex_curve04_decompose.py +++ b/curve2d/ex_curve04_decompose.py @@ -8,7 +8,6 @@ """ import os from geomdl import NURBS -from geomdl import Multi # Try to load the visualization module try: @@ -36,15 +35,13 @@ bezier = curve.decompose() # Plot the curves using the curve container -curves = Multi.MultiCurve() -curves.delta = 0.01 -curves.add_list(bezier) +bezier.delta = 0.01 if render_curve: vis_comp = VisMPL.VisCurve2D() vis_comp.figure_size([8, 8]) - curves.vis = vis_comp - curves.render() + bezier.vis = vis_comp + bezier.render() # Good to have something here to put a breakpoint pass diff --git a/curve3d/ex_curve3d01_split.py b/curve3d/ex_curve3d01_split.py index 84c17d0..7b2b37a 100644 --- a/curve3d/ex_curve3d01_split.py +++ b/curve3d/ex_curve3d01_split.py @@ -9,7 +9,6 @@ import os from geomdl import BSpline from geomdl import utilities -from geomdl import Multi # Try to load the visualization module try: @@ -35,18 +34,15 @@ curve.knotvector = utilities.generate_knot_vector(curve.degree, len(curve.ctrlpts)) # Split the curve -curve1, curve2 = curve.split(0.3) +curves = curve.split(0.3) # Move the 1st curve a little bit far away from the 2nd curve -c2tan = curve2.tangent(0.0, normalize=True) +c2tan = curves[1].tangent(0.0, normalize=True) c2tanvec = [-1 * p for p in c2tan[1]] -curve1.translate(c2tanvec) +curves[0].translate(c2tanvec) # Plot the curves using the curve container -curves = Multi.MultiCurve() curves.delta = 0.01 -curves.add(curve1) -curves.add(curve2) if render_curve: vis_comp = VisMPL.VisCurve3D() curves.vis = vis_comp diff --git a/shapes/ex_circle2d_2.py b/shapes/ex_circle2d_2.py index 4202ad6..3e0ecce 100644 --- a/shapes/ex_circle2d_2.py +++ b/shapes/ex_circle2d_2.py @@ -7,7 +7,6 @@ Developed by Onur Rauf Bingol (c) 2018 """ from geomdl.shapes import curve2d -from geomdl import Multi # Try to load the visualization module try: @@ -31,16 +30,14 @@ bezier_segments = circle.decompose() # Prepare Bezier segments for plotting -curves = Multi.MultiCurve() -curves.add_list(bezier_segments) -curves.delta = 0.01 +bezier_segments.delta = 0.01 # Render the Bezier curve segments and their control points polygons if render: vis_comp = VisMPL.VisCurve2D(plot_ctrlpts=True) vis_comp.figure_size([9, 8]) - curves.vis = vis_comp - curves.render() + bezier_segments.vis = vis_comp + bezier_segments.render() # Good to have something here to put a breakpoint pass