Skip to content

Commit 9ab879b

Browse files
author
Onur Rauf Bingol
committed
Update function signatures of volume evaluator derivatives
1 parent c1d462d commit 9ab879b

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

geomdl/evaluators.py

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,28 @@ def evaluate(self, datadict, **kwargs):
514514

515515
return eval_points
516516

517-
def derivatives(self, **kwargs):
518-
""" Evaluates the derivative at the given parametric coordinate. """
519-
pass
517+
def derivatives(self, datadict, parpos, deriv_order=0, **kwargs):
518+
""" Evaluates the n-th order derivatives at the input parametric position.
519+
520+
:param datadict: data dictionary containing the necessary variables
521+
:type datadict: dict
522+
:param parpos: parametric position where the derivatives will be computed
523+
:type parpos: list, tuple
524+
:param deriv_order: derivative order; to get the i-th derivative
525+
:type deriv_order: int
526+
:return: evaluated derivatives
527+
:rtype: list
528+
"""
529+
# Geometry data from datadict
530+
degree = datadict['degree']
531+
knotvector = datadict['knotvector']
532+
ctrlpts = datadict['control_points']
533+
size = datadict['size']
534+
dimension = datadict['dimension'] + 1 if datadict['rational'] else datadict['dimension']
535+
pdimension = datadict['pdimension']
536+
537+
# TO-DO: Complete volume derivatives
538+
return list()
520539

521540

522541
@utl.export
@@ -557,9 +576,25 @@ def evaluate(self, datadict, **kwargs):
557576

558577
return eval_points
559578

560-
def derivatives(self, **kwargs):
561-
""" Evaluates the derivatives at the input parameter. """
562-
pass
579+
def derivatives(self, datadict, parpos, deriv_order=0, **kwargs):
580+
""" Evaluates the n-th order derivatives at the input parametric position.
581+
582+
:param datadict: data dictionary containing the necessary variables
583+
:type datadict: dict
584+
:param parpos: parametric position where the derivatives will be computed
585+
:type parpos: list, tuple
586+
:param deriv_order: derivative order; to get the i-th derivative
587+
:type deriv_order: int
588+
:return: evaluated derivatives
589+
:rtype: list
590+
"""
591+
dimension = datadict['dimension'] + 1 if datadict['rational'] else datadict['dimension']
592+
593+
# Call the parent function to evaluate A(u) and w(u) derivatives
594+
SKLw = super(VolumeEvaluatorRational, self).derivatives(datadict, parpos, deriv_order, **kwargs)
595+
596+
# TO-DO: Complete rational volume derivatives
597+
return list()
563598

564599

565600
# Don't export alternative curve evalutator

0 commit comments

Comments
 (0)