Skip to content

Commit

Permalink
Update 3D curve example with the thread-enabled evaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur Rauf Bingol committed Sep 1, 2018
1 parent bcd57af commit da26e36
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions curve3d/ex_curve3d02.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
from geomdl import BSpline
from geomdl import utilities
from geomdl import exchange
# from geomdl.visualization import VisMPL
from geomdl.visualization import VisPlotly
from geomdl import evaluators
from geomdl.visualization import VisMPL as vis
# from geomdl.visualization import VisPlotly as vis


# Fix file path
Expand All @@ -23,6 +24,10 @@
# Create a B-Spline curve instance
curve = BSpline.Curve()

# Set threaded evaluator
threading_evaluator = evaluators.ThreadedCurveEvaluator(curve.evaluator, threads=4)
curve.evaluator = threading_evaluator

# Set up curve
curve.degree = 3
curve.ctrlpts = exchange.import_txt("ex_curve3d02.cpt")
Expand All @@ -37,7 +42,7 @@
curve.evaluate()

# Plot the control point polygon and the evaluated curve
vis_comp = VisPlotly.VisCurve3D()
vis_comp = vis.VisCurve3D()
curve.vis = vis_comp
curve.render()

Expand Down

0 comments on commit da26e36

Please sign in to comment.