nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.26k stars 233 forks source link

General Curves API mapping #3385

Open portnov opened 4 years ago

portnov commented 4 years ago

In this issue I will try to outline a general API for all types of curves we are going to support.

Legend:

General curves:

SvCurve method Geomdl FreeCAD rhino3dm
evaluate(t) evaluate_single(t) value(t) PointAt(t)
evaluate_array(ts) :construction: :construction: :construction:
:new:: evaluate_even_t(n) :construction: discretize() :construction:
:new:: evaluate_even_distance(n) :construction: discretize() :construction:
calc_length :construction: length() :construction:
tangent(t) tangent() tangent() TangentAt()
tangent_array(ts) :construction: :construction: :construction:
second_derivative(t) derivatives(t,2) derivative2At(t) :construction:
second_derivative_array(ts) :construction: :construction: :construction:
:new:: third_derivative(t) derivatives(t,3) derivative3At(t) :construction:
third_derivative_array(ts) :construction: :construction: :construction:
:new:: derivatives(n, t) derivatives(t,n) :construction: :construction:
derivatives_array(n,ts) :construction: :construction: :construction:
main_normal(t) normal(t) normal(t) :construction:
main_normal_array(ts) :construction: :construction: :construction:
binormal(t) binormal(t) :construction: :construction:
binormal_array(ts) :construction: :construction: :construction:
tangent_normal_binormal_array(ts) :construction: :construction: :construction:
frame_array(ts) :construction: :construction: :construction:
:new:: curvature(t) :construction: curvature(t) CurvatureAt(t)
curvature_array(ts) :construction: :construction: :construction:
torsion_array(ts) :construction: :construction: :construction:
:new: intersect_curve :question: intersectCC() :question:
:new: intersect_surface :construction: intersectCS() :construction:
:new: ortho_project (implemented in sverchok_extra.utils.geom) :construction: parameter() :construction:
:new: length_parameter (implemented in sverchok.utils.curve.SvCurveLengthSolver) :construction: parameterAtDistance() :construction:
:new: to_nurbs :construction: (trivial) toNurbs() :construction: (trivial)
:new: to_bspline :construction: (trivial) toBSpline() :construction: (trivial)
portnov commented 4 years ago

NURBS / BSpline curves methods; :new: SvNurbsCurve will be a new abstract class, so all it's methods are new.

SvNurbsCurve method Geomdl FreeCAD rhino3dm
classmethod approximate() approximate_curve(points, degree, ctrlpts_count) approximate(points, degree_min, degree_max, tolerance, continuity) :x:
classmethod interpolate() interpolate_curve(points, degree, centripetal) interpolate(points, is_periodic, tolerance, initial_tangent, final_tangent, tangents, tangent_flags) :x:
move_point() :x: movePoint(t, point, i1, i2) :x:
is_planar() :question: : :question: IsPlanar()